Dave Landers

Dave’s thoughts (such as they are)

Archive for the 'Tech' Category

Colorado Software Summit wrapup

It has been a great week - I’ve now got a lot of things to dig into more. There were things I learned directly from the sessions, and other stuff that I picked up outside the sessions themselves.

I need to try out Virtual Box to host Linux on my Mac.

I want to look at World Community Grid and maybe contribute to something useful rather than my iPhoto screensaver.

I wish I could find an excuse to build an iPhone application - there were several good iPhone development sessions this week. Looks like fun.

I have this proxy application that I wrote and have re-written several times to investigate various technologies. I have a MINA version, and so was interested in the MINA talk this week. After that talk, I think I will now have to re-write it again to wire up the MINA filters and handlers using Spring.

I need to play more with JMX to understand how to use it for configuring and monitoring. Maybe I’ll do this as part of that same MINA/Spring update.

Simon Phipps, talking about standards, asserted that standards should be about Substitutability not Interoperability. That is, if we concentrate on building a standard that lets us Substitute one thing for another we will have a more useful standard than when we focus on interop. I’m going to have to think about that one.

And on Monday morning, I plan to clear the whiteboard and grab the slides and my notes from Subbu’s REST talks - because I have a RESTful service API to build.

What a great week. I am educated, informed, inspired, reconnected … and tired.

Technorati Tags: , ,

No comments

Colorado Software Summit Day 2

More good sessions today, but the best was from my friend Subbu, who talked on Pragmatic REST.

Subbu gave a really great overview of REST - what is it, and how do you do it. This is especially going to help me as I am just starting a project to build a RESTful API for WebLogic Portal, so I have this timely reminder to serve as a guide - thanks, Subbu!

If any of you are interested in REST, I suggest you check out his blog and his slides from this conference (they should end up on the conference web site eventually, or Subbu said he would post them to his blog soon).

Technorati Tags: , , ,

No comments

Colorado Software Summit

I enjoyed day one of Software Summit, now we’re on to day two.

Yesterday, I attended several sessions. Highlights for me included Bryan Basham’s Becoming a JavaScript Wizard and Simon Roberts’ What OO Doesn’t Address

I don’t actually do much JavaScript - I spend most of my time doing server-side stuff. But last year I made a conscious decision to shed my decade-old prejudice against JavaScript, and found it to be a language with some interesting concepts and features. It happens to have most exposure in a browser, but the Java Scripting API (and the inclusion of Rhino in JavaSE) now makes it a compelling option on the server. Bryan spent some time talking about the language basics before diving into browser-based stuff (he mostly talked about prototype for this).

Simon’s talk surprised me - I almost skipped it. I was going by the title, which doesn’t do anything to represent Simon’s entertaining and energetic presentation style. The main take-away I got from this is that we “Software Architects” are (should be) mainly around to inject reality into the design. That is, a pure OO domain model won’t necessarily consider things like security, performance, scalability, networks, usability, etc. Satisfying these concerns requires insight, experience, and a high-level understanding of lots of conflicting issues. And it often means backing down from an ivory-tower design purism.

We had some interesting weather come through in the afternoon - lightning, thunder, and rain. Then it turned to a rain snow mix - some really huge flakes mixed in with the rain. Very wet. The temperature was I thin just a few degrees too warm or we’d had a great snow.

The sun is coming out this morning, and I’ve got some good looking talks on my schedule. Should be another good day.

Technorati Tags: , ,

No comments

Colorado Software Summit - Day 1

It’s now Monday morning at Keystone, and I’m looking forward to a good week of learning and catching up with old and new friends.

For those of you who are unable to be here this year, here is the annual obligatory picture of “the goods”.

Software Summit Goodies
The coolest thing this year is how they are distributing the conference session slides. In the past it was in a big 3″ 3-ring binder. Last year, we got a CDROM. This year, everyone got the slides on a 1.8Gb USB thumb drive. Nice!

Technorati Tags: , ,

No comments

A twitter group bot for Colorado Software Summit

I have created a twitter group and an associated pair of bots for use during this year’s Colorado Software Summit.

Listening to @swsmt

The twitter group is @swsmt. If you use twitter, and want to follow tweets about the conference, then just follow @swsmt.

A few minutes later, you should also see @swsmt start following you. The main reason for this is to allow you to direct message the group. If you remove @swsmt from your followers, it should also then quit following you.

Tweeting to @swsmt

To tweet about the conference, or to send a message to everyone following @swsmt, you can do one of several things:

  • Direct message the swsmt group (For example: D swsmt blah).
  • Reply to @swsmt, or otherwise mention @swsmt in a tweet.
  • Use the #swsmt hashtag in a tweet.
  • Mention "SoftwareSummit" (one word) in your tweet - this will also pick up anyone tweeting a link to softwaresummit.com

When my bot sees any of the above, it will retweet them to the @swsmt account, so that everyone following the group will then see them.

The bots

Twitter has a pretty decent REST API, and I also found a nifty ruby library (twitter) wrapping that. Throwing together a couple of scripts was pretty easy after that.

Syncing friends

The first script I wrote syncs the group’s friends with followers. Keeping these in sync lets the follow act kind of like a subscription to the group.

The script just grabs both the followers and friends lists, and adds/removes based on the diffs between them.

The script is:

#!/usr/bin/env ruby

# synchronize followers/followed
# we do this because followers (those who 'join this group') will see
# all the messages, but we need to make them our friend so they
# can direct message the group

# http://twitter.rubyforge.org/
# sudo gem install twitter
require 'rubygems'
require 'twitter'

group_name = 'swsmt'
passwd = 'XYZZY'   # not really :)

# Log in
group = Twitter::Base.new(group_name,passwd)

# TODO only returns 100
# when we get more than 100, this will probably stop working very well
friends = group.friends.collect{ |f| f.screen_name }
followers = group.followers.collect{ |f| f.screen_name }

# followers who are not the group's friend yet (add them)
followers.each do |f|
  unless friends.include? f then
    begin
      puts "Adding friend (following) #{f}"
      group.create_friendship f
    rescue
      puts "Unable to add friend #{f}: #{$!}"
    end
  end
end

# friends who no longer follow the group (remove them)
friends.each do |f|
  unless followers.include? f then
    begin
      puts "Removing friend (following) #{f}"
      group.destroy_friendship f
    rescue
      puts "Unable to remove friend #{f}: #{$!}"
    end
  end
end

Retweeting script

The retweet script searches recent tweets for @swsmt, #swsmt, or softwaresummit, and retweets that to @swsmt. It then grabs any recent direct messages, and retweets those.

Here’s that script:

#!/usr/bin/env ruby

# retweet messages to the @group
# we'll search for messages with a group hashtag #group or
# referencing the @group
# as well as some other keywords.
# also retweet any direct messages to the group
# run this via cron every couple of minutes to keep the group updated

# http://twitter.rubyforge.org/
# sudo gem install twitter
require 'rubygems'
require 'twitter'

group_name = 'swsmt'
passwd = 'XYZZY'   # not

# search for hashtags, group ref, or conference name
search_query = "##{group_name} OR @#{group_name} OR SoftwareSummit"

# Log in
group = Twitter::Base.new(group_name,passwd)

def retweet(group, from, text, id, lastid)
  retweet =  "Via @#{from}: #{text}"
  retweet = retweet[0,140] + '...' if retweet.length > 159
  puts retweet
  begin
    group.post(retweet)
    id.to_i > lastid.to_i ? id.to_i : lastid
  rescue
    puts "Error retweeting: #{$!}"
    lastid
  end
end
# Keep track of the last ids we retweeted
searchid_file = File.expand_path('~/.group_retweet.searchid')

last_searchid = nil
last_searchid = File.open(searchid_file){ |f| f.gets.to_i } if File.exists?(searchid_file)

begin
  # search for #group hashtag etc
  # TODO this will only return the 50 most recent - if there's too much traffic,
  #   we will drop some.
  Twitter::Search.new(search_query).since(last_searchid).per_page(50).sort {|a,b| a['id'] <=> b['id'] }.each do |m|
    # skip messages from the group itself (probably our last retweet)
    unless  m['from_user'] == group_name then
      last_searchid = retweet group, m['from_user'], m['text'], m['id'], last_searchid
    end
  end
ensure
  File.open(searchid_file, 'w'){ |f| f.puts last_searchid } unless last_searchid.nil?
end

directid_file = File.expand_path('~/.group_retweet.directid')
last_directid = nil
last_directid = File.open(directid_file){ |f| f.gets.to_i } if File.exists?(directid_file)

begin
  # now grab any new direct messages and retweet them
  # TODO this will only return the 20 most recent - if there's too much traffic,
  #    we will drop some
  group.direct_messages(:since_id=>last_directid).sort {|a,b| a.id <=> b.id }.each do |m|
      last_directid = retweet group, m.sender_screen_name, m.text, m.id, last_directid
  end
ensure
   File.open(directid_file, 'w'){ |f| f.puts last_directid } unless last_directid.nil?
end

I’m running both of these via cron. I just turned this on, so we’ll see how it goes.

Technorati Tags: , , , , , ,

2 comments

Next Page »