Friday, September 9, 2011

My Experience with TCS(Tata Consultancy services)

Hello Friends.
I am going to share my experience with TCS.TCS had to visit our college on 5-6th september,2011.The selection procedure had 3 rounds.
1)Aptitude test
2)Technical interview
3)HR interview
I prepared myself for aptitude test .I solved the previous TCS papers and followed R.S agarwal.It had to be done on 5th september.I was placed in the 4th group for the test.TCS aptitude test is a online test which consist of 35 questions which you have to solve in 80 mintues.Certainly negative marking is there.1/3 marks for the every wrong question would be deducted.So never try to attempt more and more questions because they need a quality rather than quantity.The test started at 3pm.Out of first 7 questions i could not attempt a single one.Out of 35 questions i just attempted 19 questions.Perhaps i was the only one who attempted just 19 questions but still i opted quality over the quantity.Only GOD knows how i was feeling in the test.Heartbeat was on the peak.Test wasn't going as per the expectations.So after the test for the results i was sure that i am out.Before the announcement of it I had declared it to my parents,friends that i would be fail in the aptitude test.Reluctantly i came back to home and even didn't think about the Technical/HR interview so didn't touch any technical stuff for the 2nd round.In the evening i was totally desperate and was talking with my friend and  was being console bye her.Then with in 10 mintues result declared out.With the grace of GOD I had done it.My name was in the list.I was in the cloud 9 then .I thanked to GOD.
It was proved that accuracy matter not the quantity.Next day i had the technical and HR interview.I went through the technical stuff that i had mentioned in my resume.Be prepare what you have written in resume because they ask more question from there.
Next day TCS team first gave the presentation.Then technical rounds started.Standing outside the interviewer's room,i was nervous,because it was the first interview in my life.With in mintues i got a call and i entered in the room.
Me:May i come in sir?
He:Yes .Come in.
Me:Good afternoon sir.
He: a very good afternoon amrit.
Never sit untill he/she allow for the same.
He:Tell something about yourself ?
Me: I gave a introduction.
He:which lanuage u know better?
Me:c++
He:Asked to write a program of prime number.
Me:I got confused but still i told him the logic.
He:which subject you know better?
Me:Operating system.
He:If there are 3 processes which are requesting for the same resource ,how to allocate resource to anyone for 3?
Me:Explained Cpu scheduling.
He:What is a abstract class?
Me:I read it in java so explanied fully .Abstract class is a class which have abstract functions.It just includes declaration of funtions and variables which are implemented by some other class.
He: Why we make abstract class?
Me:Explained.
He:why c++ is object oriented lanuage?
Me:Explanied the Encapusulation,Polymorphism,Inheritance.
He:You seem very comfortable in c++ and java.If you are given a lanuage about which you know nothing,What you will do?will you work then?
Me:I gave a logical answer.
He:can you relocate?
Me:yes sir.i can.
He:oh!! you worked on kannel(A open Source Wap and Sms gatewwy).What is it?
Me:Explained
He:which modem/phone you are using ?
Me:Nokia phone and Huawei modem.
He:what is the function of bearerbox and smsbox?
Me:Explanied.
He:Which sim you are using Gsm/Cdma?
Me:Gsm
He:Have you tried cdma?
Me:No sir.But i will.
I was shocked how he knew all the stuff regarding kannel.Then he told me he had also worked on kannel.He was eagerly listening my replies and i was answering all the questions with a smiling face and confidence.Never loose your confidence and eye contact is must.
He:Any quesion you want to ask?
Me:No sir .Thank you.
He:ok amrit .Thank you.
Me:Thank you very much sir.
                                                                             I came out with a smiling face.I was pretty sure and confident about the results.With in 15 mintues i got to know that i had cleared it.Now i had the HR interview.The interviewer was a madam.I entered in the room with a smiling face.
She:"toh app pathak ho ? pathak toh bharman hote hai na?"
Me:Yes mam.I am.
She:"amrit pal to sardaro ka name hota hai .fir apkka nam amrit kaise ?"
Me:I gave a funny reply.
It made me more comfortable.
She:She saw my cv and asked to tell about my hobbies.
Me:Playing football,blogging,reading novels.
She:Ok nice.Where you blog? and what you blog?
Me:Explained.
She:Asked about my post on social issues.
Me:Explained.
She:Why you opted diploma over 12th?
Me:Explained
She:why you changed your stream from Mechanical to Computer Science?
Me:Explained.
She:can you relocate?
Me:Yes .I can.
Then she told me about the job,2 year bond and other things about the job.
She:Any question you want to ask?
Me:Yes .I have to ask one thing.
Me:if someone gets select in TCS then what preparations one should do before joining?
She:Explained.
She:Anything else you want to ask?
Me:No.Thank you
She:Thank you amrit
Me:Thank you very much .
                                                                  I came out .I gave all the answer with full confidence .Again i was confident about the result because everything went well but still i was scared as everyone.Truely they are very nice people.The main purpose of HR interview is to check your communication skill,attitude,confidence.Keep smiling and eye contact is must.Be confident.Thats all.You will clear it easily.
Next day i got to know i have been selected .My happiness was on the peak.
Best of luck to all of you.
Still if you have any query,please ask me .Do not hesitate.Post a comment .I am eager to help and will be glad for the same.
Else Catch me on facebook.
https://www.facebook.com/amritpalpathak

Friday, July 15, 2011

Getting a Black Login Screen at ubuntu boot-up ??

Hey.Dont be desperate!!
I too had the same problem some time ago.I had installed  ubuntu 10.04  inside Window xp(wubi).I was using it from 2 months and everything was working well since last night.When i boot up my system next morning ,i got a black login screen .I tried a lot to get my Gnome-Gui as it was before but i couldn't get  so started to curse ubuntu . I had very important stuff in home folder and web root directory that i needed at any cost.So finally i decided  to re-install it but still i hadn't  want to  lost my data.So I did following to get my data back(Home folder,web root Directory,Desktop) so then i re-installed the ubuntu.
                                                                       You should have Live-cd of ubuntu to get rid of it.You should also know at which partition ubuntu is installed .Mine was at /dev/sda8.Insert Live cd and start the system.Now open the terminal and issue following commands.

1)sudo mkdir /abc
It will create a empty directory.Now issue following.
2)sudo mount /dev/sda8 /abc 
   It will mount the ubuntu's partition in directory abc.       
3)sudo mkdir /vdisk
   It will again create a new directroy

4)sudo mount -o loop /abc/ubuntu/disks/root.disk /vdisk

                                                   
        Done.Now you have your data of home folder,desktop and web root directory in vdisk directory.Take a back up of it.
Enjoy!!!



                                                        

Wednesday, July 6, 2011

KANNEL

Kannel is a compact and very powerful open source WAP and SMS gateway.This time i got a chance to implement it.I was perplex  and was surprised why the deveolpers of it haven't documented it even they are using it since decades.So i am documenting it so that others can take a quick start and do not face the problems that i faced.Please follow it step by step and ask if you get any problem anywhere.
I am going to explain how to compile,install and configure it.My System is Ubuntu(10.04).Just follow these steps.

1) Open terminal and install it
sudo apt-get install build-essential bison libxml2-dev libmysqld-dev

Now install it.
sudo apt-get install libtool
Now download the source code of kannel from Click to download

2) Compile and Install it now as:
./configure
make
make install


3)Now you need configuration files .Download those from here Click to download
Now make the changes as per your own needs e.g change the Phone/Modem name as per your's etc.

4) Attach your phone/modem to your computer and select Pc suite or Nokia mode option.
Note:You should know at which port your phone or modem is connected so use 'dmesg' command to know it.

5) Start the bearerbox and smsbox by issuing the following commands in different terminals.
For bearbox:
sudo bearerbox -v 1 /path-to-config file

For Sms-box:
sudo smsbox -v 1 /path-to-config file

Now Kannel is configured and you are ready to use it.You can now send sms from browser (Url).Use following url and make your changes for username and password and paste it in browser's url and then enter.Message will be send to the given number.
Url is:
http://127.0.0.1:13018/cgi-bin/sendsms?username=your-username&password=your-password&to=+91-Enter a number to which you want to send a sms&text=Hello+world

Done!!!
Please don't hesitate to ask if you face any problem.

a fight against corruption and blackmoney!

INDIA:World's 4th largest economy.Growing very rapidly,developing more and more professionals ,engineers,scientist and has become the first choice of foreign companies to invest and almost ahead in every field .Sorry,i forgot to tell we stand at 2nd position in corruption too.Are we waiting now to be at 1st in corruption too??The answer might be YES because what type of scams took place in recent past and response given by the government to yoga guru baba Ramdev for his indefinite fast against corruption and blackmoney nothing else can be expected from india's "democratic" government.Corruption is like epidemic in india.
I am a common man living in india ,love to my country as every indian do.But desperate by what is happening in india these days.scams and corruption are almost in every country of the world but india dominates in it.
In the recent past number of scams took place in india ,most popular were 2G scam(1.76 million crore) and CWG(common wealth games) scam.The main issues here today are 'corruption and blackmoney' and framing of 'Jan Lokpal bill' raised by baba ramdev and Anna Hazare(Social activist) respectively.About Jan Lokpal bill the final decision is yet not made by government and some demands are still unaccpted.So we cannot assure whether the agreement will take place and all the demands will be accpted between Anna Hanare's team and government.But about the issue 'blackmoney and corruption' which was raised by baba ramdev ,i have definately something to say.
India having more than 1.4 trillion(400 lakh crore) blackmoeny in foreign banks leads the world.Definately owner of this moeny are our "democratic" politicians ,bureaucrats,bussinessmans,industralists etc who are not taintless.They are looting india,'richer becoming more rich and poorer becoming more poor'.I would like to thanks A Raja (former telecom minister) due to whom we are today at 2nd position in the world having the biggest scam ever.
How long we can allow them to do so.Should someone take the initiative to fight against it?Expected answer would be Yes.But who will take the initiative and If someone take then should we support it?
Baba Ramdev took the initiative and went on a indefinite fast on 4 june 2011 against blackmoney and corruption but unfortunately the fight couldn't be successful and government and baba could not reach on any agreement.Issues raised by the baba were genuine and vivid as:

a)The blackmoney should be get back from foreign banks and must be declare as national property=>Yes it should be such as

b)The corrupted one should be hardly punished=>Why not?

c)There should be deadline for the government affiars

d)a lot more

But what was expected from his fast nothing happened like that.After 7 days protest he was hospitalised.Desperately he ended his nine-day fast heeding the appeals of various spiritual and religious leaders.
There are lot of reason why fight could not be successful.I don't know whether i am right here or wrong.But one reason was the Non-support of Us(indian) to baba's protest.Indians just can fight with each other over their religion,culture and for it we can go on hunger strikes,stirs and rampage.We will do everthing here to win over each other.Bur we cannot support a person who is fighting for us against the government.Governement didn't give importance and didn't worry about his protest beacause they knew that indians are slepping soundly against these issues so they tried to gag the baba.Before 1947 we were slave to British and now we are slave to our democratic government who are cultivating our country with corruption.
In india it is common whenever anybody has tried to a raise a voice ,to protest against disablility , misdeeds of government the democratic government tried to gag them.is it call democracy? on ramdev's fast rather than taking appropriate decision on his demands government tried to gag him too and tried to divert the issue to put allegations on him.Government tried to prove that baba is playing a game,he is doing so just for his political career,he has illicit assests etc.Here i want to ask a question from government.OK,we agree all the allegation put by you on him are true but if you were aware to all this then why you did not take a action against him before his fast against corruption and blackmoney.For what you were waiting? it is your disability that you could not do anything before.Secondly if baba have been found corrupted then your have power to take a action against him but why are you diverting a issue from "blackmoeny corruption" to prove "Baba Ramdev is a corrupted yoga guru".you might go ahead on his issue and might take a legal action against him if he would found guilty in any case.wasn't is right choice?
But you just tried to gag him and to budge from the real issue.Every indian knows what had happened at Ram Lila ground in delhi on 4-5 june midnight.Government tried to forcible disperse the agitating mob and became violent when government found itself in predicament.The reason why government had not agree upon to get back blackmoeny proves they are owner of that and they think that is their "Personal" assest.They are all of dubious character who can't be trust upon.
Corruption is like epidemic in india.This is the right time for creating a legal framework for tacking the menance of corruption .We are still snoring against these serious issues so it is the high time to awake otherwise they will sell our india one day.

Install Photoshop On Ubuntu

Unhappy beacause of absence of Adobe Photoshop in your ubuntu pc?Missing it?
Dont Worry,here i am explaining a simple way to install it.It includes total 3 steps.

STEP:1
Firstly you need a wine.It is a software the install the .exe Files of windows in Linux.You can Install wine from Ubuntu Software Center easily.Search there and install it

STEP:2
Now it is the time to add the Tahoma Font in the Wine's directory.Download this Font from here.Download Tohoma Fontclick to the original format link there to download.Save it on your desktop, then move it to the Wine fonts folder (full path -> /home/yourusername/.wine/drive_c/windows/Fonts).
To see the .wine folder, go to View -> Show Hidden Files option in your home directory or press (ctrl+h) from your home directory.It will show you all the hidden files.
To move the Font from Desktop to .wine directory You can issue the following command from terminal
sudo mv Tahoma.ttf /home/yourusername/.wine/drive_c/windows/Fonts
Upto now 2 steps have been over.Lets move towards third one.

STEP:3
To install the Adobe Photoshop you should have setup.exe file of it (obviously).So Open that setup.exe file with "Wine Windows Emulator" and follow the installation procedure.When the installation is over, you will find the Adobe Photoshop and Adobe ImageReady shortcuts under the Wine entry in your Start Menu.It will look like


Wow!!Enjoy|

Video Converter For Every OS:Mobile Media Converter

The Mobile Media Converter is a free video and audio converter for converting between popular desktop media formats like MP3, Windows Media Audio (wma), Ogg Vorbis Audio (ogg), Wave Audio (wav), MPEG video, AVI, Windows Media Video (wmv), Flash Video (flv), QuickTime Video (mov) and commonly used mobile devices/phones formats like AMR audio (amr) and 3GP video. iPod/iPhone and PSP compatible MP4 video are supported. Moreover, you can remove and add new formats (videos) through the internet.


An integrated YoutTube downloader is available for direct downloading and converting to any of these formats.The program has a very easy-to-use and simple GUI (Graphical User Interface) that helps even the most amateur user. Most of the times, the only data that you must enter is the input file(s) or just drag 'n' drop the input file(s)! The 3GP and AMR formats are used by mobile phones for MMS, video and sound recordings, etc.
Download the Mobile Media ConverterFor Window For Linux Ubuntu For Mac OS X
Enjoy,Have Fun!

OpenStreetView

OpenStreetView is a free editable map of the whole world. It is made by people like you. OSV is Ruby On Rails application.If you want to work on OSV,you should first install it own your PC.
Here I am Sharing my experience with OSV. I used the Linux(Ubuntu 10.04).First of all you need to fetch the Source Code of site i.e. Installation of OpenStreetView at your own computer. So Follow the Following Stepts to Intall the OSV at your own computer.

sudo apt-get update;
sudo apt-get upgrade;
sudo apt-get install build-essential;
sudo apt-get install mysql-server mysql-client rake gem ruby1.8-dev
sudo apt-get install libmysql-ruby
sudo apt-get install libmysqlclient-dev

Upto Now you have Installed MYSQL,RUBY. Now its the time to Create the database for OSV. Open the terminal and do following.

mysql -u root -p (Enter your Mysql password Now)
create database openstreetview_org_development;
Control + d

Now install the Ruby gem and Rails as Follow. Download the Rubygems from Download Ruby-gems and copy it to Desktop and the Follow as:cd Desktop
sudo tar -xvzf rubygems-1.3.7.tgz --directory=/usr/local/src (please mention here your own downloaded version ,mine was 1.3.7)
cd
This will extract the rubygems into /usr/local/src Directory , So now to finally Install it do following

cd /usr/local/src
cd rubygems-1.3.7
sudo ruby setup.rb

On the other hand you can install it to from single terminal commend as:

sudo apt-get install rubygems;

Now you have Rubygems Installed version 1.3.7. Now Rails left to install . Do following to install Rails.
(Note:You OSV need a Rails's version 2.3.8, So Please mention the Same,otherwise you may face the problem)
sudo gem install rails -v 2.3.8
sudo gem install mysql
Congrets , you have Now installed Ruby On Rails . you can check the version of each installation as:
ruby -v
gem -v
rails -v

Now its the time to Fetch the Source Code of OSV. Do Following to fetch the source code

mkdir OSV
cd OSV
sudo apt-get install git-core;
git clone git://github.com/johnmckerrell/OpenStreetView.git
// or
git clone https://github.com/johnmckerrell/OpenStreetView.git
cd OpenStreetView
cd config
sudo gedit config/database.yml

It will Open the database.yml in Geditor. This file contain the Information regarding the Database connection for OSV So Carefully do as:

a)Change user and password of MySQL and socket as follow
b)socket: /var/run/mysqld/mysqld.sock

Now edit the other file as:
sudo gedit config/environment.rb

// Change server name from www.openstreetview.org to localhost in line
// number 7, in line number 4, make version for RAILS_GEM_VERSION as '2.3.8'
Now Change the Directory as Follow as:

cd vendor/plugins/
a)git clone http://github.com/technoweenie/restful-authentication.git
restful_authentication
b)sudo rake gems:install
You are Just two Steps away to Run OSV. Now change the Directory as Following and do as:

a)cd OSV/OpenStreetView
b)rake
c)rake db:migrate
d)script/server

The script/server will Start the server , Now you Can run the OSV at localhost as:

Browse in browser(localhost:3000)

It look like as:

Problems You may face during installation


Well nothing is perfect.It may possible that you face a strange problems during installation of OSV.i faced too.Some to problems that i faced ,am discussing here along with there solutions.
(1) when you give the command
cd OSV/OpenStreetView/rake

You may get the following dreading message.

DEPRECATION WARNING: Rake tasks in vendor/plugins/restful-authentication/tasks are deprecated. Use lib/tasks instead. (called from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10)
/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/moderate_controller_test.rb" "test/functional/private_controller_test.rb" "test/functional/homepage_controller_test.rb" "test/functional/main_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/api/application_controller_test.rb" "test/functional/api/photo_controller_test.rb" "test/functional/api/photos_controller_test.rb" "test/functional/content_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/upload_controller_test.rb"
/usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:271:in `require_frameworks': no such file to load -- net/https (RuntimeError)
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:134:in `process'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run'
from /home/amritpal/public_html/OSV/OpenStreetView/config/environment.rb:12
from ./test/test_helper.rb:2:in `require'
from ./test/test_helper.rb:2
from ./test/functional/moderate_controller_test.rb:1:in `require'
from ./test/functional/moderate_controller_test.rb:1
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
from /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"
Errors running test:units and test:functionals!

You can resolve this error message by simple giving following terminal command

sudo apt-get install libopenssl-ruby1.8
It will install some packages and show you the following gems which you were missing
Missing these required gems:
rubyist-aasm
mini_magick
exifr
json

Now obviously you want to install the these gems,otherwise you will face the problems again.So to install these all gems in one go ,issue the following command from terminal

sudo rake gems:install

It will installed all the gems and other related stuff.Now you can issue the rake command from terminal without any error message as:

cd OSV/OpenStreetView/rake
Enjoy!!


(2)When you issue the following command to start the server

cd OSV/OpenStreetView/script/server/you may face the following error message.

=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-01-08 17:50:11] INFO WEBrick 1.3.1
[2011-01-08 17:50:11] INFO ruby 1.8.7 (2010-01-10) [i486-linux]
[2011-01-08 17:50:16] WARN TCPServer Error: Address already in use - bind(2)
Exiting
/usr/lib/ruby/1.8/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `new'
from /usr/lib/ruby/1.8/webrick/utils.rb:73:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `each'
from /usr/lib/ruby/1.8/webrick/utils.rb:70:in `create_listeners'
from /usr/lib/ruby/1.8/webrick/server.rb:75:in `listen'
from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:10:in `new'
from /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:10:in `run'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/server.rb:111
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3

To resolve this error message issue following command in terminal
lsof|grep 3000
This will give you a line starting with:
ruby 6205 adam 4u IPv4
Take the number in second position (6205 in this case) and in console do
kill -9 6205
Now again issue
script/server

It would work now.

Create Account On OSV


Now you need to Create an account for Upload photos, Processing,Moderation etc of Photos. So simple sign up for an account it would Say"Thanks for signing up! We're sending you an email with your activation code.", But you dont have any Email Server.
So You need to activate the user from Backend. Simply login to Mysql and activate the user as follow:

mysql -u root -p (Enter your password)
use openstreetview_org_development; (This is name of database which we are using for OSV)
select * from users;
The last command will give you id ,login ,name,email ,crypted_password for your created user. Just note down the id ,most probly it is 1. So to activate your created user do following .
update users set state=’active’,activated_at=NOW(), activation_code=NULL WHERE id=1;


User has been activated. Now you can login with your choosenLogin and Password.


Upload Photos

Geocoding photos means attaching location information to them. You can then make links between maps and your photos, so that people can see exactly where your photos were taken. Digital photo file formats support the addition of this geographic information (latitude and longitude).
After the photos has been Uploaded you ,they needs Processing and Moderation. Do it .Now the photos will be automatically display on the Map. The Following Map shows the uploaded Image on the Map.


Problems Yet Not Solved

There are 5 copies of the same images that you have uploaded are placed in a folder(/home/OSV/OpenStreetView/public/available) i.e.large(1024*768),medium(500*375),small(240*180),thumnail(75*75),square(100*50) in size.
There is a OSVMain.js file in (/home/OSV/OpenStreetView/public/javascripts) that upload number of Geocoded images(square size) when the page loads.The Issue is when someone click on the any Geocoded image on the page ,it should show the large image(1024*768) of the same.And further click on the large image it must show again the square size image of the same.The On-click event in javascript would be works here.
Following is the actual code(OSVMain.js).It is in .js file
//
var epsg4326 = new OpenLayers.Projection("EPSG:4326");
var OSVMain = (function() {
var map, markers, map_move_timeout;
var photos = {};
function mapChange() {
if( map_move_timeout )
clearTimeout(map_move_timeout);
map_move_timeout = setTimeout(mapChangeTimeout, 500);
updateLinks();
}
function updateLinks() {
var center = OSV.getMapCenter(map);
var zoom = map.getZoom();
$('#permalink').attr('href',OSV.getURLBase()+'?lat ='+center.lat+'&lon='+center.lon+'&zoom='+zoom);
$('#kmllink').attr('href',getLocateLink('kml'));
}
function getLocateLink(format) {
var extent = OSV.getMapExtent(map);
var url = OSV.getURLBase()+'/api/photos/locate.'+format+'?bbox=';
url += [ extent.left, extent.bottom, extent.right, extent.top].join(',');
return url;
}
function mapChangeTimeout() {
map_move_timeout = null;
var url = getLocateLink('json');
$.get( url, null, photosLoaded, 'json' );
}
function photosLoaded(json) {
var new_photos = {};
var size = new OpenLayers.Size(50, 50);
var offset = new OpenLayers.Pixel(-25, -25);
for( var i = 0, l = json.length; i = numzoom) start.zoom = numzoom - 1;
map.setCenter(start.pos.clone().transform(epsg4326 , map.getProjectionObject()), start.zoom);
OSV.setupMapEventHandlers(map);
map.events.register("moveend", map, mapChange);
map.events.register("zoomend", map, mapChange);
mapChange();
markers = new OpenLayers.Layer.Markers("Markers", {
displayInLayerSwitcher: false,
numZoomLevels: numZoomLevels,
maxExtent: new OpenLayers.Bounds(-20037508,-20037508,20037508,20037508),
maxResolution: 156543,
units: "m",
projection: "EPSG:900913"
});
map.addLayer(markers);

}
return {
setup: setup,
1:1
};
})();
$(function(){
OSVMain.setup();
});
//

I Created

I have made a another javascript cum html file.This file loads the number of thum-nails on the page when the page is loaded.On click at any thumnail over the page ,it shows the full resolution of the same and vice versa.But this is another code(file) other than OSV.The code of this file is as follow


window.onload = start;
function start ()
{
allSmall ();
allTriggers ();
}

function allTriggers ()
{
var images = document.getElementsByTagName("img");
for (var i = 0, image; image = images[i]; i++)
{
image.onclick = othersSmallThisLarge;
image.style.position = "absolute";
}
}
function smallImage (image)
{
with (image.style) { width = 50; height = 50; }
}

function largeImage (image)
{
with (image.style) { width = 500; height = 500; }
}

function switchSize (image)
{

if ( (image.offsetWidth != 500) && (image.offsetHeight != 500) )
{

largeImage (image);

}
else
{
smallImage (image);
}

}
function switchResolution (image)
{
var previous = image.src;
image.src = image.getAttribute("data");
image.setAttribute("data", previous);
delete previous;
}
function allSmall ()
{
var images = document.getElementsByTagName("img");
for (var i = 0, image; image = images[i]; i++)
smallImage (image);
}
function othersSmallThisLarge ()
{
switchResolution (this);
switchSize (this);
}
images.style.position = "absolute"
img src="Thumnail's path" data="Full resol's path"
img src="Thumnail's path" data="Full resol's path"
img src="" data=""

Possible Solution

The OSVMain file is using a JQuery lightbox plugin.Either above file may be embedded into the original (OSVMain.js) file.On other side,the original file should be throughly changed.Osv file is totally unlike the above file so it is not so easy to embed the file into Osv file.Here is link for creating your own JQuery Plugin Create own JQuery Plugin.Now other possible solution would be to create your own plugin and try to embed into actual file.

Ruby on Rails

Ruby on Rails is a web application framework written in Ruby, a dynamically typed programming language similar to Python, Smalltalk, and Perl.Ruby on Rails is Open Source Web framework that's optimized for programmer happiness and sustainable productivity.It lets you write beautiful code by favoring convention over configuration.
Ruby on Rails, often shortened to Rails or RoR, is an open source web application framework for the Ruby programming language. It is intended to be used with an Agile development methodology that is used by web developers for rapid development.

You can follow the following procedure to install the Ruby on Rails on your own pc.
Go to terminal and type
sudo apt-get install build-essential

sudo apt-get install ruby-full
Now Download the rubygem from "http://rubyforge.org/frs/?group_id=126" and copy it to Desktop and then do following step by step
cd Desktop
sudo tar -xvzf rubygem-1.3.7.tgz -C /var/src
(Here give your own version of rubygem )
cd /var/src/rubygem-1.3.7
sudo ruby set.rb
sudo gem install rails -v 2.3.8

Well you have now install Ruby on Rails ,Now its time to test it.So Create a Rails's application .Here name of Rails application is blog ,you can give your own name.

rails new blog
cd blog
script/server

The rails server command launches a small web server named WEBrick which comes bundled with Ruby. You’ll use this any time you want to view your work through a web browser.
This command will give you the following output in terminal

=> Booting WEBrick => Rails 3.0.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-04-18 03:20:33] INFO WEBrick 1.3.1 [2010-04-18 03:20:33] INFO ruby 1.8.7 (2010-01-10) [x86_64-linux] [2010-04-18 03:20:33] INFO WEBrick::HTTPServer#start: pid=26086 port=3000

With just three commands we whipped up a Rails server listening on port 3000. Go to your browser and open http://localhost:3000, you will see a basic rails app running.
Congratulations ,You are now running Ruby on Rails.

OPEN STREET MAPPING

Open Street Map is a free editable map of the whole world. It is made by people like you. Open Street Map allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. Open Street Map has been praised for being more detailed than maps compiled by big companies like Google and Microsoft,yahoo and its creators hope that with thousands of editors, it will be more accurate.

GPS (Global Positioning System)


This is a GPS device that is used to make a Map.The Global Positioning System (GPS) is a U.S. space-based radio navigation system that provides reliable positioning, navigation, and timing services to civilian users on a continuous worldwide basis -- freely available to all. For anyone with a GPS receiver, the system will provide location and time. GPS provides accurate location and time information for an unlimited number of people in all weather, day and night, anywhere in the world.

JOSM (Java Open Street Map Editor)


JOSM is the “Java OpenStreetMap Editor”, a desktop application originally developed by Immanuel Scholz and currently maintained by Dirk Stöcker. JOSM is an editor for OpenStreetMap written in Java 1.5. The current version supports stand alone GPX tracks, GPX track data from the OSM database and existing nodes, line segments and metadata tags from the OSM database.You can download JOSM from there


Steps to Make a Map

1:Mark the points with GPS device
2:Upload the Map
3:Edit a Map (JOSM)
4:Use the Map

Difference Between Google,Yahoo and Open Street Map

I made a Map of Dugri Phase-1 just in 3 hours.It was very interesting experience.There is a Lot of Difference Between My Map and Yahoo and Google Map of Dugri Phase-1.You Can find the Difference Between the Map of yahoo,Google and Open Street here.

Saturday, June 25, 2011

INSTALL TURBOX IN LINUX

Amrit Pal Pathak: INSTALL TURBOX IN LINUX: "
1:Download dosbox from here
2:Now install it.
3:Copy the Tc folder of turboc compiler in ur c drive
4:Now run the dosbox and write the following commands in it step by step
a) mount c c:\TC
b)c:
c)cd BIN
d)tc
Thats all.You can use the alt+enter combination to maximize the screen

Intall wordpress on linux

Step1:First install LAMP on your system .

Step2: Create a database for WordPress and an user who has all privileges for accessing.
So open terminal and type :

mysql -u root -p
mysql> CREATE DATABASE wordpress;
mysql> CREATE USER wpuser;
mysql> SET PASSWORD FOR wpuser = PASSWORS(“wppassword“);
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO wpuser@localhost IDENTIFIED BY ‘wppassword’;
mysql> FLUSH PRIVILEGES;


Step3:Download Wordpress from http://wordpress.org/download
Step4:Move the wordpress directory to the root directory of Apache web site, /var/www/ as
Open terminal and then type

sudo tar -xvzf wordpress-2.9.2.tar.gz -C /var/www


Step5:Now in wordpress directory, rename the wp-config-sample.php file to wp-config.php as
Open terminal and then type

sudo mv wp-config-sample.php wp-config.php

Step6: Now open the terminal type:

sudo gedit /var/www/wordpress/wp-config.php

Change putyourdbnamehere to wordpress.
Change usernamehere to wpuser.
Change yourpasswordhere to the wppassword.

Enjoy,Congrats you have installed wordpress.

Monday, June 20, 2011

Install LAMP in Ubuntu


1:Install Apache

1. Open up the Terminal (Applications > Accessories > Terminal).
2. Copy/Paste the following line of code into Terminal and then press enter:

sudo apt-get install apache2

3. The Terminal will then ask you for you're password, type it and then press enter.

Testing Apache

To make sure everything installed correctly we will now test Apache to ensure it is working properly.

1. Open up any web browser and then enter the following into the web address:

http://localhost/

You should see a folder entitled apache2-default/. Open it and you will see a message saying "It works!" , congrats to you!

2:Install PHP

In this part we will install PHP 5.
Step 1. Again open up the Terminal (Applications > Accessories > Terminal).
Step 2. Copy/Paste the following line into Terminal and press enter:

sudo apt-get install php5 libapache2-mod-php5

Step 3. In order for PHP to work and be compatible with Apache we must restart it. Type the following code in Terminal to do this:

sudo /etc/init.d/apache2 restart


Test PHP

To ensure there are no issues with PHP let's give it a quick test run.
Step 1. In the terminal copy/paste the following line:

sudo gedit /var/www/testphp.php

This will open up a file called testphp.php.
Step 2. Copy/Paste this line into the testphp.php file:


Step 3. Save and close the file.
Step 4. Now open you're web browser and type the following into the web address:

http://localhost/testphp.php

A page will be pop up .
Congrats you have now installed both Apache and PHP!

3:Install MySQL

Step 1. Once again open up the amazing Terminal and then copy/paste this line:

sudo apt-get install mysql-server

Step 2. This is where things may start to get tricky. Begin by typing the following into Terminal:

mysql -u root -p

Following that copy/paste this line
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpassword');
(Make sure to change yourpassword to a password of your choice.)

4:INSTALL PHPMYADMIN

step1. open the terminal copy and paste following command and then enter

sudo apt-get install phpmyadmin

step2. Now type the following

http://localhost/phpmyadmin

If this does not work, then you can do the following to include the phpMyadmin-shipped Apache configuration into Apache:
step3.Type the following command in terminal

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf

step 4.Now type following

sudo /etc/init.d/apache2 reload

Step5. Test again your phpmyadmin ,type following:

http://localhost/phpmyadmin


Thats all ,You have successfullly installed LAMP