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

 PROGRAMMING


  All Programmers Are Self-Taught

When I was a teenager I played high caliber baseball. I’m competitive to a fault and when I decide I want to be good at something, results usually follow. Now I’m a third year undergrad studying computer science. There’s something critically different between programming and sports though: A pitching coach teaches you how to pitch, but a CS professor doesn’t teach you how to code.I was surprised that neither my TAs nor professors critiqued my code during my first year, but grew concerned after my second year. The assignments were larger and the problems tougher, but...

4,227 0       PROGRAMMING STYLE HABIT SELF LEARNING


  Scala, Patterns and The Perl Effect

He tried to understand that one concept for a couple of months before it made sense to him. Admittedly, partial functions are not intuitive for anyone who has been schooled in traditional programming, but still, looking at the problem he was trying to solve it seemed like James was required to expend too much effort relative to the simplicity of the problem (as he pointed out, now that he understands the concept it seems straightforward).He showed me the code, and it was basically a situation where there was common code in the existing function, and the partial function completion allowed the ...

3,184 0       PATTERN SCALA PERL TEMPLATE PARTIAL FUNCTION


  Unfortunate Python

Python is a wonderful language, but some parts should really have bright WARNING signs all over them. There are features that just can't be used safely and others are that are useful but people tend to use in the wrong ways.This is a rough transcript of the talk I gave at my local Python group on November 15, with some of the audience feed back mixed in. Most of this came from hanging around the Python IRC channel, something I highly recommend.[update 2011-12-19: improved "array" critique, add "python -i" suggestion to "reload" critique, add html targets to sections]Easy Stuff FirstStarting...

3,057 0       PYTHON WARNING DEFECTS DEPRECATED METHODS


  Java API vs Framework

What is the difference between a Java Library and a framework? The two concepts are essentially important for a Java developer. The most important difference between a library and a framework is Inversion of Control. It means that when you call a library you are in control. But with a framework, the control is inverted: the framework calls you. (This is called the Hollywood Principle: Don’t call Us, We’ll call You.) This is pretty much the definition of a framework. Basically, all the control flow is already in the framework, and there’s just a bunch of predefined white sp...

8,175 0       JAVA FRAMEWORK DIFFERENCE API LIBRARY


  Python Patterns - An Optimization Anecdote

The other day, a friend asked me a seemingly simple question: what's the best way to convert a list of integers into a string, presuming that the integers are ASCII values. For instance, the list [97, 98, 99] should be converted to the string 'abc'. Let's assume we want to write a function to do this.The first version I came up with was totally straightforward: def f1(list): string = "" for item in list: string = string + chr(item) return stringThat can't be the fastest way to do it, said my friend. How about this one: def f2(list): return reduce...

10,613 0       OPTIMIZATION PYTHON ANECDOTE LOOPUP ASCII


  C++11 multithreading tutorial

The code for this tutorial is on GitHub: https://github.com/sol-prog/threads.In my previous tutorials I’ve presented some of the newest C++11 additions to the language: regular expressions, raw strings and lambdas.Perhaps one of the biggest change to the language is the addition of multithreading support. Before C++11, it was possible to target multicore computers using OS facilities (pthreads on Unix like systems) or libraries like OpenMP and MPI.This tutorial is meant to get you started with C++11 threads and not to be an exhaustive reference of the standard.Creating and launching a t...

4,109 0       C++ DEMO MULTITHREADING STANDARD 11


  Why programmers work at night

A popular saying goes that Programmers are machines that turn caffeine into code.And sure enough, ask a random programmer when they do their best work and there’s a high chance they will admit to a lot of late nights. Some earlier, some later. A popular trend is to get up at 4am and get some work done before the day’s craziness begins. Others like going to bed at 4am.At the gist of all this is avoiding distractions. But you could just lock the door, what’s so special about the night?I think it boils down to three things: the maker’s schedule, the sleepy brain and br...

4,256 0       PROGRAMMER SLEEP LATER EFFICIENCY HABIT


  C++/CLR int to System::String^

In C++/CLR (for Microsoft), sometimes we need to convert int to System::String type or vice versa. The simple way is :From System::String^ to int int num= int::Parse(str); // System::String^ to intFrom int to System::String^System::String^ str = num.ToString(); // int to System::String^For all the other data types, similar ways can be adopted....

21,963 2       MICROSOFT C++ CLR SYSTEM::STRING CONVERT INT