Archive for the ‘General’ Category

Jabra BT250V Bluetooth Headset

Its 2007, I’m tired of driving around and not being able to pick up my handset (or doing so, and looking over my shoulder), and its just so much fun chatting into blank space (to onlookers). Okay, all that’s a lie. Stewart & I were looking for a power adapter for his laptop, and we found a closing CompUSA store; Bluetooth headsets were going off for about 50% discount, so I only paid USD$30 for this baby. Go Jabra BT250V!

I hesitated in its purchase, not sure if the charger will blow up when I bring it back to Australia, but the store clerk was ridiculously helpful in finding out. The Motorola headset that was for sale was about half the size of the Jabra, but according to the store clerk, he’s received complaints about the Motorola. Plus the Jabra advertises that it performs better against wind. So I picked it up on a whim.

No returns for me (considering I was going to hop on a plane in a couple of hours after said purchase). Charged it up yesterday, paired it with my Nokia N73, and I’m a happy caamper. It just works. In fact, I can voice dial using the Jabra as well.

It comes with a Mini Gel, and that can be changed depending on which ear I want it configured for. I must say, the behind the ear design is a little odd, so it takes some time to get it on my ear, but once that’s done its a secure fit, and seems rather comfortable. It advertises 8-10 hours of talk time, I haven’t tested it yet, but with a 2 hour to full charge time, I’m kind of impressed. Did I mention, it vibrates, when you’ve got a call – so my phone can be in silent (non-vibrate) mode in my pocket when I sit in the train, and still answer my calls with great ease.

What I do dislike about the charging scenario is that I have yet another American style charger (ick! but not the Jabra’s fault), and you need the little charging dock that comes with the Jabra. You can’t just plug the charger in, which seems a little daft, so this is extra stuff I’ve got to carry when I travel.

Technorati Tags: , , , ,

svrc2007 links

More so that I will remember, the 2nd Annual Silicon Valley Ruby Conference 2007 have some interesting web links.

  • sv ruby conf on Tumblr – looks like Twitter for groups? They sell it as “blogs with less fuss”, but I’m definitely not signing up for yet another blogging platform.
  • Conference Meetup site for svrc2007 – this is pretty cool. People logs, make connections, upload presentations, plan gatherings. This is something conferences should definitely look at having running. Its just cool stuff.

I’m sure if you search on Flickr or Technorati for svrc2007 or something similar, that tag will be used…

Technorati Tags: , ,

ActiveRecord

ActiveRecord, by Rabble.

  • Rails ActiveRecord is mostly database agnostic.
  • Good subset of the SQL standard is supported, so you can migrate very easily (this is what OS X Leopard will do – develop using sqlite on your workstation, then migrate to mysql on the server).
  • Integer primary keys, and classname_id foreign keys. Single table inheritance is what really works well.
  • What ActiveRecord doesn’t like:
  1. views
  2. stored procedures
  3. FK constraints
  4. cascading commits
  5. split/clustered DBs
  6. enums
  • Complexity is best located in the code, not in the database, according to the Rails developers.
  • Avoid SQL injection with find. Use an array or let it do the quoting for you. By itself, it allows you to do stupid things – so avoid cross site scripting, etc.
  • Joins are very rarely used, you use ActiveRecord relationships.
  • Some associations:
  1. has_one – when the FK is in the OTHER table
  2. belongs_to – when the FK is in THIS table
  3. has_many
  4. has_and_belongs_to_many
  • DBAs like FK constraints, but the Rails way is to really just use validations.
  • ActiveRecord returns enumarable objects, which look like arrays
  • ActiveRecord also allows for output formats – like to_yaml, to_xml, to_json. So your database records can become XML pretty easily.
  • find_by_sql – use it when you’re finding ActiveRecord isn’t suitable for you, i.e. you’re doing something that is not very standard.

Rabble also gave us an anecdote from his Odeo days. They thought that grabbing feeds should be done in parallel. Which is when they used RubyThreads. And suddenly, they were getting some horrendous database problems, duplicate records and so on. Moral of the story: RubyThreads and ActiveRecord don’t mix. A member of the audience mentioned that using find_by_sql consumed about 1MB of memory in his application, however, using ActiveRecord to do the same thing was costing about 20MB per thread.

Technorati Tags: , , , , ,

Business Scripting Languages or SAP’s marketing talk + Stanford HCI mashup

The after lunch talk on Business Scripting Languages, by Asuman Suenbuel and Murray Spork was something I found very hard to stay awake in. In fact, I think so did many others, some of whom walked out of the room.

The first half of the talk was filled with SAP marketing spiel, something I think should sincerely stay away from conferences that are tech-oriented. When you hear a word like “SOA”, you already know you’re in the wrong talk. Greg the architect video (link courtesy Leslie Wu), now that was funny. Saving grace, and they do mention the movies are not from SAP. Figures. SOA is like a clothes wardrobe was the other video, with some somewhat hot looking girl – sure, again, saving grace.

Model-driven development (this is not UML – this is more like the Eclipise Modeling Framework, etc.) vs. Ruby Domain Specific Languages (DSL’s) [What is a DSL?]. SAP utilizes a modeling framework (MOIN), and supports external DSLs (unlike Ruby where you’ve got an embedded/internal DSL).

Ruby + SOA is about flexibility, is where they concluded off. I think thats an hour I’m never getting back, but thank goodness I have my laptop lying around and actually was getting other work done.

I was surprised that they never mentioned MaxDB once. They do follow MySQL naming schemes, calling things “connectors” though.

More interestingly, was the video, titled Rapidly prototyping web applications with d.mix, presented by Leslie Wu, from the Stanford HCI group on Ubicomp. Its a cool mashup, and while I haven’t investigated Yahoo! Pipes yet, it looks like it just may be something similar, except that Ubicomp also supports hardware interfaces. Of course, the other thing about Ubicomp is that I can’t actually can’t test it. The publications on their website are worth a read though (see, I told you I found a use for the one hour wasted on SAP). Relevance to Ruby? They use it – Ubicomp is built with Ruby.

Technorati Tags: , , , , ,

Making & Breaking Web Services (with Ruby)

Chris Wanstrath (ex-CNET, now freelancing) worked on Chow and ChowHound, and thats Ruby and MySQL based, as opposed to PHP which is something they normally use. At last years conference, he arrived still as a PHP programmer. He transformed to a Rails programmer in only a year!

The Ruby SOAP library is really hard to debug. It however, creates methods on the fly, and the library itself is reliable. mocks is a good way to test SOAP, or Mocha.

Microformats – the website is your API. Just use semantic markup, that tell the pareses what information is important. They’re very easy to add accessibility to the stuff that you already have there. mofo (sudo gem install mofo) is a gem to parse microformats. Corkd – another rails site? mofo supports pretty much everything – hCard, hCalendar, hReview, hEntry, hResume. hEntry is what they used to get recent blog posts displayed on Chow, from ChowHound (because they’re two separate applications).

Hpricot allows you to scrape pages (and a whole lot more). Its written in C, and its really fast. Great for scripting.

Cheat.errtheblog.com – stores cheat sheets. And its a command line Ruby application that pulls information off a web service. The web site itself is some sort of wiki (diffing changes, logging everything).

Technorati Tags: , , ,

Selenium for your web application testing

Selenium looks cool. Sure, its slower than unit tests, but its much faster than a human. It uses the web browser itself, to get your tests going, and will test it just like how a human tests. In a continious build farm, you can have good browser compatibility testing (run it against IE on Windows, even), and it also does functional testing.

It’s not only for Ruby, it works with Perl, Python, PHP and so forth. Its good for regression testing, and uses JavaScript. This means its very cross-platform, and cross-browser compatible.

How does it work with Flash? The new version of Flash apparently has JavaScript support according to Alex Chaffee, and you can actually use Selenium if need be. A member of the audience did mention that he had tried it, and its a little icky.

When testing web apps, getting titles are important, to see what the title of the page says – do it frequently in testing, because sometimes with web apps, you don’t get a 404 error, but a 200 OK (even though the page itself says it has failed). Write your tests early. Selenium can become slow – consider refactoring, or maybe move it to unit testing. It also has a slow mode, and it might be useful for a demo of your application even (well, you can see the login, and so forth). Polling architecture, web apps will time out – a somewhat sensible timeout is about 20 seconds, even if you’re on a very slow connection – any longer, and you’re probably not generating the page and its a (timing) failure.

Selenium doesn’t work well with testing file downloads. And on Firefox, you might need to use the Chrome extension. Cookies stay on between tests, so this can leads to tests passing when run alone, but failing when run together – solution is to eval JavaScript to clear cookies between tests. In Firefox, you can specify the name of a profile and launch it in a clean browser – Selenium by default, makes a new profile by itself – this really helps as some Extensions might affect your tests. On Linux, this is firefox -ProfileManager.

Peer To Patent, a community patent review site (and it will be open source!). Its tested with Selenium, sponsored by the USPTO, and looks like something that can definitely be useful in making sure silly patents aren’t passed (when the patent officer doesn’t know there’s prior art). When asked at the SDForum Ruby on Rails gathering, how many held patents, I’d say about 15-20% of the crowd raised their hands! Impressive number, but then again, I’m sitting in the Silicon Valley, what did I expect, right?

Continious testing architecture? Mac Mini, Parallels (Ubuntu, Windows), they use coherence mode of Parallels and IE sits and looks like a “native” application. All tests run, and the Ubuntu virtual instance is what launches everything. Testing thus happens on everything – OS X, Linux and Windows.

Technorati Tags: , , , ,


i