Sunday, October 16, 2016

Find Length of Longest Common Subsequences for Large String

Dynamic Program used to find length of longest common subsequences (adopted from
def lcs(X, Y):
    # find the length of the strings
    m = len(X)
    n = len(Y)
    previous = [0] * (len(Y)+1)
    current = [0] * (len(Y)+1)

    for i in xrange(m + 1):
        for j in xrange(n + 1):
            if i == 0 or j == 0:
                current[j] = 0   
            elif X[i - 1] == Y[j - 1]:
                current[j] = previous[j - 1] + 1
                current[j] = max(previous[j], current[j - 1])
        previous = current
        current = [0] * (len(Y)+1)
    return previous[n]

X = "AGGTAB"Y = "GXTXAYB"print "Length of LCS is ", lcs(X,Y)

Friday, October 14, 2016

Best Policy Around the World

Policy makers are the men that bear the power to change the world/country. All people with wisdom to change country need long-term hard work with group collaboration except policymaker. After reading How Asia Work by Joe Studwell, I was interested to know the best policy around the world. At the mean time, I was fortunate to tune BBC My perfect program. The 6-episode series covers various best policy around the world. Estonia digital policy, costa Rica green energy policy to drug policy of Portugal that helps to view drugs as a health issue than a crime, Michigan's zero suicide model policy, India's pioneering policies on sanitation and barefoot lawyer of Uganda that result on revolutionized Uganda's legal system through social media. It is the good digest for the people interested in learning good policy around the world, analyzing the attribute of good policies.

1. Drug policy of Portugal
2. Michigan's zero suicide model
3. Sanitation policy of India

4. Barefoot lawyer of Uganda

5. Costa Rica green energy

6. Estonia digital policy

Friday, March 11, 2016

In Which Month Are the Most Babies Born in #Nepal?

The question of the day: In Which Month Are the Most Babies Born in #Nepal?

Answer: Undefined. No birthday data repository available to the public. no, it remains unanswered.

One of my friend Sudip Kafle tried to analyze it from one particular sample data - IOE entrance applicant name list. Though data isn't representative, The result was surprising.

@KafleSudip: Result with 1st letter of month (data source: here) B - 1365 J-729 A-860 S-817 B-878 A-906 K-899 M-940 P-822 M-915 F-855 C-670

Above results lead to other questions, 

  1. can we make a correlation with ranking?
  2. birth month/day with interest

Wednesday, February 10, 2016

2016 Hiking Route

Hiking Route 2016
  1. Bishnu Dawar - Shivapuri (1 day)
  2. Chitlang Markhu Kulekhane (2 days)
  3. Balthali (1 days)
  4. Everest Base Camp (
  5. Arun/Barun Valley
  6. Rara Lake
  7. Cho Rolpa lake
  8. Trekking to Phoksundo Lake (photo feature)

Tuesday, January 19, 2016

2016 Reading List

2016 Reading List...
  1. The 4-Hour Workweek by Timothy Ferriss
  2. How Asia Works: Success and Failure in the World's Most Dynamic Region*
  3. Business Adventures by John Brooks
  4. Surely You're Joking, Mr. Feynman!
  5. Sumnima (by BP Koirala)
  6. Nirvana (Ghanshyam Khadka)
  7. The Art of Computer Programming by Donald Ervin Knuth (Vol 1,2 and 3)
  8. Hacker's delight by Henry S. Warren, Jr.
  9. The Hobbit by J. R. R. Tolkien
  10. How to Lie with Statistics, by Darrell Huff
  11. The Bully Pulpit, by Doris Kearns Goodwin
  12. The Rosie Project: A Novel, by Graeme Simsion
  13. Stress Test, by Timothy F. Geithner. 
  14. On Immunity: An Inoculation, by Eula Biss
  15. ...

Monday, January 4, 2016

Install lots of software in one shot

Goto Select Application you want to install and then request installer. Not use that installer to install software on target machine.

Thursday, December 31, 2015

2015 Hiking Route

2015 Hiking Route
  1. Bhotechaur (1 day)
  2. Champa Devi (1 day)
  3. Lakuri Bhangang (1 day)
  4. Jamacho Gumba, Nagarjun (1 day)
  5. Chandragiri (1 day)
  6. Poon Hill (3 day)