Skip navigation

Image manipulation in Java

Created a small and simple utility class for myself to be able to perform common operations on images in Java.
Using this class you can load and save images, you’re able to resize images maintaining aspect ratio, you’re able to save jpeg images with specified compression, you can rotate images to any given angle, you can also watermark images.
Hope it’ll save you some time.

Writing a SQL parser

Well… not exactly writing a parser but generating one.
For the task I’ve been working on recently I needed to have (inside my java code) a data model representing database tables, so I could perform data normalization according to it.
“CREATE TABLE” sql statement is a natural fit for representing the data model. The only thing I [...]

Today I had this nice idea…

I wanted to implement some simple persistence support for my objects that probably contain at most 5-7 fields and the total number of objects would be at most 20-30. I didn’t want to put database and ORM in place for such a small task.
So I thought I’m going to develop something like:

#persons.properties
name = John
lastName = [...]

Don’t let Xml be your API

It’s interesting to see how many hours java developers spend these days writing Xmls. I can hardly imagine writing java server-side applications without a single xml document nowadays. All those configuration files, deployment descriptors, schema files, mappings, etc. Has anybody tried to count those hours?
The things are getting worse when you work within SOA. The [...]

How to write Evil, Unstable code

How to write evil code? It’s easy, follow the guidelines. :)
Conditional Slalom - Always, always, feel good when writing lengthy if branches and switch statements. These increase the number of possible execution paths that tests will need to cover when exercising the code under test. The higher the Cyclomatic complexity, the harder it is to test! When someone suggests to [...]