Category: applications

Amazon EC2, autoscaling and Glassfish challenges

Posted by – July 9, 2011

Are you thinking about put a awesome java webapplication running on top of Glassfish application server and use the awersome Amazon Elastic Balancer? If the answer is yes, please read this article first.

At first time the autoscaling feature seens to be an awesome solution, but it may bring some problems if the website deployment isn’t properly planned.

The first and the biggest issue that I found is website update, I created a simple script that check if there’s a new version of site war file at Amazon S3 and then perform its download, if I just redeploy the war file it may crash because of the current database connections made by JPA which cause to put all website down.
More

Share

Adding Mask to UITextField

Posted by – February 19, 2010

Cocoa Touch is an awesome API, it contains a large set o frameworks that can be used to create fantastic applications for iPhone, iPod Touch and iPad, but if we compare Cocoa Touch with Cocoa API for MacOSX we won’t find some cool features like masking on input controls.
More

Share

Writing MacOSX System Services with RubyCocoa

Posted by – September 7, 2009

Today I started my study about RubyCocoa and how it works, my first project was a simple system service for MacOSX Leopard where the user can type a portuguese text, select it and translate to english, the user can also type the text in english and execute the system service to translate it back to portuguese.

Here’s what I did:
More

Share

Playing with AppleScript

Posted by – August 22, 2009

ApplesScript is a very interesting scripting language that allows the user to write scripts to automate computer tasks, it differs from the other script languages because of its syntax that is pretty closer to natural language.

I spent few hours this morning trying to understand how to write AppleScript scripts, It’s very simple, please read the AppleScript Language Guide to learn more about how to use AppleScript with your favorite applications.

The scripts below give to us an idea about how we can use AppleScript to change the behaviour of 4 most popular applications for MacOSX: iChat, Growl, Adium and Skype.

iChatStatus

1
2
3
tell application "iChat"
    set the status message to "New iChat status message"
end tell

iChatStatus can be used to change status message of the user on iChat. The first line starts with “tell” statement, we use this statement to specify the target of all commands on this script, in the second line we are using the “set” command to change a the value of “status message” property value on application to “New iChat status message”, the third line finishes the “tell” statement.

More

Share

Handling server responses with WinHttpRequest object

Posted by – August 14, 2009

Yesterday I spent few hours trying to understand why my application was crashing after receive a big responses from server, in the end it was a question of how to use WinHttpRequest object.

WinHttpRequest is a COM object that can be used to send and receive data from server via HTTP protocol, I use it a lot in my search application because I need send user queries to search server and then process the responses in xml format.

Look this piece of code that I used to send HTTP requests to my search server:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Dim objXMLHTTP
Set objXMLHTTP = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
objXMLHTTP.Open "GET" , "/bigfile.xml" , false
objXMLHTTP.setRequestHeader "Content-Type", "text/html; charset=utf-8"
objXMLHTTP.Send
       
Dim objXML
Set objXML = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0")
objXML.validateOnParse = false
objXML.resolveExternals = false
objXML.preserveWhiteSpace = false
objXML.async = false
       
objXML.LoadXML( objXMLHTTP.ResponseText  )

More

Share