
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.

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 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.

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.

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.

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.

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…

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…

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: “][“, “())(“, “(()”.

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

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…

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.

My not-so-humble evaluation of VS tests distinctions from NUnit is (in points on -10 to 10 scale).
- (-4) To run tests, VS launches an entire process which takes no less then 3 seconds to start. If you’re in “F5 hit breakpoint – Shift-F5″ loop, that’s disgusting. NUnit tests can be run in-process by Resharper or TestDriver.NET;
- (-2) GUI that shows where test failed is ugly. You don’t get to failed line on double-click, you first get to test log page. Status and call stack are necessary, but I’d like not to trash my document tabs, I already have enough of them open. You can’t make that kind of windows docked/floating;
- (-1) You got a “
public TestContext TestContext;” sticking in your code. You’ll need it only when it comes to testing on data, which doesn’t always happen, even in a data-driven application;
- (-1) It’s a “not invented here” technology, while NUnit was around for years;
Edit: In a moment of madness, I mixed together coverage profiling and unit testing tools. May God and readers forgive my aberration.
Edit2: If you need a half-page kickstart in unit testing techniques, the next post can help.