Latest Updates: programming RSS

  • Articles

    Do regular expressions like a pro

    Stii 10:02 am on December 1, 2009 | Comments: 1 Permalink | Reply
    Tags: adobe air application, programming, regex, regular expressions

    Regular expressions (a.k.a. regex) is not for the faint hearted. It sometimes seems like a programming language on its own. Unless you use it on a daily basis, you tend to forget how to extract an URL from text or how to properly validate an email address. There are a number of good tools, but they all kind of lack one or more features.

    Grant Skinner made an Adobe AIR desktop application that runs on any platform that supports AIR. It is a bloody fantastic app called RegExr. It has a slick user interface that makes it perfect to test your regex on and the very handy feature of saving your regular expressions for future use and a number of recipes made by the user community.
    Screen shot 2009-12-01 at 10.14.11 AM

    With very little or no regex knowledge, you can now impress your friends like a superhero!

    Welcome back! You should subscribe to my RSS feed here.
    You should follow me on Twitter here
    You should follow me on Gatorpeeps here.

    Save Cape Town City Ballet
     
  • Articles

    The Google Go programming language

    Stii 2:57 pm on November 11, 2009 | Comments: 2 Permalink | Reply
    Tags: c, , google go, , pascal, programming, programming languages,

    Lately Google announced a wide array of new products and features. The Google Chrome browser, Google Wave, Android and Google Chrome OS are the ones immediately coming to mind. This morning I saw they released Go. Their own experimental programming language.

    Go is not a scripting (a.k.a. interpreted) language, but a compiled language like C or C++. It looks very, very simple compared to C/C++ and according to them it was born from their frustrations with said languages. This has potential to become popular should they drive it sufficiently.

    The syntax of Go looks like a mix of Python, C, Java and Pascal. Have a look at this:

    package main
    
    import (
        "os";
        "flag";  // command line option parser
    )
    
    var omitNewline = flag.Bool("n", false, "don't print final newline")
    
    const (
        Space = " ";
        Newline = "\n";
    )
    
    func main() {
        flag.Parse();   // Scans the arg list and sets up flags
        var s string = "";
        for i := 0; i < flag.NArg(); i++ {
            if i > 0 {
                s += Space
            }
            s += flag.Arg(i)
        }
        if !*omitNewline {
            s += Newline
        }
        os.Stdout.WriteString(s);
    }
    

    I can say this: It looks friendly! I like the sugar.

    Some of the features makes a lot of sense and I hope this will evolve successfully. Just look at the names behind this little experimental project and you’re bound to get excited! I’d love to know what C and C++ stalwarts think.

    PS: Love the origin of the name:

    “Ogle” would be a good name for a Go debugger.

    I concur.

    Save Cape Town City Ballet
     
  • Articles

    Why programmers should learn LISP

    Stii 11:36 am on October 30, 2009 | Comments: 1 Permalink | Reply
    Tags: eric raymond, lisp, programming

    LISP is a very old programming language. It was originally specified in 1958. So why should programmers learn LISP? Eric Raymond explains it best in this very short paragraph:

    Lisp is worth learning for the profound enlightenment experience you will have when you finally get it; that experience will make you a better programmer for the rest of your days, even if you never actually use Lisp itself a lot.

    There you have it. What better reason do you need?!

    Save Cape Town City Ballet
     
  • Articles

    Another Ted Dziuba classic

    Stii 12:15 pm on October 13, 2009 | Comments: 0 Permalink | Reply
    Tags: programming, , ted dziuba, the register

    I’m a Ted Dziuba fan. God knows why, since I actually wouldn’t enjoy working with someone like that, but I love his straight-shooting-from-the-fucking-hip style of writing and he does make a lot of sense most of the time. His latest post:

    I don’t code in my free time

    …is a true Dziuba classic! This part made me laugh. Out loud. Literally.

    Me, I can count on one hand the number of times I’ve programmed outside of work or a class. There was only once when I actually enjoyed it, though. I was in college, and shared a common wall with a girl from Spain who was painfully unaware that her computer had a volume control knob. She would stay up late on AOL instant messenger, and I couldn’t sleep. So, I rigged up a Python script to play AOL instant messenger sounds randomly every 5 to 10 seconds, turned up my speakers, pointed them at the wall, and went on vacation for a week. And thus, the asshole you all know and love is born.

    Ted often writes for The Register and his opinions are often so refreshingly true albeit a bit brash. Makes for excellent reading even if you don’t agree with everything he says.

    ted dziuba

    (Photo credit: Wired.com)

    Save Cape Town City Ballet
     
  • Articles

    The Zen of Python

    Stii 2:06 pm on August 17, 2009 | Comments: 0 Permalink | Reply
    Tags: , programming, , Software Dev

    Found at this Stack overflow gem.

    “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”

    :)

    Save Cape Town City Ballet
     
  • Articles

    Java is Groovy and Groovy is Java

    Stii 10:02 pm on May 21, 2009 | Comments: 11 Permalink | Reply
    Tags: , , programming,

    groovy_transparentgroovy |ˈgroōvē|
    adjective ( groovier , grooviest ) informal dated or humorous
    fashionable and exciting : sporting a groovy new haircut.
    enjoyable and excellent : he played all the remarkably groovy guitar parts himself.

    That is as defined in my beloved and trusted Mac Dictionary. I have to do a little Java project soon. Not because I want to, because I HAVE to for Afrigator. Don’t get me wrong, I think Java is great and powerful. I have a healthy dose of respect for it. Problem is, I’ve never done anything remotely formal in Java. The only experience I have with it was when I checked it out about 6 years ago. Safe to say, I’m a n00b.

    The problem is that I’m quite busy these days. Time and energy is not much for attempting learning a mammoth like Java.

    Hello, Groovy! Groovy is a dynamic language specifically for the Java platform. Groovy is built for the JVM, making it easy for Java to integrate with Groovy vice versa. In Netbeans, they went a far as not even having an option to create a Groovy project. You create a normal Java project and then add Groovy classes to it. That is how tightly it seems integrated, which is good news for a n00b like me :)

    The syntax itself seems very close to that of Ruby. Lets look at these examples (from the excellent article by Gerald Bauer – Groooooovy Babe: Jazzing Up Plain Old Java)

    Here is some Java code

    import java.util.*;
    
    public class HelloWorld
    {
      public static void main( String args[] )
      {
         List country = new ArrayList();
         country.add( "Canada" );
         country.add( "Austria" );
         country.add( "Brazil" );
    
         Collections.sort( country );
    
         for( Iterator it = country.iterator(); it.hasNext() )
            System.out.println( "Hello " + it.next() );
      }
    }
    

    The same in Groovy ( note the code reduction compared to Java :) )

    country = [ 'Canada', 'Austria', 'Brazil' ]
    country.sort
    country.each { println "Hello ${it}" }
    

    And in Ruby

    country = [ 'Canada', 'Austria', 'Brazil' ]
    country.sort
    country.each { |country| puts "Hello #{country}" }
    

    To top it all off, they even have their own Rails-like web framework called Grails (Groovy on Rails). I’ll check that out in due time.

    All in all, Groovy feels much more comfortable and familiar to me. I’m looking forward to this little challenge and will probably write about it as I go along. Aslam Khan assured me that it is solid and he even have some Groovy code out there in the wild in production which is comforting! That and knowing someone who is an expert to ask for advice when the going gets rough, since I’m fairly sure it will get rough due to n00bn3ss!

    Save Cape Town City Ballet
     

About Me

Software developer at Afrigator.com Love Python, do PHP.
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel