Friday, August 31, 2012

HDR Porsche GT3 @Willow Springs

This is World Challenge Porsche GT3 winter testing at Willow Springs, California in December, 2011

Camera: Canon Rebel T1i
Lens: Sigma DG f/2.8-4.0
ISO: 1600
f-Stop: 5.6
Exposure Bracketing: single shot

Thursday, August 30, 2012

Is your Linux 64-bit?

Two easy ways to check it:
[root@swdartifact01 ~]# uname -m
x86_64
and
[root@swdartifact01 ~]# file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
First one, is the name of the kernel. Second one is binary file on the system, which tells that the system is most likely 64-bit system.

Wednesday, August 29, 2012

Solving /safehaus/jug/jug/2.0.0-osgi Maven build error

Couple days ago I was working on upgrading MuleESB and Maven to versions 3.2 and 3 (respectively). When I swapped Maven 2.2 fro new version and tried to build one of my Mule project, I got the following error:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.070s
[INFO] Finished at: Wed Aug 29 11:13:16 CDT 2012
[INFO] Final Memory: 7M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project mobileproxyrouter: Could not resolve dependencies for proj ect com.abcfinancial.mule:mobileproxyrouter:mule:1.0.1-SNAPSHOT: Failed to collect dependencies for [com.sun.jersey:jersey-server:jar:1.3 (provided), com.sun.jersey:jersey-json:jar:1.3 (provided), com .sun.jersey:jersey-client:jar:1.3 (compile), com.sun.jersey:jersey-core:jar:1.3 (provided), org.mule .modules:mule-module-cxf:jar:3.1.0 (compile), org.mule.transports:mule-transport-vm:jar:3.1.0 (compi le), org.mule.transports:mule-transport-http:jar:3.1.0 (compile), org.mule.modules:mule-module-xml:j ar:3.1.0 (compile), javax.xml.bind:jaxb-api:jar:2.1 (compile), com.sun.xml.ws:webservices-rt:jar:1.2 (compile), com.abcfinancial.rest.api:MobileInterface:jar:1.1.0-SNAPSHOT (compile), com.abcfinancial .rest.api:InternalInterface:jar:1.8.0-SNAPSHOT (compile), net.sf.flexjson:flexjson:jar:2.0 (compile) , com.abcfinancial.ws.common:CommonWsObjects:jar:1.0.1-SNAPSHOT (compile), com.abc.utilities:abc_uti lities:jar:1.0 (compile), org.mule.tests:mule-tests-functional:jar:3.1.0 (test), org.mule.modules:mu le-module-client:jar:3.1.0 (test), org.mule.modules:mule-module-scripting:jar:3.1.0 (test), org.mule .tools:maven-mule-plugin:jar:1.4 (compile)]: Failed to read artifact descriptor for org.safehaus.jug :jug:jar:asl:2.0.0-osgi: Could not transfer artifact org.safehaus.jug:jug:pom:2.0.0-osgi from/to jbo ss (http://repository.jboss.com/maven2): Access denied to: http://repository.jboss.com/maven2/org/sa fehaus/jug/jug/2.0.0-osgi/jug-2.0.0-osgi.pom, ReasonPhrase:Forbidden. -> [Help 1]
So I started digging Internet to see how I can solve it. The solution turned out to be quite simple. The mirror to the public repository should be added to you local .m2 settings.xml file. Add the following lines, and run the project. No errors...
<mirror>
        <id>jboss-public</id>
        <name>JBoss Public Nexus Repository</name>
        <url>https://repository.jboss.org/nexus/content/groups/public/</url>
        <mirrorof>jboss</mirrorof>
</mirror>

Monday, August 20, 2012

iPhone SDK and phone number formatter

For all the wonderful things that iPhone SDK does for us beautifully, I finally found one feature that is not supported: phone number formatting. I was hopeful that after using NSNumberFormatterCurrencyStyle, I will be able to find something similar to format my phone numbers. I was no able to find any such a formatter. So I decided to use NSNumberFormatter with custom coding around it to get the job done:
  NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
    [formatter setNumberStyle:NSNumberFormatterNoStyle];
    [formatter setPositiveFormat:@"(###) ###-####"];
    [formatter setLenient:YES];
    
    homePhoneValue.text = [formatter stringFromNumber:[NSNumber numberWithDouble:[homeNumberAsString doubleValue]]];
    mobilePhoneValue.text = [formatter stringFromNumber:[NSNumber numberWithDouble:[mobileNumberAsString doubleValue]]];
Unfortunately, that did not work either. As it turns out, iPhone SDK formatter does not support spaces, dashes and brackets. If the above code is ran, it fails silently, and the text is displayed in its "pre-formatted" form. I think I read somewhere that there is a bug opened with iPhone Developers to fix this issue. Until then... 

I think I will write my own formatter...