Skip to main content

Posts

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`;

Screenshot capture in MacOS

To capture the entire desktop, press Command-Shift-3 . The screen shot will be automatically saved as a PNG file on your desktop. To copy the entire desktop, press Command-Control-Shift-3 . The screen shot will be placed on your clipboard for you to paste into another program. To capture a portion of the desktop, press Command-Shift-4 . A cross-hair cursor will appear and you can click and drag to select the area you wish to capture. When you release the mouse button, the screen shot will be automatically saved as a PNG file on your desktop. (The file is saved as PDF in Mac OS 10.3 and earlier.) To capture a specific application window, press Command-Shift-4 , then press the Spacebar . The cursor will change to a camera, and you can move it around the screen. As you move the cursor over an application window, the window will be highlighted. The entire window does not need to be visible for you to capture it. When you have the cursor over a window you want to capture, jus

Tools for MacOS

OSX Editors: Applications -> TextEdit (set up as a Plain Text Editor ) TextMate (commercial) vim (graphical version, command line version comes with recent OSXs) Padre   OSX Command line terminals: Applications -> Utilities -> Terminal.app iTerm2