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

SEARCH KEYWORD -- Puzzle



  Implementation of Tower of Hanoi

The Tower of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. The objective of the puzzle is to move the entire stack to another rod, obeying the following rules: Only one disk may be moved at a time. Each move consists of taking the upper disk fro...

   Algorithm,Tower of Hanoi     2012-08-20 02:15:55

  A C++ program puzzle

Recently I came across a question asked by wang2191195 on a Chinese IT forum CSDN which asks about a C++ program puzzle. He has a code snippet which cannot be compiled. The code is:#include <cstdlib> #include <iostream> using namespace std; class Base{ public: virtual void func(){ cout << "Base::func()" << endl; } virtual int func( int num ){ cout << "Base::func( int " << num << " )" << endl; return 0; ...

   C++,Puzzle,Hide,Overload     2012-05-13 02:31:26

  Learning Ruby and Ruby vs Lisp

The company I work for has a lot of legacy Ruby code, and as Ruby has become kind of a mainstream language, I decided to get a book about it and learn how it works. As my learning resource, I chose The Ruby Programming language by David Flanagan and Yukihiro Matsumoto as that receives great customer reviews, covers Ruby 1.8.7 and 1.9 and is authoritative because the language creator is one of the authors. The book makes a good read in general. There are plen...

   Ruby,Feature,Functional,OOP,Lisp,Difference     2011-12-12 07:42:01

  Programming: the benefits of taking a break

This post lists several benefits of taking a break during programming. You work smarter, not harder. Once, I worked really hard on a feature. For two weeks, 12 hours a day, I put in a lot of effort. After those two weeks, I took a break and came up with several ideas that made much of the work unnecessary.You think more clearly. Being tired has a similar effect as being drunk. At the end of a day, I often kid myself that I’ll just get this one thing finished quickly to have a fresh ...

   Programming,Tips,Break,Tired     2011-07-28 09:04:29

  Are You a Good Programmer?

If someone asks you to recommend a good programmer, who comes to mind? Do you consider yourself a good programmer? What criteria do you use to judge? In thinking about this, I realized that there are different ways that a programmer can be good. So I present to you The Four Kinds of Good Programmers. And in celebration of Whyday, I include quirky Why-styled illustrations* for your viewing pleasure! The Philosopher The PhilosopherThe philosopher loves to write well-defined, well-structured...

   Programmer,Inventor,Philosopher,Conquero     2011-08-23 07:56:26

  My secret Hobby: Applying for jobs

I have a probably unusual habit: I'm applying for jobs as programmer at least once a year. It 's not that I don't have a job, or that I don't like what I do, but since I am self employed and running my own company I have the feeling that I am coming out of touch of what the current job market is like, and so I started to apply for jobs at different companies once in a while. Just to keep in mind how this is like and for the fun of it.I think this is also a good training should I need to be emplo...

   IT,Career,Hobby,Job,How to     2011-08-26 02:41:47

  Collection Of Puzzles For Programmers

Did you know that we have a nice collection of puzzles here on less than dot? Some are harder than others so there is something for everyone. You can pic any language you want, you will see that there are solutions in Ruby, Python, Visual Basic, SQL, JavaScript, C++ and other. Here is a partial list of what we have Friday the Thirteenths The goal is to identify all friday the thirteenths for a given timeframe Regular Pentagon Given a grid co-ordinate (x,y) as the centre point of a regu...

   Programming puzzle,Fibonacci,Prime,ASCII     2012-01-04 08:06:18

  PHP function overloading puzzle clearer

PHP's meaning of overloading is different than Java's. In PHP, overloading means that you are able to add object members at runtime, by implementing some of the __magic methods, like __get, __set, __call, __callStatic. You load objects with new members. Overloading in PHP provides means to dynamically "create" properties and methods. These dynamic entities are processed via magic methods one can establish in a class for various action types. Some example:class Foo{    p...

   PHP,function overloading,OOP,default val     2011-07-11 03:24:30

  Is Scala Only for Computer Scientists?

I have experience struggling through these kinds of things andI know enough about the subject that I can understand why they did it that way. But my concern is that this should be an example that a beginner could understand, and they can't. There's too much depth exposed. Here's the example, which is written as a script: import scala.io.Source._ case class Registrant(line: String) { val data = line.split(",") val first = data(0) val last = data(1) val email = data(2) val payment = da...

   Scala,Application field,Computer science     2012-02-17 07:46:40

  Programming: the benefits of taking a break

This post lists several benefits of taking a break during programming.You work smarter, not harder. Once, I worked really hard on a feature. For two weeks, 12 hours a day, I put in a lot of effort. After those two weeks, I took a break and came up with several ideas that made much of the work unnecessary.You think more clearly. Being tired has a similar effect as being drunk. At the end of a day, I often kid myself that I’ll just get this one thing finished quickly to have a fre...

   Programming,Break,Rest,Refresh,New idea     2011-11-08 08:50:45