Dave Landers

Dave’s thoughts (such as they are)

Archive for the 'Misc' Category

Last (hopefully) Lion issue

I was getting frequent lockups – I wasn’t sure initially what was going on, but it became apparent that it was something related to Eclipse.  While eclipse was building my projects, it would crawl to a halt (always at the same place on the same project).  Other apps would be responsive- for a while, but eventually everything would crawl to a halt.

I think the ultimate issue was actually with the Java VM.  I had two entries in my eclipse.ini: UseConcMarkSweepGC and UseCompressedOops which I had added per the ScalaIDE docs.

Once I removed these, things started behaving again.  I didn’t like using the concurrent mark and sweep algorithm anyway, as I thought the pauses were worse.  But something is certainly misbehaving in that algorithm (or in the VM as a whole) with Lion to allow it to lock up the entire machine.

It seems that the JDK available for Lion has at least changed some defaults (like the memory sizes I discovered earlier) and possibly some other things (memory/gc/hotspot-related).

Comments are off for this post

And another thing

The Lion upgrade deleted all (except one random guy) in my address book contacts.

I restored the ~/Library/Application Support/AddressBook folder from the TimeMachine backup pre-Lion and everyone is back now.

Update – No, it’s not back.  This was not Lion doing this, but iCloud.  Every time I turned on iCloud to sync Contacts, it deleted everybody (apparently preferring the empty list on iCloud to the full list on my Mac).  The solution (after many restores from backups) was:

Turn on iCloud on my iPhone (I had not done this previously).  Sync contacts from there (after a short prayer).  That did preserve my contact list (whew) and got everything up to iCloud.  Then, turning on iCloud at the Mac did sync properly.  Finally.

Apparently, this whole business of trying to make my computer work like a phone is not quite there yet – my computer is now in some ways less-capable than my phone.  At least (for now) I can still do software development on the Mac.

Comments are off for this post

XC Ski Overnight Outing

Trip MapI just got back from a fun overnight with my son Paul and his friend Nick. Around Christmas, Paul decided we needed to do a “Cross Country Ski / Backpacking” overnighter. We had planned to go last week while I was on vacation, but we decided to wait due to our colds. So I took off a couple extra days from work and we headed out yesterday.

We decided to hit the Sourdough trail – an area we are familiar with (at least in the Summer). The forecast called for high winds along the Front Range, and snow in the mountains. I figured, due to the area where we were going, that we’d have one, both, or neither :).

We get to the trailhead, and it snowing lightly and somewhat windy. By “somewhat windy”, I mean that my estimate at the time was 60 MPH or more. That was confirmed today as I checked the Niwot Ridge data (a set of CU weather research stations). Their Saddle Site is the closet to where we camped (about 1.5 miles south), and it showed average wind speeds at around 50 MPH, and gusts in the 60-70 MPH range. One of their other stations registered a peak gust of around 106 MPH that morning.
Wind
Fortunately, once we were off the road and in the forrest, we didn’t experience much of the wind.

For the first mile of the trail, the snow was pretty poor – we walked about as much as we skied But south of the Beaver Bog TH the snow was pretty decent.

We made it to the junction of the Wapiti/Baptiste Ski Trails, (about another mile) and decided the location would be a good spot to make camp – the area seemed to be reasonably sheltered from the wind, and there was a good place where we could camp without worrying about snags or widow makers.

We set up camp and built a fire, intending to do a bit more skiing (without the backpacks) but it didn’t happen. Just a quiet afternoon and evening around the fire.

The trip back this morning was nice – more downhill than the trip in. Downhill is obviously easier, but for us novice cross-country skiers carrying backpacks it also proved to be occasionally exciting. But no one was injured, and we had a great time.

I hope to do things like this more often, it was fun.

Comments are off for this post

Collecting for dIon at Software Summit

In past years, at the Colorado Software Summit, we have taken up a collection and given some sort of “surprise” gift to the organizers: Wayne and Peggy.

We’re going to do something different this year. We recently lost one of our “family” – our dear friend dIon Gillard.

This year’s collection will be sent to the Melanoma Foundation (Austrailia) – hopefully we make it less likely that we loose another friend to this awful disease.

If you are here at the conference, find me or Kelvin and please make a donation.

Thanks.

Technorati Tags: , ,

3 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 »