Friday, August 31, 2012
Thursday, August 30, 2012
Is your Linux 64-bit?
Two easy ways to check it:
[root@swdartifact01 ~]# uname -mand
x86_64
[root@swdartifact01 ~]# file /usr/bin/fileFirst 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.
/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
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] ------------------------------------------------------------------------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...
[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]
<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:
I think I will write my own formatter...
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...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]]];
I think I will write my own formatter...
Tuesday, July 10, 2012
VMWorkstation 8 and Internet troubles
As I installed VMWorkstation 8 to test the site in IE 8 (I am running IE 9 on my box). After installation, I noticed that my virtual machine has no connection to the Internet. After searching the web for the possible solution, I finally got it. By default, when you install VMWorkstation (or VMPlayer for that matter), Network Adapter is set into 'NAT' mode - used to share the host's IP address. Correct setting for my scenario is to switch it to 'BRIDGED' - done, and I have internet access.
Thursday, July 5, 2012
Сложный русский язык (Difficult Russian language)
Перед нами стол. На столе стакан и вилка. Что они делают? Стакан стоит, а вилка лежит. Если мы воткнем вилку в столешницу, вилка будет стоять. То есть стоят вертикальные предметы, а лежат горизонтальные? Добавляем на стол тарелку и сковороду. Они вроде горизонтальные, но на столе стоят. Теперь положим тарелку в сковородку. Там она лежит, а ведь на столе стояла. Может быть, стоят предметы готовые к использованию? Нет, вилка–то готова была, когда лежала.
Теперь на стол залезает кошка. Она может стоять, сидеть и лежать. Если в плане стояния и лежания она как–то лезет в логику "вертикальный–горизонтальный", то сидение — это новое свойство. Сидит она на попе. Теперь на стол села птичка. Она на столе сидит, но сидит на ногах, а не на попе. Хотя вроде бы должна стоять. Но стоять она не может вовсе. Но если мы убьём бедную птичку и сделаем чучело, оно будет на столе стоять. Может показаться, что сидение — атрибут живого, но сапог на ноге тоже сидит, хотя он не живой и не имеет попы. Так что, поди ж пойми, что стоит, что лежит, а что сидит.
А мы ещё удивляемся, что иностранцы считают наш язык сложным и сравнивают с китайским.
(c) не знаю
Теперь на стол залезает кошка. Она может стоять, сидеть и лежать. Если в плане стояния и лежания она как–то лезет в логику "вертикальный–горизонтальный", то сидение — это новое свойство. Сидит она на попе. Теперь на стол села птичка. Она на столе сидит, но сидит на ногах, а не на попе. Хотя вроде бы должна стоять. Но стоять она не может вовсе. Но если мы убьём бедную птичку и сделаем чучело, оно будет на столе стоять. Может показаться, что сидение — атрибут живого, но сапог на ноге тоже сидит, хотя он не живой и не имеет попы. Так что, поди ж пойми, что стоит, что лежит, а что сидит.
А мы ещё удивляемся, что иностранцы считают наш язык сложным и сравнивают с китайским.
(c) не знаю
Friday, June 22, 2012
piwik stats for your website
After setting up piwik on your server, here is some simple code to get your website to send some usage data. In the .jsp load the piwik script:
Then, to tack something in you .javascirpt, the code will look something like this:<script type="text/javascript">var pkBaseURL = (("https:" == document.location.protocol) ?"https://[your-server-name]/" : "http://[your-server-name]/");document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));</script>
var siteId = 1; // check piwik website settings to get siteId needed for the appThat's it, pretty simple...
if (typeof pkBaseURL === 'string') {
try{
// setup any variables you want to track
var customVariable1 = 'test';
// can track up to 5 custom variables
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", siteId);
piwikTracker.setCustomVariable (1, 'customVariable1', customVariable1, 'page');
piwikTracker.setCustomVariable (2, 'customVariable1', customVariable1, 'page');
piwikTracker.setCustomVariable (3, 'customVariable1', customVariable1, 'page');
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
}
Subscribe to:
Posts (Atom)

