Code

Bit Dust

Posted in Code by Daniel Von Fange on Saturday, May 10, 2008

I beg your patience, as over the next few weeks I slowly merge my two previous blogs into this one.

You’ll have a close up view as I finish this out.

The Ruby Way

Posted in Code by Daniel Von Fange on Monday, November 15, 2004
Coming to Ruby from Java:
Ruby is a subtle language. If you come to it after mastering another language like Perl or Java, it's easy to write Ruby code that looks a lot like the code you used to write in your previous language. Now, writing code that way won't take any longer than it would've taken in your previous language. But if you decide to become another disciple in the burgeoning Ruby cult, you'll have a lot to gain by absorbing the various Ruby idioms. You'll write clearer code in less time, and you'll write less of it while accomplishing as much as you had before
A recommended read.

10k Lines per day

Posted in Code by Daniel Von Fange on Thursday, November 04, 2004
Alltech Consulting Services is looking for superman.
PERL/VBA Programmer Required Experience: Developer with extensive knowledge of PERL and ability to code 7.5K to10K lines per day.
Yow. Via the daily wtf. On an unrelated tangent while of ten thousand lines, there is the story of Master Foo and the Ten Thousand Lines. (Why I dislike C.)

TextMate Todo

Posted in Code by Daniel Von Fange on Tuesday, October 19, 2004
I just changed to having my "todo lists" in TextMate. Previously I've used Omni Outliner and Tinderbox, but I wanted to experience the unix way for a few months. Pervasive user scripting inside a text editor is a major mental shift. Here is a bit of scripting that fetches my current assigned tickets from our project's trac site and replaces my current selection with todo items for the tickets:
#!/usr/local/bin/ruby
# Note: This script requires ruby 1.8

require 'open-uri'
require "rexml/document"

puts

xml = open("http://devsupport/cgi-bin/trac.cgi/report/4?format=rss").read
rss = REXML::Document.new xml
rss.elements.each("//item[author/text()='DanielVonFange']/title") { |element|
   task = /(#[0-9]+): (.+)/.match(element.text)
   puts "[ ] #{task[2]} - #{task[1]}"
}
Another small script is for my completed todo items. I click on a line, press command-shift-D, and the todo item vanishes from the list, and appears in a log file along with the time that I finished it, and what file it came from. Log entry:
[X] Blog Textmate converting me to a unix head - Tasks rip, GTD completion.
      in Blog 08:48 20041019 Tue
Log script:
#!/usr/bin/ruby

task_text = $stdin.read
task_text.gsub!(/[ ] /,"[X] ")

from = File.basename(ARGV[0],".txt")

File.open("/Users/dvf/Documents/Writing/Life/plan/Completed.txt",'a'){|archive_file|
   archive_file.puts
   archive_file.puts task_text
   archive_file.puts "      in #{from} #{`date "+%H:%M %Y%m%d %a"`}"
}
This script must be saved to a file, and then called as command, passing along the name of the current file being edited. So it the command in TextMate would look something like this:
ruby /path/to/script/task_completed.rb  $TM_FILEPATH
These are just quick hacks, but I'm slowly learning the way of the scripted editor.

SMIL

Posted in Code by Daniel Von Fange on Wednesday, October 13, 2004
I needed to display four separate sets of video and pictures across four monitors hooked up to one computer. The images needed to be shown at the full 1600x1200 resolution of the monitors, while the video needed to be scaled up to that size. While bumping around, I ran across Quicktime's support for SMIL, a W3C standard for munging video, audio and pictures together. After a little bit of learning I've written a ruby script that goes through a folder of media for each screen, and creates an XML file to present it. It works well.

Laszlo goes Open Source

Posted in Code by Daniel Von Fange on Tuesday, October 05, 2004

The rich web application toolkit Laszlo just went open source. I’ve wanted to mess with Laszlo for a while, now maybe I can find an excuse.

The Laszlo in ten minutes area allows you to step through the basics of writing Laszlo’s xml file, and get live feedback on your modifications of their tutorial. It’s a great way to get a feel for simple development.

Whoo hoo.

Payment history mini graph

Posted in Code by Daniel Von Fange on Monday, September 06, 2004
Here is an experiment in displaying a customer's payment history. Each bar is a project. The width of the bar shows the dollar value of a project, the length how many days it took to be payed. At a glance I can compare how big of a customer they are, and the size of the projects, and how well they pay. Pretty cool. (I'm using this on my internal project "Dashboard" that I've built)
Page 1 of 39 pages  1 2 3 >  Last »