Author Archives: MantasCode

Android: ScotchApp – How to parse Excel data and display it using a ListView and Dialog.

Some time ago, I had come across some interesting data about Scotch Whiskey.  I soon, decided to parse it and display it in an android app.  The app can be downloaded for free at the Android Market https://market.android.com/details?id=Scotch.App

scotchapp

This Scotch data can be downloaded here below.

http://www.bio.umontreal.ca/casgrain/en/labo/scotch.html

This file being parsed : scotch.xls

To get this Excel Data into my android java application:  Using Microsoft Excel, I simply saved it as a *.csv, opened it using notepad, and copy and pasted it into a string variable (String scotchData).

For each row of different Scotch, parse the appropriate columns for their values.

I also added a tasty photograph taken by Kyle May.

Continue reading

C#: Scrabble Player; Part 2 – Find all permutations of a string, parse a dictionary, cheat at Scrabble.

This an extension of a post from before.

C#: Find all permutations of a string, parse a dictionary, cheat at Scrabble.

ScrabblePlayer is a combination of my own joyous curiosity and an accumulation of my previous posts.  It is not built for performance.

This program accepts an input of English Letters from the user.  It then, figures out all possible permutations of the characters(letters), as well as, all permutations of sub-combinations down to a length of two.

Example: User inputs the word “abcd” ;

sub-combinations and -> permutations of input “abcd

each set has its own permutations recurviely.

1.) abcd : 4 characters, 24 permutations; (1*2*3*4)
2.) abc  : 3 characters, 6  permutations; (1*2*3)
3.) ab   : 2 characters, 2  permutations; (1*2)

Next, ScrabblePlayer parses a set of XML files which contain Websters Dictionary content.  The parsing populates both a LinkedList and a HashTable.  LinkedList<string> is set to the word, HashTable<string, string> is set to word as Key, and definition as Value.

After a LinkedList of both the accumulated permutations and dictionary words is created, ScrabblePlayer compares them.  If a permutation of the User’s input is found in the dictionary word list, it is displayed along with its definition.

The dictionary can be downloaded at http://www.ibiblio.org/webster/. I have renamed all the files ( A.xml, B.xml, C.xml, and so on ) .

Continue reading

C#: Find all permutations of a string, parse a dictionary, cheat at Scrabble.

This program has been expanded in a later post:
C#: Scrabble Player; Part 2 – Find all permutations of a string, parse a dictionary, cheat at Scrabble.

Find all possible permutations of a string.  Parse an XML dictionary http://www.ibiblio.org/webster/.  Compare permutations with dictionary and display results.  Ofcourse, the following program will only find words the same length as letters inputted.

Continue reading

Android: How to Install Android Emulator onto Eclipse Ganymede ; Walkthrough / Tutorial / Guide

Want to become an android developer?  ITS FREE!  Just follow these easy steps and you’ll be making free apps in no time.

UPDATE : Ganymede is no longer supported by  newer versions of of the sdk.  Download Galileo 3.5, tutorial still valid    :>

Download and install Eclipse.

Download Android sdk from http://developer.android.com/sdk/index.html

android-sdk_r08-windows.zip

Click below to Read the Walkthrough / Tutorial / Guide

Continue reading