Monthly Archives: April 2010

Javascript: Always define variable with ‘var’

So today, I found one more unseen behavior of Javascript (at least for me).

I wrote a very simple function in Javascript and forgot to add ‘var’ in front of variable definition. This function worked first time but for second time I got JS error saying the function does not exist. I was like what the hell, where did my function go? It just worked as expected for first time and suddenly browser is not able to find it.
It took me 20 minutes to find out the reason of my biggest mistake of tonight. Such a waste of precious 20 minutes at 3:00 AM :(
Lesson learned, always define variables in Javascript with ‘var’ keyword or else stay up till late night ;)

Install Memcached on Windows 7

To install Memcached on Windows 7 you need administrative rights. Grab your copy of Memcached for Windows (I got it from here, so I will explain this one). Now follow the steps below:

  1. Download and unzip Memcached binaries.
  2. Press the Win key, type cmd, press Ctrl+Shift+Enter.
  3. Select yes from elevation prompt.
  4. A command window will open with administrative rights.
  5. Go to Memcached folder (mine is c:\memcached\)
  6. Type and run [ c:\>memcached -d install ], this will install Memcached as service.
  7. Now start the service with [ c:\>memcached -d start ]
  8. FIN
Now Memcached is installed and running.
 Scroll to top