Skip to main content

Posts

Settting up PATH Environment Variables

HOW TO EDIT PATH VARIABLES IN MAC -  1. Open terminal and enter the following command  -  touch ~/.bash_profile; open ~/.bash_profile This will open the bash_profile in text editor   2. Add the following line to the end of the file adding whatever additional directory you want in your path: export PATH="$HOME/.rbenv/bin:$PATH" 3. Save the .bash_profile file and Quit (Command + Q) Text Edit. 4. Force the .bash_profile to execute. This loads the values immediately without having to reboot. In your Terminal window, run the following command. source ~/.bash_profile Voila ! You are done.  Check your Path vars by typing echo$PATH in the editor.    Multiple path environment variable setup with bash - export PATH = "A" export PATH = "$PATH:B" export PATH = "$PATH:C"

Install apk file on your phone through adb command .

While I was trying to download an android app on my mobile phone, I was getting a error ( 498) . Tried looking for the solution but couldn't get the resolution of my problem. That's when I tweaked around and downloaded the app on phone through adb install command from my mac book .  Steps -  (Follow steps 1, 2 if Android SDK is not already installed on your system. ) 1. Download the Android Software Development Kit (SDK) from the Android SDK Download Site. 2. Once downloaded, find a safe installation location on your machine and simply extract the zipped files to this directory. For example, • on Mac or Linux, install in $HOME/ • on Windows, install in C:/ Make note of the full path to and directory name of this directory where the SDK files are unpacked on your system.  3.  If you are currently in the platform-tools directory, just call ./ adb -- help The dot is your current directory, and this tells Bash to use adb from there. Otherw

Cool App - to control your android mobile phone remotely from anywhere

Just fumbled on this cool video about a app which help you control your phone remotely over the web but yes you need to be on the sam network ( same wi-fi network ) . Sounds really cool, downloading it lets see how helpful it turns out to be . Video link : http://www.youtube.com/watch?v=fWfS_63Jd2g Thanks to Ankit Fadia ! 

Difference between GET and POST methods

Fundamental Difference is probably the Visibility - GET request is sent via the URL string (appended to the URI with a question-mark as separator), which is visible whereas POST request is encapsulated in the body of the HTTP request and can't be seen. Length - Since, GET request goes via URL, so it has a limitation for its length. It can't be more than 255 characters long (though this is browser dependent, but usually the max is 255 characters only). Whereas no such maximum length limitation holds for the POST request for the obvious reason that it becomes a part of the body of the HTTP request and there is no size limitation for the body of an HTTP request/response. Performance - GET request is comparatively faster as it's relatively simpler to create a GET request and the time spent in the encapsulation of the POST request in the HTTP body is saved in this case. In addition, the maximum length restriction facilitates better optimization of GET impl

Getting Started with C or C++

On MAC : Source : [ http://www.cprogramming.com/xcode.html ] Using Apple XCode Once you've downloaded XCode, you can install it from the disk image. Then you can run XCode from Developer|Applications|XCode. XCode has lots of documentation and can walk you through setting up a project. The very simplest thing to do is to create a new project from "File|New Project...". First choose "Application" and then "Command Line Tool". This will give you a basic command line program that you can use when you're learning to program. Before you leave that screen, make sure to change the "Type" of the project to "C++ stdc++" if you are using C++ instead of C. Go through the rest of the prompts and create your new project. Now you have a small project set up that has a main.cpp file. You can edit main.cpp, but by default it will include a small sample "hello world" program. Let's go ahead and run that sample progra

Perl command to execute a system shell command

exec(PROGRAM); $result = system(PROGRAM);    Both Perl's exec() function and system() function execute a system shell command. The big difference is that system() creates a fork process and waits to see if the command succeeds or fails - returning a value. exec() does not return anything, it simply executes the command. Neither of these commands should be used to capture the output of a system call. If your goal is to capture output, you should use the backtick operator:   $result = `PROGRAM`;