Adam Monsen

March 5, 2012

Squelch Doctrine/MongoDB logging in Symfony2

Filed under: Default — Tags: , , , , , — adam @ 7:30 pm PDT

If you use Doctrine+MongoDB in Symfony2, you may have flood of mongodb queries in your dev environment log. Here’s a snippet of code for app/config/config.yml that will squelch them:

doctrine_mongodb:
  document_managers:
    default:
      logging: false

September 30, 2011

Warren Buffet’s Long Bet

Filed under: Default — Tags: , — adam @ 12:35 pm PDT

Please check out my post Warren Buffet’s Long Bet on the BreadVault blog.

September 19, 2011

offline HTML 5 validation

Filed under: Default — Tags: , , , , , — adam @ 11:05 am PDT

HTML 5 logo

I’m liking Henri Sivonen’s Validator.nu service. I’ve got it running locally, and it works well. I can use it as a web service and validate HTML from within Vim, using quickfix to rapidly resolve errors. My Jenkins CI server uses the same validator via phpunit tests.

Warning: it took me a very long time to get it running locally. Technically easy (just run a build script), but it downloads tons of libraries and files before it can do its job.

July 26, 2011

Debugging web tests on remote servers

Filed under: Default — Tags: , , , — adam @ 8:01 am PDT

I run “web tests” on a remote server. I use Selenium to act like a person interacting with a website, viewing and entering data. Selenium is pretty awesome, it can drive a real web browser like Firefox.

Even better is to have these web tests run automatically every time I commit code. I use Jenkins for this. Jenkins even fires up a headless desktop so Selenium can run Firefox.

When a web test breaks (especially in some way I can’t reproduce on my local desktop), sometimes it helps to actually see what Jenkins sees as it runs the test. Here’s a quick guide for doing so on an Ubuntu GNU/Linux server.

  1. Connect to the remote server using SSH. Install VNC server:
    sudo apt-get install vnc4-server
  2. On the remote server, become the user tests run as. For example:
    sudo su - ci
  3. Set a password for the VNC server using the vncpasswd command.
  4. Start headless X server by running vncserver. Note the given display. If example.com:1 is included in the output of vncserver, the display is :1.
  5. Figure out which port the VNC server is using. I usually do something like

    sudo netstat -nape | grep '^tcp.*LISTEN.*vnc.*'

    Here’s some example output:

    tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN      107        3099855     13233/Xvnc4     
    tcp6       0      0 :::5901                 :::*                    LISTEN      107        3099858     13233/Xvnc4

    By trial and error, I figured out that 5901 was the port I should use.

  6. Port-forward VNC to your local machine.

    1. Disconnect from the server.
    2. Reconnect, including -L10000:localhost:5901 on your SSH command line.
    3. Leave this connection open.
  7. On your local machine, connect a VNC client to localhost:10000. An X terminal should be displayed.

  8. In the X terminal, run your web tests.

  9. When finished debugging, kill the X server using the display noted earlier.
    vncserver -kill :1

January 25, 2011

Measuring Development Speed

Filed under: Default — Tags: , — adam @ 11:35 am PDT

We’re rewriting the Mifos front-end from Struts 1.0/JSP to SpringMVC/Freemarker. So far it’s been slow going, so we’re trying out several experiments to speed up the process.

I think it’s important to measure the impact of our improvements. I want to know: are we moving faster? Is product quality flourishing? Can we say so quantitatively? The last bit has been the most elusive. It’s like measuring how useful a painting is!

Still, here are some measures which we hope will eventually show how much the improvements are or are not helping. Right now we’re just establishing baseline data.

The red line in the graph represents legacy front-end code that will eventually disappear. The green line is new code, but it really doesn’t matter.

From the chart data, we can say the following by measuring deltas between points: the most dramatic change in Struts/jsp LOC was 4380, for the time period ending Aug 2010.  The most dramatic change in SpringMVC/ftl LOC was 3665, for the time period ending Sep 2010.

Assumptions:

  • these data are not useful for estimating speed of future refactoring work
  • all acceptance tests pass in refactored areas
  • look & feel of refactored areas is acceptable

The 2nd & third bullets are a bit vague. To address this shortfall, we’ll measure the following aspects of quality:

  1. Time spent modifying CreateSavingsAccountTest.
  2. Number of issues (regressions) caught during CSS walk through.
  3. Number of layout or functional bugs logged during testing phase (missed during walk through).
  4. Time spent by QA manually testing the feature, including logging issues and retesting bugs fixes.

Finally, developers should know if things are better. This is the most qualitative and possibly the most important “measure”! Certainly, for the migration of our codebase from svn to git, it was the only measure we used, and it was enough.

Thoughts/comments/feedback are appreciated. I’d rather have some kind of simpler measure, like “x increased by 250%”. Do you know of any more effective (and hopefully simpler) means of measuring development speed?

I used gnuplot to generate the graph. Here’s the source.

October 5, 2010

Mifos opportunity: i18n

Filed under: Default — Tags: , , , — adam @ 2:42 pm PDT

We need help with i18n (and support of L10n) in Mifos. Are you interested in becoming the Mifos i18n champion? It’s a great volunteer opportunity! The work should be intermittent, and basically at your leisure. One of the really fun parts is working with the folks at Translatewiki.net… they added a bunch of messages from our “questionnaire” module, and after a few days it was completely translated to Interlingua, Macedonian, Dutch, Norwegian, and Finnish! There’s an army of talented translators ready to help.

Here are some example tasks for the i18n champion:

See also: #Mifos, #microfinancing and #Wikimedia

Update

A day after I sent out this call for help we got two volunteers! Thank you, Stanley Kwok and Jasmine Sandhu!

September 13, 2010

Mifos Manual as an ebook

Filed under: Default — Tags: , , , — adam @ 7:00 am PDT

I learned about ebooks last week. Very cool! I’ve found them much more readable than PDFs or Web pages. Maybe it’s the ebook readers… they sure help me focus on the content.

Since we used FLOSS Manuals to write our manual, it’s easy to generate an ebook using Objavi. Here’s the Mifos Manual as an ebook. Looks pretty good on the iPhone (lately I’ve been using “Stanza”). Probably looks even better on a Nook, Kindle, or iPad.

June 28, 2010

FLOSS technical/dev summits: why? how? with Tarus Balog of OpenNMS

Filed under: Default — Tags: , , , — adam @ 11:47 am PDT

Tarus Balog is the CEO of the OpenNMS Group, a company which funds the development of OpenNMS: FLOSS enterprise network monitoring software. OpenNMS lets you know when your machines go down, among other things. I use OpenNMS at work to keep Mifos infrastructure up and running: build servers, cloud, databases, etc.

Our corner of the Grameen Foundation focusing on Technology for Microfinance has a lot to learn from OpenNMS! They’re also FLOSS, and they’re profitable.

I talked with Tarus the other day. Turns out he’s a really cool guy. I’ve been following his blog closely for quite a while now, so I was thrilled with the chance to pick his brain. The point of the call was to find out why and how they run their developer summits: in-person meetings where coding, alignment, teambuilding and planning are plentiful. OpenNMS hosts these yearly, and we’d like to do them for Mifos.

(more…)

April 1, 2010

The Mifos user manual sprint; how we’ll break Brooks’s law

Filed under: Default — Tags: , , , — adam @ 4:08 pm PDT

I’m really excited for the Mifos user manual sprint tomorrow. We’re using FLOSS Manuals to write our new user manual. FLOSS Manuals is an exciting way to write a book, it provides a framework for high-bandwidth collaboration, publishing to HTML and print, translating, and more. There are many examples of small teams (less than 10 people) publishing large, excellent books in short time periods (less than a week).

We’ll have a video feed going. I’ll be wearing my track suit.

Check out our coordination wiki page and stop by our IRC channel if you’d like to join in! If you’ve ever edited text on a wiki, are brave enough to learn how, or just want to see me in a track suit, come on by.

I suppose I should explain the title of this post. If we can establish a framework for software development on Mifos like we’re running this sprint, we can break Brooks’s law. Why not? The Ksplice folks did it, so we can too!

March 29, 2010

Ehcache Java library’s UpdateChecker == spyware

Filed under: Default — Tags: , , — adam @ 9:03 am PDT

I just took a peek at recent Grails development, and noticed they added code to disable a “phone home” feature in Ehcache. Strange, I thought, why would this be necessary?

Apparently Ehcache includes an automatic update check that is also effectively a phone home. Terracotta software conveniently collects some extra information (such as your IP address) when Ehcache phones home. The information they collect is benign. But, seriously? A library phoning home, by default?

Who decided it would be a good idea to add this feature to a popular Java library? It’s a transparent attempt at gathering usage statistics.  As a participant in a professional FLOSS project, I can fully identify with the need for knowing who is using your software. But automatically, secretly phoning home is not the way to do it!

Terracotta, will you turn this feature off by default in the next Ehcache release?

I see this issue has come up in forums:

Other tidbits:

Older Posts »

Powered by WordPress