Search This Blog

Thursday, April 12, 2012

Argument List in main() function


main(int argc, char** argv)
(The syntax char** argv declares argv to be a pointer to a pointer to a character, that is, a pointer to a character array (a character string)--in other words, an array of character strings. You could also write this as char* argv[]. Don't worry too much about the details of the syntax, however--the use of the array will be made clearer below.)
When you run a program, the array argv contains, in order, all the information on the command line when you entered the command (strings are delineated by whitespace), including the command itself. The integer argcgives the total number of strings, and is therefore equal to equal to the number of arguments plus one. For example, if you typed
 a.out -i 2 -g -x 3 4
the program would receive
 argc = 7
 argv[0] = "a.out"
 argv[1] = "-i"
 argv[2] = "2"
 argv[3] = "-g"
 argv[4] = "-x"
 argv[5] = "3"
 argv[6] = "4"

Wednesday, September 7, 2011

Monday, May 23, 2011

Latex tips and tricks - keep checking for newer ones

Some  tips,
  • While creating a new book or article, if you intend to have a modified family of default font across all the pages in your doc, use
                 " \renewcommand{\familydefault}{\sfdefault} "
    in the preamble. The above, for example, sets the font to sans serif.

  • How to embed an image into a table? - Use the graphicx package and your problem is solved.
    \begin{table}[ht]
    \caption{A table arranging images}
    \centering
    \begin{tabular}{cc}
    \includegraphics[scale=1]{graphic1}&\includegraphics[scale=1]{graphic2}\\
    \newline
    \includegraphics[scale=1]{graphic3}&\includegraphics[scale=1]{graphic4}\\
    \end{tabular}
    \label{tab:gt}
    \end{table}%

Friday, May 20, 2011

Java and References

Point to note;
  1. Java has pointers!!
    Java : Dog d = new Dog("Wicky"); is same as
    C++: Dog *d;

  2. When you pass foo(d) in Java, you actually pass the pointer


Thursday, May 19, 2011

New Hope to Moores Law

The new 3-D processor

I very much believed that Moores law is no longer true with the RND coming to a standstill to no longer being able to increase the number of transistors on a processor and (so) we have been going for multi cored architecture. However, Intel has found some new way to address this limitation. It might have thought "If not XY; haaa let me go for XYZ dimension!!" and it has come up with a production solution.

This is truly going to be a real Mile stone in hardware technology and even more promising to small scale devices like IPhones, handhelds and like for this new technology can save upto 50% of power.




Play this video for some experience of the new technology.

Sources
  1. http://newsroom.intel.com/community/intel_newsroom/blog/2011/05/04/intel-reinvents-transistors-using-new-3-d-structure
  2. http://www.hindu.com/seta/2011/05/19/stories/2011051950191300.htm

Tuesday, May 10, 2011

How to calculate 'differentiation' of a given function??

  • Forward difference






  • Centered difference





Now, using a computer one can easily compute the value of  up to a certain approximation. This is one such example where a continuous computation can be approximated using discrete formulation. The key here is the value of which should be chosen NOT too large (such that curvatures are totally avoided) nor too small (such that IEEE754 might fail to represent using the system hardware). Now, one can easily write off a C/Java program so as to calculate the differentiation of a function at a given value.

Refer "Press et al, Numerical Recipes, The Art of Scientific Computing, Cambridge Univ Press, III Ed, 2007" for more details.

    Thursday, April 28, 2011

    Computers' Time Line


    1. ~1000BC The abacus 
    2. 1621 The slide rule invented
    3. 1625 Wilhelm Schickard's mechanical calculator
    4. 1822 Charles Babbage's Difference Engine
    5. 1926 First patent for a semiconductor transistor 
    6. 1937 Alan Turing invents the Turing Machine 
    7. 1939 Atanasoff-Berry Computer created at Iowa State
      • the world's first electronic digital computer
    8. 1939 to 1944 Howard Aiken's Harvard Mark I (the IBM ASCC)
    9. 1940 Konrad Zuse -Z2 uses telephone relays instead of mechanical logical circuits 
    10. 1943 Collossus - British vacuum tube computer 
    11. 1944 Grace Hopper, Mark I Programmer (Harvard Mark I) 
    12. 1945 First Computer "Bug", Vannevar Bush "As we may think" 
    13. 1948 to 1951 The first commercial computer – UNIVAC 
    14. 1952 G.W.A. Dummer conceives integrated circuits 
    15. 1954 FORTRAN language developed by John Backus (IBM) 
    16. 1955 First disk storage (IBM) 
    17. 1958 First integrated circuit 
    18. 1963 Mouse invented by Douglas Englebart 
    19. 1963 BASIC (standing for Beginner's All Purpose Symbolic Instruction Code) was written (invented) at Dartmouth College, by mathematicians John George Kemeny and Tom Kurtzas as a teaching tool for undergraduate 
    20. 1969 UNIX OS developed by Kenneth Thompson 
    21. 1970 First static and dynamic RAMs 
    22. 1971 First microprocessor: the 4004 
    23. 1972 C language created by Dennis Ritchie 
    24. 1975 Microsoft founded by Bill Gates and Paul Allen 
    25. 1976 Apple I and Apple II microcomputers released 
    26. 1981 First IBM PC with DOS 
    27. 1985 Microsoft Windows introduced 
    28. 1985 C++ language introduced 
    29. 1992 Pentium processor 
    30. 1993 First PDA 
    31. 1994 JAVA introduced by James Gosling 
    32. 1994 Csharp language introduced
    33. ..will see to get other stuff

    Information taken from some random computer science ppt. Not responsible if some date is wrong ;).