Pulkit Gaur

dream - do - deserve

Gridbots - In News

Filed under: General at 08:00:52 On 2008-01-04

We were in news for roboGRAD (gBOT series) on the main page of Economic Times (National Edition) on 2'nd Jan 2008.Cool


Our first consumer robotics product roboGRAD was covered along with our future plans of marketing and production.


Cool .. eh ! 



3 Options ....

Filed under: General at 08:25:18 On 2007-07-16

Edukite guys called today and assured of resolving the issues which were lying pending.


Prima facie .. it seems to be the miscommunication from both the sides. 

Both had points to prove each other wrong but we mutually agreed over settling this issues and closing the deal.



I hope things will settle down peacefully.



One Laptop Per Child ( OLPC) !

Filed under: General at 02:48:17 On 2007-05-19

Well ..  OLPC has taken off .. and this picture says it all !!

OLPC Initiative !

MYSQL Clone records in same table

Filed under: PHP at 05:03:33 On 2007-05-09

While working on picporta we had one requirement where were supposed to clone records within the same table.

Searching in MYSQL manual i found INSERT-SELECT statement but it still does not supports same table Undecided


So did this quick hack in PHP ..


$tempTable = mysql_fetch_array(mysql_query("SELECT * FROM table." WHERE id='$passedId'),MYSQL_ASSOC) or die("Could not select record");
$result = mysql_query("INSERT INTO table (".implode(", ",array_keys($tempTable)).") VALUES ('".implode("', '",array_values($tempTable))."')");



Worked for me ..

PHP India

Filed under: General at 08:21:00 On 2007-04-24

Currently we are operating from Ahmedabad.

I found this city to be a big hub for web design, PHP development outsourcing solutions from coutries like U.K. , U.S.A.


Just Google "PHP India" and you will get about 4-5 companies from ahmedabad .. strange isn't it Tongue out

Top reasons which i could think behind this rather unusual phenomenon may be following :


1)Cheaper Solutions as compared to other cities in India.

2)A lot of immigrants are from Gujarat in these coutries.

3)PHP , Web designing are relatively easy to learn and get money flowing in ... ahem 


Still there is a scarcity of quality programmers just like any other city .. coz by the time a programmer realize his potential he already has a lot of compelling reasons to migrate to other cities.



Swim capable Snake Robot - ACM-R5

Filed under: Robotics at 01:51:58 On 2007-03-12

Wow ...

Hirose Fukushima Robotics lab has made this awesome creature..


Swmming Robot

Following are the technical specs of this robot

Size1750 (length) x 80 (diameter) [mm]
Weight7.5 [kg]
Torque of joint (Max.)9 [Nm]
Speed of joint (Max.)70 [deg/s]

Pun Intended ....

Filed under: General at 05:45:23 On 2007-03-10

Found this post at http://www.destraynor.com/serendipity and thought of copyiong it here :)

The Ubiquity of Perl

The likelihood of Perl being involved in a system is directly proportional to the length of time the system has been in maintenance.


If you boast about how quickly you developed your product, people will complain about its performance. (Rails)

If you boast about how well your product runs, people will complain about its development time. (Vista)

If you don't boast about either, people will assume you are developing in Java.

Web 2.0

For every 1.6 billion dollar buy out, there are 1.6 million start-ups in garages digging their own websites.

Startups 1

If your target market is the readers of digg, reddit, and delicious then you're trying to sell shelves to a carpenter. If he really wanted them, he would have built them himself, years ago.

Startups 2

If you build it, they might come. If you have a nice website they might stay. If you offer a free service, they might use it. If you've gotten this far without thinking about where the cash comes from , you're in trouble.

Software Development

For every Architecture Astronaut out there, there is at least one coder who thinks that being "Agile" is a perfect substitute for foresight.

Learning programming languages

Every 5 minutes you spend writing code in a new language is more useful than 5 hours reading blog posts about how great the language is.

3d labelling

Filed under: Electronics at 09:19:37 On 2007-03-10

A not so novel approach towards environment mapping from this company.

Though it can not be used as a solution in day to day robotics but may sound like a good option for not much changing environment (industries,labs etc).


Anywayz, to me it does not looks like an innovation.

Yahoo Pipes - Cool IDE for custom RSS feeds building

Filed under: General at 07:53:16 On 2007-02-14

Today only came across Yahoo Pipes , I should say its one of the best online apps i have came across.

In mozilla ,it seems they are using canvas object to show realtime interconnecting threads and in IE i assume they are making use of the SVG/VML plug-in from Adobe.


All in all , a true web 2.0 product Wink



Picporta ... coming soon !

Filed under: General at 03:44:14 On 2006-12-23

Seems ,

Soon we will be able put picporta online Cool. Vijaita, has been cooperative on my weird suggestions and pre-release changes.

Desktop manager will follow the release , which provides one click sharing and printing of pictures, albums from anywhere - with anyone .


Some of the unique features of are enlisted here :


  • Quick Edit -Quick picture editing in your browser window,without Flash
  • Geo Tagging with locations Explorer.
  • and some other cool stuff which will be disclosed later !



count down begins .....




Controlling Monitor Power - Switch On / Switch Off

Filed under: Visual Basic at 03:28:25 On 2006-11-18

Nothing new ..


but this code fragment will allow you to control your terminal display to be switch on or off.

Well you may use it to schedule your monitor power after a predetmined time instead of screensaver - go greener :)



To use this code put this code in your form code and put 2 buttons on the form.


Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
Const MONITOR_ON = -1&
Const MONITOR_OFF = 2&

Private Sub Command1_Click()
End Sub

Private Sub Command2_Click()
End Sub

Combobox and TreeView handy tricks

Filed under: Visual Basic at 09:21:19 On 2006-09-27

While working on a small project i used these frequently,thought should share it !


1)To Select First Item as default in Dropdown Combobox use :


ComboBoxName.ListIndex = 0

2)To remove a particular nodes children from tree view use this fragment :

While treeControl.SelectedItem.Children > 0
treeControl.Nodes.Remove treeControl.SelectedItem.Child.Key

3)This code fragment facilitates ajax type autosuggest/autocomplete feature in combobox.This code is not mine !


'Api declaration
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long

'Cont declaration
Private Const CB_FINDSTRING As Long = &H14C

'Procedure declaration
Public Sub ComboAutoComplete(ByRef SourceCtl As VB.ComboBox, _
ByRef KeyAscii As Integer, ByRef LeftOffPos As Long)
Dim iStart As Long
Dim sSearchKey As String

With SourceCtl
'If text entered so far matches item(s) in the list, use autocomplete
Select Case Chr$(KeyAscii)
Case vbBack
'Let backspace characters process as usual; otherwise try to match text
Case Else
If Chr$(KeyAscii) <> vbBack Then
.SelText = Chr$(KeyAscii)

iStart = .SelStart

If LeftOffPos <> 0 Then
.SelStart = LeftOffPos
iStart = LeftOffPos
End If

sSearchKey = CStr(Left$(.Text, iStart))
.ListIndex = SendMessage(.hwnd, CB_FINDSTRING, -1, _
ByVal CStr(Left$(.Text, iStart)))

If .ListIndex = -1 Then
LeftOffPos = Len(sSearchKey)
End If

.SelStart = iStart
.SelLength = Len(.Text)
LeftOffPos = 0

KeyAscii = 0
End If
End Select
End With
End Sub

Use this code as follows:

Private Sub Combo1_KeyPress(KeyAscii As Integer)
Static lWhere As Long
ComboAutoComplete Combo1, KeyAscii, lWhere
End Sub

And 3 lines of CSS crashed IE !

Filed under: General at 12:57:18 On 2006-08-12


Here is the CSS which does this !

No JS , no messy code .... just 3 lines of CSS Tongue out


#tooltip { font-size: 1em; float: left; display: inline;}
#tooltip A:hover { float: left; display: inline; background-color: #dbe4f2; text-decoration: none; font-size: 1em; }
#tooltip .toolbox A:hover span { display: block! important; font-size: 1.2em; background: white; border: black 1px solid; color: black; position: absolute; padding: 5px; min-width: 100px; text-decoration: none; }



See it in action here


PS : Tested for Internet Explorer 6.0.2800.1106. SP1 / Q823353 / Q333989

Disable write on USB drive for Win XP/NT

Filed under: General at 16:44:17 On 2006-08-04

Open the Registry Editor click on the Start button on your taskbar, then click on Run and type "regedit" and click on OK to start the regedit utility.

Expand HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control.

From there right click and create a new key and name it "StorageDevicePolicies". In the window on the right then create a new DWORD value and label it WriteProtect, give it a value of "1" and users can no longer write to USB drives. To re-enable this option change the value to 0 and users are again allowed to write.

UDP Data Xchange

Filed under: C at 02:36:04 On 2006-07-11

Was working on a UDP dataXcahnge project ,thought this code fragment will be of some use to newbees.


Server Code :


#include <netinet/in.h>

#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <arpa/inet.h>
#include <sys/types.h>

#define BUFLEN 512
#define PORT 10000

void die_err(char *s)

int main(void)
    struct sockaddr_in *sock_server, *sock_client;
    int s;
    socklen_t socklen=sizeof(struct sockaddr_in);
    char buf[BUFLEN];

    sock_server = malloc( socklen );
    sock_client = malloc( socklen );
    if ( !sock_server || !sock_client )
        die_err( "allocation failed" );
    if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1)
    sock_server->sin_family = AF_INET;
    sock_server->sin_port = htons(PORT);
    sock_server->sin_addr.s_addr = htonl(INADDR_ANY);
    if ( bind(s, (struct sockaddr *)sock_server, socklen )==-1)

    while( 1 ) {
        if (recvfrom(s, buf, BUFLEN, 0,
                     (struct sockaddr *)sock_client, &socklen)==-1)
        printf("Received packet from %s:%d\nData: %s\n",
               ntohs(sock_client->sin_port), buf);

    return 0;



 Client Code :


#include <netinet/in.h>

#include <sys/socket.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include <arpa/inet.h>
#include <sys/types.h>

#define BUFLEN 512
#define PORT 10000
#define USERVER ""

void die_err(char *s)

int main(void)
    struct sockaddr_in *sock_server;
    int s, i;
    socklen_t socklen=sizeof(struct sockaddr_in);
    char buf[BUFLEN];

    sock_server = malloc( socklen );
    if ( !sock_server )
        die_err( "allocation failed" );
    if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))==-1)
    sock_server->sin_family = AF_INET;
    sock_server->sin_port = htons(PORT);
    if (inet_aton(USERVER, &(sock_server->sin_addr))==0) {
        fprintf(stderr, "inet_aton() failed\n");

    for (i=0; i<3; i++) {
        printf("Sending packet %d\n", i);
        sprintf(buf, "This is packet %d\n", i);
        if (sendto(s, buf, BUFLEN, 0,
                   (struct sockaddr*)sock_server, socklen)==-1)

    return 0;

List of device bandwidths

Filed under: General at 05:49:21 On 2006-07-11

A list comparing the device bandwidths can be found here


Worth Noting : 


Slowest Device         : Modem 10 B/s

Fastest till 2005-Feb : Prototype DDR3-SDRAM (8.528 GB/s)


In telecommunications : 1 kbit/s = 1 000 bit/s, NOT 1 024 bit/s



Default BIOS Passwords

Filed under: General at 01:47:12 On 2006-07-07

These are some of the default passwords in case you forgot yours.


WARNING: Some BIOS configurations will lock you out of the system completely if you type in an incorrect password more
than 3 times. Read your manufacturers documentation for the BIOS setting before you begin typing in passwords.

Award BIOS backdoor passwords:

aLLY Condo PINT 01322222
ALLY d8on pint 589589
aPAf djonet SER 589721
_award HLT SKY_FOX 595595
AWARD_SW J64 SYXZ 598598
AWARD?SW J256 syxz
AWARD SW J262 shift + syxz
AWKWARD j322 awkward

AMI BIOS Backdoor Passwords:


Phoenix BIOS Backdoor Passwords:


Misc. Common Passwords:

ALFAROME BIOSTAR biostar biosstar
CMOS cmos LKWPETER lkwpeter
setup SETUP Syxz Wodj

Other BIOS Passwords by Manufacturer:

Manufacturer Password
VOBIS & IBM merlin
Dell Dell
Biostar Biostar
Compaq Compaq
Enox xo11nE
Epox central
Freetech Posterie
IWill iwill
Jetway spooml
Packard Bell bell9
Siemens SKY_FOX
Toshiba Toshiba

Toshiba BIOS

Most Toshiba laptops and some desktop systems will bypass the BIOS password if the left shift key is held down during boot


Press both mouse buttons repeatedly during the boot

Ultra fast Screen Capture

Filed under: Visual Basic at 13:09:40 On 2006-06-29

This is one of the fastest and smallest method to capture screen.

I am putting this in visual basic to make easily understandable to newbees.


Visual basic timer object reports time 0 seconds for this operation !

Here goes the code.

'API Declarations

Private Declare Function CreateDCAsNull Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, lpDeviceName As Any, lpOutput As Any, lpInitData As Any) As Long

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long

Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long

'Sub To be called
'For example Use : dumpScreenToPicturebox(picture1)

Public Sub dumpScreenToPicturebox(targetPictureBox As Control)

lngDesktopDC = CreateDCAsNull("DISPLAY", ByVal 0&, ByVal 0&, ByVal 0&)
BitBlt targetPictureBox.hdc, 0, 0, Screen.Width / Screen.TwipsPerPixelX, Screen.Height / Screen.TwipsPerPixelY, lngDesktopDC, 0, 0, vbSrcCopy

End Sub

Hope it was useful !Cool

StretchBlt API limitations

Filed under: General at 08:23:36 On 2006-06-24

While working on a company project came thru this weird limitation of Stretchblt API.

Actually i was working on some huge images of the order of 3500 * 2500 pixels with 24 bit depth.My display card settings were 1280 * 1024 32 bit ( yes,it matters ! ) on winXP.

Now, when ever i try to zoom the complete bitmap with a scaling factor of greater than 1.2 StretchBlt returns false.

Seems,i exceed the selectors limit for StretchBlt.

PS: I found ,StretchBlt is quite slower while working with huge bitmaps or downsampling them.

PLOG passed XHTML 1.0 validation

Filed under: General at 07:41:00 On 2006-06-19


It took about 2 hours to fixup all the invalid markup's in PLOG.
Now its a valid XHTML translation. 

For the proof ,click the link on the right to verify. Cool


AJAX web album with instant zooming

Filed under: Javascript at 12:19:53 On 2006-06-15


Had nothing much to do on tuesday so did this small AJAX based web album with zooming and background loading.

Its not using any backend rightnow ,everything is coded in just one page.
But it provides instant zooming with background fetching.So gives a nice interface where you need not wait for images to get downloaded.
That part goes in background.

I assume many web albums like Flickr and Picasa web album are using the same trick.

Though,it can be made even better by using GD library as backend.
But you see, i am a bit busy cool

Anywayz you can visit it here.

Will keep on working this !

Visual Basic ByRef gotcha

Filed under: Visual Basic at 11:57:45 On 2006-06-14

A few dayz back my friend raghav was working on one ActiveX for company project.

He got stuck at one point where his procedure was changing the value of a variable while using ByRef.( The project is done in Visual Basic)

I also tried to figure out the problem but in vain frown.

BTW i never use ByRef in ActiveX control's coz i prefer to use classes most of the time.

Later ,searching this on net i found that whenever you enclose the passed variable in parenthesis Visual basic evaluates this as an expression and your passed variable becomes a ByVal passed variable.


//Code Begin




Private Sub foo(myVar)

myVar = newValue

End Sub

//Code End

Will not change the value of myInt to newValue.

Rather :

//Code Begin

foo myInt



Private Sub foo(myVar)

myVar = newValue

End Sub

//Code End

Will do the Trick

Strange but true cool

PS: Anywayz Microsoft has made ByVal as a default method to pass variables in dotNET.

Google search - results relevance Irony !

Filed under: General at 01:00:37 On 2006-06-11

They say that they provide most appropriate search results to the user.

A few days back while searching a term "robotics" i was amazed to find US robotics - a telecom euipment company to be listed first.

How will google justify this ?


While the same search term on Yahoo gave me a relevant search result.

works fine

Javascript global variables

Filed under: Javascript at 23:43:14 On 2006-06-08

Discovered something which i should have figured out earlier.

window.myvariable = some_value;

is same as a global variable declared like




var some_value;

function foo(){




Strange but true wink


Top 10 Supercomputers

Filed under: General at 03:05:04 On 2006-06-03

top 10 list

* Taken from top500.org

Cookie limits on your browser

Filed under: General at 11:00:21 On 2006-06-03

Tried to find out some session info about cookies.

This info i found,Your browser supports:

    * 300 cookies in total
    * 20 cookies per domain
    * 4096 bytes per cookie

It seems as though this minimum requirement is part of the original RFC for cookies - see section 6.3 specifically 

Flash Skinnable Window

Filed under: Flash/Actionscript at 11:07:52 On 2006-05-31

Well ,

I started Flash/Flex a few dayz back.Got allured with its stronger "RAD" capabilities where you need not dwelve much into CSS and Javascript to make some web based application work for basic functionality and portability across browsers is a bless.

Some projects which i did are already online which includes Flash/Flex based web operating system( Web OS).It can be found @ www.ostype.com.

Other is Web Meet - which is an online meeting and collaborative tool.

Though, not getting much time to complete them ,but they will be fully functional soon ,this i hope cool

Ankur ,Chintan and Pratik have been helping me throughout these projects ,whereever i got stuck these guys have been more than helping to me and sometimes even gave their code.

One here comes from Chintan which is very basic thingy but shows how easy is it to inherit the skinnability to you components.

red window blue window

You can download the source from here.


Worst 25 technical gadgets

Filed under: General at 02:15:35 On 2006-05-27

And ......here are the winners ....... 

1. America Online (1989-2006)
2. RealNetworks RealPlayer (1999)
3. Syncronys SoftRAM (1995)
4.Microsoft Windows Millennium (2000)
5. Sony BMG Music CDs (2005)
6. Disney The Lion King CD-ROM (1994)
7. Microsoft Bob (1995)
8. Microsoft Internet Explorer 6 (2001)
9. Pressplay and MusicNet 2002
10. Ashton-Tate dBASE IV (1988)
11. Priceline Groceries and Gas (2000)
12. PointCast Network (1996)
13. IBM PCjr. (1984)
14. Gateway 2000 10th Anniversary PC (1995)
15. Iomega Zip Drive (1998)
16. Comet Systems Comet Cursor (1997)
17. Apple Macintosh Portable (1989)
18. IBM Deskstar 75GXP (2000)
19. OQO Model 1 (2004)
20. DigitalConvergence CueCat (2000)
21. Eyetop Wearable DVD Player (2004)
22. Apple Pippin @World (1996)
23. Free PCs (1999)
24. DigiScents iSmell (2001)
25. Sharp RD3D Notebook (2004)

Build Your own Laser

Filed under: General at 02:48:15 On 2006-05-22

Ever wanted to make own ruby laser device ?

Well ,now you can .. cool .

Find it here

Now ... this is cool

Filed under: General at 06:55:32 On 2006-05-21

Check this out

Why my Win32:Timer code sucks !

Filed under: Visual C++ at 13:05:24 On 2006-05-17

Now i came to know why my precise loops alwayz showed a random behaviour.

Actually i used to call timeGetTime() to do timing control.

But it seems because of the granularity of the system timer can be as high as 10-15
milliseconds, meaning that timeGetTime() is only accurate to 10-15 milliseconds.

There are multiple approaches which we can use for time control, some of them are :


It stands for "Read Time Stamp Counter." This assembly instruction returns
an unsigned 64-bit integer reading on the processor's internal high-precision

In order to get the frequency of the timer (how much the timer return
value will increment in 1 second), you can read the registry for the machine's

bool GetPentiumClockEstimateFromRegistry(unsigned __int64 *frequency)
HKEY hKey;
DWORD cbBuffer;
LONG rc;

*frequency = 0;

rc = RegOpenKeyEx(

if (rc == ERROR_SUCCESS)
cbBuffer = sizeof (DWORD);
DWORD freq_mhz;
rc = RegQueryValueEx
if (rc == ERROR_SUCCESS)
*frequency = freq_mhz*1024*1024;
RegCloseKey (hKey);

return (*frequency > 0);


double GetPentiumTimeAsDouble(unsigned __int64 frequency)
// returns < 0 on failure; otherwise, returns current cpu time, in seconds.
// warning: watch out for wraparound!

if (frequency==0)
return -1.0;

// get high-precision time:
unsigned __int64 high_perf_time;
unsigned __int64 *dest = &high_perf_time;
_emit 0xf // these two bytes form the 'rdtsc' asm instruction,
_emit 0x31 // available on Pentium I and later.
mov esi, dest
mov [esi ], eax // lower 32 bits of tsc
mov [esi+4], edx // upper 32 bits of tsc
__int64 time_s = (__int64)(high_perf_time / frequency);
__int64 time_fract = (__int64)(high_perf_time % frequency);
double ret = (time_s % (60*60*24*7)) + (double)time_fract/(double)((__int64)frequency);
return ret;
return -1.0;

return -1.0;

QueryPerformanceFrequency & QueryPerformanceCounter:

QueryPerformanceFrequency returns the amount that the counter will increment over 1 second; QueryPerformanceCounter


returns a LARGE_INTEGER (a 64-bit *signed* integer) that is the current value of the counter.

This approach is accurate upto 10 micro seconds.tongue-out


If we call timeBeginPeriod(1) at the beginning of our program (and timeEndPeriod(1) at the end), timeGetTime() will usually become

accurate to 1-2 milliseconds.

Sleep() sleeps for goes hand-in-hand with the granularity of timeGetTime(), so after calling timeBeginPeriod(1) once, Sleep(1)

will actually sleep for 1-2 milliseconds, Sleep(2) for 2-3, and so on (instead of sleeping in increments as high as 10-15 ms).

For simple timing, both timeGetTime and QueryPerformanceCounter work well, and QueryPerformanceCounter is obviously more accurate.

Part of this post is coming Ryan M. Geiss's post.

Firefox Blogging

Filed under: General at 10:52:12 On 2006-05-16

Deepest Sender is a blogging client for Firefox.

So, instead of having to go to the update page on LiveJournal/WordPress/Blogger/whatever, or loading up a separate client program, all you have to do is hit Ctrl+\, or click the button in your toolbar, and you can start posting your blogs from anywhere

Find it here 

Here are some of the features:

1.Multiple accounts



4.Drag and drop

5.Music detection


7.Crash recovery

8.Load and save drafts

9.Easily edit posts

10.Offline mode

Hacking Apache to its limit

Filed under: General at 11:56:03 On 2006-05-11

Well ,need we consider nay other example than this case study

Yahoo - One of the busiest site runs on Apache ,see how to make ur apache pump this much blood.

A very nice Power Point presentation about Yapache :


Google Suggest - Hack

Filed under: PHP at 04:00:00 On 2006-05-09

You may like to visit this old project of mine.

This tool does not use Google API.

We have gone beyond one step here from Google by recursively calling the function and appending alphabets from A to Z to the query string to get the complete resultset about that keyword.

For example if you put "paper" as a query the result set will be like :

paper 175,000,000 results
paper airplanes 1,830,000 results
paper mache 403,000 results
paper doll heaven 245,000 results
paper dolls 3,120,000 results
paperdoll heaven 19,100 results
paperport 353,000 results
paperdollheaven 1,780 results
paperchase 72,100 results
paper source 21,700,000 results

I used CURL for this project ,but regex can be used more efectively.

Actually i found this script on net a way back and then heavilly modified it as my webHost was not supporting many functions

putting a snippet here for you to think ahead. P.M. me if you need the complete source.

function buildSuggestUrl($keyword)
return "http://www.google.com/complete/search?hl=en&js=true&qu=" . urlencode($keyword);

PHP Eval

Filed under: PHP at 05:36:19 On 2006-05-07

Well ,this is a slower method (100 times slower sometimes) than direct page rendering.

But ,u get total control over the pagecontent dynamically.

Many a times its safe also to secure your PHP code.The immediate application which i could think of after looking at this function is my own template engine.

function eval_new_helper($arr){
return ("echo stripslashes(\"".addslashes($arr[1])."\");");

function eval_new($string){
$string = "".$string."";
$string = preg_replace("/<\?=\s+(.*?)\s+\?>/", "", $string);
$string = str_replace('?>', '', str_replace( array('((.|\n)*?)<\?/","eval_new_helper",$string) ) );
return eval($string);

// call it from here



Filed under: Robotics at 06:40:49 On 2006-05-05

 Found some referrences to ALIAS over the net.




Next Page                    Prev. Page