Jan 23

Prawn’d by Scruffy, Gruff

I’ve been putting together an automated report for my team, and decided to give prawn and scruffy a try.  I ended up using Gruff, but here are some of the lessons along the way:

  • Scruffy has issues with bar charts and values from 1-3 (actual values were [1,3,1]).  I was able to get around this by setting a minimum value of 0 and a maximum of (datapoints.max + 1)
  • Scruffy failed, miserably, when I just had one column.
  • Prawn has issues, potentially, with png’s generated by gruff (It’s actually a rmagick issue).  The easy way to get around this is to generate a jpg.
  • I’d seen indications that you could use to_blob to generate the jpg, and yes, you can, but it won’t
    1. Write the file
    2. If you attempt multiple generation types in sequence, it creates multiple copies of text in the resultant graph, and they don’t always line up.

Right now I’m working on packaging with rawr. Once that’s done, I’ll publish my results.

Jan 14

SSL and Java Keystores

If you happen to change a machine’s name, be sure to delete the previous definition from the keystore.  Otherwise it will complain mightily and, indeed, fail when you attempt to add in the pem file.

Dec 17

JBoss and Sesame Street’s Count

One, One database record!
Two, Two database record!
Muahahaha!

By default, when using datasources with JBoss, it does a count to validate a connection, both on creation and when it is requested from the connection pool.  It looks something like:

select count(*) from x

Now, this can take take a while when working with tables containing 1.8 million rows and growing.  That said, the datasource config file has two properties which can be set:

  • new-connection-sql
  • check-valid-connection-sql

These allow you to specify something like

count 1 from x

which runs a good bit faster.

Dec 02

The “A” stands for Asynchronous

So, I have a piece of code which goes out and updates a list.  I’m using Ajax.Updater from Prototype.js, to get data back from the server. In my javascript, however, I’m immediately after kicking off the Ajax.Updater, doing processing based on the results from the update. And they’re out of sync, of course.

It just so happens that Ajax.Updater is not recognizing onSuccess. So I have to rewrite — not a big deal, more amused with myself for forgetting the ‘A’.

So, I need to use Ajax.Request.

Nov 25

Upgrading rubygems on Ubuntu

Maybe it’s me.  Maybe it’s a feature of ubuntu, but on two separate systems, when I went to upgrade rubygems to the latest via

gem update –system

it didn’t work for me.  So, I had to go the more extreme route of:

gem install rubygems-update
updatee_rubygems

This is mostly for my own reference, it’s not the first time I’ve had to do so…..

Nov 18

Signs I’ve not had enough sleep

I just named a rails controller class ElmoController, because it gets invoked by a tickler…

Nov 14

Concatenation Note to Self

To concatenate in PHP you use a ‘.’, not a ‘+’.  Likewise, you don’t use ‘.’ to reference an object’s members, you use ‘->’. 

Move along, nothing to see.

Nov 12

DIY Maps and Linux Firefox/Flash Quirks

First off, let me say that I really like DIY Map. It’s quick, and responsive, with an easy to use interface, as well as allowing you to make changes on the fly easily.

That said, I discovered lastnight / this morning that there are some quirks with its updating through the Flash JavaScript Integration Kit.

First of all, the only way I’ve been able to get paths to resources to work is via relative paths.  More on why I think that is the case in a moment.  I was finding that resources were not being found until I used relative paths.  Once I did so, that part worked just fine.

Second, in order to be able to update the map, it needs to be fed an XML data file, which is fine.  Wherein lies the trouble is when you are attempting to feed a dynamic file (like a cgi script or php) — I’ve not been able to get it to work, despite having the right data in the output and the proper content type — the data works just fine when loaded from a file, however…  So, my workaround is to write to a temporary file and use that file to make the changes.

Third, and this was a kicker….  The Javascript integration kit isn’t talking to Flash 9 on Firefox 3.0.3 under linux.  The messages get lost out on the bit bucket.  Just to make sure it wasn’t me, I also tried the examples which came with the app.  They, however, work on Firefox under windows.  So, I don’t know if it is something having to do with my box or what…  But it ain’t working.

4+ hours spent  on this.  Meh.  It’d be a bit more amusing if I’d gotten more sleep.  I napped for about an hour around midnight, and another nap at 7:30am until I had to get up for work @ 9.

Nov 11

YUI Datasources

Been a while since I’ve written.  I’ve been sick and working on a side project.  That said, I’ll be writing more……

Today’s note/reminder is a gotcha about YUI datasources.  If you have JSON feeding the datasource and you’re getting back more fields in the results than you’re expecting, the datasource will not behave properly.  For example, if you’ve declared that you’re getting back

  • name
  • id

But in reality you get

  • name
  • id
  • address
  • email

it will just sit there. Very frustrating. Very fun trying to debug, too!

Oct 20

New Favorite Pencils

I’m a stationary supply junkie.  I admit it.  I love pens, papers, notebooks….  I’ve just found a new favorite pencil.  Barnes & Noble has a small section of art supplies in a local store and one of the items they have are graphite stick pencils.  At first grasp, they feel a little heavy — about 2-3 times the weight of a Dixon ticonderoga.  But after the initial shock, I really like their solid feeling.  And they really flow well across the paper.  A set of 10, with  two each of HB, 2B, 4B, 6B, and 8B pencils is $5. 

I was not compensated in any way for this post…  Just a happy user.

Older posts «

» Newer posts