Archive for the 'Programming' Category

Creating a Binary File Using a Ruby DSL

March 25th, 2008 | Category: Networking, Programming, Ruby, XML

So I used ruby to convert a simple hex string into a binary file in Converting hex to Binary in 4 Languages. Today I was trying to create a mixed ascii/binary file at work and created a little Domain Specific Language that has good possibilities.

NOTE: There is an expanded version of this script here: A Better Binary File Generator DSL in Ruby
Read more

Comments are off for this post

Why C Switch Statements Should go the way of the GOTO

March 15th, 2008 | Category: C, C#, Programming, Ruby

The venerable C switch statement keeps showing up in other languages presumably because the people who write new languages are familiar with C and don’t really think about it.
Read more

2 comments

Embedding Rhino Part I: Parsing Command Line Arguments in JavaScript

March 11th, 2008 | Category: Java, JavaScript, Programming

Rhino is a JavaScript/ECMAscript implementation in Java. Using the new java1.6 scripting API you can now easily embed JavaScript into your Java applications. I thought I’d try writing yet another implementation of the net_tool application using Rhino. Originally this was going to be a single article, but it turns out to be a two-fer.
Read more

Comments are off for this post

Converting hex to Binary in Java Too

March 05th, 2008 | Category: Java, Programming

So apparently the hex to binary in 4 languages portion of this web page is what gets the most google hits and who am I to argue? So without further ado, hex to binary in Java as well…

Read more

Comments are off for this post

Writing a Wordpress Plugin

March 02nd, 2008 | Category: JavaScript, PHP

As an experiment I wrote a WordPress plugin that turns [wikipedia]c++[/wikipedia] into c++.

Read more

1 comment

Java’s @Override Annotation

February 28th, 2008 | Category: Java, Programming

Most people are aware of java annotations by now, but I’m not sure everyone knows about @Override. They really should.

Read more

1 comment

Ruby Shell as Domain Specific Language

February 27th, 2008 | Category: Programming, Ruby

My favorite example of a DSL is the latest jmock API just because you really have to fight the language. Fortunately Ruby makes things easier. I’ve been thinking a shell in ruby might be a nice change of pace so this is a small example of how to go about implementing one.

Read more

Comments are off for this post

Netcat Clone in Three Languages – Part III (Perl)

February 25th, 2008 | Category: Networking, Perl, Programming

So for the final segment in the netcat clone series (see this and this) I’m going to write it in Perl…
Read more

14 comments

Netcat Clone in Three Languages – Part II (Python)

February 22nd, 2008 | Category: Programming, Python

A continuation of this article I now write a very stupid version of netcat in python.

Read more

Comments are off for this post

Netcat Clone in Three Languages – Part I (Ruby)

February 20th, 2008 | Category: Networking, Perl, Programming, Ruby, XML

I thought I’d continue my series of writing the same application in multiple languages by trying to clone the wonderful network tool: netcat. For the first installation I’m going to try it in Ruby.

Read more

3 comments

« Previous PageNext Page »