Skip to content

Precise Redmine burndown chart

11-Oct-10

I’m thinking of precise Redmine burdown chart, which is not so simple.

  • It has to build burdown chart for a given sprint (Version in Redmine).
  • It has to account issues added to Version and removed from during the sprint.
  • It, after all, has to account for what is considered “closed” status, which might be one of non-stock, custom statuses.

There are couple of Redmine addons, but for now I’m precautious about installing them. They are:

For now, I do it by hand. I put together a SQL query to get me the data:
More…

Google Buzz button for WordPress

12-Feb-10

Just installed a shiny new Google Buzz button for WordPress by Tejaswini, Sanjeev.
I hacked it a bit, to align to the right. Download this plugin version here, until author updates it.

I’m replacing a diggIt button; Buzz fits my color scheme better 😀

Enjoy.

“group by” clause in GORM/HibernateCriteriaBuilder

08-Feb-10

Just in case someone needs a code snippet.
This one groups Prices by PriceProvider and was intended to pick only last 5 values for each PriceProvider – but sadly, it’s impossible without window functions. Which are not supported in Hibernate in any way.
More…

Hibernate join bug

03-Sep-09

Hibernate bug 1895 seems to be still there since 2006.
If, for instance, in Grails, such a syntax won’t work for you (it won’t):

def books = Book.findAll("FROM Book AS b JOIN Chapter AS c WHERE c.active = :isActive")

with a NullPointerException in “HqlSqlWalker.createFromJoinElement” — just use alternative join syntax, via WHERE:

def books = Book.executeQuery("select b FROM Book AS b, Chapter AS c WHERE c.active = :isActive")

Move “WITH” conditions to “WHERE” as needed.

Self-update library for .NET using WiX: DotUpdater

03-Sep-09

Just published a library I created on one of past jobs out of Updater Application Block and WiX’s ClichThrough component.
Please meet: DotUpdater
It can auto-update an application, just create a RSS feed of updates and Windows Installer (MSI) binaries.

Link Taxonomy Terms to Views in Drupal

07-Aug-09

Imagine a task (actually, quite common), if you have:

  • a nodes (articles, ads, whatever) taxonomy in Drupal,
  • a taxonomy-based url path rewrites, like /monkeys/primates/homosapiens
  • and want to show a block/page View with articles only from current path term (and, maybe, its subterms).

It might be a hard time finding out the current term. One could try having two nested views, passing a current term as a parameter to nested view, like Dustin Currie did.

Though, Views has several pre-defined solutions. Just go to /admin/build/views/ and enable this one: “Default Node view: taxonomy_term”, (clone it to play safe), voila!

You got a View for the current term.

Diff a Micorosoft Office documents inder SVN?

13-Jul-09

In case you, like me, need to compare version of Office documents (under Windows), just know that TortoiseSVN got a pretty set of scripts for that.
It works out of box!
YES!
You can compare Office documents just like plaintext files!.
Just tried it and it worked. If you were afraid of trying, like me – don’t be.

Grails: mocking domain objects in unit tests

13-Jul-09

We’re trying Grails, Rails-like web application framework for Java.
It’s fine, just that Groovy debugger support is, er, imperfect, even in the best Gruoovy IDE – IDEA.

And, if you want to unit test, you won’t have fancy domain class methods addTo* – like Customer.addToOrders().
They’re generated by Grails on startup.
In order to have addTo*(), inherit from GrailsUnitTestCase and call mockDomain(Customer) in setUp().

Oh, if you get "NullPointerException: Cannot invoke method containsKey() on null object", add super.setUp() to yout testcase’s setUp().

Having proper save() is more tricky. Implementation from mockDomain() works to some extent: it won’t save connected objects.
So, in order to get save() working, you have to do something like this:
More…

“Project Dependencies” of Visual Studio 2008 broken in MSBuild

20-Nov-08

Just dealt with another Visual Studio 2008 “feature”.

You can specify all the necessary “Project Dependencies” in Visual Studio, but will get “CSC : error CS0006: Metadata file FooBar.dll could not be found“. Even if your csproj files have correct references to other solution projects, msbuild will fail.
Maybe it appears only if project output path is outside of project directory.

It appears that Visual Studio keeps the dependencies in two ways, only one of which is read by MSBuild. I see that because I still can specify dependencies in GUI, copy solution to other machine and build it with VS in correct order.

Not with MSBuild.

The data needed by MSBuild is a “ProjectSection(ProjectDependencies) = postProject” section of SLN file. Like this:

More…

Algorithmic quiz: check a 3-braces expression

23-Oct-08

I just won a bet for $10 by solving a quiz:

Check the correctness of a braces, brackets and parentheses sequence. The solution should be of linear complexity (to say more, it’s 1-pass).

For instance, these expressions are correct: “()”, “()()[]”, “([][][]{})”, “([])()[]”, and these are not: “][“, “())(“, “(()”.

Ten dollars

It’s basically solved in 15 lines, all others being auxiliary. Can you reproduce the algorithm?

The solution follows.
More…

IListSource.ContainsListCollection explained

09-Oct-08

Whenever you implement own datasource for .NET GUI binding, you’lll have the choice – whether to implement IList or IListSource.

IListSource is a simplistic interface with two members: IList<T> GetList() and bool ContainsListCollection;

MSDN help about IListSource.ContainsListCollection states it’s “indicating whether the collection is a collection of IList objects”.
MSDN is not true here.

If IListSource.ContainsListCollection is false, GetList() just returns your IList.

If IListSource.ContainsListCollection is true, GetList() is expected to return ITypedList, which needs to provide a collection of PropertyDescriptor-s for every field of your collection.
Its purpose is to provide field names (including by-name field access) in runtime.

Quoted below is a code piece from a Microsoft newsgroup that resolves both cases to a data list (field values list, in second case).

And yes, if you’re planning to mutate the UI-bound collection, use IBindingList<> instead of IList<>.
More…

Unit tests quickstart

24-Jun-08

A friend asked me for it, so probably someone might need a jumpstart in unit tests.

Here’s a short list of short (though very deep, if not best) intros.

For deeper dive, take a “xUnit patterns” book (this one is longer).

For Kent Beck‘s book on TDD, shame on me – I never read it. Though after “XP explained” I don’t strive for reading his books.

// If you’re interested in XP and “XP explained” criticism, take a look at “Extreme Programming Considered Harmful for Reliable Software Development” by Gerald Keefer.