When we look for something in the web we use search engines. Like many of you my favourite SE is Google. The term googling started upon doing search using the Google. Then comes Bing. Now what do we search using SE? I asked my friends & collogues about this. Majority of the answers are almost anything. Well I also think more or less the same, but with an assumption of existence of the information on the web. This means I search for things like address of restaurant or coffee shop, specific product review, news for certain things or may be work related information etc. I believe most of you also do the same. In simple words we search information present in the web using SE.
Now if you need to find out the some information like 30 degree C equivalent F or 8% tax upon $1200 or interest amount upon $4500 with 13.5% yearly compound interest etc. Best way is to find out pen & paper and a calculator to do the math. I found out an interesting search engine powered by computational power. Continue reading ‘Computational Search Engine – Wolfram|Alpha’ »
Information storage and retrieval is an important job while designing or developing an application. We all know how to store data with normal data types in database or file systems. Here I am going to discuss about storage and retrieval of data having complex type. Complex type means they are not like normal string or number or boolean values. Complex type means data structure or objects.
Think of a situation where you are working with some array. Now there may be some situations where you need to store the array and retrieve it back. If you are familiar with OOPS concept then objects are another type which you may need to store and retrieve.
Serialization is the process by which you can convert an object or data structure into a sequence of bits which can stored and retrieve back. Serialization is also known as deflating or marshalling. The opposite process (converting the serialized sequence of bits to object or data structure) is known as Deserialization or inflating or unmarshalling. Most of the important languages have their own implementation of these processes. In Java provides automatic serialization by implementing the java.io.Serializable interface. In perl there are modules like Storable or FreezeThaw. Python implements serialization through the standard library module pickle. In PHP there are two built-in functions as serialize() and unserialize() for this purpose. However as I will continue the discussion with PHP then you should be aware of the fact that – there is a difference in the implementation of serialization in PHP 4.x and PHP 5.x.
Continue reading ‘PHP serialization or Json’ »
The reasons why I selected Beau’s code is :
The code is simple to use but robust and has good documentation.
It uses standard JS library like prototype and scriptaculous.
Now having previous knowledge of integration of QuickForm and Jscalender I created the code for autosuggest class. This autosuggest class file contains constructor function, toHtml function which generates the HTML code for the field, getFrozenHtml function to return the autosuggest content in HTML and finally the registering process of the autosuggest type with HTML QuickForm. I put this autosuggest class name as autosuggestwce. View this wceautosuggest.php file.
This autosuggest uses php script to populate values. The name of the php script has to be mentioned in the $attribute array for the key ‘fileref’.
Continue reading ‘QuickForm and AutoSuggest’ »
After giving a thorough search I selected jscalendar to incorporate with my form elements. The reasons behind selecting jscalendar are:
- It has a nice interface and wide variety of themes.
- Multiple integration options along with selectable date format to put the date in the text field.
- Support for integrating the calendar object with HTML_QuickForm.
Prior to integrate the jscalendar I need to upgrade HTML_QuickFom version to 3.2.10 as I found some code added in this version to support jscalendar. I also need to upgrade my PEAR DB package to version 1.7.13 and DB_Table to version 1.5.5. In my projects most of the cases I generate forms using DB_Table instead of using QuickForm directly. This gives an extra benefit for data validation and storing them in database.
I was following the method described by Philippe Jausions of 11abacus in jscalendar.php file. It was working fine with the QuickForm. In that case I was using addElements function to add jscalendar with proper options using the $option array like this –
‘baseURL’ => ‘../js/jscalendar/’,
‘styleCss’ => ‘calendar-win2k-1.css’,
‘language’ => ‘en’,
‘button’ => ”,
‘inputField’ => ‘datefield1′,
‘ifFormat’ => ‘%d.%m.%Y %H:%M’,
‘showsTime’ => true,
‘time24′ => true,
‘weekNumbers’ => false,
‘showOthers’ => true
$form->addElement(‘jscalendar’, ‘ datefield1′, ‘My Date’, $options);
I used this same option array in the column definition for the same field, as DB_Table uses the column definition for the attributes of the form elements of the form. I written like
Continue reading ‘QuickForm and Jscalendar’ »