Skip to content

Category Archives: Main

On-topic posts

Documenting Python REST API whining


A downside of Python dynamic nature is that REST API documentation won’t generate right out of your code, like Swagger does for Java. The best you can get is, for which you need to duplicate all of your REST service method signatures in ReStructured text, a format I’m not a fan of. One can […]

Fast Windows JSON pretty-printer


Just built a Win32 version of yajl, a comandline C JSON pretty-printer and validator. Viva CMake. Welcome to downoad.

The dead end of Russian software engineer?


Ex-USSR has got a great school of engineers. Russia is the 3rd software outsourcing country (market) in the world. Russian (let’s use the name, though I’m Ukrainian, for instance) engineers are very educated and think out of the box. We got OOP gurus, Java buddhas, UI Picassos, Haskell Lamas, agile addicts and tech team management […]

Getting Glassfish stdout logging under control


By default, Glassfish does an ugly thing: takes an application’s stdout/stderr and wraps it into its own log with INFO level for stdout and WARN level for stderr. Other logging facility normally log to stdout. In the end, a log entry looks pretty stupidly (and it’s damn multiline!): [#|2012-11-21T11:25:07.225+0200|INFO|glassfish3.1.2||_ThreadID=100;_ThreadName=Thread-2;|11:25:07.225 [http-thread-pool-8080(2)] DEBUG c.mycompany.packages.SomeClass – Finally, some […]

Got a StackOverflow careers invitation.


They do a pretty cool thing: force you to tell “the truth” — no matter how subjective this term is — as opposed to emasculated official style: what you really did (whatever it means to you); what opensource/published projects did you participate in; Top Stack questions you answered; your professional reading and (sic!) writing. Here […]

Why I don’t like GMock


I don’t like GMock. It’s not as if it was badly written or designed. But it lets you to unit-test dirtier code, tying to method call structure instead of resulting data. For instance, this GMock code can be rewritten:

Groovy Comparator for class field names


I wonder why this was not in JDK/Groovy Collections. Just put together a Comparator for StackOverflow question – a Groovy Comparator that would sort class field names in the declaration order. Feel free to use: class PropComparator implements Comparator { private Class clazz PropComparator(Class clazz) { this.clazz = clazz } int compare(Object o1, Object o2) […]

DB2 supports LIMIT and OFFSET syntax, in MySQL compatibility layer…


It hasn’t even been a ten years that DB2, one of the most, er, expensive DBMSes, got a feature needed by every other application – dataset paging. Before, you had to use window functions rownumber() and fetch first 40 rows only. When used by Hibernate, this resulted ugliness like: [sourcecode language=’sql’] select * from ( […]

Google Buzz button for WordPress


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


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.

Hibernate join bug


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 = :isActive”) with a NullPointerException in “HqlSqlWalker.createFromJoinElement” — just use alternative join syntax, via WHERE: def books = […]

Unit tests quickstart


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. Except for JUnit cookbook (~2 pages) (which has a lot of “ports”, like CppUnit cookbook), I’d name: “Endo-Testing: Unit Testing with Mock Objects” at (Tim […]