Posts

Showing posts from 2009

Content publish in blogspot through google docs

Today was an amazing day!! Feeling like flying in sky after a long time of heavy working pressure. Rambling around the web, chatting with friends, commenting pictures in facebook etc... in a nutshell enjoying the time very much.  Suddenly I found this web site  http://www.ismckenzie.com/blog-writing-software/  ( I was googling a easy way to publish content in my blogs with source code). One word stuck my eyes "Google docs". Personally i like it very much. I maintain all my TODOs, presentations, daily calculations in my google docs. And when i saw that it also facilitates to publish my content in my blog i was so excited the check it out instantly. However I configured my blog in Google docs account and trying to publish the content in my blog. As i also needed to publish source codes in my blogs lets try to put some code also. dont know what will happen :P i=0; [1,2,3].each{|i| i};  puts i; simple ruby code. Well after writing the code here I opened this doc in

Margin 0 auto in Internet Explorer

I dont know how I missed this fix(!) of so common problem for these long days. Whenever I started some template related work i found IE the most irritating. What I am talking about is using Margin: 0 auto, mostly used to center a container ( DIV or table anything ). But before few days ago I believed that IE is not gonna support this easy way and i must have to write some additional IE fixing in my css files. However now i got to know that the DOCTYPE type declaration is the thing I was using incorrectly. As soon as I fixed my DOCTYPE declarations the IE started working perfectly. However in a nutshell it is really a better practice to use proper DOCTYPE in your web applications. Please refer to the wiki for detail understanding of using DOCTYPE. Here I am giving a code snap. Just run it in your IE with and without the DOCTYPE declaration at top and watch out the differences. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1

Javascript minification along with automated deployment

Javascript compression has always been a great concern specially for interactive web applications where you will have lot of javascripts with lot of ajax requests. And as the ultimate target is to make your user happy with faster response, its better to squeeze your javascript files as much as possible. If possible reduce the number of files as well. Lots of advices are available to make your web sites faster enough as if users are working in desktop application. A good guideline can be found here . Besides we also need such a convenient way so that we can have this minification process as a part of our deployment. Some kind of automation I meant. Well we have found JS min very useful regarding all the above concerns. It gives pretty much good ratio of compression for js files compare to some contemporary minification processes. And in ruby you will have a rake task to make the minification process totally automated. In scrumpad we used JS-min with little bit tweaked. Here I wil

Retina pattern recognition towards human identification

Image
A paper prepared from my undergraduate thesis work has been indexed in IEEE Explore recently. Find the abstract at IEEE explore . It was basically on human identification based on retina blood vessel orientation pattern recognition. We proposed a way to detect the pattern of the blood vessels followed by identifying the intersection points of those vessels. Blood vessel orientation of different human beings are different and hence the intersecting points of these vessels give a unique pattern to recognize. However, to compare between two patterns, the variance of the intersecting points are measured. If the measured variance is under a threshold value which is empirically determined, we assume it as a match. Steps are pictorially described below: 1. Human Retina: Green-Scale version of a colorful retina image 2. Segmentized blood vessels: Binary image. Detected blood vessel portions are black 3. Intersecting points detection (Binary Image): Binary image. Inter

recognize_path to determine url hash from RESTful url

If you are using RESTful controllers for your application, same url can refer different actions in a controller based on the associated HTTP method. For instance let’s consider a URL http://your.host.com/messages/123 . Any request with this url with HTTP get will be paired with the show method of messages controller. Some other pairs are like HTTP put with update action, and HTTP delete with destroy action. Then how can you get a hash of controller and action from this url? In this situation recognize_path to the rescue. You can use ActionController::Routing::Routes .recognize_path(url, method) where url is the '/messages/123' part and method is anyone from GET, PUT, POST or DELETE. It will return a hash containning controller, action and other parameters, for example :id => 123 in the above case. By the way if you are thinking to trim the first part of the url just use as following url = 'http://your.host.com/messages/123' extracted_part = url.g

ROR draggable_element with ghosting property in IE

Some days ago I faced a problem of drag and drop functionality in developing Scrumpad . We had to give a way to drag a DIV element from one block and drop to another to make user experience more interactive. It’s really an easy task as we have many rich javascript libraries. Besides ROR provide a rich javascript helper. However we enabled the DIV s to be draggable by the following way: <%= draggable_element ‘element_[id]’, :revert=>true, :ghosting => true -%> Here ‘element_[id]’ refers to some DIV s having id like ‘element_1’, ‘element_2’ and so on... When equipped with everything I checked in firefox and found everything working well. But in IE this code created a huge mess. After digging a bit more I found the problem in the ghosting property in draggable_element function. Actually this property helps to create a replica of the dragging element and move that DIV anywhere else. But IE showed so devotion on it that it was creating a new replica on each movement of