As you can see the Java implementation of Step 1 of 15 Exercises for Learning a new Programming Language was more complicated than the C# implementation. This was largely due to one factor. You can't poll whether someone is typing from the console in Java.

The second problem is that you can't use a KeyEvent handler in the console, which would the second easiest solution to attempt.

Finally a third problem is that by using an event handler you essentially need to use threading so that the loop doesn't interfere with the handler and you are able to interrupt properly.

...

posted by dharh at Feb 10

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;...

posted by dharh at Feb 10

function trim(str) { var str = str.replace(/^ss*/, ''), ws = /s/, i = str.length; while (ws.test(str.charAt(--i))); return str.slice(0, i + 1);...

posted by dharh at Feb 04

Experimental HTML and AJAX stuff i'm playing around with.

posted by dharh at 06/10/06

Code examples of manipulating an array of pointers.#include <stdio.h>#include <stdlib.h>#include <string.h>...

posted by dharh at 06/10/02

Part of my passion in life, besides life itself, is programming and computers. I especially like the idea of smart computers through smart programs and OS. Which is what I want to focus on in my career, creating intelligence to various degrees to help create better and more efficiency user experiences for computers.

Bellow is a table of various code snippets and articles organized by language.

...
posted by dharh at 06/03/15