Showing posts with label zza. Show all posts
Showing posts with label zza. Show all posts

How to clear browser cache for CSS files

Every time you change external files like CSS (Cascading style sheets), you have to clear cache on the browser to see the changes. Clearing cache on application load is a a frustrating step for users. Here is a solution:
Add a questions mark and  string to the end of the UTL of the CSS fil, example "?version=xx.xx.x". On application load, the browser will think that this is a new CSS file, but when it parses it it will get the file name with out the "?flush=1". 
Caching:

<link rel="stylesheet" href="css/html_tags.css?version=xx.xx.xx" type="text/css">

NOT caching

<link rel="stylesheet" href="css/html_tags.css" type="text/css">:

Ref:


As an Amazon Associate I earn from qualifying purchases.

How to clear browser cache for CSS files

Every time you change external files like CSS (Cascading style sheets), you have to clear cache on the browser to see the changes. Clearing cache on application load is a a frustrating step for users. Here is a solution:
Add a questions mark and  string to the end of the UTL of the CSS fil, example "?version=xx.xx.x". On application load, the browser will think that this is a new CSS file, but when it parses it it will get the file name with out the "?flush=1". 
Caching:

<link rel="stylesheet" href="css/html_tags.css?version=xx.xx.xx" type="text/css">

NOT caching

<link rel="stylesheet" href="css/html_tags.css" type="text/css">:

Ref:


As an Amazon Associate I earn from qualifying purchases.

Software Tool: OmniGraffle

Recently I have been using OmniGraffle, which is an excellent tool for software design. It has tools like diagrams, flow charts, etc.
OmniGraffle download:


As an Amazon Associate I earn from qualifying purchases.

Software Tool: OmniGraffle

Recently I have been using OmniGraffle, which is an excellent tool for software design. It has tools like diagrams, flow charts, etc.
OmniGraffle download:


As an Amazon Associate I earn from qualifying purchases.

Java String parser

To split a String into words (tokens) where delimiter is white space...

 String delims = "[ ]+"

 String[] tokens = someLongString.split(delims);

Now you can look thru the tokens and do comparisons, etc.



As an Amazon Associate I earn from qualifying purchases.

Java String parser

To split a String into words (tokens) where delimiter is white space...

 String delims = "[ ]+"

 String[] tokens = someLongString.split(delims);

Now you can look thru the tokens and do comparisons, etc.



As an Amazon Associate I earn from qualifying purchases.

Interactive Map Implementation

To create an interactive map where a user can highlight a state, a red border appears around the state he/she has selected.
Example:
When user clicks on the highlighted state, which is Oregon in above picture, the highlighted state's map shows:
Download below jquery.maphighlight.min.js and jquery-1.2.3.pack.js locally and include thier paths on your file system
 - Create an DE.html file which corresponds to the state's name:
 - Create an index.html file and include:


As an Amazon Associate I earn from qualifying purchases.

Interactive Map Implementation

To create an interactive map where a user can highlight a state, a red border appears around the state he/she has selected.
Example:
When user clicks on the highlighted state, which is Oregon in above picture, the highlighted state's map shows:
Download below jquery.maphighlight.min.js and jquery-1.2.3.pack.js locally and include thier paths on your file system
 - Create an DE.html file which corresponds to the state's name:
 - Create an index.html file and include:


As an Amazon Associate I earn from qualifying purchases.

Adding maven and SVN plugin to Eclipse 2.4.2

To add maven plugin:
Go Help menu in your Eclipse IDE 
Select Software Updates
Click on Add Site and enter http://m2eclipse.sonatype.org/update/
To add SVN plugin:
Go Help menu in your Eclipse IDE 
Select Software Updates
Click on Add Site and enter http://subclipse.tigris.org/update_1.4.x
To see your SVN repository view, go to Window menu 
Select Show View and select SVN Repository


As an Amazon Associate I earn from qualifying purchases.

Adding maven and SVN plugin to Eclipse 2.4.2

To add maven plugin:
Go Help menu in your Eclipse IDE 
Select Software Updates
Click on Add Site and enter http://m2eclipse.sonatype.org/update/
To add SVN plugin:
Go Help menu in your Eclipse IDE 
Select Software Updates
Click on Add Site and enter http://subclipse.tigris.org/update_1.4.x
To see your SVN repository view, go to Window menu 
Select Show View and select SVN Repository


As an Amazon Associate I earn from qualifying purchases.

Java set

Java set is a collection that contain unique elements.
Set sports = new HashSet(); for (Season season : currentSeasons) { sports.add(season.getSportLeague().getSport()); }


As an Amazon Associate I earn from qualifying purchases.

Java set

Java set is a collection that contain unique elements.
Set sports = new HashSet(); for (Season season : currentSeasons) { sports.add(season.getSportLeague().getSport()); }


As an Amazon Associate I earn from qualifying purchases.

Baby Steps

Good code is a succession of small programming steps that would eventually create a well-written functionality. 
In order to create a clean, simple, and functional code, it is good to follow some of the best practices of programming: 

Let's say we want to create UI with following functionalities: 
- List 
- Add 
- Edit 
- Delete items 

1) Create a skeleton UI with "comming soon.." text, you test and commit code. 
2) Make a fake, hardcoded list and you display it , you test and commit code. 
3) Fetch the list via a service call that returns a fake list, , you test and commit code. 
4) Implement the DAO , you test and commit. 
5) Connect all pieces, you test and commit. 

Now you have the "list" and you can move to the "add" functionality.


As an Amazon Associate I earn from qualifying purchases.

Baby Steps

Good code is a succession of small programming steps that would eventually create a well-written functionality. 
In order to create a clean, simple, and functional code, it is good to follow some of the best practices of programming: 

Let's say we want to create UI with following functionalities: 
- List 
- Add 
- Edit 
- Delete items 

1) Create a skeleton UI with "comming soon.." text, you test and commit code. 
2) Make a fake, hardcoded list and you display it , you test and commit code. 
3) Fetch the list via a service call that returns a fake list, , you test and commit code. 
4) Implement the DAO , you test and commit. 
5) Connect all pieces, you test and commit. 

Now you have the "list" and you can move to the "add" functionality.


As an Amazon Associate I earn from qualifying purchases.

hibernate: generating a new table from model obj.

pom.xml:
Create a Java model object containing the needed properties and Java 1.5 annotations:
@Entity @Table(name = "mail_history") public class MailHistory implements Serializable { @Column(updatable = false, name = "date_sent", nullable = false) private Date dateSent; @Column(name = "entity_id", nullable = false) private int entityId; @Column(name = "entity_name", nullable = false, length=20) private String entityName; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(updatable = false, name = "id", nullable = false) private Long id; @Column(name = "mail_type", nullable = false) private int mailType; @ManyToOne @JoinColumn(name = "user_id", nullable = false) private User user; //generate getter and setter methods
Add the model object to applicationContext.xml and hibernate.cfg.xml configuration file Run maven:
mvn -e clean compile hibernate3:hbm2ddl -Dtarget=Zainab


As an Amazon Associate I earn from qualifying purchases.

hibernate: generating a new table from model obj.

pom.xml:
Create a Java model object containing the needed properties and Java 1.5 annotations:
@Entity @Table(name = "mail_history") public class MailHistory implements Serializable { @Column(updatable = false, name = "date_sent", nullable = false) private Date dateSent; @Column(name = "entity_id", nullable = false) private int entityId; @Column(name = "entity_name", nullable = false, length=20) private String entityName; @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(updatable = false, name = "id", nullable = false) private Long id; @Column(name = "mail_type", nullable = false) private int mailType; @ManyToOne @JoinColumn(name = "user_id", nullable = false) private User user; //generate getter and setter methods
Add the model object to applicationContext.xml and hibernate.cfg.xml configuration file Run maven:
mvn -e clean compile hibernate3:hbm2ddl -Dtarget=Zainab


As an Amazon Associate I earn from qualifying purchases.

apt quotation..