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

 ALL


  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,277 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,646 0       OPTIMIZATION PYTHON ANECDOTE LOOPUP ASCII


  I’m too lazy to be a HTML developer

There’s no denying it. I’m just to damn lazy to be an HTML developer. This really sunk in when I looked at a tutorial for doing a jQuery Lightbox – for a client project. The tutorial was titled “Super Simple Lightbox with CSS and jQuery” but after reading it over I thought a better title would be “A really freaking hard tutorial on the inane intricacies of doing something that looks simple but in reality is a skein of HTML, Javascript and CSS that no one except an HTML Jedi Master could every come up with “.I must say that I have a totally refreshed...

4,130 0       JAVASCRIPT HTML WEB DESIGN COMPLEXITY MESSY


  Code Optimization Techniques for Graphics Processing Units

Books on parallel programming theory often talk about such weird beasts like the PRAM model, a hypothetical hardware that would provide the programmer with a number of processors that is proportional to the input size of the problem at hand. Modern general purpose computers afford only a few processing units; four is currently a reasonable number. This limitation makes the development of highly parallel applications quite difficult to the average computer user. However, the low cost and the increasing programmability of graphics processing units, popularly know as GPUs, is contributing to over...

3,883 0       GUI OPTIMAZATION GRAPHIC PROCESSING


  Cracks in the Foundation

PHP has been around for a long time, and it’s starting to show its age. From top to bottom, the language has creaky joints. I’ve decided to take a look at how things got to this point, and what can be (and is being) done about it. I start out pretty gloomy, but bear with me; I promise it gets better.In the Beginning, There Was Apache and CGIAnd there was much rejoicing.In 1994, Rasmus Lerdorf created the “Personal Home Page Tools,” a set of CGI binaries written in C. These tools looked little-to-nothing like the PHP we know today. Embedded in HTML comments, and using ...

2,541 0       PHP HISTORY FOUNDATION DESIGN COMPATIBILITY


  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,147 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,306 0       PROGRAMMER SLEEP LATER EFFICIENCY HABIT


  How big are PHP arrays (and values) really? (Hint: BIG!)

Upfront I want to thank Johannes and Tyrael for their help in finding some of the more hidden memory usage.In this post I want to investigate the memory usage of PHP arrays (and values in general) using the following script as an example, which creates 100000 unique integer array elements and measures the resulting memory usage:<?php$startMemory = memory_get_usage();$array = range(1, 100000);echo memory_get_usage() - $startMemory, ' bytes';How much would you expect it to be? Simple, one integer is 8 bytes (on a 64 bit unix machine and using the long type) and you got 100000 integers...

2,614 0       PHP ARRAY MEMORY OCCUPATION GARBAGE COLLECTION