Category Archives: Uncategorized

Given an array A[] and a number x, check for pair in A[] with sum as K

Let’s say the array is of size N. The naive way to solve the problem, for each element checking whether k-element is present in the array, which is O(N^2). This is of course far from optimal and you might not … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Memory Layout of C Programs

A typical memory representation of C program consists of following sections. 1. Text segment 2. Initialized data segment 3. Uninitialized data segment 4. Stack 5. Heap A typical memory layout of a running process 1. Text Segment: A text segment … Continue reading

Posted in Uncategorized | Leave a comment

“Hello World” JNI

Steps to be follow to compile a hello world program on ubuntu 1) Create java file    — MyPro.java 2) Compile with javac javac MyPro.java output:- MyPro.class 3) Generate .h file for native cpp class using javah javah -jni MyPro … Continue reading

Posted in Uncategorized | Leave a comment

JDK setup for building android source code

Many time I face problem while setting build environment for building android. Specially when i format my machine . After  googling a lot  I find that now Sun-java-6 has be removed from the ubuntu repository so it is a big problem for … Continue reading

Posted in android, Java | Leave a comment

using gdb with android emulator.

One of the biggest challenge ,I face while working on Browser in Android Platform is ‘GDB’. Many time I have to check the stack strace of the call to native function. Here is one method which make your debugging native … Continue reading

Posted in android, Debugging Native Libary | Leave a comment

vi advance settings

Vi is one of the most standard and powerfull tools for programmers. You can also customize the vi editor as per your need. following is my vi setting file. if has(“autocmd”)   filetype plugin indent on endif set incsearch  ” Incremental … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

GL Architecture for webkit on android

 GL Architecture To draw things, WebView use a tree of layers. The root of that tree is a BaseLayerAndroid, which may have numerous LayerAndroid over it. The content of those layers are SkPicture, the content of the BaseLayer is an … Continue reading

Posted in android | 3 Comments