Posts Tagged ‘tutorial’

Convenient setting for .gitignore for Ruby on Rails app

Posted in ruby on September 26th, 2010 by Aditya – Be the first to comment

Taken from http://railstutorial.org/book. Git has a simple mechanism to ignore files that are inconvenient to be git-ed: configuring .gitignore in the Rails root directory can tell git some rules which files to ignore.
read more »

Setting up your first Rails application in Windows 7 and more

Posted in ruby on September 25th, 2010 by Aditya – 10 Comments

Most, if not all, Rails applications start through the same way: rails command. The command essentially creates a skeleton Rails application in a directory of your choice. To get started, make a directory for your Rails projects and then run the rails command to make the first application. read more »

Set Up SQLite3 for Ruby on Rails Development in Windows

Posted in ruby on September 24th, 2010 by Aditya – 4 Comments

The SQLite3 installation on Windows was really straight forward and easy although it may be documented rather obscurely. The main thing is to download the pre-compiled version of SQLite3 (at this moment 3.7.2) from the SQLite web site. read more »

Installing Ruby on Rails development environment from scratch in Windows 7

Posted in ruby on September 22nd, 2010 by Aditya – 4 Comments

In this tutorial, I will show you how I install RoR development environment in Windows 7. I will be using Ruby 1.9.2. , Pik 0.2.8 and Rails 3.0.0. While Pik’s usage might be not clearly explained in this post, its kinda useful. read more »

Customize Android ListView via ListAdapter

Posted in android on August 29th, 2010 by Aditya – 5 Comments

Often I find situation where typical listview layout provided by Android’s Hello Listview tutorial is barely adequate. For instance, it does not mention anything about ListAdapter and most of the time I want to get a list that goes beyond one line text. Icon and several textfields are the norm. In this tutorial I will discuss how to create Listview that can be customized with one icons and two text fields via a ListAdapter that is customized just for that particular view. read more »

Create Dummy Progress Dialog in Android

Posted in android on August 27th, 2010 by Aditya – 2 Comments

Sometimes you just want to make an android app prototype with minimal logic embedded on it. Or sometimes your UI ‘designer’ just being **** and want some ‘loading’ indicator’ to do whatever he want before creating documents which I will never see anyway. In fact there are many reasons not to develop your fully functional application for user testing. In this tutorial, you will see how to create a dialog progress bar which is literally a fake progress bar.
read more »

Declare Global Variable In Android via android.app.Application

Posted in android on August 14th, 2010 by Aditya – 2 Comments

I am creating an application which requires login. The problem comes when I want to store the application state (e.g. whether user has login or not). Storing state in activity class is almost it is hard to make it persistent. For example, rotating the screen will literally wipe out the application state. Also when the phone keyboard slides the login form appears again and again.
read more »

Screen Sharing with Mac OS X and Windows 7 – or possibly any other Windows

Posted in post on June 30th, 2010 by Aditya – 3 Comments

Today, I discovered how easy it is to share my school’s Mac OS X (10.5.x) screen with another non-Mac OS computer. I know it is not a sophisticated or such but I’m posting it here as I know this might not be obvious to most Windows user or even Mac user who often live in their own world.

My first attempt to do this screen sharing thing is by following this super complex tutorial. http://howto.diveintomark.org/remote-mac/

The tutorial by Mark Pilgrim comes with videos and links and nice background music and such – making it looks highly reliable for beginner like me. It sounds like a very secure procedure, with explanation about SSH, man-in-the-middle and many more. However, this tutorial miss one crucial aspect regarding setting up fixed domain, tcp-forwarding and those ip related stuff that might confuse 99% of world population. Not to mention his tutorial only shows configuration for home internet with a particular ISP.  The mac that I use for example was located behind CMU’s firewall and some other obstruction, making his tutorial to be only for geeks.

I could not set up the screen sharing capability through his tutorial. :(

*swearing phase*

For some reason all the VNC client that I use, RealVNC, TightVNC, UltraVNC does not seems to work properly. The clients fails with message like: ”Server did not offer supported security type” (tightVNC), ”No matching security types” (realVNC), ”Incompatible Version” (UltraVNC).

Then I google this error message only to found out this very long tutorial on how to tweak Mac to accept screen sharing. The tutorial can be found in this forum:

http://forums.macrumors.com/showthread.php?t=380251

In short, the tutorial asks me to perform some kind of surgery to the mac machine which obviously I was not so keen of doing so.

*swearing phase*

Then Justin, one of my research mentor pointed out that for mac, there should be no additional set up other than setting up screen sharing. He suspects its a mac-windows uneasy relationship thing.

After few googling I stumble upon one of the forum post somewhere – I forgot from where but it basically said I need to set the password for screen sharing so that those windows based client can actually connect to the mac.

IT WORKS… wtf

Here is how.

Go to (top-left-apple)-> system preferences->sharing->tick screen sharing together with the users that can be allowed to screen share.

Go to system preferences and then Sharing

Click Computer Setting to set up the password for allowing screen share.

Tutorial List for Mac Noob

Posted in post on June 20th, 2010 by Aditya – Be the first to comment

http://wiki.apache.org/tomcat/TomcatOnMacOS

note
./startup.sh && tail -f ../logs/catalina.out

Using java.util.Set interface

Posted in post on June 11th, 2010 by Aditya – Be the first to comment

I am not really good when it comes to work with interface class. It just feels weird.

In any case, java.util.Set interface is an interface class (dugh) that extends Collection. To be more specific it is

A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1 and e2 such that e1.equals(e2), and at most one null element.

Thus when you try to init that…, that all constructors must create a set that contains no duplicate elements.

In any case, here I use the set with some stupid checking for your convenience

// Create the set
Set spSet = new HashSet();

// Add elements to the set
// both Extras.* will return a string
spSet.add(Extras.GEO);
spSet.add(Extras.LICENSE);
spSet.add(Extras.DATE_TAKEN);

// Remove elements from the set
spSet.remove(Extras.DATE_TAKEN);

// Get number of elements in set
int size = spSet.size();          // 2... wohoo
System.out.println("The size of the set is... " + size);

// If you add equal element, it is no use
spSet.add(Extras.GEO);
size = spSet.size();              // 2
System.out.println("Now... the size of the set is... " + size);

// Determining if an element is in the set
boolean b = spSet.contains(Extras.GEO);  // true
System.out.println("The set contains Extras.GEO (T/F)? " + b);
b = spSet.contains(Extras.DATE_TAKEN);          // false
System.out.println("The set contains Extras.GEO (T/F)? " + b);

// Using iterator
Iterator it = spSet.iterator();
while (it.hasNext()) {
    Object element = it.next();
}

// Create an array from the set
String[] array = (String[])spSet.toArray(new String[set.size()]);

More info:

http://publib.boulder.ibm.com/infocenter/wsadhelp/v5r1m2/index.jsp?topic=/com.sun.api.doc/java/util/Set.html