Archive for December 2009


How to solve “XAMPP: Couldn’t start MySQL!”

December 25th, 2009 — 2:34am

Linux platforms are growing on personal computers at a really fast rate. For all those developers who fantasize web development, a personal server is inevitable. Long ago in the ages of kings, you would have required to compile apache and MySql binaries for a windows based desktop/laptop and then make your installations co-exist. Then came the WAMP which really made the whole process of setting up Apache, MySQL and PHP for Windows really easy.

To help you with setting up the server, database and php on Linux comes the XAMPP. This experience in this post is based on a Mandriva 2007 spring installation of linux. XAMPP is really easy to setup following the instructions on their home page.

Some of you might wonder why you get the error “XAMPP: Couldn’t start MySQL!” even though you followed all the instructions properly.

If this is what you did then thats the issue :

The following was the second step in the installation and here is where the problem could have occurred. The problematic point is marked in red.

Step 2: Installation

After downloading simply type in the following commands:

1. Go to a Linux shell and login as the system administrator root:

su

2. Extract the downloaded archive file to /opt:

tar xvfz xampp-linux-1.7.2.tar.gz -C /opt

Warning: Please use only this command to install XAMPP. DON’T use any Microsoft Windows tools to extract the archive, it won’t work. {IN LINUX TOO USE THE COMMAND LINE INTERFACE AND NOT THE EXTRACTOR FROM KDE OR OTHER DESKTOP ENVIRONMENT}

That’s all. XAMPP is now installed below the /opt/lampp directory.

Take home message is to use the command interface for extracting the package and not using the extractor in the desktop environment to extract the package. I hope that solves your problem, if it did please leave a comment and confirm it so that others can follow the same with no skepticism. Thanks folks !!

Comment » | Featured

20 Video Lectures on algorithms

December 25th, 2009 — 12:40am

Reading from ebooks and text books can help you with a good understanding of algorithms. To aid those efforts you can as well watch these helpful video lectures online for free. They are long and informative !!

Video Lectures

[1] Algorithms — overview

[2] Sorting

[3] Sorting II

[4] Searching & Data Structures

[5] Red-Black Trees

[6] Graph Algorithms I – Topological Sorting, Prim’s Algorithm

[7] Graph Algorithms II – DFS, BFS, Kruskal’s Algorithm, Union Find Data Structure

[8] Graph Algorithms III: Shortest Path

[9] Graph Alg. IV: Intro to geometric algorithms

[10] Geometric Algorithms: Graham & Jarvis

[11] Dynamic Programming I

[12] Dynamic programming II

[13] Parsing

[14] Knapsack, Bandwidth Min. Intro: Greedy Algs.

[15] Greedy Algs. II & Intro to NP Completeness

[16] NP Completeness II & Reductions

[17] NP Completeness III – More Reductions

[18] NP Completeness IV

[19] Approximation Algs.

[20] Alternate Models of Computation

Miscellaneous

[a] MIT OpenCourseWare: Introduction to Algorithms
- These videos are available on YouTube and a variety of other formats.

[b] ArsDigita Lectures by Shai Simonson

Comment » | Featured

How to use Python for web applications

December 25th, 2009 — 12:20am

Python is a very powerful language that can be easily used in various platforms. To give you an example, if you wanted to develop simple 2D games, working out with C/C++ and openGL would be an overkill. Especially if are just a hobby gamer who wants to create one for yourself too then try out python. Python as a language comes with so many additional frameworks that really makes things easy.

This article will work as a starter to help you begin your wonderful journey of web programming with python. The article will answer this exact question for starters: “How to use python with Godaddy (shared hosting) and Dreamhost. “.

python_internet_programming

Godaddy and Dreamhost make it particularly easy to host python pages on their shared hosting as well. All you have to do is the following.

Tutorial : python for web

The tutorial deals with creating a python script and using it in a webpage and to see the results on a browser.

1 – Create a python file:
Python files are python scripts written in a file with the extension “py”. To create a python script to upload into your server, create the file named python.pywhich is a test file that includes the code below.

#!/usr/bin/env python
print "Content-Type: text/plain\n\n"
print "Hey this is a test python page"

This file prints the sentence “Hey this is a test python page” on the webpage when you open the page using a browser (e.g http://domain.com/folder/test.py). But wait !! follow the following steps before you try this out.

2 – Upload using FTP :
Python.py was create on your computer locally, most likely a folder on your desktop ;) . You now have to upload it to a server. It must be noted that python files cannot run on double clicking on your local computer since they have to go through a python interpreter. If you are developing desktop python applications then you have to invoke your python script as python test.py from the python prompt, mayb from IDLE ( a python development window).

To work with web applications of python, you will have to move your python file to a server. Also the server must have a python interpreter installed. Godaddy and Dreamhost provide a python interpreter by default, so you don’t have to worry about any setup at all.

You can now upload the file onto your Godaddy or dreamhost server. Here is a tutorial to use FTP. Once your file is uploaded you will be able to access your first web python script at http://domain.com/folder/test.py .

3 – Changing file permissions :
In order to allow python script to execute, you must provide ‘execute’ permissions to the file by changing CHMOD. Set the CHMOD of the test.py file to 755. If you are unsure about how this can be done, have a look at Find this tutorial on changing permissions.

4 – Test your python page
You now are perfectly set to view your page through the URL.

Here is a sample Python page hosted on a Godaddy hosted server.

Error ?:

Most often when you are new to python, you will encounter countless errors mainly due to the syntax. Python is case sensitive and also tabs/indentation are important unlike other languages. If you encounter a screen as below be sure to rewrite your test.py file. you can copy the code above as is to the clipboard and use it

error_python_page

Comment » | Programming

Python Video Tutorials

December 6th, 2009 — 11:15pm

Getting started with python programming is really easy given the number of tutorials available and the brilliant python documentation. Yet, it is very typical for someone to look for python video tutorials as it just makes the learning even more easier. here is a wonderful series of video tutorials that takes you from being a novice to another level of novice in python programming. It is a wonderful start for someone who is just stepping into programming for the first time.

Comment » | Uncategorized

Back to top