I’ve been working on a project that enables caching on mobile devices. Two different approaches are studied, explored and implemented.
The first approach is to implement a transparent caching system. The caching system will behave like a transparent proxy, and the traffic for user specified apps will be intercepted and examined. If the content [...]
This was a ancient Chinese story regarding Zeng guofan (曾国藩). Zeng is a military general and Confucian scholar in Qing Dynasty. He has a large group of counselors working for him. But one thing bothers him is that a lot of people leaves after working for a short period. One day, he asked one of [...]
There’re times developers want to deploy a NDK library in a separate APK. A typical use case is your library is big and it has different versions for different CPUs/phones. A naive strategy is to put all those libraries in a single huge apk and get lots of user complains. A better approach is [...]
Android DDMS allows one to take screenshot easily by clicking a button. However, sometimes a developer may want to take screenshot from the command line in order to automate it. This post discusses how we can do this and provides a java program at the end.
0. How DDMS Capture Screenshot
Most of computer applications operates on small integers which can be represented by 32 bit integers. However, there are times we’ll need to deal with extremely big integers which can only be represented by hundreds of bits. One of such application is cryptography.
This post gives two simple implementations of the big integer arithmetic. [...]
Previous posts on primality testing are all trying to factor the input number. For a very large number with few hundreds of bits, it is difficult to compute in that manner.
This post introduce a probabilistic approach based on Fermat’s primality test.
Fermat’s Little Theorem
Fermat’s primality test is based on Fermat’s [...]
Modular exponentiation is a exponentiation performed over modulus. It is used in many cryptographic algorithms.
Modular exponentiation accepts three input integers, say x, y and n and computes according to the formula below,
(x ^ y) mod n
Native Approaches
A naive approach to compute modular exponentiation is to compute the exponentiation first and [...]
The previous two posts cover the naive approaches for primality testing and a method with precomputation. This post introduces a new method which could perform better than previous approaches and it can be used together with the precomputation.
The optimization is based on the observation that all prime numbers are in the [...]
Previous post covers two naive methods for primality testing. This post introduces an algorithm to generate prime numbers called Sieve of Eratosthenes. With this algorithm, an optimization can be applied to speed up the primality testing.
Sieve of Eratosthenes
Suppose we want to generate prime numbers up to N. The algorithm consists of two [...]
Primality refers to determining if a given input number is prime or not. This post covers two naive approaches for primality testing.
Naive Approach 1
This most straightforward approach is to check if a given input integer n is divisible by integers from 2 to n-1. If a number is prime, then it should not [...]
Categories
- Android Apps (11)
- TS 2 (3)
- Video Converter Android (4)
- Android Tutorial (21)
- Android Dev Tools (1)
- API illustrated (6)
- Multimedia API (1)
- ffmpeg on Android (4)
- NDK (4)
- UI (4)
- Code Snippet (2)
- Coding Beyond Technique (16)
- a word, a world (4)
- Bug Rectified (3)
- Software as a Career (1)
- Software as User Experience (1)
- Computer Languages (25)
- C/C++ (13)
- Java (4)
- JavaScript (2)
- PHP (1)
- Python (5)
- Data Structure & Algorithms (28)
- Data Structure (5)
- Integers (10)
- BigInteger (1)
- Prime (4)
- Search (3)
- Sorting (5)
- Strings (5)
- Database (1)
- SQLite (1)
- Digital Signal Processing (29)
- Linux Study Notes (37)
- Linux Kernel Programming (8)
- Linux Programming (12)
- IPC (2)
- Linux Network Programming (5)
- Linux Signals (2)
- ssh (2)
- Machinery (19)
- misc (1)
- My Project (1)
- Mobile Caching (1)
- My Readings (1)
- Networking (15)
- Program for Performance (6)
- Virtual Machine (2)
- Web Dev (8)
- web components (3)
- Android Apps (11)
Recent Comments
- Shafi on Android TCP Client and Server Communication Programming–Illustrated with Example
- Rajesh Perul on Android FileObserver–The Underlying inotify Mechanism and an Example
- arjun on Linux Kernel Programming–Linked List
- Stéphane Nicolas on Android Custom Notification with Progress Bar
- LocNar on Top Secret II — Question List
Archives
- May 2012 (3)
- April 2012 (4)
- March 2012 (13)
- February 2012 (19)
- January 2012 (9)
- December 2011 (11)
- November 2011 (12)
- October 2011 (4)
- September 2011 (12)
- August 2011 (16)
- July 2011 (15)
- June 2011 (6)
- May 2011 (10)
- April 2011 (13)
- March 2011 (20)
- February 2011 (4)
- November 2010 (2)
- May 2010 (1)
- April 2010 (1)
- February 2010 (1)

