The four stages of programming competence

One of the basic pillars of the study of human psychology is the analysis of the subconscious and conscious mind. Sigmund Freud was one of the first to clearly identify and characterize the ‘areas’ where our psychic energy flows. During the first part of his notable life he stated that these were the ‘subconscious’, ‘preconscious’ and ‘conscious’ mind.

If we wanted to get an idea of how each of them is involved in our ideas, feelings, thoughts, decisions and motivation (which are key in our daily and professional lives), we should picture ourselves as an iceberg. The tip of the iceberg, the only part we see from the surface, is the conscious mind. It’s logical, organized, and we can control it, but still small. The vast and voluminous underlying mass is the unconscious mind. It’s disorganized, illogical, irrational, but defining in how we act.

Modern psychology has attempted to classify how good we are at a certain skill by observing how deep it perforates that iceberg. It thus describes four stages of competence an individual can achieve. In this article I’ll try to apply this simple scheme to the skill we practice everyday: programming.

Read more

MKCOL … 405 Method Not Allowed Subversion error

I use DreamHost to store and manage all my Subversion repositories. When trying to commit a while back, I got this strange error:

svn: Commit failed (details follow):
svn: MKCOL of '.../images': 405 Method Not Allowed

Searching around, I managed to find a couple of reasons this could occur — wrong charset or a connectivity problem (proxy discarding the MKCOL command). I’m not behind a proxy so I tried passing a charset parameter but that didn’t really help.

What finally helped was deleting the problematic “images” directory in the repository and re-commiting the directory. I use TortoiseSVN so it was as simple as using the Repo-Browser, right-clicking on the problematic directory and deleting it. The commit went through just fine after this.

Exclude Spotlight from indexing External Drives and folders

Getting Spotlight to skip indexing particular folders in a fixed drive is as simple as dragging the folders into Spotlight’s Privacy Settings tab. However, in order to get Spotlight to stop indexing external drives (USB drives, external hard disks, etc), the Privacy Settings tab only disables it temporarily – when you remount the volume, indexing begins again.

To avoid Spotlight from indexing an entire volume, create an empty file named .metadata_never_index in the root folder of the volume. If your volume is called MYDATA, for example, open up Terminal and type:

$ touch /Volumes/MYDATA/.metadata_never_index

Spotlight should now skip indexing this volume – as long as this file exists.

Backup Windows files into a Ubuntu file server via rsync

I have a Linux file server on Ubuntu 8.10 (Intrepid Ibex) running a rsync daemon, and a Windows server running a freeware rsync GUI called DeltaCopy. I wanted an automated, incremental backup every weekend.

Configuring the Ubuntu machine is pretty straightforward. Install and configure rsync and xinetd

There are a couple of changes from the rsyncd.conf you get from the URL above, mainly to avoid permission related problems when trying to rsync from a Windows machine. Here is my complete rsyncd.conf

uid = backups
gid = nogroup
use chroot = yes 
max connections = 5 
pid file = /var/run/rsyncd.pid
log file = /var/log/rsync.log
incoming chmod = Dg=s,Dug=rwx,Do-rwx,Fug=rw,Fo-rwx

[wbackups]
        path = /home/backups/wserver
        comment = Backups from wserver
        read only = false
        auth users = backups
        secrets file = /etc/rsyncd.secrets
        hosts allow = 192.168.1.1

Changes to note from the Ubuntu Wiki example is the “incoming chmod” line and the “auth users” line. I created a separate user called “backups” and store everything under /home/backups. Next, I notified logrotate about the new log being created. To do this, create a file /etc/logrotate.d/rsync with the following:

/var/log/rsync.log {
       weekly
       rotate 4
       compress
       notifempty
       missingok
}

And that is about all you need to do on Ubuntu.

On Windows:

  1. Install DeltaCopy
  2. Run the DeltaCopy Client, point it to the Ubuntu machine
  3. For “Virtual Directory”, my setting was wbackups, defined in the configuration file above
  4. Authenticate as the backups user you created
  1. Set your rsync options

The rest should be straightforward. The DeltaCopy GUI also allows you to automatically schedule backups.

Optimizing Code for Speed

Optimization of code is the term that was applied to a process in which a code is tuned to be better in some respects: either speed, memory consumption, Input/Output (disk read and writes or network reads and writes), etc. In Mathematics, Optimization means a process in which one finds the values with the best performance. In Computing where programs are very complex, usually optimizing for speed in the mathematical sense is impossible. Instead the term has come to mean just advancing in the direction of better performance in one or more respects.

This document will focus on optimizing code to run faster. However, as you will see later, doing this may involve having to optimize the code in a different aspect. Furthermore, often when programmers are trying to optimize one aspect of a program, they are doing so in order to increase speed.

Read more

50 Extremely Useful PHP Tools

PHP is one of the most widely used open-source server-side scripting languages that exist today. With over 20 million indexed domains using PHP, including major websites like Facebook, Digg and WordPress, there are good reasons why many Web developers prefer it to other server-side scripting languages, such as Python and Ruby.

This post presents 50 useful PHP tools that can significantly improve your programming workflow. Among other things, you’ll find a plethora of libraries and classes that aid in debugging, testing, profiling and code-authoring in PHP.

Link

World Community Grid/BOINC

World Community Grid’s mission is to create the largest public computing grid benefiting humanity. Our work is built on the belief that technological innovation combined with visionary scientific research and large-scale volunteerism can change our world for the better. Our success depends on individuals – like you – collectively contributing their unused computer time to this not-for-profit endeavor.

To join, download BOINC , install and register with World Community Grid. You can also choose other projects. A list of projects is available here or here

10 programming languages worth checking out

If you program for fun or profit, chances are that you know C, C++, Java, PHP, Perl, Python or Ruby. These programming languages are all widely known, and, to a different degree, used in commercial applications. At least some of them can safely be considered mainstream, even if that word has become so overused and misused that has almost lost its original meaning, if it ever had one. If you are earning your living by coding, it’s often one of these languages that pays the bills. Nevertheless, true hackers frequently meander in other directions, exploring and discovering different paradigms and methodologies, sometimes to the most esoteric extremes.

Even if you’re particularly devoted to one of the languages mentioned above, it is normal to be curious about what else is out there. As the end of the year approaches, I find myself thinking about learning – or at least become acquainted with – some less known, more experimental, programming languages. I was originally planning on learning another programming language as a New Year’s Resolution, which is quite common among programmers. The most difficult task turned out to be choosing a particular language: there are so many out there which makes it very hard to decide.

Read more






www.flickr.com