Author Archive for melriffe

14
Sep
09

I just don’t blog like I used to…

I can’t believe May was the last time I blogged. Well, yeah, I can believe it. Over the past several months I’ve been trying to focus on staying gainfully employed. So Far, So Good. I will let you know that as now (and since June) I’m 100% Rails. I’m so stoked. But I’m also over committed. I would venture a natural reaction for a young freelancer motivated to keep the food on the table for his family.

I think the main reason my blogging has almost become nil is that I’m not sure what I want to use this blog for. I’m on Twitter. I run the CVREG. I just don’t know what to do this blog. I had ideas. But I don’t have the enthusiasm and energy right now – I’ve been focusing those on the projects I’m either running or helping with; maybe I’ll talk about my projects (at a high-level since I’m under NDA for some).

Maybe.

Until then…Cheers

30
May
09

Ruminations on being too busy

Sometimes it’s a Good Thing; sometimes it’s Not. Though it’s no excuse for not blogging about my adventures, huh? Keep an eye on this space because the plan is to let you all in on what’s been going on; hint: my business is picking up. ;-)

Cheers!

13
Mar
09

Has it been One Year already?

Actually, it’s been 1 year and 1 week. I’m still Freelancing!

Hurray!

I’ve been fortunate to remain working in these tough times. For that I’m very thankful to my clients. And I’m still doing Ruby on Rails and PHP. I’ve even done a bit of C++.

The 2d Half

I have to say the back 6-months of my year wasn’t nearly as exciting as the front 6-months. It was mostly due to the fact I only had two main clients. For me having two concurrent clients is just right, stress and work-level-wise; not to mention the paperwork load. But I also stepped up my involvement the CVREG and now I’m main organizer. It’s been very exciting running the CVREG – but that’s another post.

Anything New?

I still have a lot to learn. Good thing I love learning. However I think the most important lesson I learned over my first year is: I love Freelancing. It’s still a lot of work; I haven’t automated as much as I want or need.

Dark Cloud?

Right now the only dark cloud in my silver lining is Medical Benefits. I’m looking at my options and not liking what I see. Wish me luck.

What Now?

So I’m going to persevere, improve my skills, and continue to create good work. Plus, if you need a top-notch developer for one of your projects, we should talk. ;-)

Cheers!

19
Feb
09

Have you seen WeewarSpy Web?

Just some quick screen shots of a Sinatra App I use to Spy on my Weewar Games:

Main Page

Main Page

The Main Page displays your Weewar handle, the server with which the Spy is communicating, and a list of your Active Games. The Units and Terrains Buttons offer quick access to those specific pages on the Weewar Wiki

Game Page

Game Page

The Game Page displays the details of the selected game. It displays the Spy’s debrief. As a convenience you will see, in bold, whether or not the selected game is rated. Plus, when it is your turn the View Game button turns into Play Game; the button links to the selected game on Weewar. The Game Page also has the Units and Terrains Buttons, as well as a button back to the Main Page, labeled Headquaters

Short, sweet and to the point!

Source

You can get WeewarSpy Web off of Github: http://github.com/melriffe/weewar-spy-web/tree/master. It’s a fork, of course, and you’re welcome to fork mine too. I have a couple more features planned for it, but the basics are there. Enjoy!

Happy Spying!

19
Feb
09

I so owe you people a new blog entry…

It’s been too long since my last post. And it’s not like Nothing has been going on in my life. I know for sure I’ll be posting in the next couple of weeks; I’m coming up on my 1-year Freelancing Anniversary.

See you in a couple of weeks…

Cheers!

14
Dec
08

Weewar and Weewar-Spy v1.0…

I was introduced to Weewar a little over a year ago. I really enjoy playing it, though I’m not that good; I am slowly learning though. So I created a tool to feed my addiction, er, that requires a lot of field research. ;-)

I kind of always knew about Weewar’s API but kept it in the back of my mind. I had/have more important things on which to focus. However a few months ago I started looking for Ruby Implementations of the Weewar API. I fancy myself a Ruby developer and, like a good craftsman, wish to continue to hone my skills. What better way then to develop something you know you’ll use?

I started my search on Github, of course, and found two Ruby libraries: one that used the standard API and another that used the new AI API. I knew I wanted something in between so I downloaded both libraries and started studying them. I slowly started piecing together my vision for weewar-spy. And at the end of October I uploaded my repository to Github and started announcing its availability. And, today I am officially releasing v1.0.

What is weewar-spy? you may ask. First, it’s a Ruby library that uses a couple different technologies to provide an object model over Weewar’s API. Second, it uses this object model to provide information on the games you’re playing. It provides information on the other players as well; that’s the real value. It was during a game on a large map with six players where I first had the thought: there must be an easy way to know how many bases a player has. I now have weewar-spy to give me all kinds of information.

Weewar-spy is essentially a command-line oriented tool/library. However, I’ve started using a Sinatra-implemented web app on top of weewar-spy. Oshuma (Dale Campbell), in addition to providing some patches for weewar-spy, started a Sinatra-based web application for weewar-spy. I have since forked his implementation and will continue to flesh it out, adding new features and functionality to it. At this time I recommend using either my version or Oshuma’s version of weewar-spy-web (I’ll write more about it at a future date).

I don’t have any screenshots yet. However, the README does contain a sample of weewar-spy’s output. I’ve received favorable reviews, so far. If you’re into Weewar, a Ruby developer, and would like to spy on the players in your games then download weewar-spy and send me your feedback.

Happy Spying!


Links

  1. Weewar
  2. My Weewar Profile
  3. My Github Profile
  4. Weewar-Spy
  5. Weewar-Spy-Web
  6. Oshuma’s Profile

Update: Added my Weewar Profile to the Links list.

13
Dec
08

NTS: replace existing git submodule

This is for when you have forked and cloned a repository that contains a submodule you would like to replace with your own implementation:

$> git clone ...
$> rm .gitmodule
$> rm -r <path to submodule>
$> git update-index --force-remove <path to submodule>
$> git submodule add <your git url> <path to submodule>
$> git submodule init
$> git submodule update

If there’s an easier I’d love to know what it is.

Cheers!

11
Dec
08

I Voted…for the NHL All Star Game

Guess who I voted for? Go Wings!

Cheers!

22
Nov
08

Getting to know Sinatra

For one of my clients I’ve been tasked to create a web-based testing tool that will be used to test a JSON-message-enabled Service. I asked my friends and was pointed to Sinatra.

I perused the website and thought, “Wow, that looks really easy.” So I then started thinking about the requirements for the testing tool. Aside from the pretty bits, the tool has to:

  1. send and receive from a socket
  2. send and receive json
  3. read from the filesystem
  4. display printable results (aka the pretty bits)

So, in true XP fashion, I set out to build a Spike to research numbers 1 and 2. Aside from the dependencies, I had a no-frills Spike with only 3 files. Not too bad, huh?

Implementation

Dependencies

sudo gem install json
sudo gem install rack
sudo gem install sinatra

View Files

layout.erb

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <title>Frank</title>
</head>
<body>
  <div class="container">
    <div id="header">
      <h1>Frank</h1>
    </div>

    <div id="content">
      <%= yield %>
    </div>
  </div>

</body>
</html>

index.erb

<h2>Basic NORM Test Harness</h2>
<form action="/" method="post" accept-charset="utf-8">
  <p><label for="line1">Line 1: </label><input type="text" name="line1" value="" id="line1"></p>
  <p><label for="line2">Line 2: </label><input type="text" name="line2" value="" id="line2"></p>
  <p><label for="city">City: </label><input type="text" name="city" value="" id="city"></p>
  <p><label for="state">State: </label><input type="text" name="state" value="" id="state"></p>
  <p><label for="zip">Zip: </label><input type="text" name="zip" value="" id="zip"></p>

  <p><input type="submit" value="Continue &rarr;"></p>
</form>

<div>
  <pre><%= @result %></pre>
</div>

Controller

myapp.rb

# myapp.rb
require 'rubygems'
require 'sinatra'
require 'json'

server  = 'localhost'
port    = 40000

get '/' do
  erb :index
end

post '/' do
  message   = {
    "line1" => params[:line1],
    "line2" => params[:line2],
    "city"  => params[:city],
    "state" => params[:state],
    "zip"   => params[:zip]
    }

  socket = TCPSocket.new(server, port)
  socket.puts JSON.generate(message)
  socket.flush

  output = ""
  while(response = socket.gets)
    output += response
  end
  socket.close

  @result = output

  erb :index
end

No Fuss! No Muss!

I have a feeling any medium to large application will require some careful forethought when using Sinatra. For my purposes though, Sinatra fits the bill. If you have a small-ish application give Sinatra a look; you might be pleasantly surprised how quickly you get up and running.

Cheers!

06
Nov
08

I gave my Dentist my Business Card

I have about three ideas brewing for blog posts. However, in my defense, I’ve been fairly busy with Life. However not too busy to get my teeth cleaned (I actually forgot about the appointment until they called to confirm).

Before going in I made up my mind to give my Dentist one of my business cards. Admittedly the business card is more a prototype and contains information that can be used to find me on the Net. But it doesn’t contain my business website (working on that one); it has this blog though (a fair 2d if I may say so myself) and my Twitter profile. However what I didn’t count on was my not being able to give my pitch. So he has a card with no context. Now you may be saying, “why’d you give it to him then?” Fair Question. To which I reply: I believe it a Good Thing™ to advertise, generate Word-of-mouth, regardless…

What is my pitch and is it available when I can’t give it?

That got the wheels turning. I mean, Why am I self-employed? What makes me so special? Why should you choose me over anyone else? Questions to which I need to provide an answer. I’ve been lucky in that I’ve had steady work since March. But, like everyone tells me, it can’t rain all the time, er, or the flipside: it has to rain some time.

Short of having a website for my company (again, working on it) I can use my blog to host my pitch. I’ll add a tab: “I’m Special” Look for it in the next couple of days. Until then…

Cheers!