Stupid monitoring trick: Watch mysql queries fly

1 Comment

Put this somewhere in your ~/bin:

watch 'echo "show processlist" | mysql -u whateveruser --password=mypassword | grep -v "show processlist" '

Now run it and you will have a poor man's monitor, kind of like top but for MySQL. That coupled with screen (or multiple terminals) may give you some quick and easy piece of mind.

This should give you *a lot* of monitoring automation ideas. It should be easy to put together a shell script that puts it all in a little "important things panel" to use watch on. Sometimes that's all you need.

Speed Up Firefox web browser – Ubuntu Geek

No Comments

Ubuntu Geek provides a great little guide on speeding up Firefox. A lot of the about:config settings he proposes changing are already fairly optimal on a Mac, but disabling IPv6 seemed to make the most difference on my case.

[From Speed Up Firefox web browser | Ubuntu Geek]

JIRA To Omnifocus Script

8 Comments

This script logs into your JIRA and creates OmniFocus tasks for each of the JIRA items that are assigned to you, so they sync to your Omnifocus for iPhone, you only have to keep track of one inbox, etc. It only takes a tiny bit of setup.

More

Ruby Appscript – Sweet automation

2 Comments

Yesterday a coworker pointed me to ruby's appscript. I have found it nothing short of amazing.

I love my Mac, and many of us like the idea of automating our software, until we try to use AppleScript to do it. To say that Applescript is professional developer unfriendly is an understatement. I like ruby but to make ruby and applescript talk requires sending strings to osascript in just the right way and getting the output from osascript back. Not a lot of fun at all.

Enter appscript. Appscript is a ruby library that interfaces with applescript seamlessly.

More

Concurrency Strategies for Hibernate Caching

No Comments

Caching and concurrency management are tricky. If you have a cache that lives in memory but you have updates to the database that the objects originally came from, how are you going to make sure that the cached objects still reflect the contents of the database?

This really depends on what type of data you are dealing with. Data types that are mostly read (news, notices, articles) probably benefit from whatever caching you can provide, while areas of data that change a lot (shopping carts, server status records) probably won't benefit from caching at all.

Here are the concurrency strategies on hibernate caching explained:

technorati tags:

More

On the topic of assertions

2 Comments

Every assertion should be thought from the standpoint of

  1. What was expected
  2. What actually happened

Translation: assertTrue should always, always have a message.

Consider the following:

 
assertTrue(mv.getViewName()
    .startsWith(myController.getSuccessView()));
 

This will only return "assertion failed". Which is great, but how do we know what happened? If this is buried on one of the lunt automated remote builds, how am I supposed to know what is going wrong? Which is the expected? What actually happened?

A much better version of the same looks like this:

 
assertTrue(
    "Was expecting something like "
        + myController.getSuccessView() + " but was "
        + mv.getViewName(),
    mv.getViewName()
        .startsWith(myController.getSuccessView()));
 

Same assertion, but now it tells me more specifically what's going on and I can fix bugs with it. Once I set this on the test, it becomes easy to see what was going on.

I recently had a Saturday with some other Bay Area developers where we did a lot of thinking about testing, so expect some more advice in the future as I collect my notes.

Remember the goal of unit tests is to "find bugs" (thanks Harry!). An assertion without an associated message merely notifies you that a bug occurred but doesn't actually "find it". As you are writing your unit tests, make sure you find it as well.

technorati tags:, , ,

Wazaabi – XUL for RCP.

1 Comment

This opens pretty interesting possibilities:

Via TheServerSide:

Wazaabi includes a GUI framework that brings XUL to Eclipse RCP plugin developers and a set of components that link the client-side XUL based viewers and forms to server-side business components. Thus, rich client developers can use XUL to code a GUI, rather than using SWT.

Wazaabi brings XUL to Eclipse RCP based rich client applications

This is an actual XUL viewer, not a similar syntax like XSWT or similar attempts. They use servlets to communicate between the XUL side and your application, to keep the flexibility of sending the XUL to a mozilla browser. Very interesting.

technorati tags:, ,

Cheatsheet: Favorite Eclipse Plugins

1 Comment

This is a quick little cheatsheet with my favorite eclipse plugins and the locations of their update sites. It's so I can get back up and running quickly when reinstalling eclipse from scratch.

  • Eclipse Checkstyle - http://eclipse-cs.sourceforge.net/update
  • Spring IDE - http://springide.org/updatesite/
  • Fitnesse by Band XI - http://www.bandxi.com/fitnesse/
  • Subversion for Eclipse - http://subclipse.tigris.org/update_1.0.x
  • Memory Monitor - http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-ui-home/updates
  • Mylar - http://download.eclipse.org/technology/mylar/update-site/e3.2 (or e3.3)

Also, here's some stuff that I like to install manually:

  • JSEclipse - no offense to the WTP folks, but their JS editor is not that great. This one can understand OO javascript, common ajax libraries, JSDoc and more.

technorati tags:, ,

Graphical Modeling Framework

No Comments

Boy don't I know this - in a prior life I wrote a GEF editor for a workflow engine.

Let me be blunt: In the past, creating graphical editors within Eclipse using the Graphical Editor Framework (GEF) was slow and painful. It involved understanding a complex framework and quite a bit of redundant code. That said, GEF is an excellent framework for creating graphical editors because it is model-agnostic. On the other hand, being model-agnostic creates its own problems.

Learn Eclipse GMF in 15 minutes

Using Hibernate Validators with Spring and Hibernate

No Comments

In this article, Ted Bergeron shows you how to use the Validator component of Hibernate Annotations to build and maintain validation logic easily in your Web apps.

Hibernate can meet your validation needs

technorati tags:,

Older Entries