Tuesday, 21 April 2009

Installing MySql on MAC OS X



This post shows you how to install MySql on MAC.

1.) On a first note, if your developing using Python, it needs 32-bit MySql version. (64-bit will NOT work)

2.) Remove the previous versions of MySql: open terminal

sudo rm -rf /usr/local/mysql

2.) Go Here and download "Mac OS X 10.5 (x86)"

3.) Open the mysql.dmg and install & run the mysql package

4.) In the terminal create the folder: sudo mkdir /var/mysql
This just says super user make directory mysql in the var directory

5.) Go to your home folder i.e
cd ~
Use a command-line text editor to create the enviroment-variables and aliases by typing
vi ~/.bash_login
(that is a tilde not a dash btw). This opens the vi text editor and either opens or creates the .bash_login hidden file at your user’s folder.

6.) Copy and paste the below text at the end of the file:

export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

and then press esc and :wq and enter
This should write the text to the file and quit it.

7.) Now enter mysql command in the terminal and there are 90% chances for you to get this error:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

8.) Creating a symbolic link to your ports file, by running...

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

9.) Now you can start MySQL by running...

sudo /usr/local/mysql/bin/safe_mysqld

10.) Open a new terminal window and type mysql and you should see the server running.

That's it. Hope it helps you. If you face any problems, please leave a message and I'll look into it.

Thursday, 19 March 2009

Ind vs NZ first test March - 2009

It was good start for the Indians on the 1st day at Hamilton. NZ were quickly down at 60 for 6 wickets with some decent bowling from India. Here is a quick video of the six wickets! Please leave your comments if you like it!

Monday, 16 March 2009

Accessing Google Maps

So, I'm done with masters and the economy is not very encouraging for graduates. This has forced me to learn new technologies and I started learning .Net and its very interesting how it shares much of concepts from Java and Delphi. So, I shall be blogging anything that fancies me.

Today I'll talk about accessing a RESTful web service using Java. I'll show you how to call Google map web services i.e given a valid US address, the Google service will return the latitude and longitude of the address. This will enable us to dynamically create Google Maps based on the address given. I'm assuming that you've registered for Google Map service for the maps to show on your web page. More info here: http://code.google.com/apis/maps/signup.html

public static Vector getLatLong(String address) {

String usAddress = "http://maps.google.com/maps/geo?q=";
usAddress += address;
usAddress += "&output=csv&sensor=false&key=urkey";
//the url that google service accepts is:
//http://maps.google.com/maps/geo?q="your address"&output=csv&
//sensor=false+&key="your google map api key"

URL url;
InputStream is = null;
BufferedReader bf = null;
InputStreamReader in = null;
String returnedValues[] = null;
Vector latLong = new Vector();
try {
url = new URL(usAddress);
is = url.openStream();
in= new InputStreamReader(is);
bf = new BufferedReader(in);
String latLongFromGoogle = bf.readLine();
returnedValues = latLongFromGoogle.split(",");
System.out.println(
returnedValues[2]);
System.out.println(
returnedValues[3]);
latLong.add(Double.parseDouble(
returnedValues[2]));
latLong.add(Double.parseDouble(
returnedValues[3]));
} catch (Exception e) {
e.printStackTrace();
} finally {
if (is != null) try { is.close();} catch (Exception e) { System.out.println(e.getMessage());}
if (bf != null) try { bf.close();} catch (Exception e) { System.out.println(e.getMessage());}
if (in != null) try { in.close();} catch (Exception e) { System.out.println(e.getMessage());}
}
return latLong;
}

That's it for today!! Hope this was of some use. Good day!

Saturday, 24 January 2009

I'm back!

I don't know why, but I randomly want to continue writing on this blog. Its been a loooong time since my last post.

Let me give a quick re-cap of what has happened in the past. I continued looking for a job and then landed with a offer from Accenture, India. I worked there for over a year and had to quit to pursue my masters. Prior to that I got an offer from Google as a SQE (search quality evaluator). I had a tough time whether to accept the offer or not as it wasn't a complete engineer position. I wanted to do something and then gave up on the offer to purse higher studies.

Today I'm here in the US graduated and looking for a job in the recession hit market. I think its a good time for me because it has given me a opportunity to learn new technologies which I never bothered to think about. I'd try to put down my perceptions on this blog on a daily basis so that I can reflect on it when I get old.

Tuesday, 10 April 2007

psst.... the meeting

It was the BCCI meeting that every1 was looking forward to.... but as anticipated no major changes have been brought about. Strangely, the players endorsements have been kept a watch which is madness. If BCCI can earn, y not the team members ??? Taking the permission for endorsing sounds pointless. With the players contracts being scrapped, it'd be innteresting to see how the players would respond to this, as there is no more grade system. If a players plays well, he paid on par with any other senior player who plays well....oops not "on par", but equal.

Ravi Shastri has been made the team manager for the Bangladesh's tour and the team will not have a coach. But we do have a bowling coach in the guise of Venkatesh Prasad, who has coached the U-19 cricket team and the fielding coach as Robin Singh.

Thursday, 5 April 2007

Indian cricket in a soup!!!

It was doom's day for Indian cricket, the moment they lost to Sri Lanka in the league matches in World Cup 2007. Utter disappointment was visible on all the faces of senior Indian cricketers. Back home at India, the supporters were shocked to see a dismal performance by the team. It all started with vision 2007 when the Aussie great Greg Chappel took upon the job of coaching the Indian cricket team. They'r many contenders for that position as Indian cricket board is the richest in the world. So Chappel was more than happy to bag it. Vision 2007 in an abstract view was to win the world cup. This propagated many changes in the Indian team. Youngsters were roped to perform and poor Pathan was the sufferer in the hands of Chappel.

Things drastically changed for India after Chappel took over the captaincy. They were high expectations among the public with the world cup in mind. The D-day however arrived and the Indians lost their first match to Bangladesh, a minnow, comprehensively. All the drama surrounding the vision was a damp by now, as there was no co-ordination among the players. The next match was with an other minnow Bermuda, like wounded tigers, the capable Indian team bounced back and amassed a huge score which saw them home. After this, the crucial match was against the SriLankans, which was a must win match for the Indians. But to every1's sureprise, the Indian team proved chokers. INDIA OUT OF THE WORLD CUP.

Back home at India, the public started their agitation towards the senior players who didnt perform well. They were allegations that the players were more interested in their endorsements to circket which caused the downfall. Things started getting out of control when the board was to answer for the world cup debacle. A report is awaited from the board now. Lets hope some senior players are dropped and the youngsters are given a chance to prove their mettle. We'r a country of billion population, but still the board is not able to get that perfect eleven for the nations most loved sport.

Keep reading this post, as I try to find a few solutions for the board and also ur views are welcome.

Wednesday, 14 March 2007

Movie gossips

All Telugu movie buffs... if u want to know the latest gossips that are making rounds in the Tollywood then this is the ULTIMATE destination for you. This site also caters to the rumours and gossips in the lives of the politicians. Mind u, this site doesnt have any movie or music downloads .

www.greatandhra.com/movies/gossips.php


Watch this space for more on movies and gossips