Archive for September, 2006

The Why of it all

September 30, 2006

Came across Joe Mathlete’s daily Marmaduke explanation. I loved the dry, detailed explanation of the comic strip. Marmaduke is not printed in any Indian daily I’ve come across.

My newspaper, Deccan Herald, has a pathetic comics page. Tell me, does *anyone* find Moose and Molly even faintly amusing?

Sample today’s Moose and Molly. I hate the strip and don’t know why I’m even pasting one here on my blog.
<it’s ugly. I removed it>

Then found another brilliant thread here, Garfield really is much, much more fun with all his thought bubbles cut out of the strip.

And loved reading Anousheh Ansari’s writing on her blog. Blog surfing is so much fun. I can spend hours doing that.

I blog because there are so many things I like enough to write about. Recording them in a public forum and finding others who like the same, that feels great.

As arvind says, the web is now very close to how Tim Berners-Lee envisioned it to be, a read/write medium. And I’m loving it.

Advertisements

Java Algo -1

September 19, 2006

So, about the DFA. Here is the algorithm I plan to use :

// DFA:
//
// 1. A finite set of states. (Set Q)
// 2. A finite set of input symbols.
// 3. A transition function (takes as argument a state and input symbol and returns a state).
// 4. A start state (one of the states in Q).
// 5. A set of final states (subset of Q).

--------

class State {

State (name of state, number of symbols) { // Constructor
		Create array transition[number of symbols];

while (i < number of symbols) {
			transition[i] = stdin.read (state, ith-symbol)    
		}

getNewState (symbol number) {
			return (transition[symbol number]);
		}
}

main () {
	acceptableSymbolArray[nSymbols];

State state[nStates] (name of state, number of symbols)

string: #abc#abbc#

while (string does not end) {
		symbol = search for symbol in acceptableSymbolArray[]
		next state = state[current state].getNewState(symbol);
	}

if (final state = next state) {
		String accepted
	}
}
---------

Java Help

September 12, 2006

Nice Java I/O tutorial.