07 October, 2011

Java 7

Great enhancement: binary literals and underscores:

int netaddr = 0b11000000_10101000_00000000_00000000; //192.168.0.0
int netmask = 0xFF_FF_FF_00; //255.255.255.0

03 October, 2011

MySQL Workbench crashes on startup under Windows 7 64-bit

MySQL Workbench crashes on startup.

This problem appears because of normal users install 64-bit libraries (.Net Framework and Visual C++ Redistributable) for 64-bit Windows 7.

But MySQL Workbench compiled with 32-bit binaries and required 32-bit libraries. So you have to install Microsoft Visual C++ Redistributable x86 (!not x64).

08 July, 2011

Spring: annotation driven and configured scheduler

Properties file (file.properties):

...
manager.cron=0 */1 * * * ?
...


Application context (context.xml)

...
<context:property-placeholder location="file.properties"/>
<task:annotation-driven/>
...


Bean:

@Component
public class Manager {
...
@Scheduled(cron = "${manager.cron}")
public void doSomething() {
log.info("doSomething");
}
...
}