Animated horizontal or vertical progress meter using jQMeter

For animated progress meter, we should use these codes at the end of the body in document ready function.


$(document).ready(function(){
$('#jqmeter-horizontal-container').jQMeter({
goal:'$1,000',
raised:'$600',
orientation:'horizontal',
width:'200px',
height:'50px'
});
$('.jqmeter_horizontal_without_value').jQMeter({
goal:'$1,000',
raised:'$300',
orientation:'horizontal',
width:'200px',
height:'50px',
displayTotal:false
});
$('#jqmeter-vertical-container').jQMeter({
goal:'$1,000',
raised:'$800',
orientation:'vertical',
width:'50px',
height:'200px'
});
$('.jqmeter-vertical-container-without-value').jQMeter({
goal:'$1,000',
raised:'$400',
orientation:'vertical',
width:'50px',
height:'100px',
displayTotal:false
});
});

In the body part, we should write the divisions

Horizontal progress meter using jQMeter
Vertical progress meter using jQMeter

You can see the live demo

How to make a content center in the page

To make center display of any content, you should have these properties for the content:

1. display: block;

2. width:500px;

3. margin: 0 auto;

<body>

<div class="content">

</div>

</body>

The css should be:

.content{

margin:0 auto;

display:block;

width: 50%;}

The output would be like that

This is content

 

All free things for web

From this site: http://freebie.supply/all

FREE WEBSITE + LOGO + HOSTING + INVOICING

FREE BUSINESS / PROJECT NAME GENERATORS

WRITING / BLOGGING

  • Hemingway: Hemingway App makes your writing bold and clear.
  • Grammarly: Finds & corrects mistakes of your writing.
  • Medium: Everyone’s stories and ideas.
  • ZenPen: The minimal writing tool of web.
  • Liberio: Simple eBook creation and publishing right from Google Drive.
  • Editorial Calendar: See all your posts, drag & drop to manage your blog.
  • Story Wars: Writing stories together.
  • Headline Analyzer: Emotional marketing value headline analyzer.
  • WP Hide Post: Control the visibility of items on your blog.
  • Social Locker: Ask visitors “to pay” for your content with a tweet, etc.
  • Egg Timer: Set a time and bookmark it for repeated use.

FIND (TRENDING) CONTENT (IDEAS)

 

FREE SEO + WEBSITE ANALYZERS

FREE IMAGE OPTIMIZERS

FREE IMAGE EDITORS

  • Canva: Amazingly simple graphic design for bloggers.
  • Pixlr: Pixlr Editor is a robust browser photo editor.
  • Skitch: Get your point across with fewer words.
  • Easel.ly: Empowers anyone to create & share powerful visuals.
  • Social Image Resizer Tool: Create optimized images for social media.
  • Placeit: Free product mockups & templates.
  • Recite: Turn a quote into a visual masterpiece.
  • Meme Generator: The first online meme generator.

COLLECT & SEND EMAILS FOR FREE

FREE SOCIAL MEDIA + COMMUNITY MANAGEMENT + SURVEYS

A/B TESTS & GROWTH HACKING

  • Petit Hacks: Acquisition, retention, & revenue hacks used by companies.
  • Optimizely: One optimization platform for websites and mobile apps.
  • Hello Bar: Tool for A/B testing different CTAs & power words.
  • GrowthHackers: Unlocking growth. Together.

 

FREE DESIGN RESOURCES

COLOR PICKERS

INSPIRATION

  • MaterialUp: Daily material design inspiration.
  • FLTDSGNDaily showcase of the best flat UI design websites and apps.
  • Site Inspire: Web design inspiration.
  • UI Cloud: The largest user interface design database in the world.
  • Moodboard: Build a beautiful moodboard and share the result.
  • Crayon: The most comprehensive collection of marketing designs.
  • Land-Book: Product landing pages gallery.
  • Ocean: A community of designers sharing feedback.
  • Dribbble: Show and tell for designers.
  • Behance: Showcase & discover creative work.
  • Pttrns: Mobile user interface patterns.
  • Flat UI Design: Useful board I discovered thanks to Erik.
  • Awwwards: The awards for design, creativity and innovation.
  • The Starter Kit: Curated resources for developers and designers.
  • One Page Love: Resource for one page website inspiration.
  • UI Parade: User interface design tools and design inspiration.
  • The Best Designs: The best of web design.
  • Agile DesignersBest resources for designers & developers.
  • Niice: A search engine with taste.

FREE STOCK PHOTOGRAPHY

FREE TYPOGRAPHY

FREE ICONS

FREE USEFUL STUFF

 

BACKGROUND SOUND TO FOCUS

  • NoisliBackground noise & color generator.
  • Noizio: Ambient sound equalizer for relax or productivity.
  • Defonic: Combine the sounds of the world into a melody.
  • Designers.mx: Curated playlists by designers, for designers.
  • Coffitivity: Stream the sounds of a coffee shop at work.

AVOID DISTRACTION

  • Self ControlMac: free application to help you avoid distracting websites.
  • Cold Turkey: Windows: temporarily block yourself off of distracting websites.

ORGANIZE & COLLABORATE

  • Trello: Keeps track of everything.
  • Evernote: The workspace for your life’s work.
  • Dropbox: Free space up to 2GB.
  • Yanado: Tasks management inside Gmail.
  • Wetransfer: Free transfer up to 2GB.
  • Drp.io: Free, fast, private and easy image and file hosting.
  • Pocket: View later, put it in Pocket.
  • Mailtoself: An iOS extension to mail notes to yourself from any app.
  • List.ly: Discover and create great lists.
  • MarkticleMark your reading progress in articles for later.

DIGITAL NOMADS & REMOTE WORKING

 

DISCOVER TOOLS & STARTUPS

BUILD TOGETHER

LEARN

NEWSLETTERS THAT DON’T SUCK

USEFUL

Continue reading All free things for web

cool programming — mathematical operation

If we want to input a string, we should use in_string function. To do mathematical operation with the string, we should convert the string into integer and after doing mathematical operation the output should be converted integer to string. At first, we want to take input from user and add 1 with the value. We can do this by using the following program as fact.cl file.


(*
fact.cl
*)
class Main inherits A2I{
main():Object{
(new IO).out_string(i2a(a2i((new IO).in_string())+1).concat("\n"))

};

};

Here, for integer to string and string to integer conversion we should inherit a class A2I which will work for string conversion. A2I class code is given below


(*
a2i.cl
*)
(*
The class A2I provides integer-to-string and string-to-integer
conversion routines. To use these routines, either inherit them
in the class where needed, have a dummy variable bound to
something of type A2I, or simpl write (new A2I).method(argument).
*)

(*
c2i Converts a 1-character string to an integer. Aborts
if the string is not "0" through "9"
*)
class A2I {

c2i(char : String) : Int {
if char = "0" then 0 else
if char = "1" then 1 else
if char = "2" then 2 else
if char = "3" then 3 else
if char = "4" then 4 else
if char = "5" then 5 else
if char = "6" then 6 else
if char = "7" then 7 else
if char = "8" then 8 else
if char = "9" then 9 else
{ abort(); 0; } -- the 0 is needed to satisfy the typchecker
fi fi fi fi fi fi fi fi fi fi
};

(*
i2c is the inverse of c2i.
*)
i2c(i : Int) : String {
if i = 0 then "0" else
if i = 1 then "1" else
if i = 2 then "2" else
if i = 3 then "3" else
if i = 4 then "4" else
if i = 5 then "5" else
if i = 6 then "6" else
if i = 7 then "7" else
if i = 8 then "8" else
if i = 9 then "9" else
{ abort(); ""; } -- the "" is needed to satisfy the typchecker
fi fi fi fi fi fi fi fi fi fi
};

(*
a2i converts an ASCII string into an integer. The empty string
is converted to 0. Signed and unsigned strings are handled. The
method aborts if the string does not represent an integer. Very
long strings of digits produce strange answers because of arithmetic
overflow.

*)
a2i(s : String) : Int {
if s.length() = 0 then 0 else
if s.substr(0,1) = "-" then ~a2i_aux(s.substr(1,s.length()-1)) else
if s.substr(0,1) = "+" then a2i_aux(s.substr(1,s.length()-1)) else
a2i_aux(s)
fi fi fi
};

(*
a2i_aux converts the usigned portion of the string. As a programming
example, this method is written iteratively.
*)
a2i_aux(s : String) : Int {
(let int : Int {
(let j : Int (let i : Int while i < j loop
{
int i }
pool
)
);
int;
}
)
};

(*
i2a converts an integer to a string. Positive and negative
numbers are handled correctly.
*)
i2a(i : Int) : String {
if i = 0 then "0" else
if 0 < i then i2a_aux(i) else
"-".concat(i2a_aux(i * ~1))
fi fi
};

(*
i2a_aux is an example using recursion.
*)
i2a_aux(i : Int) : String {
if i = 0 then "" else
(let next : Int i2a_aux(next).concat(i2c(i - next * 10))
)
fi
};

};

You need not understand all the codes in the elementary level. You could understand this code later.

To run the code these codes, we should run

coolc fact.cl a2i.cl
spim fact.s


In the program if we input 6 it will output 7.

We could do this type of increment by using fact function
like this


class Main inherits A2I{
main():Object{
(new IO).out_string(i2a(fact(a2i((new IO).in_string()))).concat("\n"))
};
fact(i: Int):Int{

i+1

};

};

here fact function will return an incremented value. fact function is called in the main function.

If we want to do factorial of a mathematical value, this program will work


class Main inherits A2I{
main():Object{
(new IO).out_string(i2a(fact(a2i((new IO).in_string()))).concat("\n"))

};
fact(i: Int):Int{

if(i=0)then 1 else i*fact(i-1) fi

};

};

here we use if then conditional logic if i is zero then it will return 1 other than recursively it will call fact function. The end of if statement can be understand by fi keyword. fi means end of if condition.

We could the program by using while statement, the program will be like this


(*
this is factorial programming using while loop

*)
class Main inherits A2I{
main():Object{
(new IO).out_string(i2a(fact(a2i((new IO).in_string()))).concat("\n"))
};
fact(i: Int):Int{
let fact:Int while(not(i=0)) loop
{
fact<-fact*i;
i<-i-1;
}
pool;
fact;
}
};
};

In the program fact is a variable which is also integer type. fact is also the name of the function we could use function name as a variable name in cool programming. in the block of fact, we use while loop which is a conditional loop iterate till not i equal zero. End of loop could be understand by pool keyword which is reverse of loop. We return fact value as a return value.

In this lesson, we learn input string, output string, number conversion, if statement, while loop programming in cool language.

cool programming– working with output string

To print hello world in your cool programming, you should write this program

class Main{
i:IO<-new IO; main():Int{{i.out_string("Hello world!\n");1;}}; };[/code] here, i is an Input and output object. out-string print the hello world string. 1 is the return type which is written at the main function. main function will starting of the program as other programming languages like c,java. [code]main():Int{};[/code] the code says main function will return integer type value. If we write this below code [code]main():Int{1};[/code] it will return 1. Moreover the function main body is in a block which is [code] main():Int{{i.out_string("Hello world!\n");1;}}; [/code] for that the code has curly braces at the begin and end. If we store this file in hello.cl, we should compile the program using [code] coolc hello.cl [/code] it will produce assembly file called hello.s and we can run this by using [code] spim hello.s [/code] The output will be hello world. We could do the program other ways, [code] class Main{ i:IO<-new IO; main():IO {i.out_string("Hello world!\n")}; }; [/code] Here the main function will return IO that means input output. Another, example could be [code] class Main{ i:IO<-new IO; main():Object {i.out_string("Hello world!\n")}; }; [/code] Here the main function return object. Which is also be a output string. Moreover we can write like below. We could do the initialization of IO in the output string. It will also work. [code] class Main{ main():Object { (new IO).out_string("Hello world!\n")}; }; [/code] We could inherits IO class like OOP programming. [code] class Main inherits IO{ main():Object { self.out_string("Hello world!\n")}; }; [/code] self indicates the object. [code] class Main inherits IO{ main():Object { out_string("Hello world!\n")}; }; [/code] if you want to comment in the cool programming you should include parenthesis and star like this. [code](* this is test comment *)[/code]

How to install classroom object oriented language (cool) programming in your windows computer?

To install cool programming in your windows computer, you need to do following works:
1. Install virtual Box, download it from https://www.virtualbox.org/wiki/Downloads
2. Download compiler linux virtual machine image from http://d2bk0s8yylvsxl.cloudfront.net/stanford-compilers/vm/compilers-vm.zip. It is about 750MB.
3. Unzip the compiler-vm file to a convenient folder. It takes about 2GB.
4. Run the compilers.vbox file (which is in blue color)

image absent

5. After that compiler virtual machine will be started using Oracle virtual machine.
Oracle-VM-virtual-Box-Manager

6. Click on the setting and go to the shared folder tab.
setting virtual box

7. Add share folder, link the file to a folder which is already exist in a drive. If you did not create a folder for that, create the folder and navigate that to the folder.After that click okay button and go back to the panel.
image absent

8. Then click on the show icon.
image absent
It will start bodhi linux at the virtual box in your computer . You can follow this link for bodhi linux http://www.bodhilinux.com/
bodhi screenshot in virtual box

9. Then run the commands from the terminal
mkdir assign1
cd assign1

10. By above command assign1 folder will be created and by change directory (cd ) command we will be in the assign1 folder.

image absent

11. Now, we should copy the following command from coursera compiler assignment file
https://spark-public.s3.amazonaws.com/compilers/assignments-public/PA1.pdf
and paste it.
make -f /usr/class/cs143/assignments/PA2J/Makefile

12. This command will make necessary file in your assign1 folder.
image absent
make necessary file in the assign1 folder

13. If you want to write a program called hello_world as usual another programming, run the following command
leafpad hello_world.cl

14. After that leafpad will open, you need paste the following code and save the file.
class Main inherits IO {
main() : Object {
out_string("Hello, world.\n")
} ;
} ;

image absent

15. By using coolc command you can easily compile the code and it will generate assembly code the for the cool file. After that you can see the output by running spim command.
coolc hello_world.cl
spim hello_world.s

16. Atlast, we can see the output like this.

image absent

17. If you want to exchange the folder files to windows folder files you need to use this commands
cd
mkdir –m 000 share
sudo mount -t vboxsf shared share

By using cd you will be in the root folder. Then use mkdir command to make the folder. Atlast you should use mount command first folder name shared is coming from the share folder list which we did in the step 7 and next share is the folder or directory which is created in the previous command.

Student Result Processing using jFrame

Add Student information into the add student panel

Student info
Add Student Basic Information

After adding the information you have to add marks by selecting the student by selection box.

add_marks

After selecting students automatic subject should be  displayed by semester.

 

Add_student_marks

To show the final result, you have to select any one of the semesters.

 

resultOption

At last Semester base result are displayed in the  window like this.

 

 

result

 

WordPress shortcode for image with caption

You should add the below code in the functions.php file.

function image_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(
'link' => 'http://placehold.it/300x200',
'width'=>'300',
'height'=>'200',
'alt'=>'image absent',
'caption'=>''
), $atts ) );
return '<style type="text/css">
.alignleft {
float: left;}
.wp-caption {
background-color: #DDDDDD;
border: 1px solid #BBBBBB;
border-radius: 3px;
padding: 5px;margin:5px;
text-align: center;
}
</style>

<figure ><img src="'.$link.'" height="'.$height.'" width="'.$width.'" alt="'.$alt.'" /><figcaption>'.$caption.'</figcaption></figure>' ;
}
add_shortcode( 'image', 'image_shortcode' );

 

To add image src with its caption, width and height.

In the post you have to add this code:


[image link="http://media-cache-ak0.pinimg.com/236x/60/49/22/604922727c72015aa699f9a0f7d04683.jpg" height="450" width="236" alt="Camogli - Liguria, Italy" caption="Camogli - Liguria, Italy"]

The image will show like this:
Camogli - Liguria, Italy
Camogli - Liguria, Italy

Image shows here

Java Assignment one: Student Result processing system

Student result UML
Student Result processing

Create student result processing system with an abstract class. All years students data can be entered and displayed by inherited sub classes. Abstract class should contain student roll, name and registration number.

Aim: Students should have clear  understanding of basic java class with object oriented concepts. Abstract class  should  be  implemented in the assignment. Java basic terms  like Object, class, method, inheritance, function overloading  should be clear to the student.

Procedure:  An abstract class named student with its data member roll, name, registration number. Sub classes should inherit from the student class. Semester based students are enrolled with their subjects and subject credit. From the main class all the students result processed and displayed. Necessary member functions should be included in the classes.

Solution:

Code for Student class:

Student has name,roll and registration number as reg. Student name are String, roll and reg number are integer number. In the constructor we set name, roll and reg values by passing parameters. In student class, we have another function which is for mark to grade conversion. The function markToGrade takes mark as parameter and return the grade as float value.


package student.result;

public class Student {
String name;
int roll, reg;

public Student(String name, int roll, int reg) {
this.name = name;
this.roll = roll;
this.reg = reg;
}
public  float markToGrade(float mark){
float gradePoint;
if(mark>=80 && mark<=100)
gradePoint=(float) 4.0;
else if(mark>=75 && mark<=79)
gradePoint=(float) 3.75;
else if(mark>=70 && mark<=74)
gradePoint=(float) 3.50;
else if(mark>=65 && mark<=69)
gradePoint=(float) 3.25;
else if(mark>=60 && mark<=64)
gradePoint=(float) 3.00;
else if(mark>=55 && mark<=59)
gradePoint=(float) 2.75;
else if(mark>=50 && mark<=54)
gradePoint=(float) 2.50;
else if(mark>=45 && mark<=49)
gradePoint=(float) 2.25;
else if(mark>=40 && mark<=44)
gradePoint=(float) 2.00;
else
gradePoint=(float) 0.00;
return gradePoint;
}
}

In the program, we have to use interface called Result. Result interface  has calculateGpa, getSubject, showResult and setMarks functions which should be  implemented in implemented class.


package student.result;

public interface Result {
float calculateGpa();
void getSubject();
void showResult();
void setMarks(float mark1,float mark2);
}

FirstSemester class extends from student class and implements result interface. Here,subject1 as sub1 and subject2 as sub2 are String and mark, grade and credit are float property. calculateGpa, getSubject, showResult and setMarks functions are implemented here as it is from result interface. For calculateGpa we have to add multiplication of grade and credit and add it with grade


package student.result;

public class FirstSemester extends Student implements Result {
private String sub1, sub2;
private float mark1, mark2, grade1, grade2,credit1,credit2;

public FirstSemester(String name, int roll, int reg) {
super(name, roll, reg);

}
@Override
public void setMarks(float mark1,float mark2) {
this.mark1=mark1;
this.mark2=mark2;
this.grade1=markToGrade(mark1);
this.grade2=markToGrade(mark2);
}

@Override
public float calculateGpa() {
return (grade1* credit1+ grade2*credit2) / (credit1+credit2);
}

@Override
public void getSubject() {
sub1="Introduction to Computer System";
sub2="Structured Programming Language";
credit1=(float)2.0;
credit2=(float)3.0;
}

@Override
public void showResult() {
System.out.println("\nName: " + name + "\nRoll = " + roll + "\nRegistration no: " + reg + "\n" + sub1 + " grade: " + grade1+ "\n" + sub2 + " grade: " + grade2 + "\nGPA: " + calculateGpa());
}
}


package student.result;

public class SecondSemester extends Student implements Result {
private String sub1, sub2;
private Float mark1, mark2, grade1, grade2,credit1,credit2;

public SecondSemester(String name, int roll, int reg) {
super(name, roll, reg);
}
@Override
public void setMarks(float mark1,float mark2) {
this.mark1=mark1;
this.mark2=mark2;
this.grade1=markToGrade(mark1);
this.grade2=markToGrade(mark2);
}
@Override
public float calculateGpa() {
return (grade1* credit1+ grade2*credit2) / (credit1+credit2);
}

@Override
public void getSubject() {
sub1="Data Structure";
sub2="Discrete Mathematics";
credit1=(float)3.0;
credit2=(float)2.0;
}

@Override
public void showResult() {
System.out.println("\nName: " + name + "\nRoll = " + roll + "\nRegistration no: " + reg + "\n" + sub1 + " grade: " + grade1+ "\n" + sub2 + " grade: " + grade2 + "\nGPA: " + calculateGpa());
}
}


package student.result;

public class StudentResult {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
FirstSemester std1 = new FirstSemester("Shufol", 127, 149);
std1.setMarks(60,70);
System.out.println("\nEnter First Semester Student's Info:");
std1.getSubject();
std1.showResult();

SecondSemester std2 = new SecondSemester("Fakhrul", 227, 249);
std2.setMarks(70,80);
System.out.println("\n\nEnter Second Semester Student's Info:");
std2.getSubject();
std2.showResult();
}
}

 

download the project from here