Friday, October 7, 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

My big vacations

Now I have a big vacation between my past and future jobs.
I traveled to Turkey and had a big fun: climbing to the mountains, trip to antic cities, free-diving and driving buggy.



Monday, October 3, 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).

Friday, July 8, 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");
}
...
}

Wednesday, November 17, 2010

AMF3 expected int but got double

Surprise :-)

Max AMF3 value for integer = 268435456.

In AMF3 integers are serialized using a variable length unsigned 29-bit integer. The ActionScript integer types - a signed 'int' type and an unsigned 'uint' type - are also represented using 29-bits. If the value of an unsigned integer (uint) is greater or equal to 22^9 or if the value of a signed integer (int) is greater than or equal to 22^8 then it will be represented as a double and thus serialized in using the AMF3 double type.

Wednesday, November 10, 2010

Flex: load external CSS


  1. Create and compile css file (mxmlc -static-rsls=true -output=out/style.swf src/style.css)

  2. Load this style file from the application (styleManager.loadStyleDeclarations('style.swf');)

Sunday, March 28, 2010

Flex compiler locale

In order to switch flex compiler messages to US locale put this string "-Duser.language=en -Duser.region=US" into the $FLEX_HOME/bin/jvm.config file.


...
java.args=-Xmx384m -Dsun.io.useCanonCaches=false -Duser.language=en -Duser.region=US
...