Archive for February, 2010

Implicit declaration of function stpcpy

February 27th, 2010 | Category: from the road

A very irritating compiler warning:

tarc.c:174: warning: implicit declaration of function “stpcpy”
tarc.c:174: warning: incompatible implicit declaration of built-in
function “stpcpy”

No clear way to fix it. Upon first thought you
#include string.h

But that doesn’t work.

The only workaround is to add a function prototype to your .h file or
to the top of your .c file:
//function prototype for external function
extern char *stpcpy (char *__dest, const char *__src);

This declaration is the fix you need to supress that warning. Stpcpy
is extern’d from usr/include/string.h

Stpcpy: http://www.opengroup.org/onlinepubs/9699919799/functions/stpcpy.html

No comments

My Radio Station

February 23rd, 2010 | Category: music

Click the “Visualizer”.. I really like the way Pandora has set that up. I have the most random music selections, maybe you can click and enjoy some too. Pandora is one of the top 10 innovations of all time. Get on it.

No comments

India Pictures

February 10th, 2010 | Category: travel

I had a marvelous trip to India from December 21st till January 14th. It was my longest India trip since my childhood. In another entry I’ll write about how much I loved it and how to appreciate the culture, liveliness and craziness of India. Anyway, great trip! I spent the whole time with Meli, and it was tremendous. I can’t imagine a better travel partner! We saw Tania and Viraj’s regal wedding in Kolkata, then travelled to visit Beej in Mumbai. After that I visited Ashiyana Yoga retreat for a few days of Detox in Goa, then my posse arrived so we could party in Goa properly.

I had some camera issues (read: lost charger) so I didn’t get many pictures. But here are a few of my favorites.

“No Outside Food” Bengali Style (Kolkata)

The Lungi is making a comeback!

My dream car- Tata Sumo 80 bhp! Can climb hills ! (disclaimer: Small hills)

Sangeet Party / Ceremony

Late Night with SOCE at The Underground

Victoria Memorial

Kid’s are entertained by this? Simple minds simple pleasures i guess.


Nice Hat Meli!


(The hat won’t go away!)


Viraj’s Last night as a gay bachelor


Lick the man carrying all the beers


Is the fog machine for the dance floor? NOOOOO It’s for the mosquitoes!


HOT ladies!!


Thrilling!


You guys are lucky, she’s light!


Take a Deep Breath, V


Viraj’s PRANK


Your hair is looking a little dry. Try some coconut oil.


Hahaha


Gone too far? Never!

GOA

Relaxing and detoxing at Ashiyana Yoga Retreat in Goa


One of the instructors- The CHUCK NORRIS of Yoga. His right leg is named Dharma and left leg is named Karma.


How we spent most of the goa trip, eating and drinking beachfront


Beej and Kristen in front of our Luxury Tents at Club Fresh


Beach-Front Concert at Club Fresh – Awesome band but I can’t remember their name

3 comments

Installing Ruby and Rails 1.9.1 on Ubuntu 9.x

February 05th, 2010 | Category: geek out

One would think that installing Ruby & Rails on Ubuntu 9.X would be cake, right? WRONG. It is a lot of unexpected work and package additions. It no longer works “out of the box”.

Important Note: Install as many packages as you can before trying to run your Rails project. Once you type “ruby script/server” , the weaknesses of your configuration will be exposed, and who knows how the system will behave. Fill in the missing packages before this happens.

From the beginning

Your best bet for getting started is to use Synaptics Package Manager to install this package that supposedly contains everything you need:
ruby1.9.1-full
While you are at it, get the following dependencies that WILL come back to haunt you later:
rubygems1.9.1
libopenssl-ruby1.9.1
libruby1.9.1
sqlite3 (omit if you’re using MySQL)
libsqlite3-dev (omit if you’re using MySQL)

Accept all of the dependencies that Synaptics asks you for. More is better!

Symbolic Links

Do you want to type “ruby1.9.1″ each time? Nah i don’t think so. Make some symbolic links to help you out.

sudo ln -s /usr/bin/ruby1.9.1 /usr/bin/ruby
sudo ln -s /usr/bin/gem1.9.1 /usr/bin/gem
sudo ln -s /usr/bin/rake1.9.1 /usr/bin/rake

ln makes symbolic links. Check out the man page on it. You can delete the symbolic links when Ruby1.9.2 or whatever comes out.

Rails

Why doesn’t this come standard? Boggles my mind.

sudo gem install rails

Sqlite3

Status: 500 Internal Server Error
no such file to load -- sqlite3

Use Synaptics and install : libsqlite3-dev to get sqlite3.h header file

Then:

sudo gem install sqlite3-ruby

Scrapers

If you use hpricot or any kind of scraper, use Synaptics package manager to get:

libxml2
libxml2-dev
libxslt1-dev

sudo gem install hpricot
sudo gem install mechanize

Random Stuff

Problem: NameError (uninitialized constant ApplicationController)
Fix: sudo rake rails:update

Problem: syntax error, unexpected ':', expecting keyword_then or ',' or ';' or '\n' when "rated" : @movies = Movie.paginate(:al...
Fix: In Ruby 1.9, colons in a case statement are disallowed. Replace them with a "then" statement.

Turns out that the new rails renames app/controllers/application.rb to application_controller.rb. This cute rake task will take care of it for you.

sudo gem install hpricot


No comments

Graduate school teaches you…

February 04th, 2010 | Category: from the road

Graduate school teaches you -
* Patience – Because a class may be incredibly awesome or absolutely
terrible. Either way, it is still 5 months long. No one, no matter how
smart or special they are, can make the class go by any faster. You
just have to be patient and deal with it.

* Tolerance – A professor might be a genius in his field, Here are ( 1
), ( 2 ), and ( 3 ) who I can give as examples. They are pioneers in
their research, and some are personable and good teachers. But others
are not at all interested in giving lecturers and have very little perception of what the
student brings to the class, what students need to know and what they are
lacking.

* Time management – No work now, more work than 10 donkies, 10 mules,
and 10 graduate students can do come April. What are you going to do
about it?

* Interesting applications for your Blackberry / iPhone – because face
it, some lectures are going to be boring as fcuk and you have to sit
through the entire thing to catch the one pertinent fact that will be
mentioned all day

* Discipline – Picking your nose in class will get you a dirty look
and no one will want to work together with you. If you’re bored find
then another hobby.

No comments