Category Archive: ruby

Oct 06

Ruby Enumerables ‘with_index’

Ruby’s Enumerable module provides a couple of methods for stepping through an enumerable with the index of the element as well. However, a couple are missing — there is no inject_with_index or map_with_index. There are a couple of ways of remedying this.

Continue reading »

Oct 06

Just because I Koan

"Rubin, biotyt, Ihosy, Madagaskar". Licensed under CC BY-SA 3.0 via Wikimedia Commons.

If you have some ice cream, I will give it to you. If you have no ice cream, I will take it away from you. It is an ice cream koan. Ruby Metakoans In software, koans are a form of kata, or practice. There are a number of these; one of the first I’d encountered …

Continue reading »

Sep 30

From the vaults…. on Parentheses

To paren, or not to paren: that is the question: Whether ’tis nobler in the mind to suffer The bugs and errors of maintenance programs, Or to take arms against a host of typos, And by debugging end them? To hack: to slash; No more; and by a slash to say we end The heart-ache …

Continue reading »

Dec 24

Merging Records with Uncertainty

I’m in the process of revisiting and migrating a service I’d first written almost five years ago; one of the backend data sources has changed (drastically!) so I’m looking at refactoring as well as streamlining in the process — parsing the new backend takes longer than the old. Part of the reason for doing so …

Continue reading »

Jun 22

cygwin and torquebox and rvm, oh my!

rvm, despite being wonderful, doesn’t play very well with torquebox under cygwin. In particular, the gem paths are not working. So, in order to fix this, simply do: rvm use system And then it will work right. Once you’re done with the torquebox work, you can go back to using rvm.

Jun 09

Torquebox and Cygwin: Take I

Torquebox and Cygwin don’t work as nicely together as one might hope. That said, here are a couple of findings: In order to deploy, you need to set the $JBOSS_HOME with the Windows path.  You can do this via export JBOSS_PATH=cygpath -w PATH_TO_JBOSS. Additionally, the JRUBY_HOME needs to be a windows path as well.   Otherwise …

Continue reading »

Mar 02

Rails & JRuby in a Jar

This is a discussion of what I needed to do to put rails and JRuby together in a single jar.

Sep 01

Fractal Terrain Generation

Sample Terrain

I’ve been working on a wargaming library/framework off and on for over a year; along the way I’ve encountered a number of interesting problems to solve. This blog entry details one of them, fractal terrain generation.

Aug 25

Using jnp as a JBoss heartbeat

jnp is a JBoss protocol which exposes jndi.  It is, by default, bound to port 1099.  I’d been using that port as a heartbeat, but “cheating” — I would open a socket and then close it immediately.  However, this caused problems.  jnp is chatty.  And it got upset at my not letting it say ‘hi’ …

Continue reading »

Feb 05

Web Based Portable mysql tool suite

Are you limited in what software you can use at work?  This article details how to have a web based tool suite for mysql.  It currently has the following tools: AjaxMyTop — a php implementation of mytop (think top for mysql) which runs in a browser. rbdb — a phpmyadmin work-alike in progress.  It’s the …

Continue reading »

Older posts «