Monday, February 7, 2011

Dropbox (Error code -36)

Today, I was faced with Dropbox 'Error 36' on MacOS.
So, let's start from beginning... Dropbox has file name limitations, and those limitations are a bit different than operating system limitations (MacOSX).
I am convinced that there are good reasons for these, as they have special meaning on the command line level or would look really weird in the browser.

Let's start with the issues:
- Issue 1: File names can not start or end with blank character
- Issue 2: File names should not contain slashes

Where issue 2 is easy to spot, finder does not make it easy to spot issue 1. Thus I have created a short script that fixes blank characters in file names.

You can download You need to navigate to the folder you are trying to copy, unzip and run this script from terminal.

Before you run this script, make sure to backup your data.

If there are enough interested readers, I may wrap this into application that you can drop a folder on.

--- script content is:
#!/usr/bin/env perl
sub fix()
    my @list = `find .` ;
    for my $file (@list)
    print "." ;
    my $base = `basename "$file"` ;
    my $dir = `dirname "$file"` ;
        if( ($base =~ /\s+$/) || ($base =~ /^\s+/) || ($base =~ /\// )
      print "match $file\n" ;
          $base =~ s/\s+$//mig ;
          $base =~ s/^\s+//mig ;
          $base =~ s/\//_/mig ;
    print "\n" ;
          return ( $file, "$dir/$base");
    return undef;

while( 1 )
    my ($file, $new_file) = &fix();
    if( defined( $file ) )
        print "rename '$file' '$new_file'\n" ;
        if( -f $new_file )
            print "file already exists $new_file -- fix $file \n" ;
            exit ;
        if( -d $new_file )
            print "dir already exists $new_file -- fix $file \n" ;
            exit ;
        rename $file , $new_file ;


Wednesday, January 26, 2011

DNA reverse complement

Just published simple DNA reverse complement tool. It features reverse sequence generation, complementary RNA and DNA generation and of course reverse complement for both DNA and RNA. Check it out.

Wednesday, January 19, 2011

Click-o-mania and cyclick-o-mania in pure HTML

Last time I wrote click-o-mania clone was in summer of 1999. I wrote it in an MIT Athena cluster one summer day with the idea that it would help me with, than fresh Java skills.

Now the time has come, and I wanted to work on my GWT skills - thus - new HTML only, Flash-free, Java-free version of Click-o-mania and cyclick-o-mania are available. This simple games are written in using GWT/Java and compiled and tested on Mac and Windows, in variety of browsers and also adapted to work on iPhone. If they work well on Android, I would be interested to hear.

I hope you will enjoy these games as much as I enjoyed writing them.