Peter's Blog

Redefining the Impossible

Posts made during May 2008


I upgraded my home desktop to Ubuntu 8.04 (Hardy Heron) as soon as it came out last week. I used the feature in the Upgrade Manager which told me the new version was available so doing the actual upgrade was fairly idiot proof.

Since then Firefox (version 3 beta) has been broken, the menu's don't work, I click on them and nothing happens, as if they were disabled. Also the user interface locks up after five to ten minutes of doing anything. When it happens again the menu's die, the mouse moves about and some of the panel widgets work but essentially it is useless. Ctrl-alt-backspace fortunately works so I can reboot the desktop and start again.

World of Warcraft is the only thing that works for any period of time ( smile ). Apart from that the system is useless and I've had to use Windows.

I've googled and found other people complaining about 8.04 but they appear to have kernel lockups which would be much more dire.

It's a pity as I had been enjoying using a linux desktop. The only thing that didn't work before was my printer and I hadn't put any effort into fixing that.

I had already upgraded my Mythical Convergence Box to Xubuntu 8.04 which is Ubuntu with a lean mean xfce user interface rather than gnome. Xfce gives a passable Windowsy level of functionality. That box is running just fine and now reacts to the Hauppauge Remote Control. Unfortunately 8.04 has a newer version of mythtv so if I rolled my desktop back to the previous version (gutsy gibbbon) I wouldn't be able to use a gutsy mythtv frontend with the hardy backend and I don't want to roll the myth box back.

When gnome is working on Hardy it has changed it's behaviour somewhat. The application menu works in a contrary way such that the menu is only there while your mouse button is down so you press your mouse down to open it, find your menu item while holding the button down and then release to activate. I can see that this needs just a mouse down and up rather than two clicks but it's annoyingly different, especially as I can't find a way to turn it off.

Gnome also has interesting behaviour when moving windows around in that it tries to guess where you are dragging it to and how big the window will be. I can drag a maximised app from one screen to another and even though the screens are different sizes I get the result I want. I think this may actually be useful once I learn to predict what it is going to do.

Conclusion: I wish I'd waited for 8.0.5 sad I may go back to gutsy on the desktop and live without the myth frontend for a while. I don't want to go back to windows.


Filed under: linux mythtv ubuntu

Add a comment

I resolved my issues with Ubuntu hardy heron. Extensive googling revealed I was pretty much alone in my misery so I fixed it the Windows way, with a clean install. To be more accurate, I installed Xubuntu rather than Ubuntu and I'm glad I did. The difference is that I am using xfce rather than gnome and so I'm missing a lot of gee whiz features but, oddly enough, I've never found anything extra in gnome that I can't live without. Gnome development seems to be going in the direction of dumbing it down to make Windows converts feel at ease and all the brilliant new features of gnome are cunningly hidden in case Windows folk turn them on by mistake and their brains explode from the amazement and confusion.

I reinstalled as follows:

  • backed up my xorg.conf in case I broke my carefully crafted X setup.
  • backed up assorted irreplacable stuff in my home directory. How nice it is having a home directory, one place to store all my files.
  • downloaded and blew xubuntu install cd
  • swapped my primary and secondary monitor leads as I am sooo sick of my small secondary monitor being considered the primary monitor (despite my protests).
  • booted cd
  • selected install option
  • cd booted and gaved me a totally orange desktop
  • rebooted cd and pressed f4 for safe graphics mode
  • ran install, carefully overwriting my old linux setup
  • install complete.
  • make sure the nvidia restricted (urgh nasty closed source) driver is installed.
  • Most importantly, run
    sudo aptitude install nvidia-settings
    nvidia-settings
    
    to set up the multi-monitor. I've learn from my last install not to touch the main display control panel.

Um, that's it. It was easy and took maybe 30 minutes (which didn't include downloading the cd image).

Xubutu has a great advantage over ubuntu: a crisp blue theme instead of that brown!

One problem I am having with all the (x)ubuntu work: I have to type my password about 300 times a day, both for ssh and sudo and it is driving me MAD.


Filed under: linux ubuntu xubuntu

2 Comments

Maezyn

Maezyn went out to tame a plague swine for some next rank gore and charge and somehow ended up in Winterspring taming Rak'shiri:

Maez and Blue

Maez and Blue

Fate drew me to Winterspring as I fancied taming a good looking cat and Rak'shiri happened to be there. I didn't really want to tame a level 57 and have to level it up to 60 but he was so good looking that I couldn't just kill him.

Back to questing in Hellfire and by the time Maezyn was half way to level 61 Blue, as I renamed him, had dinged 60! He was on the olf Azeroth experience quotas and not Maez' hellfire quotas so it wasn't so bad.

He came with Dash 3 and I had to tame a Winterspring Owl to get claw and he still doesn't have bite but he looks good.


Filed under: games warcraft wow

2 Comments

I think I was aware of the existance of something called Netbeans in the Java world but for some reason I had always assumed it was some kind of object packaging thing, like Java Beans.

I had been using E Texteditor for about three months and a few things were niggling at me about it:

  • My project has many files and I have many files open at once. The files all open in tabs and soon I have too many tabs to be shown in a horizontal bar. With E I end up having to horizontal scroll all the time to get to the tab for the file that I have selected: it doesn't automatically scroll to that tab. As I say, it's a niggle but I've done it too many times.
  • It comes with lots of textmate bundles and more can be downloaded but first you need spend time working out what they are supposed to do and how you are supposed to use them, then you have to determine just how broken the script is after its port from an OS X environment and whether you can be bothered to fix it.
  • Unlike every other editor on the windows platform the INS button doesn't toggle into overwrite mode.
  • I became familiar with it and started to get bored. It lacked depth apart from writing my own textmate-like stuff which I don't have time to do.

The one thing that kept me using E was the ruby bundle that dumped unit test output into a window with stack traces so I could easily click on a line where an error occured and open it in the editor.

Still I started researching what else was available. I use linux at home all the time now and I wanted a cross platform editor/ide.

First I tried Jedit which is another editor written in Java. While it has many features it had a number of it's own niggles:

  • the way it displays text is just ugly. It has trouble rendering fonts in anything like a crisp and clear way. There are settings for subpixel antialiasing or whatever it is but I couldn't get it working nicely under Windows. It was better under Ubuntu.
  • (silly niggle) instead of a single tree the file manager has two selection controls, a tree for directory and another for the files in the directory. This means mucho switching between the two controls and just reminds me of Windows 3.1 file open dialogs. The project manager is better and has the traditional single file selection tree holding both files and directories.
  • the mechanism for running a command and capturing the errors wasn't set up for ruby and I didn't feel inclined to develop a regular expression to parse them. Laziness on my part.

The font thing put me off Jedit the most, it's just awful.

Then I found Netbeans and discovered that despite the misleading name it's an editor/IDE. It comes from the java world and is written in java but it has plenty of modules available to support C/C++ and Ruby/Rails. And the Rails support actually works. I'll emphasise that again, it works. Unlike the fragile stuff in Eclipse and the half-hearted E texteditor bundle ports, the rails features work and are usable: this is an environment that I can use without having to keep a command line open in the background.

The rails support gives me:

  • can run and debug a rails environment from the IDE. If I'm editing a file for a rails view, for example, I can press CTRL-R (not the default) and it will start a rails server and open firefox and the URL that relates to that view! The way it runs the server from the IDE is robust and I can even hibernate my laptop, resume and continue running it. That's robust.
  • When I say debug I mean the debugger works. It's not an interactive debugger in that I haven't found a way to evaluate expressions from a breakpoint but just being able to breakpoint, single step and watch variables is something.
  • run a rails console from the IDE. This is nice except the up/down keys don't work for command history which is a major downer.
  • run migrations
  • The project tree for a rails application displays the project directories in a slightly flatter way which makes navigating the project much easier. For example, the app directory is suppressed. It's still in the file system but the project doesn't bother to display it.
  • Pressing ctrl-shift-a in a view will take you to the controller for that view.
  • Pressing ctrl-shift-t in a controller will take you to the tests for that controller.
  • There is a built-in database client that lets me browse the mysql databases and run SQL statements.
  • There's a built-in gem administrator that shows me what gems I have installed and, interestingly, lists what more are available. This works better under windows than linux as under the latter it is unable to run sudo and install new gems.
  • Administer the rails plugins in a project.

General Features:

  • Very nice project-search facility, best I've used.
  • Refactoring that works! Want to change the name of something, run the refactoring, get a preview of what changes it will make, then apply the changes. I've never dared to try refactoring before but I could use this.
  • Runs just as nice on windows and ubuntu.

Netbeans annoyances:

  • Initially Netbeans wouldn't run, it would just lock up on opening. I tried installing a development version, googling etc but no joy. I was determined to get it going and ultimately I downloaded the Process Monitor to see what it was trying to do. It turned out that it was trying to use the cygwin version of subversion for something or other (who knows what) and this was locking up. I resolved the situation by simply renaming the cygwin svn.exe to svnhidden.exe and netbeans could start. Once it was sentient enough to open a settings window I installed a windows command line version of subversion for it to use. I'm going to add some keywords here to help other googlers find this fix: netbeans hang lockup freeze dammit ffs.
  • Double-clicking in the project tree doesn't always open a file. Often have to right click and click on open.
  • Can't seem to use save-as to copy a file. Have to go through irritating 'new file' wizard and copy/paste.
  • No apparent python support, not that I care much these days.
  • Not sure how well it would support a mixed ruby/c development project.

Conclusion: Netbeans is the nicest rails environment I have found so far.

UPDATE: don't just take my word for it.


Filed under: e editor netbeans

2 Comments

Not posted for a while, not been playing quite so much, what with hot weather and all. I have made some progress though.

Maezyn

I spent a number of hours levelling her leathercrafting to something respectable. This involved farming thick leather in Blasted Lands (just outside dark portal) and then rugged leather in Winterspring. I bought the last stack or so of rugged on the AH as I couldn't stand the farming any more. All I made I sent to Maexyn for disenchanting. Maezyn then used all her Knothide leather to get up to 307.

At this level she can start making Felscale Gloves, the first item in the Felscale Armour set that ultimately yields heaps of agility and attack power. Good Stuff. The only odd ingredient these things need is Fel Scales that drop from ravagers.

She is 70% of the way to level 61.

Maesyn

Maesyn spent time in Darkshire killing easy (lvl 20) wolves and in Wetlands killing harder (lvl 26) Dinosaurs. She was level 26 and wasn't very dominant against equal level dinosaurs, lots of drinking and downtime. Most killing was cat form, any bear form work is still very poor, she struggles against two equal level mobs. Not sure what I'm doing wrong, maybe leaving the shift to bear form too late, don't know. Did the obligatory Sarltooth kill, him being 29 and very close fight, Maesyn was left with nothing visible in her health bar. Cat form isn't all that pew pew but maybe it gets better at higher levels?

Go to level 27. Here I tried gearing her up with level 27 kit, Maezyn made her some barbaric bracers, a blue, and Maexyn enchanted what she could.

Maexyn

Now Maexyn IS pew pew. At level 40 she was grinding level 43 dragon whelps in badlands relentlessly. I was using the Imp as a mana battery and doing this she can kill continually, not downtime required, just top up the mana from the imp at the end of each fight. It was very sustainable, the only limiting factor to fighting like this is the durability problems from Maexyn being hit so much by dragon fireballs.

The dragon whelps didn't drop anything nice like quest objectives or whelplings but did drop a new +stamina warlock pointy hat that increased her stamina by about 10%. It's blue and doesn't go with her purple robes but stamina is stamina.

She went to STV and carried on grinding level 43 naga but these hit harder and she had to switch to voidwalker which she continued with. She's a few quest turnins from level 42 (eighties pop group blah blah).

Saw a moonkin druid doing a kill/drink/kill/drink slog while Maexyn killed one venture co after another. I hope druid play doesn't get too pally like.

Enjoying warlock at the moment, nice and over powered. It takes a level 43 elite dragon to stop her and then she has soulstone up so it isn't a big deal.

I had a browse through her stocks of enchanting materials. I find it hard to follow which items are which level but I've auctioned all her strange dust as I'm not sure she still needs it. For all the other stuff: lesser/greater dream/vision/nether/astral/whatever dust/shards I have no real idea of what is useful and what isn't. I found that she had over 100g's worth in one stack of six shards so her stocks are worth something.


Filed under: games warcraft wow

4 Comments

I've been trying out rspec, a new testing framework for ruby that allows one to better follow the principles of Behaviour Driven Design (BDD). BDD is a step on from Test Driven Design (TDD) approach exemplified in the standard ruby unit test framework. TDD is the process of starting ones development by writing the tests that your new module should pass. As you write each test you then implement the code to pass it and hence, voila, you have nicely designed and robust software. In BDD you approach testing the code from how it is supposed to behave. When liasing with clients this is a better approach as everyone can talk in the same language, essentially in terms of requirements so one can try to get less bogged down in implementation details.

Here are some rspec tests for a class I have been working on:

   1  describe ReportHelper do
   2    before(:each) do
   3      #
   4      # Create a new clean Report class for each individual test
   5      #
   6      @oReport = ReportHelper::Report.new
   7    end
   8  
   9    it "should allow a column to be added" do
  10      @oReport.AddColumn( 'First Column')
  11    end
  12  
  13    it "should allow multiple columns to be added" do
  14      @oReport.AddColumn( 'First Column')
  15      @oReport.AddColumn( 'Second Column')
  16    end
  17  
  18    it "should allow rows to be added to the report" do
  19      @oReport.AddColumn( 'First Column')
  20      @oReport.AddColumn( 'Second Column')
  21      @oReport.AddRow do
  22        # pass
  23      end
  24    end
  25  
  26    it "should only allow rows to be added if columns exist" do
  27      lambda{ @oReport.AddRow}.should raise_error(RuntimeError, 'No columns defined')
  28    end
  29  
  30    it "should return simple cell values" do
  31      @oReport.AddColumn( 'First Column')
  32      @oReport.AddColumn( 'Second Column')
  33  
  34      @oReport.AddRow do |oRow|
  35        oRow[ 'First Column'] = 98
  36        oRow[ 'Second Column'] = 198
  37      end
  38  
  39      @oReport[0]['First Column'].should == 98
  40      @oReport[0]['Second Column'].should == 198
  41    end
  42  
  43  end

Each test has a descriptive string that can be interpreted in two ways: as a test that must be passed or as a requirement for the software. The rspec toolset includes something that will pull out all these strings and give a summary of what testing has been done/what the requirements for the software are. If an auditor asks how the software is tested, bang, there is a full report of the tests. At a practical level (i.e. makes life easier for me) I prefer this to the ruby unit test system where one has to think up meaningful_method_names for each test. The strings are easier to write and read and reduce the need for comments.

Example report:

ReportHelper

- should allow a column to be added
- should allow multiple columns to be added
- should allow rows to be added to the report
- should only allow rows to be added if columns exist
- should return simple cell values

Rspec contains sweeter syntactic sugar than the ruby unit test module. For example, rspec overloads every object in the system with a 'should' method for doing the equivalent of assert tests:

    @oReport[0]['First Column'].should == 98

Compare this to test/unit:

    assert_equal 98, @oReport[0]['First Column']

apart from more typing, assert_equal has the expectation/actual things in what is intuitively to me the wrong order and I'm always having to correct these lines because the error messages have the terms swapped.

Rspec can test assertions more cleanly:

    lambda{ @oReport.AddRow}.should raise_error(RuntimeError, 'No columns defined')

although it's a pity that the lambda is necessary (and probably no 1 noob trap) but with test/unit the following always seemed like a lot of typing:

    oError = assert_raises RuntimeError do
      @oReport.AddRow
    end
    assert_equal 'No columns defined', oError.message

rspec is nicely integrated into rails, plugins being available to generate rspec tested controllers and models and suchlike, rake tasks to generate documents (woohoo) etc. It is integrated into netbeans and runs ok on Windows although when the tests are run (CTRL-F6) there is a tedious few seconds wasted in startup time. It is possible to run an rspec server in the background to eliminate this startup but it doesn't work on windows native ruby, it gives an error lamenting Microsofts glorious omission of a fork api.

There is much more to Rspec than this. One aim seems to be to write psuedo testing languages and have clients use these to write stories about what the software will do, these stories turning into a test framework. As the slashdot tag goes, 'goodluckwiththat'. At a practical level, I'm liking rspec even if only as a unit test framework with added syntactic sugar.


Add a comment

Netbeans and cygwin ruby don't have a happy relationship. To use the cygwin ruby interpreter it is necessary to launch Netbeans (6.1) with the arguments:

-J-Druby.no.sync-stdio=true

as otherwise Netbeans will pass a windows-style file name to the cygwin ruby that the latter cannot recognise (C:\Projects\Blah instead of /cygdrive/c/Projects/Blah). Unfortunately the ruby interpreter configuration in Netbeans tries to be clever and insists you point it to a ruby executable, you can't give it a batch file that will hack things into working shape.

rspec on cygwin has some similar problems. Here are some hacks to the rspec plugin to make it work from netbeans:

In vendor/plugins/rspec/bin/bin, change:

$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))

to

$LOAD_PATH.unshift(File.dirname(__FILE__).sub( /C:\//, '/cygdrive/c/') + "/../lib")

In vendor/plugins/rspec/lib/spec/runner/example_group_runner.rb, change:

load file

to

load File.expand_path(file).gsub(/C:/, '/cygdrive/c')

Tip: to diagnose problems with 'require' not finding files, put this:

p $:

before the failing line to see what directories are in the load path. If you see 'C:\' and it's cygwin then fix it.

Unfortunately it takes a good 20 seconds for cygwin/rspec to run a trivial test script. The rspec server starts and runs but netbeans/rspec seem reluctant to use it (it runs tests ok from the command line).

Why am I still bothering with cygwin? Because I still want to test gcc C code by compiling it into ruby extensions and using ruby test codes (rspec or unit testing).

In tracing these problems I came across more reasons that Netbeans is worth the hassle:

  • ctrl-tab to switch to last open tab. ctrl and hold tab brings up a handy little context menu to choose a tab from (kinda like windows task switching with tab).
  • press ctrl and mouse over an identifier to bring up rdoc info about it. Ctrl-click to go to it's definition.
  • alt-b to go back to where you came from.
  • click on an 'end' and the matching begin/do/if is highlighted and vice versa, which is damn useful.
  • select an identifier and all matching identifiers in your file are automatically highlighted.

Filed under: cygwin netbeans rspec ruby

Add a comment

My lamentations at lack of pew pew on my druid led to researches which have yielded the existence of the Druid's 'Natures Grasp' talent.

It sounds too good to be true:

  • for 40 seconds gives a 35% chance a melee hit will cause the attacker to be rooted
  • one minute cooldown (i.e. useful in every other fight)
  • available at level 10 for one measly talent point
  • instant cast
  • castable in cat and bear forms
  • zero mana

It's in the balance tree so I totally neglected it, it's a unique decent talent for just one point in tier one of a talent tree. There's me bemoaning boar form and I could have been rooting one mob, bashing another, healing and kicking butt. I never bothered much with the direct rooting spell but the instant cast and being able to use it in cat/bear form makes this far, far more appealing.

I even had a talent point going spare.

Bum

And is it just me or are the affliction warlock talent points after Dark Pact pretty feeble? Tempted to start putting points into demonology.


Filed under: games warcraft wow

4 Comments

Maesyn

Well the Natures Grasp is handy, not life changing but still useful now and then. A couple of times she fought in cat form and her health got low so she cast this, rooted the opponent, then casually stepped back, healed and then laid in with long cast spells. Maesyn spent level 27 fighting Worgen in Darkshire and really the most useful druid ability was being able to run away quickly! Bear mode still seems crap to me, I'm still missing something. If she is pulling and likely to pull two mobs then maybe she should cast a renewal (instant HoT) then shift to bear but in a normal cat fight, if an add comes along it is normally too late to shift to bear.

Level 28 and Maesyn got a fistful of next ranks so her next trip to Darkshire yielded level 29 quite easily. Not long now till she gets Travel Form and she can run away that much faster!

Maexyn

Ran meax enough to get her to level 42. Was delighted to find that this gave her Death Coil and I can see now why PvPers hate warlocks: an instant cast fear than damages the foe and heals the warlock. Me like.

Was browsing through her spell book and found the Curse of Tongues that appears to halve an opposing casters ranged dps. How did I miss this one? Trying to run too many classes at once probably. I get to a new level, rush to the trainers, get loads of new spells, logout, then run three other classes before returning.


Filed under: games warcraft wow

4 Comments