Wednesday, July 27, 2011

Android applications free download-Facebook for Android

Share and stay connected with your friends with the Facebook for Android app.
Facebook for Android
Facebook for Android makes it easy to stay connected and share with friends. Share status updates from your home screen, chat with your friends, check out your News Feed, review your upcoming Events, look at your friends’ walls and user info, check in to Places to get Deals, upload Photos, share links, check your Messages, and watch videos.

Application Screenshots



What's New

  1. Improved Pages support
  2. View the full list of Pages you Like as well as Pages you admin
  3. Post as a Page you admin
  4. Tag Pages in status updates using "@"
  5. Various bug fixes

Free and quick download


Android applications free download-Google Maps with Navigation

Here you can download the latest release of Google Maps free, and never carry a paper map again.
Get Google Maps with Navigation (Beta), Places, and Latitude
*Navigation: Free, voice-guided GPS navigation system
*Places: Find, rate, and get recommendations for places

*Latitude: See friends on the map and check in at places
Application Screenshots






























What's new in this version?
  • Personalize Place pages by uploading pictures from your visit
  • Manage your starred and recently visited Places in the 'My Places' tab
  • See descriptive terms for Places in search results and Places pages
  • Add a new place to Places when checking in
Free and quick download link:

Saturday, July 23, 2011

What is done in Compiling and Linking?

When programmers talk about creating programs, they often say, "it compiles fine" or, when asked if the program works, "let's compile it and see". This colloquial usage might later be a source of confusion for new programmers. Compiling isn't quite the same as creating an executable file! Instead, creating an executable is a multistage process divided into two components: compilation and linking. In reality, even if a program "compiles fine" it might not actually work because of errors during the linking phase. The total process of going from source code files to an executable might better be referred to as a build

Compilation refers to the processing of source code files (.c, .cc, or .cpp) and the creation of an 'object' file. This step doesn't create anything the user can actually run. Instead, the compiler merely produces the machine language instructions that correspond to the source code file that was compiled. For instance, if you compile (but don't link) three separate files, you will have three object files created as output, each with the name <filename>.o or <filename>.obj (the extension will depend on your compiler). Each of these files contains a translation of your source code file into a machine language file -- but you can't run them yet! You need to turn them into executables your operating system can use. That's where the linker comes in.


Linking refers to the creation of a single executable file from multiple object files. In this step, it is common that the linker will complain about undefined functions (commonly, main itself). During compilation, if the compiler could not find the definition for a particular function, it would just assume that the function was defined in another file. If this isn't the case, there's no way the compiler would know -- it doesn't look at the contents of more than one file at a time. The linker, on the other hand, may look at multiple files and try to find references for the functions that weren't mentioned.


You might ask why there are separate compilation and linking steps. First, it's probably easier to implement things that way. The compiler does its thing, and the linker does its thing -- by keeping the functions separate, the complexity of the program is reduced. Another (more obvious) advantage is that this allows the creation of large programs without having to redo the compilation step every time a file is changed. Instead, using so called "conditional compilation", it is necessary to compile only those source files that have changed; for the rest, the object files are sufficient input for the linker. Finally, this makes it simple to implement libraries of pre-compiled code: just create object files and link them just like any other object file. (The fact that each file is compiled separately from information contained in other files, incidentally, is called the "separate compilation model".) 


To get the full benefits of condition compilation, it's probably easier to get a program to help you than to try and remember which files you've changed since you last compiled. (You could, of course, just recompile every file that has a timestamp greater than the timestamp of the corresponding object file.) If you're working with an integrated development environment (IDE) it may already take care of this for you. If you're using command line tools, there's a nifty utility called make that comes with most *nix distributions. Along with conditional compilation, it has several other nice features for programming, such as allowing different compilations of your program -- for instance, if you have a version producing verbose output for debugging. 

Knowing the difference between the compilation phase and the link phase can make it easier to hunt for bugs. Compiler errors are usually syntactic in nature -- a missing semicolon, an extra parenthesis. Linking errors usually have to do with missing or multiple definitions. If you get an error that a function or variable is defined multiple times from the linker, that's a good indication that the error is that two of your source code files have the same function or variable. 

Pointer to Function in C/C++


A pointer to a function points to the address of the executable code of the function. You can use pointers to call functions and to pass functions as arguments to other functions. You cannot perform pointer arithmetic on pointers to functions.
The type of a pointer to a function is based on both the return type and parameter types of the function.


A declaration of a pointer to a function must have the pointer name in parentheses. The function call operator () has a higher precedence than the dereference operator *. Without them, the compiler interprets the statement as a function that returns a pointer to a specified return type. For example:


int *f(int a); /* function f returning an int* */
int (*g)(int a); /* pointer g to a function returning an int */
char (*h)(int, int) /* function h that takes two integer parameters and returns char */


In the first declaration, f is interpreted as a function that takes an int as argument, and returns a pointer to an int. In the second declaration, g is interpreted as a pointer to a function that takes an int argument and that returns an int.

Inline Functions in C


An inline function is one for which the compiler copies the code from the function definition directly into the code of the calling function rather than creating a separate set of instructions in memory. Instead of transferring control to and from the function code segment, a modified copy of the function body may be substituted directly for the function call. In this way, the performance overhead of a function call is avoided.
A function is declared inline by using the inline function specifier or by defining a member function within a class or structure definition. The inline specifier is only a suggestion to the compiler that an inline expansion can be performed; the compiler is free to ignore the suggestion.
  • In this example all the declarations and definitions use inline but one adds extern:
    // a declaration mentioning extern and inline
    extern inline int max(int a, int b);
    // a definition mentioning inline
    inline int max(int a, int b) {
    return a > b ? a : b;
    }
    In this example, one of the declarations does not mention inline:
    // a declaration not mentioning inline
    int max(int a, int b);
    // a definition mentioning inline
    inline int max(int a, int b) {
    return a > b ? a : b;
    }
    In either example, the function will be callable from other files.
    
    
  • A function defined static inline. A local definition may be emitted if required. You can have multiple definitions in your program, in different translation units, and it will still work. Just dropping the inline reduces the program to a portable one (again, all other things being equal).
    This is probably useful primarily for small functions that you might otherwise use macros for. If the function isn't always inlined then you get duplicate copies of the object code, with the problems described above.
    A sensible approach would be to put the static inline functions in either a header file if they are to be widely used or just in the source files that use them if they are only ever used from one file.

    In this example the function is defined static inline:
    // a definition using static inline
    static int max(int a, int b) {
    return a > b ? a : b;
    }
The first two possibilities go together naturally. You either write inline everywhere and extern in one place to request a stand-alone definition, or write inline almost everywhere but omit it exactly once to get the stand-alone definition.
main is not allowed to be an inline function.

Monday, July 18, 2011

Features of Google+ Plus with compared to Facebook

Google Plus, a new initiative from google with a aim to redefines how social sharing works. Currently google+ is available as invite only.

Google plus only works with Google Accounts that have an active Google Profile. i.e. if you have not created google profile before, you won't be able to sign up for Google+.

You must have a Gmail account to Access or Sign Up or to receive Google Plus invitations. If you have used Windows Live, Hotmail or Yahoo account to sign up for google account you can access google+ after creating a Publicaly Visible Google Profile.

Setting Up a Google+ Profile:
1. After following the received invitation you will be taken to google Plus page where you have to sing in with you google account.
Or
2. You can Leave your email address at this link http://google.com/+ Google will send you an invitation.

Google Plus Features:
The Google+ bar, which appears at the top of Google products, is your connection to Google+ . You can share what’s on your mind, view your Google+ notifications, access your profile, or jump to a variety of other Google products. For instance, to get to Google+, all you have to do is click +[Your Name]
Create a new post from the stream or the Google+ bar. Upload photos from your Google+ Photos homepage or from the Photos tab on your Google profile. Share directly from your mobile device.

+Circles: share what matters
You share different things with different people. So sharing the right stuff with the right people shouldn’t be a hassle. Circles makes it easy to put your friends from Saturday night in one circle, your parents in another, and your boss in a circle by himself - just like real life.

+Sparks: strike up a conversation
Tell Sparks what you’re into and it will send you stuff it thinks you’ll like, so when you’re free, there’s always something cool to watch, read, or share.

+Hangouts: stop by and say hello
With Hangouts, the unplanned meet-up comes to the web for the first time. Let specific buddies (or entire circles) know you’re hanging out and then see who drops by for a face-to-face-to-face chat. Until teleportation arrives, it’s the next best thing.

+Mobile: share what’s around
Share updates and see what's going on around you with Google+ Mobile

+Location

+Instant Upload
Taking photos is fun. Sharing photos is fun. Getting photos off your phone is pretty much the opposite of fun. With Instant Upload, your photos and videos upload themselves automatically, to a private album on Google+. All you have to do is decide who to share them with.

+Huddle
Texting is great, but not when you’re trying to get six different people to decide on a movie. Huddle turns all those different conversations into one simple group chat, so everyone gets on the same page all at once. Your thumbs will thank you.

Friday, July 8, 2011

How To Build A Website??

Learn The Different Ways to Design, Develop and Build a Website

As there are so many useful tools on the web today, we would share some of the different ways you can build a website.


For Beginners
If you've always wanted to create a website, but you thought it would be difficult, this is for you!
If you’ve always wanted to create a website, but you thought it would be difficult, if you have no experience in website building and know nothing about web design, I highly recommend using site builders where you can create a website easily without having any technical knowledge.
Wix - You can create a free Flash website with Wix with its easy to use drag & drop editor, choose from dozens of free templates & publish online with a click.

For Budding Web Designers
For Students Who Want To Learn Professional Website Design and Development
  1. First, you need to get a Domain Name and Web Host. We recommend Hostgator for cost effective Hosting solutions. HostGator is one of the world's top 10 largest web hosting companies with more than 1,000,000 hosted domains. They include a Site Builder, 24x7 Support, 99.9% Uptime Guarantee, 45 Day Money Back Guarantee, Free / Instant Setup, Instant Blogs, Formus, Portals Guestbooks and much more!
  2. Next you need to need to purchase the best web design software. Currently it is Adobe Dreamweaver CS3.
  3. Finally, you need to learn how to design and develop a site in Dreamweaver. Discover everything you need to know to build your website step by step from start to finish with this Dreamweaver tutorial.
  4. The above tutorial also teaches you how to FTP your site to your host and make the site Live!

For Seasoned Web Design Professionals
For Busy Web Design Professionals, Web Design Firms, Freelancers and Programmers
I recommend using ready-made website templates, where you can show a variety of designs to your client and they can choose the best design which you can customize so it is tailor made to your clients requirements. It cuts down design and production time. You can choose from a variety of more than 19,000 ready made website designs. You need to have the web design software and software expertise to customize and use these templates. The templates also include Joomla templates, blog templates, Flash website templates, ecommerce templates, logos and corporate identity. The best part is you will earn a 20% commission for each template you sell from your website! These templates are great and would take days to develop if you needed to develop it yourselves. 

Thursday, July 7, 2011

String Anagrams

You are required to implement a program which is able to print out all anagrams of a specified string. Two strings will become anagrams if letters of one string can be rearranged to obtain the other string. For example, the string "rats" is an anagram of "star". Your first step is to load a reasonable number of words in the dictionary into a hash table enabling the user to efficiently look for anagrams of a given word/s. The user should have the facility to specify anagram queries through stating the required word/s. The output should print out the given string/s along with the number of matching anagrams and the corresponding list of anagrams retrieved from the hash table.

       Example :    traps            2          sprat    strap
                            opt               2          top       pot
                            star              1          rats

      Note: The matching anagrams that the program prints out may be ordered differently.


Algorithm and Implementation 
Our first step is to load all of the words in the dictionary.txt into the hash table. A clever trick that we have used to facilitate this is to first sort the letters of every word we insert into hash table to produce a key for each word. For example, the key for the string for both "star" and "rats" is "arst". We will then use a hash table to store pairs of strings, where the pair consists of the original word and it’s key. When performing insertions, we will compute the hash of the key of the word to compute the correct bucket. This approach guarantees that all words which are anagrams of one another are stored in the same bucket of the hash table. Similarly, when we are searching for anagrams, we will first compute the key of the word we are searching for, then hash the key, then search that bucket for anagram matches. For this question, there are 5 files.

1. list.h ==> implementation of the linked list
2. hashtable.h ==> implementation of the hash table and basic functionality (insert, find) of a chained hash table.
3. main.cpp ==> a main program which loads words from the dictionary.txt into the hash table and then answers anagram queries
4. dictionary.txt ==> this contains all the anagrams of strings.
5. user_string.txt ==> user can be able to search word/words by specifying in this file.


Dijkstra's Algorithm with example

Dijkstra's Algorithm solves the single-source shortest path problem in weighted graphs. Here we show it running on a planar graph whose edge weights are proportional to the distance between the vertices in the drawing -- thus the weight of an edge is equal to its visible length.
Dijkstra's algorithm starts from a source node, and in each iteration adds another vertex to the shortest-path spanning tree. This vertex is the point closest to the root which is still outside the tree. Watch as the tree grows by radiating out from the root. Note that it is not a breadth-first search; we do not care about the number of edges on the tree path, only the sum of their weights.
Dijkstra(G, w, s)
  Initialize-Single-Source(G, s);
  S<-- {}; Q <-- V[G];
  while Q not equal {}
    do u = extract-min(Q)
       S = S U {u}
       for each vertex v E Adj[u]
           do relax(u, v, w)


Example: Step by Step operation of Dijkstra algorithm.


Step1. Given initial graph G=(V, E). All nodes nodes have infinite cost except the source node, s,  which has 0 cost.
Step 2. First we choose the node, which is closest to the source node, s. We initialize d[s] to 0. Add it to S. Relax all nodes adjacent to source, s. Update predecessor (see red arrow in diagram below) for all nodes updated.
Step 3. Choose the closest node, x. Relax all nodes adjacent to node x. Update predecessors for nodes u, v and y (again notice red arrows in diagram below).
Step 4. Now, node y is the closest node, so add it to S. Relax node v and adjust its predecessor (red arrows remember!).
Step 5. Now we have node u that is closest. Choose this node and adjust its neighbor node v.
Step 6. Finally, add node v. The predecessor list now defines the shortest path from each node to the source node, s.

Q as a linear array

EXTRACT_MIN takes O(V) time and there are |V| such operations. Therefore, a total time for EXTRACT_MIN in while-loop is O(V2). Since the total number of edges in all the adjacency list is |E|. Therefore for-loop iterates |E| times with each iteration taking O(1) time. Hence, the running time of the algorithm with array implementation is O(V2 + E) = O(V2).

Q as a binary heap ( If G is sparse)

In this case, EXTRACT_MIN operations takes O(lg V) time and there are |V| such operations.The binary heap can be build in O(V) time.Operation DECREASE (in the RELAX) takes O(lg V) time and there are at most such operations.
Hence, the running time of the algorithm with binary heap provided given graph is sparse is O((V + E) lg V). Note that this time becomes O(ElgV) if all vertices in the graph is reachable from the source vertices.

Q as a Fibonacci heap

In this case, the amortized cost of each of |V| EXTRAT_MIN operations if O(lg V).
Operation DECREASE_KEY in the subroutine RELAX now takes only O(1) amortized time for each of the |E| edges.
As we have mentioned above that Dijkstra's algorithm does not work on the digraph with negative-weight edges. Now we give a simple example to show that Dijkstra's algorithm produces incorrect results in this situation. Consider the digraph consists of V = {s, a, b} and E = {(s, a), (s, b), (b, a)} where w(s, a) = 1, w(s, b) = 2, and w(b, a) = -2.

Dijkstra's algorithm gives d[a] = 1, d[b] = 2. But due to the negative-edge weight w(b, a), the shortest distance from vertex s to vertex a is 1-2 = -1.

Shortest path Algorithms

In a shortest path problem we are given a weighted graph where each edge has an associated numerical value, called the weight of the edge.The weights are often used to represent time, cost, penalties or any other quantity that accumulates linearly along a path and that one wishes to minimize.

The weight of path p = < v0, v1,….vk> is the sum of the weights of its constituent edges.

Given a weighted graph and two vertices u and v, we want to find a path of minimum total weight between u and v. 
 Length of a path is the sum of the weights of its edges.

We will focus on Single source shortest paths problem: given a graph G = (V,E), we want to find a shortest path from a given source vertex s Є V to each vertex v Є V.

Shortest Path Properties

Property 1: A sub path of a shortest path is itself a shortest path.

Property 2: There is a tree of shortest paths from a start vertex to all the other vertices.

The shortest path algorithms use the technique of relaxation.
For each vertex v Є V, an attribute d[v] is maintained which is an upper bound on the weight of a shortest path from source s to v.

d[v] – shortest path estimate

The shortest path estimates and predecessors are initialized by the following O(V) time procedure.

INITIALIZE-SINGLE-SOURCE (G,s)

for each vertex v Є V[G]
     do d[v] <-- ∞
         π[v] <-- NIL
                     d[s] <-- 0 

Relaxing and edge (u,v) – consists of testing whether the shortest path to v found so far  can be improved by going through u. If so d[v] and π[v]  values should be updated.
A relaxation step may decrease the value of the shortest path estimate d[v].

Relaxation

d[v] > d[u] + w(u,v)                              d[v] d[u] + w(u,v)
d[v] is changed by relaxation            d[v] is unchanged by relaxation


Relax (u,v,w)
if d[v] > d[u] + w(u,v)
  then d[v] <-- d[u] + w(u,v)
   π[v]  <-- u