Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- TAIL RECURSION



  Traditional recursion vs Tail recursion

Recursion is a frequently adopted pattern for solving some sort of algorithm problems which need to divide and conquer a big issue and solve the smaller but the same issue first. For example, calculating fibonacci  accumulating sum and calculating factorials. In these kinds of issues, recursion is more straightforward than their loop counterpart. Furthermore, recursion may need less code and looks more concise. For example, let's calculate sum of a set of numbers starting with 0 and st...

   ALGORITHM,RECURSION,TAIL RECURSION,TRADITIONAL RECURSION     2016-09-23 23:54:09

  Do you have this kind of comments in your source code?

Writing runnable code is the essential skill of a programmer, writing understandable comment is also a skill a programmer should acquire. There is some famous saying that bad comment is worth than no comment. Usually your code will be maintained by other people, if you provide them some difficult to understand or misguided comments, this will be nightmare to them. While at some other time, programmers may put some funny comments in their codes which may make others laugh. Today we...

   COMMENT,HUMOR     2016-08-01 10:25:14

  How the Internet is Changing Economics

I'm not an economist by training, but I've spent a long time observing markets, and I've often wondered what the great economic thinkers of centuries past (Marx, Smith, Keynes, others) would say if they were alive today and could witness the transformations that have been caused by mass media (radio, TV, print) and the Internet. The Internet, in particular, has had a transformative effect that will doubtless be studied for hundreds of years to come. One of the things that can be said abou...

   Internet,Economic,Change,Reason     2012-01-14 12:03:05

  Haskell’s effect on my C++: exploit the type system

Like most programmers, I was attracted to Scheme by the promise that it would make me a better programmer. I came to appreciate the functional style, but swapped to Haskell, a more developed language with a rapidly developing standard library. Unfortunately, for me, Haskell can’t yet replace C++ on a day to day basis, so I reluctantly spend my days tapping away at C++. So, were the promises true? has functional programming made me a better programmer? Better is a tough question,...

   Haskell,C++,Type system,Comparison     2012-02-06 07:44:35

  Here is Surface Pro 4

Microsoft is holding a new product release event today in New York. The biggest excitement Microsoft brings us is the Surface Pro 4. The most advanced Microsoft tablet ever equipped with Windows 10. Here are the selling points of Surface Pro 4: Performance 6th generation of Intel Core processor 30% faster than Surface Pro 3 50% faster than MacBook Air Up to 15 G RAM Up to 1TB storage 8.4 mm. Thinnest Surface Pro ever Four USB 3.0 ports Two 4K display ports Ethernet One productive connection S...

   WINDOWS 10,SURFACE PRO 4,MICROSOFT     2015-10-06 10:39:57

  First page of 2012

The tail of 2011 has gone through my heart silently, Year of 2012 is coming with mystery. Looking back to 2011 and looking forward to 2012, it's time to record something...In the past 2011, nothing specials happened in my life. At the beginning of 2011, I was a college student with full of passion, while at the end of 2011, I am an engineer with 5 month's working experience. At the beginning of 2011, I was struggling through my Final Year Project and job hunting, while at the end of 2011, I am p...

   2012,New year,Mayan,Summary     2012-01-01 05:19:32

  Something you may not know about Shell

Shell is also called command line interface, it is the interface between *nix users and computer. Shell is a program which provides service to access OS kernel services. This article is to introduce some not so well known but useful and interesting knowledge about shell. Wiki shell was born almost at the same time as Unix. The first UNIX shell was written by Ken Thompson in 1971 and its name is Thompson sh. It's older than Linux kernel. The default Shell in most *nix and MacOS is bash, bash was...

   Linux, Unix,Shell,Command     2012-11-24 07:19:47

  My frequently used Linux commands

In our day to day work. We may have many chances working on Linux/Unix systems. There are many things we may need to do, checking logs, navigating in directories, creating file or installing software. We may use many commands to complete the work, such as ls, mkdir, cd etc. Below are my frequently used Linux commands or programs recently: pwd : print working directory, sometimes I need to check which working directory I am in in order to know where to go next. ls : List current directory files,...

   Linux,Command,Program     2012-08-16 15:09:42

  Set Theory in C++11

Have you ever felt the need to perform set theoretic operations on types? Not really? Me neither, but I thought it’s a fun thing to try out. So, if you ever feel the need of using type sets, C++11 makes it quite easy to do so. Especially variadic templates allow for a much more condensed syntax compared to type list constructs formerly used. (Disclaimer: This is rather a proof of concept, but maybe somebody comes up with a useful scenario.) Let’s start by d...

   C++,set theory,Math     2012-03-11 13:15:55

  Functional Programming For Object Oriented Programmers

After recently remarking about how I finally "got" functional programming I was asked by one of my millions of twitter followers... ¬_¬ to write up an explanation of a small F# program spoken in terms that fellow O-O programmers would understand. Before I become too entrenched into the functional programming way of thinking, that is, and can't explain it anymore. As a former tutor this is one of the major problems with being able to teach something once you understand it. You've ...

   Functional programming,OOP,F#,Pattern     2011-11-25 13:49:16