Cephi Systems Software and Contract Services

5Aug/120

Euclidean Algorithm in Objective-C

This is the Euclidean Algorithm in Objective-C.

The Euclidean algorithm (also called Euclid's algorithm) is used to calculate the greatest common divisor (GCD) of two integers. The GCD is the largest positive integer that divides the two input integers without leaving a remainder.

This is a basic example of a simple computational algorithm. It was developed by the Greek / Alexandrian mathematician Euclid around 300 b.c. It is still used today in cryptography and in mathematics.

This code snippet was created for use with the Cocoa Touch framework used with iOS devices and the iOS simulator. The while loop will continue to iterate as long as secondInt (the remainder) is not 0. When secondInt is 0, the GCD has been found, and firstInt (the GCD) is returned.

- (void)viewDidLoad
{
    [super viewDidLoad];

    int returnedGCD = [self greatestCommonDivisor:800:352];
    NSLog(@"GCD = %d\n\n", returnedGCD);
    
    //This is a simple example to see of this algorithm works. The GCD is 2 below
    returnedGCD = [self greatestCommonDivisor:2:8];
    NSLog(@"GCD = %d\n\n", returnedGCD);
    //the order of the two numbers is not important as shown below:
    returnedGCD = [self greatestCommonDivisor:8:2];
    NSLog(@"GCD = %d\n\n", returnedGCD);
    
}

//Euclidean algorithm. Returns the GCD
- (int) greatestCommonDivisor: (int)firstInt: (int)secondInt
{
    NSLog(@"--Calculaing GCD of %d and %d--",firstInt,secondInt);
    while (secondInt != 0)
    {
        int remainder = firstInt % secondInt;
        NSLog(@"remainder = %d\n\n", remainder);
        firstInt = secondInt;
        secondInt = remainder;
        NSLog(@"firstInt = %d", firstInt);
        NSLog(@"secondInt = %d", secondInt);
    }
    return firstInt;
}
25Dec/112

Simple Java Applet

Java applets are a somewhat dead technology. Many have hoped for years that they would get a face-lift someday. They are easy to use and you can do a lot with them, wherein one language can be used server side and client side. I am starting to think with the rise of HTML5 applets may never return. As of this writing only about 37% of all computers used for surfing the web have Java loaded per Riastats.com. This makes choosing a Java applet as the main technology for your web application a rather poor choice unless you know ahead of time that all of your users will have Java installed.

A couple of ways to get a Java applet on a WordPress page are with the following WordPress plugins:

  • Java Applet Embed (I haven't tested this one)
  • Page View - link an HTML page with a applet link on it

Below is an example of a simple Java Applet:

23Oct/112

Head First iPhone & iPad Development – 2nd ed

Head First Iphone & iPad Development by Dan Pilone and Tracy Pilone is aimed at guiding programmers new to development for iOS though the SDK tools, the fundamentals of Objective-C, and the app development and submission processes.

This is the fourth Head-First book I have read, and I am a fan of the series and of the communication style they use. They like to employ established cognitive science techniques that aid in understanding and retention, such as using an informal tone, humor, reiteration/rephrasing, active participation / exercises, and they facilitate visual-style learning.

While this particular book does not include a lot of introduction to computer science material, it does walk you through some interface design principles and introduces some of the Apple guidelines for iOS applications. Many of the other Head First books take time to explain some of the basics like how arrays work in a particular language, or the basics of objects in object orient programming, but this book mainly focuses on subjects unique to Objective-C programming for iPhone/iPad, with a some good examples of how to adapt an existing iPhone application to the iPad, or to support both the iPad / iPhone the from the get go and make a universal app.

While not current to iOS5, I am not aware of anything in this book that will not work with iOS5. The examples give a good starting point for people that want to learn Objective-C and include many commonly-used topics such as working with multiple views, the table view, and various UI elements. For storing your data they cover property lists and core data, both of which are pretty easy to get started with. Core data is powerful and makes saving and retrieving data from a MySQL database easy.

The book also covers integrating the camera into your apps, as well as map kit, and core location. It also briefly touches on animation and the accelerometer.

This is one of a handful of books that I would recommend for new or maybe even intermediate-level iOS developers. Here are some of my favorites books (in no particular order):

Beginning iPhone 4 Development: Exploring the iOS SDK (I actually read an earlier version but really enjoyed it)
Big Nerd Ranch Guide to iPhone Development.
Head First iPhone & iPad Development - 2nd ed.
Programming in Objective-C

New Objective-C programmers would probably benefit from reading at least a couple of these. There is some overlap amongst these books, but there is also some significantly different material, approaches and underling philosophy. Also there are not a lot of books out there dedicated to more advanced topics in Objective-C so sometimes you can find information you need towards the end of one of these beginner books. None of these books cover game development but that is really a topic worthy of a separate book.

25Sep/111

Property Lists in Objective-C

If you are new to Objective-C, property lists (plists for short) can be an unfamiliar concept. Opening a .plist file with a text editor will reveal that they closely resemble XML files. A plist is just a data file: it stores data in the form of serialized objects in a standardized format and structure. This standardization is important since plists can be read by any application designed to read them. Put another way, an application expects the data in the plist to be organized in a certain way (a structure). If the application does not see the plist in the correct structure then it will probably throw an exception.

Here is an example of the source code of a simple plist holding two people's personal information:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <array>
        <dict>
            <key>name</key>
            <string>Bob Johnson</string>
            <key>payGrade</key>
            <integer>5</integer>
            <key>weight</key>
            <real>175.5</real>
        </dict>
        <dict>
            <key>name</key>
            <string>Mike Smith</string>
            <key>payGrade</key>
            <integer>2</integer>
            <key>weight</key>
            <real>475.5</real>
        </dict>
    </array>
</plist>

When viewed as a plist file in Xcode, this plist will appear as follows:

Like XML files, plists consist of data elements which hold content (elements of your data). In the above example there is a hierarchy of data elements: an array as the root property-list object (the top-level container), then each individual person is represented by a dictionary object. Each dictionary then holds some data elements: a string for the person's name, a floating point number (the tag) for the person's weight, and an integer for their pay grade. Each element is denoted or wrapped by tags, and each must have an opening and closing tag or the application will consider the plist invalid.

Example:

<string>Bob Johnson</string>

So the tags are enclosed in the <>'s, with the opening tag coming first and the closing tag with a backslash being at the end of your content. When you instruct your application to reference the object corresponding to the name key, it will return a copy of the object between the tags, in this case Bob Smith (technically I believe it returns formatted data which is then converted into an object by the app/OS.) If you want to see more examples of how XML files are organized see the links at the end of this article.

Once your data is in a plist it can be written to disk, or sent across the internet to communicate with a another application or server. Plists are designed to be storable, transportable and easily accessible. Plists often hold a dictionary object such as with the Info.plist, but you can set your plist up to hold objects such as an array, an array of dictionaries, a dictionary of arrays, or whatever is convenient for you. When you create a plist in Xcode the default root property-list object (the top level or root container) is a dictionary ready to contain other objects. Through Xcode's plist editor you can add new rows that can be dictionaries, arrays, booleans, strings, dates, numbers, or data (NSData objects).

If you want something other than a dictionary as your root property-list object you cannot currently do this though Xcode's plist editor (as of version 4.0.2). You do this by editing the source code instead. This is done by right clicking on the Plist file in Xcode's project manager window and selecting “Open As” then “Source Code.” You then see the source code as shown at the top of this article. The default location for plist files is in the Supporting Files folder and they are identifiable by the .plist file extension.

In iOS devices, like the iPad and iPhone, applications have a default info-plist which stores information (metadata) about the application such as bundle names, its icon, and supported interface orientations. This plist is named [the application name]-Info.plist. This information is read by the operating system and is used to display and configure the application.

Having problems with your plist? This can be caused by the syntax being incorrect such as a misspelled or missing tags, putting a string inside an integer element, or an invalid character somewhere. When you try to build and run the application containing the plist, Xcode will give an “error: reading plist: The data couldn’t be read because it has been corrupted.” Checking the source code for the plist as explained above is a good way to see what the problem is.

Plists are pretty easy to use and are good for storing up to a few hundred kilobyets of data per Apple. You have a choice between saving your plist in either an XML or a binary format. The tradeoff between these two choices is XML formats can be manually edited, but binary formats have the advantages of being more compact, consuming less memory and they read/write faster, so binary formats may be better for working with larger amounts of data. You can also save your plists in an old-style ASCII format that is most commonly associated with the OpenStep API specification.

In addition to creating a plist in Xcode, plists can also be created programmatically. Below is a simple example of how to programmatically create, populate, and save a plist and then reference it by copying its contents to a dictionary:

-(void) createPlist
{
    //Get the path to the document directory in your app bundle:
    NSString *path = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    //Add the name your plist will be saved as:
    NSString *plistPath = [path stringByAppendingPathComponent:@"myPlist.plist"];
    //Make a dictionary that holds 2 strings
    NSDictionary *dictForPlist = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects: @"string 1", @"string 2", nil]forKeys:[NSArray arrayWithObjects: @"Key 1", @"Key 2", nil]];

    NSError *error;
    //Create a plist with the data from the dictionary
    //For the error we pass a pointer to a pointer so new NSError objects can be referenced rather than altering an existing NSError object.
    NSData *plistData = [NSPropertyListSerialization dataWithPropertyList:dictForPlist format:NSPropertyListXMLFormat_v1_0 options:0error:&error];
    
    //If plistData exists, save it as a plist file.
    if(plistData) 
    {
        [plistData writeToFile:plistPath atomically:YES];
        //This is written to the application bundle document directory:
        NSLog(@"plistPath %@",plistPath);
    }
    else 
    {
        NSLog(@"Something went horribly wrong: %@", [error localizedDescription]);
    }
    
    //Reterive the data from the plist, and put it in a mutable dictionary so we reference or manipulate the objects within:
    NSMutableDictionary *myDict = [[NSMutableDictionary alloc] initWithContentsOfFile: plistPath];
    NSLog(@"myDict %@",myDict);
    
    //Since we alloc'ed a mutable dictionary we should release it when done with it: 
    [myDict release];
}

Links:

More about XML: http://www.w3schools.com/xml/xml_syntax.asp

Apple's Property List Programming Guide:
https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html#//apple_ref/doc/uid/10000048-CJBGDEGD

5Aug/110

Desktop Applications with JavaScript and Adobe AIR

Recently we have been covering some basic topics in JavaScript. Aside from creating dynamic content for the web and client-side / browser run applications, another thing you can do with JavaScript is to create desktop applications with Adobe AIR.

Adobe AIR is a cross-platform runtime environment from Adobe Systems for building desktop and mobile applications. AIR applications are executed in a runtime environment conceptually similar to Java’s JRE. In simple terms, this just means your application is run inside another program (the AIR runtime) that manages and runs the application and allows for the application to be run and behave consistently on any system that can run the AIR runtime.

As of 7/5/11 the following operating systems are supported by Adobe AIR:

  • Microsoft Windows
  • Mac OS X
  • Apple iOS
  • Android
  • BlackBerry Tablet OS

Applications for AIR can be developed with a number of languages including Flash, Flex, ActionScript 3.0, or HTML/CSS/JavaScript/XML (Ajax). Currently, Mobile applications can not be developed via Ajax.

Adobe AIR applications can be built with Adobe’s Dreamweaver, Flash Builder, or Flash CS4. HTML editors and simple text editors can be used as well, in conjunction with Adobe’s free AIR SDK.

We used Dreamwever to build and compile the simple example app used in this tutorial. Dreamweaver is convenient to use in that it acts as a full-featured IDE allowing you to graphically design your user interfaces and test them in a built-in AIR simulator prior to compilation. Dreamweaver CS5 does require that a free AIR extension be downloaded before you can work with AIR however.

Compiling an app into a self-installing application executable file (.air file) is easy and provides for things like the use of digital signatures and linking application icons. To test the app simply use File/Preview in Browser/Preview in Adobe AIR. You compile the file via Site/Create AIR File. There are a few options that need to be set when doing this. The Help file is pretty good at describing what each item is for and there is an Adobe Tutorial link at the end of this article which walks your though the whole process.

If you don’t have Dreamwaver you can pick up the AIR SDK and use this example app in a text editor then compile it from the SDK command line. This approach will however require you to figure out how to do all this. There is a link for doing it this way with Adobe’s SDK tutorial at the end of this article.

Below is a simple app we created with HTML/CSS/JavaScript. It displays some text, has button and text field input fields, a little CSS for presentation, and one lonely JavaScript function.

 

Another cool thing about Dreamweaver and AIR is that this HTML file will also run just fine in a browser window (we only tested it with Chrome though). AIR allows reading and writing to files as well as working with local SQL databases. Web developers who may not know any Objective-C, C#, or Java can use AIR to make fairly sophisticated desktops apps in the language they are familiar with. Adobe even has an Adobe AIR Marketplace, were you can register as a developer and sell your apps.

Links:
Creating an app with the AIR SDK

Creating an app with Adobe Dreamweaver

Adobe Marketplace

18Jul/110

Free Scala book from O’Reily

Neato free Scala book from O'Reily: http://ofps.oreilly.com/titles/9780596155957/index.html

12Jul/110

Deadlines, KISS, and Minimalist Design Principles Used to Create a Simple JavaScript Game

Writing something that has even a bit of useful content can take a lot of time. If you are like me you probably discovered long ago that there are just not enough hours in the day to get everything done you wanted to, let alone get everything done to perfection.

One technique that can be used to help manage busy schedules is setting yourself a deadline, then proceeding with what you have when the clock reaches zero. While the two are not strictly related, when I think of meeting a deadline no matter what I tend to think of the software development philosophy, KISS (Keep It Simple, Stupid). Another way to describe this would be to employ a minimalist design philosophy: Keep things to the bare minimum and only add the functionally that is absolutely needed to get the job done, and no more.

Complexity and scope creep (the phenomenon where more and more seemingly minor tasks or requirements are added to a project over time) are the arch-enemies of getting things done on time.

The nice thing about working towards strict deadlines is it encourages people to get things done quickly, and make every minute count. It also creates a nice air or fear and stress around the office, that a perceptive person can pick up on fairly quickly simply by looking around. ("Nice" isn't actually a good way to describe things that diminish the quality of and shorten employee's lives). The down side of this strategy is that projects that have an absolute deadline run the risk of being released even though they do not meet user requirements (released in a very broken state).

While this strategy is often applied to multi-million dollar projects, one thing many people don’t realize is you can apply this deadline-oriented, minimalist principle to very small tasks (an hour or less). That is what I did today: I wanted to write a simple JavaScript game but not spend a lot of time designing or programming the game. I gave myself 15 minutes to conceptualize and design it. Then another 15 minutes to write it.

I decided on card game I used to play in a childhood’s friend’s basement called In-between, or Acey-Deuce. Basically two cards are dealt, and you guess whether the next card dealt’s value is higher, lower, or in between the first two cards. While this would be a great opportunity to make card and deck objects, arrays, and a shuffling algorithm, I opted for simple KISS/minimalist integers instead of something representing playing cards.

Anything beyond a basic layout for the UI, like using CSS, was not part of my design spec and was not included. Every time I look at the game I laugh at how ugly it looks, but here the key thing is it is functional (it performs per specifications) and it was done on time. Remember, we got to the moon with ugly UI's:

Image courtesy of Mysid, NASA.
This doesn’t look very friendly to non-astronauts… What no custom wallpaper? Where is the minimize button anyway? In all actuality this was revolutionary in terms of UI design for the 1960's, and could easily compete with some consumer electronics from the 1980's.

The code for In-between shows the basic use of if statements, variables, Math.ceil which rounds numbers up, and Math.random, which returns a random number between 0 and 1.

Variables in JavaScript are a bit different from other popular languages. Variables are loosely typed meaning that you do not have to declare the type (int, bool, String, etc) of the variable as you do in languages like C#, Java, or Objective-C. A variable is simply declared via:

var myVariable;

They can be assigned and declared as in other languages:

var myVariable = 6;
var myOtherVariable = "my string literal";

Some JavaScript programmers prefer to use underscores in their variable names rather than camel case, so the above could appear as "my_variable"

Variable scope is handled as follows:

A variable declared within a function is local and can only be accessed within that function.

A variable declared outside a function is global in scope, and all functions on the web page can access it. Much like other languages, variables are temporary and are deallocated when you close the page (like closing a Java application).

You do not even need to include the keyword var, and you can assign a value to the variable name, however doing so makes the variable global.

Anyway the code is below, followed by the game itself:

24Jun/110

Introduction to JavaScript

JavaScript is a scripting language that is used in conjunction with markup languages like HTML to create interactive (dynamic) web pages. Interactive web pages respond to the user’s actions like clicks or mouseovers, or the user’s browser information such as their native language, what type of browser they are using, or if they are using a particular device such as an a smartphone or an iPad. JavaScript can also be used to read, write, and erase the small text files on the user’s computer know as cookies.

JavaScript is pretty different from languages like Java/C#/Objective-C: it is weakly typed, dynamic and a functional language. While it is object-oriented, it does not support the use of classes, only objects (it is a prototype-based language). JavaScript has a large number of frameworks available to make it easier to use and provide new functionality, with one of the most common being JQuery.

On a basic level JavaScript can do many of the same things full-blown programming languages can do:

  • It can assign values to variables
  • Do mathematical functions
  • It has date and string objects
  • It has if and switch statements and for and while loops
  • It can handle exceptions with try, catch, and throw
  • It has simple timer method making animation and games possible

JavaScript is often referred to as a scripting language rather than a programming language since it is interpreted from its source code, and not compiled. Like HTML, a web browser reads JavaScript just as it is entered into a file with a simple text editor. Scripts were traditionally just used to control the execution of programs, or automate a sequence of simple steps, but now they control user interfaces on the web, do (lightweight) calculations, facilitate communications between client and server, do data validation, and run as more or less stand alone client-side applications with GWT, do simple operations within a PDF file, or even run as server-side applications with Node.js. In recent years the lines between scripting languages and programming languages are becoming less clear, and the differences less important.

Looking at its name people often wonder how JavaScript relates to Java. Although their names are similar, JavaScript is very different from, and has nothing to do with the programming language Java other than JavaScript was designed to look a bit like Java (they have similar keywords, naming conventions, and syntax). An interesting description I read once was Java is to JavaScript as a car is to a carpet. Other than their name, they are not really related to each other.

If you are interested in learning JavaScript you should also learn HTML since JavaScript is typically used to read, write, modify, and otherwise interact with HTML web pages. Learning some CSS is useful too if you intend on customizing the appearance (presentation) of the web page or offline browser application. An excellent resource for an introduction and reference to HTML, CSS and more is W3Schools. This article is written assuming you understand some basic HTML.

JavaScript can be created with a bare-bones text editor like Window’s Notepad, Apple’s TextEdit, or Ubunto’s gedit. Free and more powerful source code editors are available such as Notepad++ (one of my favorites) and Eclipse. There are also WYSIWYG (What You See Is What You Get) code generators that allow you to drag and drop or visually build websites like Adobe’s Dreamweaver, Microsoft Visual Studio, as well as free and open source editors. I never found a free WYSIWYG editor that I really liked, but your results may vary.

The simplest way to get some JavaScript up and running is to copy or enter it into your basic text editor and save it a with “.html” file extension. Then just open the .html file from your explorer or finder app which will open the HTML page and run any JavaScript in your web browser.

This is referred to as an embedded or inline script since the JavaScript is embedded into the HTML. If you plan on using the same script on multiple pages then you could write it into its own JavaScript file with a .js extension.

When embedded, JavaScript is contained within a HTML <script> element:

<script type="text/javascript">
document.write("Hello World!");
</script>

JavaScript can also use functions that can be called like methods in other languages like Java, C#, or Objective-C:

<script type="text/javascript">
function writeSomething()
{
document.write("Hello World!");
}
</script>

Scripts can be in the head or in the body of the HTML. When placed in the body, placing them just prior to is said to speed up loading. As with other languages, the semicolons terminate a statement. They are optional, but many consider it good practice to include them, and there are instances where a statement will not be evaluated correctly without semicolons.

document.write("Hello World!") writes the text within the quotes to the webpage. This text is written wherever this script is located on the page as can be seen in the example script below.

Another way to write to a webpage is by sending your text to a specific element with:

document.getElementById("placeToSayHello").innerHTML="Hello World!";

This statement tells your browser to write “Hello World!” to the div element named placeToSayHello.

Traditionally in computer programming your first program is a hello world application, where you instruct the system to output “Hello World” to a window or console. Below is our Hello World application for JavaScript that displays “Hello World” when you click on a button:

So with this script we implement a button that calls a method and we see two basic ways of writing text to a HTML document.

Want to see what JQuery can do? JQuery Site
Create JavaScript from Java: Google Web ToolKit summary

10May/112

JavaScript from Java: Google Web Toolkit – GWT

Programming for the web is a bit like creating a Frankenstein monster. It is an amalgamation of different technologies that weren’t always created to work together. It reminds me of Marry Shelly’s shambling monstrosity in that it is composed of seemingly unrelated parts, crudely sewn together to create something that ends up working somehow.

I imagine if web programming was reimagined and reinvented today there would be one language encompassing all the functionality of HTML, CSS, XML, JavaScript, and PHP/Ruby. You could even throw in C#/Java (or your favorite high level language), and some SQL, so you could do everything with one language.

All this will probably only happen in some dystopian future sometime after the English language is reengineered to be more efficient, consistent, and structured. That would be doubleplusgood, no?

Well enough philosophizing and on to some Google Web Toolkit goodness… I guess I could have titled this article “Google Web Toolkit: So you know some Java and you want to do some client-side web programming?”

Google Web Toolkit (GWT) is a set of development tools that includes a GUI designer for creating Ajax applications (client-side, interactive web applications than run on a browser). GWT allows you to write a program in Java and then compile them into a combination of JavaScript, HTML, and CSS. GWT is compatible with all the major browsers and is available as a stand-alone SDK or as a plug-in for Eclipse. I used the Eclipse plug-in.

I am not here to evangelize GWT, but rather to provide a Java developer’s initial opinion on and experience with the technology.

If you have some experience with Java, one nice thing about GWT is that you don’t need to learn JavaScript to produce a client-side web applications. The calculator application I wrote (see link at the bottom) required no use of JavaScript whatsoever on my part. The compiler did all the work for me.

GWT has the advantage over Flash in that GWT just requires a web browser, no plug-ins needed. So far the apps I have created with GWT have worked great on all the mobile devices I tested them on. Flash does not work on iOS, and has mixed results on Android.

Personally, I find that I can develop client side applications a lot quicker in GWT than in HTML/CSS/JavaScript. Normally you would create buttons, input boxes, and labels in HTML, format them for appearance and graphical behavior in CSS, then do some simple programming for the functionality of the application in JavaScript. The nice thing about GWT you can do most of this all in one place, in one language. You can then test and compile your application in the IDE, and it is pretty easy to deploy all the files to your server.

The SDK generates HTML and CSS pages for you but the HTML page requires a little configuring. Also to include any fancy formatting you have to modify the CSS page. For my calculator app I just changed a couple of titles and included a division to specify where to insert the app on the page with id="GWTCalcGoesHere". Google’s tutorial explains how to do all this.

On the negative side, I imagine that GWT can be likened to Dreamweaver (or a high level programming language) wherein the code produced is typically less compact and efficient than code written manually in the underlying technology. How significant the difference is, I don’t know. As with every programming technology there is a tradeoff between development time and cost vs. performance of the end product.

If you are already good at JavaScript (and enjoy using it) I would say stay with JavaScript. If you are good with Java and you want to write some client-side apps without fooling around with a lot of HTML, and JavaScript, GWT may be worth your time checking out.

To get started with GWT I recommend visiting Google’s GWT page, installing the software, and doing their StockWatcher tutorial. You can skip the CSS steps if you are not interested in making it look pretty. It only took me a couple of hours to get GWT installed, read the introductions, and do the tutorial. Then it took a few more hours to get comfortable with the libraries, and write a couple of apps. Assuming you developed a fair proficiency with Java, learning GWT should be pretty easy.

Although the bulk of the libraries I have worked with are from GWT and not JRE, GWT does a good job of keeping things Java-like so it is easy to find the method names you are looking for. The syntax is the same and for the simple projects I worked on it pretty much feels like you are writing a Java app when working with GWT. The GWT online documentation even closely resembles the Oracle API documentation for Java, so there is no new learning curve. I do wish it included more code examples but this can be said for any programming language’s online documentation.

(Google, if you are reading this I would be happy to write billions of code snippets for you at a highly affordable price.)

So below is the link to the simple calculator application and source code I wrote using the GWT plug-in for Eclipse:

GWT Calcualtor

I wouldn’t look at this as a shining example of great program construction, but rather a peek into a little of what GWT can do. Overall I found GWT to be enjoyable to use.

6May/110

Dictionary of Algorithms and Data Structures

The US National Institute of Standards and Technology (NIST):

They are small...
They are underfunded...
The other federal agencies sometimes ignore them...
It is almost impossible to talk to the person you need to on the first try...

...but they are so important.

Somehow I end up talking to them every 5 years or so. They are such a smart group of people and are very helpful.

Aside from maintaining measurement standards and researching measurement technology, NIST also has a nifty database of algorithms and data structures. Some of them have code examples.

Dictionary of Algorithms and Data Structures