Wednesday, April 13, 2011

Simple Trigonometric Functions with LabVIEW

The Unit Circle:
Needs no explanation.



The Block Diagram:
This is a simple loop that utilizes the trig functions that are in the Mathematics -> Elementary and Special Functions -> Trigonometric Functions palette.



Three Screen Shots:
Here are a few screen shots from the front panel that show this simple VI in action. 



Monday, April 11, 2011

Named Entity Extraction with Java

In February I posted on embedding weka in a java application based on content from this book by Mark Watson.

Recently I have been doing some work that requires some entity extraction, and I found another great tool and example set from the same book.

Here is some simple code that uses the classes provided:

package com.irodata.entity_extraction;

import com.markwatson.nlp.propernames.Names;

public class EntityExtraction {
    public static void main(String[] args) {
        Names names = new Names();
        System.out.println("Hello World, Is New York a real place?");
        System.out.println("New York: " + names.isPlaceName("New York"));
        System.out.println("Hello World, Is Oz a real place?");
        System.out.println("Oz: " + names.isPlaceName("Oz"));
    }
   
}

The output is this:

Hello World, Is New York a real place?
New York: true
Hello World, Is Oz a real place?
Oz: false

I am going to be using and expansion of this to do some identification of places and proper names in some database text data to assist with analysis.  If anything good and simple (and therefore appropriate for this blog) turns up I will be sure to share.  For now, all I can say is that this is a good set of classes if you need to do some quick text work in Java.


I only had one small gotcha that I should reference for anyone that wants to try this out:  

The text says this:

The “secret sauce” for identifying names and places in text is the data in the file test data/propername.ser – a serialized Java data file containing hash tables for human and place names.

When I first tried to build a test implementation, I kept getting this error:

java.io.FileNotFoundException: data/propername/propername.ser (No such file or directory)

After taking a look at the Names class, it appears that the location of the serialized data file was hard coded.  It is possible that I am missing a simple Java convention, but the easiest solution for me was to copy the .ser file to the location that Names was looking for it (/data/propername/) and then import this file system resource into the eclipse project.  It is possible that there is a better way to do this, if you know of one, please send me an email and I will update this post and give you credit.  Otherwise, this worked.  The resulting project looks like this:

Thursday, April 7, 2011

Historical Machine Learning Definition - Arthur Samuel

Arthur Samuel (1959). Machine Learning: Field of study that gives computers the ability to learn without being explicitly programmed.

Came across this while doing some general work.  I enjoy the history of AI, so many things that we take for granted now were unknown only 50 years ago.  There are more modern (and more formal) definitions, but this one has an elegance to it.

Checkers is now solved (thanks Chinook), but that does not make the original 1959 results any less cool.  As a matter of fact, I think that it might make the original results even more cool.

Wednesday, April 6, 2011

LEGO MINDSTORMS NXT - Shift Register

Here is another cool example from the LabVIEW examples that ship with the NXT module:

Description:
This example is for the LEGO MINDSTORMS NXT. The program uses a while loop and shift register to add 1 to the value of the previous iteration, the value is displayed for one second resulting in the NXT counting by seconds.

Nice and simple, but very cool.

Saturday, April 2, 2011

The Cathedral and the Bazaar

The entire essay is a bit much for a blog post, here is a link to the whole thing:
http://www.redhat.com/support/wpapers/community/cathedral/whitepaper_cathedral.html

Here is just a bit from the beginning:

1. The Cathedral and the Bazaar

Linux is subversive. Who would have thought even five years ago that a world-class operating system could coalesce as if by magic out of part-time hacking by several thousand developers scattered all over the planet, connected only by the tenuous strands of the Internet?

Certainly not I. By the time Linux swam onto my radar screen in early 1993, I had already been involved in Unix and free-software development for ten years. I was one of the first GNU contributors in the mid-1980s. I had released a good deal of free software onto the net, developing or co-developing several programs (nethack, Emacs VC and GUD modes, xlife, and others) that are still in wide use today. I thought I knew how it was done.

Linux overturned much of what I thought I knew. I had been preaching the Unix gospel of small tools, rapid prototyping and evolutionary programming for years. But I also believed there was a certain critical complexity above which a more centralized, a priori approach was required. I believed that the most important software (operating systems and really large tools like Emacs) needed to be built like cathedrals, carefully crafted by individual wizards or small bands of mages working in splendid isolation, with no beta to be released before its time.

Linus Torvalds's style of development - release early and often, delegate everything you can, be open to the point of promiscuity - came as a surprise. No quiet, reverent cathedral-building here -- rather, the Linux community seemed to resemble a great babbling bazaar of differing agendas and approaches (aptly symbolized by the Linux archive sites, who'd take submissions from anyone) out of which a coherent and stable system could seemingly emerge only by a succession of miracles.

The fact that this bazaar style seemed to work, and work well, came as a distinct shock. As I learned my way around, I worked hard not just at individual projects, but also at trying to understand why the Linux world not only didn't fly apart in confusion but seemed to go from strength to strength at a speed barely imaginable to cathedral-builders.

By mid-1996 I thought I was beginning to understand. Chance handed me a perfect way to test my theory, in the form of a free-software project which I could consciously try to run in the bazaar style. So I did -- and it was a significant success.

In the rest of this article, I'll tell the story of that project, and I'll use it to propose some aphorisms about effective free-software development. Not all of these are things I first learned in the Linux world, but we'll see how the Linux world gives them particular point. If I'm correct, they'll help you understand exactly what it is that makes the Linux community such a fountain of good software -- and help you become more productive yourself.