Tuesday, 28 July 2015

Pointers in C


> Ask the OS for a chunk of memory and use a pointer to work with it. This includes strings and structs.
> Passing large blocks of memory (like large structs) to functions with a pointer so you don't have to pass the whole thing to them.
> Taking the address of a function so you can use it as a dynamic callback.
> Complex scanning of chunks of memory such as converting bytes off a network socket into data structures or parsing files.

Difference between header file and library?


Header file contains the Interface and Library contains the implementation
It's the fundamental difference between "interface" and "implementation"; the interface (header) tells you how to call some functionality (without knowing how it works), while the implementation (library) is the actual functionality.
Note: The concept is so fundamental, because it allows you flexibility: you can have the same header for different libraries (i.e. the functionality is exactly called in the same way), and each library may implement the functionality in a different way. By keeping the same interface, you can replace the libraries without changing your code. And: you can change the implementation of the library without breaking the calling code!
When you are optimising a program, you would most likely modify the source file to improve the algorithm, but the header file wouldn't change, because external clients still call the methods using the same set of parameters and return values.
While there is nothing stopping code from being implemented in a header file, this is generally not favoured as it can introduce extra coupling and dependencies in the code.

Friday, 24 July 2015

Short overview of memory in general on a computer.


Native Memory

Native memory is the memory which is available to a process, e.g. the Java process. Native memory is controlled by the operating system (OS) and based on physical memory and other physical devices, e.g. disks, flash memory, etc.
The processor (CPU) of the computer computes the instructions to execute and stores its computation results into registers. These registers are fast memory elements which stores the result of the CPU. The processor can access the normal memory over the memory bus. A amount of memory a CPU can access is based on the size of the physical address which the CPU uses to identify physical memory. A 16-bit address can access 2^16 (=65.536) memory locations. A 32-bit address can access 2^32 (=4.294.967.296) memory locations. If each memory area consists of 8 bytes then a 16-bit system can access 64KB of memory and the 32-bit system can access 4GB of memory.
An operating system (OS) normally uses virtual memory to map the physical memory to memory which each process can see. The OS assigns then memory to each process in a virtual memory space for this process and maps access to this virtual memory to the real physical memory.
Current 32-bit systems uses an extension (Physical Address Extension (PAE)) which extends the physical space to 36-bits of the operation system. This allows the OS to access 64GB. The OS uses then virtual memory to allow the individual process 4 GB of memory. Even with PAE enabled a process can not access more than 4 GB of memory.
Of course with a 64-bit OS this 4GB limitation does not exist anymore.

Tuesday, 7 July 2015

Keys to success:-

1. Be great at an important skill. The important skills in the world right now include:
     a. sales
     b. coding
     c. product design
     d. growth
     e. design
     f. corporate storyteller

2. Refine your skill faster than your peers.
    Many folks will tell you that the world is not a zero sum game, with one person not having to lose at the
    expense of another winning. This is simply not true, as in most startups there is a very limited number
    of seats and they go to the people who work the hardest and who have the most skill.

    In your career you will find that life is a zero sum game: the winners get the prime positions and the person
    who comes in second place for that position is the first loser — not the second winner.


3. Take your skills to a startup. Period.

4. Teach everyone around you everything you’ve learned.
    There is always more knowledge to acquire, new skills to be mastered,
    yet most folks hoard their talents. This is a mistake. Give away everything you’ve learned.

5. Never get involved in politics & never be negative.

Welcome

welcome to the galaxy of beautiful minds..........