Skip to main content

Posts

Showing posts from August, 2014

When i tested my voice>

It is pretty boring these days when i concentrated on learning new programming languages and technologies,i having spending for eight hours and more in front of the computer analysing nothing much series of code.I am frustrated and tired but being love what i love to do make me not having a regret.I always sing to my self while i am coding.one day i thought,i should check my voice and hear it.I bought a new microphone and installled audacity in my linux machine.I recorded and heard, it’s pretty convinced me.Here i am presenting for you guys what i heard.
my voice

moving your online data using mover.io

I got interested in mover.io because i can easily transfer my on-line storage data from one to another data storage space.Mover is fast and simple.When my Ubuntu one got expired i have to move one GB of data to another on-line storage,it is tedious task to download the whole content to your physical drive and again upload to another on-line drive.This is where it helps,moverio has api to interface between the cloud storages.I transfered my data from Ubuntu one to drop-box easily.

03-perl Numbers and Strings

Numbers in perl are pretty straight forward.it simply declares with variables as we talked before.For example

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23#!/usr/bin/perlusestrict;usewarnings;main(@ARGV);sub main{my$variable1=1234;my$variable2=01234;my$variable3=0x1ab7;my$variable4=0b10101010;my$variable5=12.345;my$variable6=12.4e34;print("$variable1\n");print("$variable2\n");print("$variable3\n");print("$variable4\n");print("$variable5\n");print("$variable6\n");}

In the above example variable1 will print 1234.Variable2 will print 668 because if a number with leading zero, perl will take it as octal and when printing convert in to decimal that gives you 668.Variable3 will print 6839 perl will take the value as hexadecimal because with a leading 0x and convert to decimal to base ten when printing.Variable4 will print 170 and 0b recognize as binary,perl will take it as binary and covert decimal ten.Varia…

02-perl Variables and Values

Variables represents the storage space in memmory.In perl variable are represented by beginning with a ‘$’ sign followed by variable name.for example $varible_name. values are assigned to this variables.

1$variables_name="Hello World"

we can store any kind of data type in varibles including null.Each statements in perl terminated by putting semicolon ‘;‘ at the end. Each subroutines in perl ,other languages considered as method starts with a curlybraces “{}” and ends with curly braces.
lets walk though a n example

1 2 3 4 5 6 7 8 9 10 11 12#!/usr/bin/perlusestrict;usewarnings;main(@ARGV);sub main{$variables_name="Hello World"print"$variables_name\n"}

In this program its starts with two imports of libraries from perl strict and warnings. strict is used for forcing perl to not alllow any bare words,un referenced declaration.Warnings helps you to find out errors on run time for example if you missed any semicolon or typo mistake in keyword declar…

Iterate through multidimensional array in perl

Its quite easy to declare one dimensional array in perl and iterate through them.for example
1 2 3 4 5my@array=(1,2,3,"Hell World");foreachmy$ar(@array){print("$ar\n");}
but when comes to multiple dimensional array,what will do?.Its quite challenging but easy to implement.Multiple deimensional means array inside an array for example my @array = ([1,2,3],[4,5,6]);
1my@array=([1,2,3],[4,5,6]);
Here [1,2,3] is the first array and [4,5,6] is the second array,The strategy is to first iterate through arrays then iterate inside each arrays for example
1 2 3 4 5 6 7 8my@array=([1,2,3,4],[5,6,7,8]);foreachmy$ar(@array){foreachmy$arr(@$ar){print("$arr\n");}}

Generate binary string of n bits

This N bit algorithm is based on generating the subsets of given size of input,The running time of this particular algorithm can be calculated by 2^n.If n = 4 There should be 2^4 subset which is the number of cycle taken by this particular algorithm.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20classNbitStringdefinitialize(n)@a=Array.new(n)@n=nenddefgenString(n)ifn<1@a.each_slice(@n){|a,b,c|puts[a,b,c]*' '}else@a[n-1]=0genString(n-1)@a[n-1]=1genString(n-1)endendendnbit=NbitString.new(3)nbit.genString(3)

Installing couchDB on Ubuntu 14.04

First of all install couchDB through apt-get install

update your repository : sudo apt-get update

install couchDB             :  sudo apt-get install couchdb

almost done but little configuration left, go to ' /etc/couchdb/ ' and open ' local.ini ' in a text editor,

sudo nano local.ini,add username and password in a format like
' username = password' under ' [admin] ' at the end of the file.



save and exit then restart the server by 'sudo service couchdb restart'

 to access db go to 'http://127.0.0.1:5984/_utils' and login with the username and password you added in the local.ini file.

02.mysql database:create,show,rename,delete

For creating database use the command
CREATEDATABASEIF NOT EXIST db_name;
For showing existing databases use the command
SHOW DATABASES;
For rename database name is little bit a task,Actually you cannot rename a database.What we have to is back up our database then delete the database and create a new database import the backup database to the new database.

1.mysqldump -u username -p -v olddatabase > olddbdump.sql
2.mysqladmin -u username -p create newdatabase
3.mysql -u username -p newdatabase < olddbdump.sql

1.First create a backup,2.then create a new database,3.then import the backupdump.

In older Mysql version 5.1,There is a command RENAME db_name TO db_name;

but this has removed from 5.5 versions.

For delete a database use the command
DROPDATABASE db_name;

01.Installing and configuring Mysql

Installing mysql is pretty much simple
for installing in ubuntu use:
sudo apt-get install mysql-server
When installation about to complete mysql ask's for to set root user password,then set it and finish the installation.

First enter in to your root account by command in your terminal

mysql -u root -p, then enter password.In the root terminal type this command to create new user. CREATEUSER'user_name'@'your_host' IDENTIFIED BY 'your_password';example:CREATEUSER'jerin'@'localhost' IDENTIFIED BY 'password';Next is to grant all privileges to use available commands in Mysql
GRANTALLPRIVILEGESON* . *TO'user_name'@'your_host';example:GRANTALLPRIVILEGESON* . *TO'jerin'@'localhost';Atlast reload the mysql setting by using FLUSH PRIVILEGES;

03.objects in ruby

In Ruby every thing is object.Unlike Java there is no primitive data-types in ruby,Java has some primitive data type which is not object.
For Example Java has int,String,boolean,float and double but in ruby every thing is object for example when we execute 2.class in ruby this will return Fixnum that means every thing that we type in ruby considered as object.If we execute the command nil.class gives you Nilclass ,nil is a null object using in ruby.












I you and others works for facebook,google,linkedin…

Data structure and Algorithms in computer world had significant role in the advancement technologies.Many technologies are implemented with the help of Computer Algorithms and other computation theories.Scientist and computer Geeks had developed many technologies that helps the common people not to worry about the implementation of technologies rather using it in their daily life.Internet age had started drastically fast and it has grown its peak.Now what ? Obviously the Internet business,The invention of WWW by the British scientist Tim Berners-Lee changed the world to a small.Introduction of Personal computing by Microsoft and the first GUI browser Mosaic by Marc Lowell Andreessen open a new world with cannon sound(literally they had implemented sound to hear on each download of mosaic by the people ) .Back in 1996 Two Stanford Phd students had introduced one of best and efficient search Engine and they Founded Google and along with another guy from Harvard who founded…

01-perl printing Hello World

Perl is a amazing and great programming language to study.Let us go through a simple program for printing the old dialog “Hello World

#!/usr/bin/perl use strict; use warnings; print"Hello, World!\n";
Here print statement will print “Hello world”.To run perl program make a file some_fle_name.pl and save.Open your terminal and type the command perl some_fle_name.pl

learn quicksort algorithm with Hungarian dance

Quicksort, or partition-exchange sort, is a sorting algorithm developed by Tony Hoare that, on average, makes O(n log n) comparisons to sort n items. In the worst case, it makes O(n2) comparisons, though this behavior is rare. Quicksort is often faster in practice than other O(n log n) algorithms - source


02.prerequisites and working with ruby.

The prerequisites for working with ruby are you need a working OS of least 256 ram and 4 GB hard-rive.Its no matter which OS you are using,you can use windows PC or Linux or mac.Installation of ruby should done before you working with ruby. Ruby is an fully object-oriented programming languages with sugar syntax which help developers to write program easily and fast with out doing extra works for creating new standard API's.
Working with ruby provides many options,you can work with console by executing ruby directly from the console.For example $ruby -e 'puts "Hello World"'


or you can work with ruby files,put the program inside a ruby file and save it as ruby file by saving file.rb after that run from console.for example



the third way to work with ruby is,Work wit irb(interactive ruby),ruby provides a environment you can executive ruby programs.To go to irb,type irb



01.RVM install ruby

The easiest way to install ruby is by using RVM(ruby version manager).If you use RVM you don’t have to worry about dependencies and libaries install with ruby,RVM will take care of that for you.so lets install ruby,open your terminal and enter the command to update your system source list
sudo apt-get update
Next to install curl if you dont have in your system.
sudo apt-get install curl
Next is to install RVM,remember dont use sudo because this is installing in your home directory
\curl -L https://get.rvm.io | bash -s stable

After it is done installing, load RVM. You may first need to exit out of your shell session and start up a new one.
source ~/.rvm/scripts/rvm
if any error appears showing rvm command not found after this,Enter these lines to ur .bashrc manually
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Next step is to install ruby,for that enter this command
rvm install ruby
note: if you want to install specific version you can choo…