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

 PROGRAMMING


  Rediscovering the RSync Algorithm

A:Ok, you’re synchronizing this over the web;and what do you use for the synchronization?B: Oh, we implemented the rsync algorithm.A: uhu. And what do you do with really big files?B: The same.A: And you also synchronise folders?B: Yes.A: And how do you do that?B: we iterate over the folder, using the algorithm on every file, recursing over subfolders.A: Can you try 2 things for me? First, a very large file; and second, a large codebase, and see if it holds.IntroductionFirst of all, I am an admirer of the (original) rsync algorithm. (I think) it was a first stab at file synchronization,...

2,084 0       RESYNC ALGORITHM DISCOVERY


  Why so many Python web frameworks?

When asked about the plethora of web frameworks for Python the answer is often that it is way too easy to put together one in Python. That certainly seems plausible since there are so many libraries that implement the components of a web framework and if it's easy to plug those pieces together then maybe that lowers the bar of entry for new frameworks. So let's give it a shot, we'll pick some components and spend a couple hours seeing how far we can get building a web framework, which we'll call Robaccia. Executive Summary: Robaccia was built in three hours and a total of 60 lines of Pytho...

2,632 0       WEB DESIGN PYTHON WEB FRAMEWORK DYNAMIC SCRIPTING LANGUAGE


  Tricks with Direct Memory Access in Java

Java was initially designed as a safe managed environment. Nevertheless, Java HotSpot VM contains a “backdoor” that provides a number of low-level operations to manipulate memory and threads directly. This backdoor – sun.misc.Unsafe â€“ is widely used by JDK itself in packages like java.nio or java.util.concurrent. It is hard to imagine a Java developer that uses this backdoor in any regular development because this API is extremely dangerous, not portable, and volatile. Nevertheless, Unsafe provides an easy way to look into HotSpot JV...

4,064 0       JAVA TRICKS JVM DIRECTLY MEMORY ACCESS


  Python: calculate lighter/darker RGB colors

Many times color palettes have lighter and darker variations of the same color. This may be used to convey relative importance, or for something as simple as a gradient. Usually the designer will specify both colors. However, if you have a site that needs to allow user configurable styling, you may not want to ask the user for two variations of the same color.Here is some Python code to take a single color in RGB, and output an artitrarily lighter or darker variation of the same color. You could wrap this in a filter and use it right in your Django templates.view plainprint?def color_vari...

7,796 0       PYTHON RGC COLOR CALUCALTION LIGHTER/DARKER


  I am a great programmer, but horrible algorithmist

I am a great programmer, but a horrible algorithmist. It is a thought that has been weighing on me heavily recently, and I'd like to gather other developers feelings on the subject as well.I started what can be called my professional development career back in 1999. I was still in middle school, but my father hired me at his software company. My official duty was to make updates to our websites, but I mostly ended up bugging the other developers to help me learn.From there I picked up Perl (somewhat) and then moved to PHP and front end web development where I have stayed comfortably for the l...

3,708 0       PROGRAMMER ALGORITHMIST DIFFFERENCE


  How the Go language improves expressiveness without sacrificing runtime performance

This week there was a discussion on the golang-nuts mailing list about an idiomatic way to update a slice of structs. For example, consider this struct representing a set of counters. type E struct { A, B, C, D int}var e = make([]E, 1000)Updating these counters may take the form for i := range e { e[i].A += 1 e[i].B += 2 e[i].C += 3 e[i].D += 4}Which is good idiomatic Go code. It's pretty fast too BenchmarkManual 500000 4642 ns/opHowever there is a problem with this example. Each access the ith element of e requires the compiler to insert an...

2,095 0       GO EXPRESSIVENESS PERFORMACE SACRIFICE


  Why Python is important for you

I believe that Python is important for software development. Whilethere are more powerful languages (e.g. Lisp), faster languages(e.g. C), more used languages (e.g. Java), and weirder languages(e.g. Haskell), Python gets a lot of different things right, andright in a combination that no other language I know of has done sofar.It recognises that you’ll spend a lot more time reading code thanwriting it, and focuses on guiding developers to write readablecode. It’s possible to write obfuscated code in Python, but theeasiest way to write the code (assuming you know Python) is almosta...

5,392 0       PYTHON IMPORTANCE PARADIGM


  Code reviews in the 21st Century

There's an old adage that goes something like: 'Do not talk about religion or politics'.  Why?  Because these subjects are full of strong opinions but are thin on objective answers.   One person's certainty is another person's skepticism; someone else's common sense just appears as an a prior bias to those who see matters differently.  Sadly,  conversing these controversial subjects can generate more heat than light.   All too often people can get so wound up that they forget that the outcome of their "discussion" has no bearing on their life expectancy,...

3,386 0       CODE REVIEW 21 CENTUARY