Why Designers Should Learn How to Code

More often than not, designers have rightfully been accused of retreating into their cocoons of ignorance as soon as their work of creating a web design is finished, leaving the dirty and more hands-on work of putting it up on the web to developers. This apathy is prevalent not only in the web-building industry, but also in software and game engineering.

The hard truth is that the buck of development should stop with designers. For optimum efficiency, designers should not only be concerned with painting the bigger picture but also building it! In this article, I’d like to share with you some reasons why designers should learn how to code.

Read more

Don’t negotiate on your estimates

My dad made a remark once that if you want to be good in sales, you can’t just believe that the glass is half full. You have to say with a straight face that a half-full glass is better than a completely full glass.

Anyhow, my shop has generally good relationships between the technical team and the sales team. There’s one thing that drives me nuts though: when we discuss priority and they try to negotiate with me on my estimates.

Read more

Get LINQ to SQL results into a DataTable

There are two ways to get LINQ to SQL results into a DataTable, as explained here.

I use Sample II:

public DataTable ToDataTable(System.Data.Linq.DataContext ctx, object query)
{
     if (query == null)
     {
          throw new ArgumentNullException("query");
     }

     IDbCommand cmd = ctx.GetCommand(query as IQueryable);
     SqlDataAdapter adapter = new SqlDataAdapter();
     adapter.SelectCommand = (SqlCommand)cmd;
     DataTable dt = new DataTable("sd");

     try
     {
          cmd.Connection.Open();
          adapter.FillSchema(dt, SchemaType.Source); 
          adapter.Fill(dt);
     }
     finally
     {
          cmd.Connection.Close();
     }
     return dt;
}

//

Error 1606 when configuring an IIS website

When installing an IIS application on Vista, you may receive the following error:

Error 1606. Could not access network location %SystemDrive%\inetpub\wwwroot\

To correct this error, you will need to make a quick change in the registry:

  1. Make a backup of your registry.
  2. Start | Run | regedit
  3. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp using regedit
  1. Change the key PathWWWRoot to read “@C:\inetpub\wwwroot@” (your default website location in IIS) instead of %SystemDrive%\inetpub\wwwroot

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.






www.flickr.com