Wednesday, December 5, 2012

Kotta Pora Online Game

Below is the link to a java applet game I made for a class assignment. I've hosted it online on a free web hosting site (000webhost). You will need java in your browser to run the game. The computer player in the game is implemented using a random algorithm which randomly increases/decreases the difficulty level of winning. See if you can win at Kotta Pora!:)

Note : Kotta Pora is a game of pillow fight traditionally played in Sri Lanka for the Sinhala New Year.

http://harini.hostzi.com/game.html (the game may take a few minutes to load..)
Enhanced by Zemanta

Friday, November 30, 2012

Need to free up disk space on Windows C drive?

Just used these cool tools to free up space on C drive on Windows 7.

Delete temp files and free up disk space using this tool..
http://www.piriform.com/ccleaner
I managed to free up ~700MB with this tool.

Find out which of your files/folder are eating up your disk space and delete the useless junk using this tool..
http://windirstat.info/

Thursday, August 9, 2012

Running curl commands in command prompt on windows

Recently I came across the requirement of running curl commands on windows. I was trying out the rackspace (www.rackspace.com) Open Stack API (http://docs.rackspace.com/servers/api/v2/cs-devguide/content/ch_api_operations.html) on windows. I thought downloading curl.exe was all I needed but turned out I needed to install Cygwin as well. This was because running curl commands on windows command prompt gave me annoying "unmatched close brace/bracket" error messages. Cygwin allows you to run linux style commands on windows inside a Cygwin terminal (see their documentation for details).

So here are the steps I followed :

1. Download curl for windows from http://curl.haxx.se/download.html. Extract the zip file and copy the path to curl.exe. You will need this later.
2. Download setup.exe from http://cygwin.com/. Running this file will guide you through the Cygwin setup.
3. I used all the default settings in the setup wizard for Cygwin except for in the 'Select Packages' dialog, I specifically selected 'curl' which is under the section Net (see image below).

4. After setting up Cygwin I launched the Cygwin Terminal and used the cd command to change directory to the folder having curl.exe. You can use the path you copied in (1).
5. Now you can directly run curl commands inside the Cygwin Terminal :)

Wednesday, June 13, 2012

Testing Web Apps on Blackberry

I recently made a simplified web version of my Android application Colombo Stock Trades V4. You can see the web version here. I tested it on android emulator, iphone simulator and my old stupid(aka. non smart) nokia phone. So the only thing left to do was to test it on blackberry. Therefore I set about installing the BB simulator and below are the steps I followed (this was on a Windows 7 PC) .

In order to test a web app on a blackberry simulator..

Step 1:

Download the blackberry simulator and the Email and MDS services simulator package from https://swdownloads.blackberry.com/Downloads/entry.do?code=060AD92489947D410D897474079C1477 .

Step 2:
Install both. First start the MDS and then the emulator (it is important that you follow this order).

Step3:

Now you can browse your web app on your simulator.


Tuesday, June 12, 2012

How to re-sign an ipa file?

On rare occasions you may be provided with an ipa file (only the ipa file and not the code) that has been signed with a different code signing identity, and you will need to re-sign it with the correct identity before submitting to appstore or for beta testing.

To check the current signature of the ipa file..

First unzip it to get the .app file using,

unzip ".ipa_file_name"

Now check the signature of the .app file using,

codesign -dvvv ".app_file_name"

In the output by reading the value of the Authority attribute you can determine if the app was signed using a developer certificate or a distribution certificate.
eg:
Authority=iPhone Distribution: Appleseed Inc.
Authority=iPhone Developer: Appleseed Inc.

Once you have verified that the current signature is incorrect you can proceed to re-sign the ipa file.

Remove old code signature
rm -r "Payload/Application.app/_CodeSignature" "Payload/Application.app/CodeResources"

Replace embedded mobile provisioning profile
cp "MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"


Re-sign
/usr/bin/codesign -f -s "iPhone Distribution: Certificate Name" --resource-rules "Payload/Application.app/ResourceRules.plist" "Payload/Application.app"


Re-package
zip -qr "Application.resigned.ipa" Payload


References:



iOS application beta testing using adhoc distribution

You can beta test your iOS application by distributing it via .ipa files. For this the tester will need to have the following..

- a mac with itunes installed
- an iOS device

Send the application .ipa file along with the mobile provisioning profile ( .mobileprovision) to the tester. Now he/she can test your app by following the steps below..

Step 1:
Install the mobile provisioning profile (double click the file)

Step 2:
Drag the .ipa file into itunes. Now the application should display under Library -> Apps menu (menu on left).

Step 3:
Select the device from the Devices section on the left menu and then select the Apps tab (should be displayed on top). Now the application will be visible in the open panel (see pic below).



Step 4:
Select the application and the Sync Apps option. Now sync the app to the device by clicking on the Apply button.

Step 5:
Test the installed application!:)


But how can you extract the .ipa file for beta testing?


Make sure your distribution profile and certificate are installed on your mac. If not, download the distribution profile from  and install it by double clicking. Download the distribution certificate and install it in the login section of the keychain.



In Xcode (I am using Xcode 4.0) open your application project and Build and Run on the device first. Next select Build -> Archive. In Window -> Organizer under archived applications select the latest archive and then click on Share Application button. Select the proper code signing identity (ie. distribution certificate). This will generate the correct ipa file:)

References :

https://developer.apple.com/library/ios/#technotes/tn2250/_index.html

Wednesday, April 25, 2012

Colombo Stock Trades V4

The latest version of the Colombo Stock Trades Android app is now available on Google Play.

https://play.google.com/store/apps/details?id=com.blogspot.hariniachala.cmbst4&feature=search_result#?t=W251bGwsMSwxLDEsImNvbS5ibG9nc3BvdC5oYXJpbmlhY2hhbGEuY21ic3Q0Il0.

This version fixes the server error in version 3 which popped up when CSE changed their data format. The application displays the latest stock data from the Colombo Stock Exchange.

Thursday, March 8, 2012

Happy Women's Day!

Happy International Women's Day ladies!:) I came across a few good reads today and wanted to share them here on my blog..

How girl geeks can get the best tech jobs
http://edition.cnn.com/2012/03/07/business/women-in-technology/index.html?hpt=hp_c2
I currently work for a IT company founded by a woman (in fact I believe it is the only IT company in Sri Lanka run by a woman; Ms. Lakmini Wijesundera), and I'm proud of it. It's a known fact that the IT industry is male dominated. This post outlines what women need to do to get ahead in the tech industry.

Women embrace your inner geek 
http://edition.cnn.com/2012/03/07/business/weili-dai-women-geeks/index.html
Weli Dai co founder of Marvell Technology Group writes on how women should embrace their inner geek.

How to have more Sheryl Sandbergs
http://edition.cnn.com/2012/03/05/business/martin-sandberg-women-confidence/index.html


Tuesday, January 24, 2012

Creating multiple targets in an iOS project

There can be many reasons why you would want to create multiple targets for an iOS project.

- You may want a separate Release Target and a Debug target so you can restrict logging to the Release target
- You may want to build a separate target for testing the application
- You may want to build a slightly different version of the current application (eg: Free and Paid versions for the same app)

The advantage of maintaining one project with multiple targets for such cases is quite obvious, when there are code changes that should apply to both applications you don't need to repeat those changes changes in separate projects.

Given below are the steps you need to follow to make a new target for an iOS project in XCode (I am using Xcode 3.2 but the steps should be similar for Xcode4).

1. Create a new target

From xcode menu select Project -> New Target (the dialog below will open).


Select 'Cocoa Touch - Application' and then NextSet target name (eg: 'NewTarget')
Check that the project is defined correctly and then click Finish to add the new target.
Now the new target will be visible in the targets sections of Groups&Files pane (project file view).


2. Copy files from existing target

Since you are making a new target for the same application code you need to copy over the files in the existing target of the project. Select and drag over the files in the following folders to the 'NewTarget'.

Copy Bundle Resources
Compile Sources
Link Binary With Libraries

After copying make sure the folders Copy Bundle Resources, Compile Sources, Link Binary With Libraries in the 'NewTarget' don't have any duplicate files. Checking this will help you avoid compiler warnings.

3. Set build settings

Before you can build and run the new target you created, you need to set the following build settings correctly. To change build settings double click the 'NewTarget' icon (this will open the target's properties dialog - see image below) and select the Build tab.



- Check that Base SDK is set correctly
- 'Compile Sources As' should be set to Objective-C (if it is set to 'According to file type' this will likely cause compile errors)
- Check the 'Info.plist File' is set correctly. You can edit this file to change the 'NewTarget' settings such as icon, launch screen etc.

4. Run the NewTarget!

Now from the xcode menu select Project -> Set Active Target and select the 'NewTarget'.
Build and run:)

Creating new targets in this way will create a new .app file (new executable) which you can use for application testing or release.