Reversing the linked list at some given position
Today I got a question to reverse a linked at every kth position. Lets say if we have a linked list 1->2->3->4->5->6->7->8->9->10 and k is 3 then output should be...
View ArticleParsing with Applicative Functors
While reading Write Yourself a Scheme in 48 Hours, I thought of converting the monadic codes of parsing into applicative style. Learn you a Haskell for Great Good has excellent explanation about...
View ArticleGenerating primes in parallel
We can use Miller-Rabin primality testing to test a number is prime or not with certain probability. We can use this method on chunk of data to get the primes in parallel. I wrote this code to see how...
View ArticleLearning Agda
Finally I am feeling bit comfortable with Agda and feeling great . I started reading Ulf Norell‘s Dependently Typed Programming in Agda. Tutorials on Agda-wiki , AgdaTutorial , papers which mention...
View ArticleParsing Email ID
Now a days I am exploring one of the most awesome feature of Haskell, parsing. There are lot of parsing libraries but Parsec is the popular one. This parsing code is written for SPOJ EMAIL ID problem (...
View ArticleMy experience with online learning
I am one big confused soul who is always curious for learning. I found Coursera and Udacity very helpful. I try to take as many courses as possible but recently I took the Heterogeneous Parallel...
View ArticleSPOJ EMAIL ID
Finally solved EMAIL ID using python though it was very hard for me to switch from Haskell to python. While doing this problem, I learned quite a lot about regular expressions, found some cool site...
View ArticleSPOJ Pell (Mid pelling)
Pell (Mid pelling) is related to Pell’s equation. It is similar to Project Euler 66 and SPOJ EQU2. I just wrote the quick solution from mathworld but I found Chakravala method very interesting....
View ArticleMissionaries and cannibals problem
In the missionaries and cannibals problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if...
View ArticleZeroMQ for distributed computing.
This post is influenced by ØMQ – The Guide By Pieter Hintjens and translation of codes in Haskell. I suggest you to read The Guide By Pieter Hintjens and if you are interested in Haskell code then you...
View ArticleComputing a^n using binary representation of natural number in Agda
While following the Agda tutorial, I wrote this code to compute an. Not very elegant example probably because I am not expert and still learning about dependent types. Maybe after getting some more...
View ArticleCounting Inversions
First week of algorithm course programming assignment is to compute the number of inversion count of given array. We have a given array A[0...n - 1] of n distinct positive integers and we have to...
View ArticleProving the correctness of code using SMT sovler.
SMT solvers are great tool in computer science. One use of these solvers to prove the correctness of code. I wrote Haskell code to compute the inverse of polynomial using extended euclidean algorithm...
View ArticleWe, after 67 years of Independence
India has been invaded by many emperors since its inception but if we start looking back from colonial era, it is mainly ruled by British from 1757 – 1947. British ruled only here because of our...
View Article2013 in review
The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog. Here’s an excerpt: The concert hall at the Sydney Opera House holds 2,700 people. This blog was viewed about 18,000...
View ArticleWhile Interpreter
Now a days I am trying to learn about static program analysis and started reading the Principal of Program Analysis. In order to understand the concepts, the book introduces a small programming...
View ArticlePropositional Logic course ( Coursera )
Recently I took a logic course on Coursera. Although I am bit familiar with logic but this course was great. I got more clear grasp on Proposition logic, Proof tree, bit of Prolog and came to know...
View Articleyatra.com left my family stranded in midnight
You want to book a room in hotel which is fully occupied? No worries. Yatra can book a room for you in even fully occupied hotel. I booked a room in Hotel President in Patna Reference No. 28051438884,...
View ArticleProving Theorems in Coq
I recently started learning Coq from Software Foundations and I must say it’s highly addictive. Coq is theorem prover. When I started learning, the very first thing came to my mind is how is it...
View ArticleList with concatenation operation is monoid.
We will try to prove in Coq that list with concatenation ( ++ ) is monoid. Monoid is set S with binary operation with following properties. 1). Closure. 2). Associativity. 3) Identity. Proof in Coq....
View Article
More Pages to Explore .....