Wednesday, October 7, 2009
Backup of mysql database
mysqldump [options] db_name [tables]
You could use this command as:
mysqldump -u root project_production > backup.sql
or
mysqldump project_production > backup.sql
(depending on the permissions)
This will generate a file backup.sql in your current directory which could be used to regenerate the database any time in future on the same or different pc.
Importing the data from the backup file is much more simpler. Just type on the command prompt:
mysql -u root project_development < backup.sql
This will copy all the data from the backup file to another database named project_development.
For more information, visit this site.
Thursday, September 10, 2009
Shuffle/Randomize Arrays (iPhone)
ShuffleArray.h
#import "UIKit/UIKit.h"
@interface NSArray(Shuffle)
-(NSArray *)shuffledArray;
@end
ShuffleArray.m
#import "ShuffleArray.h"
@implementation NSArray(Shuffle)
-(NSArray *)shuffledArray
{
NSMutableArray *array = [NSMutableArray arrayWithCapacity:[self count]];
NSMutableArray *copy = [self mutableCopy];
while ([copy count] > 0)
{
int index = arc4random() % [copy count];
id objectToMove = [copy objectAtIndex:index];
[array addObject:objectToMove];
[copy removeObjectAtIndex:index];
}
[copy release];
return array;
}
@end
Tuesday, July 28, 2009
ATTENSION!! All computer users..
RIGHT TECHNIQUES for usage....







Hand exercises for Carpal Tunnel Syndrome




Thursday, June 18, 2009
How to install ruby and related gems on Mac OS X (Leopard)
Ruby
Type these commands into Terminal:
curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz
tar xzvf ruby-1.8.7-p72.tar.gz
cd ruby-1.8.7-p72
./configure --enable-shared --enable-pthread CFLAGS=-D_XOPEN_SOURCE=1
make
sudo make install
cd ..
To verify that Ruby is installed and in your path, just type:
which ruby
You should see:
/usr/local/bin/ruby
RubyGems
After installing ruby, move on to ruby gems the same way:
curl -O http://rubyforge.iasi.roedu.net/files/rubygems/rubygems-1.3.1.tgz
tar xzvf rubygems-1.3.1.tgz
cd rubygems-1.3.1
sudo /usr/local/bin/ruby setup.rb
cd ..
Ruby on Rails and other gems
Now you are ready to install important gems:
sudo gem install rails
sudo gem install mysql
or do it in a single step like:
sudo gem install RedCloth termios rspec sake capistrano mongrel
Congratulations! You are done with the basic setup of ruby and rails.
Tuesday, April 28, 2009
Applications on AppStore

