Rupee on the Web Two young Indian techies have developed a code for the new rupee symbol for the internet.
WebRupee is a web Application Programming Interface(API) for the new Indian rupee symbol. This makes the Rupee symbol available to everyone on the web. The API provides a cross browser support for the Rupee symbol.
Here...
Animation: Ólafur Arnalds – Ljósið http://www.ndesign-studio.com/blog/animation-olafur-arnalds-ljosi%C3%B0
Ólafur Arnalds - Ljósið (Official Music Video) from Erased Tapes on Vimeo.
CakePHP Paginate Count with group by I am working on a CakePHP project these days, today i ran into a different problem with CakePHP. Sometimes i feel that there are small-small things that are sometimes missed by the Cake developers, but thank God that there are some workarounds available to them. Here is the problem statement that i...
A new look for Gmail Today when i logged in to my Gmail account i saw that Gmail has a new look. The new look has an easy access to the contacts and tasks. There was an update to the contacts too, now one can sort by last name and add custom labels for phone numbers and other fields.
[caption id="attachment_581" align="alignleft"...
HTML5 localStorage() As you all know that its been exciting to see lots of new and good features of HTML5 and CSS3. I have been looking for things that would be very good for the future of HTML5 and CSS3, one such thing that might be very useful in the future is the HTML5 localStorage(), which is a client-side database....
Two young Indian techies have developed a code for the new rupee symbol for the internet.
WebRupee is a web Application Programming Interface(API) for the new Indian rupee symbol. This makes the Rupee symbol available to everyone on the web. The API provides a cross browser support for the Rupee symbol.
Here is the code through which you can get this symbol on the web.
I am working on a CakePHP project these days, today i ran into a different problem with CakePHP. Sometimes i feel that there are small-small things that are sometimes missed by the Cake developers, but thank God that there are some workarounds available to them. Here is the problem statement that i encountered, i had a table in which i was having duplicate records and i wanted to show only distinct records in the data grid which was using the CakePHP paginator class to create a paginated data grid.
Now to show only the distinct rows i used the group by clause to eliminate the duplicate records, the records were coming fine but when i saw the paging it was not working right at all. The problem was that the paginator’s “paginateCount” function was also considering the “Group By” clause while doing the counting of the total records. This was crazy.
I searched through Google to get a solution to that and found this link, where people have already reported a his error to the cake developers. The solution that worked for me was that i needed to override the “paginateCount” function and use a different function in my model to get the correct number of total records. I added this function to my model and whola it worked for me. Here is the function that needs to be added model to get things right.
publicfunction paginateCount($conditions=null,$recursive=0,$extra=array()){$parameters=compact('conditions','recursive');if(isset($extra['group'])){$parameters['fields']=$extra['group'];if(is_string($parameters['fields'])){// pagination with single GROUP BY fieldif(substr($parameters['fields'],0,9)!='DISTINCT '){$parameters['fields']='DISTINCT '.$parameters['fields'];}unset($extra['group']);$count=$this->find('count',array_merge($parameters,$extra));}else{// resort to inefficient method for multiple GROUP BY fields$count=$this->find('count',array_merge($parameters,$extra));$count=$this->getAffectedRows();}}else{// regular pagination$count=$this->find('count',array_merge($parameters,$extra));}return$count;}
Today when i logged in to my Gmail account i saw that Gmail has a new look. The new look has an easy access to the contacts and tasks. There was an update to the contacts too, now one can sort by last name and add custom labels for phone numbers and other fields.
As you all know that its been exciting to see lots of new and good features of HTML5 and CSS3. I have been looking for things that would be very good for the future of HTML5 and CSS3, one such thing that might be very useful in the future is the HTML5 localStorage(), which is a client-side database. The values in this database is stored as a key value pair. This database resides on the users browsers and not on the server. You need not write SQL insert/update/delete for manipulating this database. There are functions provided to this which helps in storing, updating and deleting the data stored in localStorage(). This database is available per browser so if some data is stored in the Firefox browser and you switch to Safari you won’t be able to use the localStorage data in firefox. This is a browser dependent feature, currently its supported by most modern browsers including Safari 4+, Mobile Safari (iPhone/iPad), Firefox 3.5+, Internet Explorer 8+ and Chrome 4+.
Let me show you how to code to use the localstorage() of your browser:
if (typeof(localStorage) == 'undefined' ) {
alert('Browser support unavailable, try upgrading your browser');
} else {
try {
localStorage.setItem("date", "9th July 2010"); //INSERT, "key", "value"
} catch (e) {
if (e == QUOTA_EXCEEDED_ERR) {
alert('Quota exceeded!'); //data wasn't successfully saved due to quota exceed so throw an error
}
}
document.write(localStorage.getItem("date"));
localStorage.removeItem("date"); //DELET
}
You can use this localStorage() in various ways, you can use it to track the time spent by a user on your site, you can store the date the user logged in the last time etc. In the first impression it may not sound very good to you but its a very nice feature to have for the future.
I was working on an app using Adobe AIR platform. At one stage i was at a point where i needed an alert system that i can customize according to my needs. I searched for some of the plugins that were very good but accidently i bumped into a link where it talks about how to create a jQuery plugin, so i thought of creating my own which i can customize according to my needs.
I am providing the code here so that you can use this code and customize it according to your need.
Some of the cool new stuff coming in Firefox 4.
* New Add-Ons Builder based on Bespin
* HTML5 Video display
* Painting with Canvas
* Image manipulation with Canvas – pixel testing, face detection with opencivitas
* Green screen technologies in images and video by detecting pixel colours.
* HTML5 embedded inside SVG (yes!)
* SVG as an IMG
* SVG as a CSS background
* SVG filter/mask/clip
* SVG animations
* Inline SVG inside HTML5
* CSS3 (selectors, @font-face, 2D Transforms, Transitions, Shadow, Gradients ,calculations – calc(2em-10px) )
* APIs: Geolocation, Offline (IndexDB, localStorage, AppCache, FileAPI – binary content of a file input, file drag and drop, web workers, websockets)
* Websockets controller running the presentation from the mobile.
* WebGL
Few days back i was working on two separate CakePHPapplications, suddenly there was a need to maintain session between these two separate apps working on the same domain. Let me explain a bit more.
These are two separate apps under the root folder having the directory structure as:
/htdocs
/wishlist
/app
/config
….
/lighthouse
/app
/config ….
By default the sessions are created relative to the apps directory, and this was the problem i was dealing with, not a big thing but i spent a lot of time figuring this, but for you its will work like a charm.
Steps that i follow to make the two apps share sessions between them. 1. Edit “core.php” for wishlist and the lighthouse and add the line ini_set(‘session.cookie_path’, “/”);
This is to direct the CakePHP app to create the session on the root
2. The Session.cookie name should be same for the two apps
3. The Session.salt should be same for the two apps
4. Security.level should be low in both the apps
This is it what is required. Let me know if you are still stuck with the things, happy coding.