Tuesday, September 23, 2008
Rambo mode of Linux kernel
Kernel enters *Rambo* mode in out_of_memory() :mm/oom_kill.c
and what does it stand for..well, kernel starts to "shoot down" processes hoping to increase amount of free memory in the system.
Friday, September 19, 2008
What does 'I' stand for?
The book I am a strange loop is a search for the answer. I just read 50 pages of it and came up with this thought...
In that book 'being alive' is described as having a set of complex reflexes. Then one of those relexes (one of the strongest) should be a reflex that generates the answer 'I am alive' whenever I ask myself 'Am I alive?'.
"I think, therefore I am"
Church numerals (numbers and arithmetic using lambda calculus)
(define (add-1 n)
(lambda (f) (lambda (x) (f ((n f) x)))))
Tuesday, September 16, 2008
Bug fixing
1. Change the implementation to match the spec.
2. Change the spec to match the implementation.
Monday, September 15, 2008
Some thoughts on mass
- So when two bodies are brought sufficiently close together (such that r becomes very small), the force of attraction will be very large. This force will pull them closer. So masses does have a tendency to combine.
- Two masses always attract each other. The universe is full of masses, but ever expanding why??
First drive after driving test
Created a blogger template!!!
Saturday, September 13, 2008
Implementing conditionals using lambda calculus
>>> false = lambda x, y: y
>>> ifelse = lambda x, y, z: x(y,z)
>>> ifelse(false, 1, 2)
2
>>> ifelse(true, 1, 2)
1
>>>
...
>>> ifelse(false, p(), 1)
Factorials as summation
Thursday, September 11, 2008
Stack permutation
I was trying to solve a stack permutation problem in taocp. The question asks us to find no: of permutations of n numbers from 1...n that can be generated using a stack. The no:s 1...n can be pushed into the stack in that order only. When an element is popped of the stack, it is appended to an output queue. Once all elements are in output queue, the order of elements in the queue is a permutation obtained using stack.
For ex:- To obtain 2,3,1 from 1,2,3 we follow the sequence of operations
push 1,push 2,pop 2,push 3,pop 3,pop 1
Not all permutations can be obtained using the stack (for ex: - 3,1,2).
Let the no: of permutations of 1...n be a(n) with a(0) = 1 (only empty permutation possible with no numbers).
We have to find a(n+1)
Suppose that nl no:s appear to left of "1" and nr no:s to right of "1" in a permutation.
The process of obtaining a permutation for those nl numbers to the left of "1" can be considered as permuting 2...(nl+1) using a stack (The "1" at the bottom of the stack can be ignored). This no: will be the same as no: of permutations possible for 1...nl using a stack(Only the number of numbers matter).Driver's license
PS: - This post should be dated 3-Sep-2008
See Also
Search This Blog
Pages that I visit
Blog Archive
-
▼
2008
(25)
-
▼
September
(11)
- Rambo mode of Linux kernel
- What does 'I' stand for?
- Church numerals (numbers and arithmetic using lamb...
- Bug fixing
- Some thoughts on mass
- First drive after driving test
- Created a blogger template!!!
- Implementing conditionals using lambda calculus
- Factorials as summation
- Stack permutation
- Driver's license
-
▼
September
(11)