Android tutorial: OnClickListener for a RadioGroup

by Marshall Farrier|2/9/11

This tutorial will show first how to create a RadioGroup listener and, second, how to identify specific buttons when you can't access them through a resource id. Anonymous radio buttons (and other views) will normally occur when you create them dynamically from a database or some other resource. I couldn't find a good tutorial on setting up a radio group when I was working on it myself, so I thought I would share what I've learned. This tutorial assumes that you know the basics of setting up activities and views. ... more

Graph library for Java

by Marshall Farrier|2/6/11

This library is a Java implementation of the graph datastructures and algorithms presented in Cormen, Leiserson, Rivest and Stein, Introduction to Algorithms, 3rd ed.(CLRS). I have also used some ideas from Robert Sedgewick's graph algorithms books (in C as well as in Java) and a few other sources. I started developing the library late last fall while working through the graph theoretical portion of CLRS. To begin with, I just found it helpful for getting a solid grasp of the material in the book. But then I also discovered that Java has no standard support for graphs (although there are several unofficial graph libraries for Java easily found by googling). Boost, by way of contrast, does provide C++ support for graphs. Since I intend to continue the study of graph theory both from a mathematical ... more

Android development: Creating a custom view

by Marshall Farrier|2/5/11

The technique I'll present here allows you to create a custom view entirely in Java, then embed that view into an XML layout. While there are already numerous tutorials for creating custom views both on the web and in the literature, I couldn't find anything that explained what is actually essential in this particular kind of configuration. So, I had to piece it together from tutorials that explained something kind of similar but still not quite the same and then the usual trial and error. ... more

Advanced Color Calculator

by Marshall Farrier|2/20/10

In this article I'd like to deal with some complexities that were omitted in my Simple Formulas for Calculating Tints and Shades. These complications arise when one attempts a more exact treatment of color saturation.

I should point out that here, as in my previous examination of color, I intend to treat only the mathematics of color--whether or not it corresponds ... more

Menus with JavaScript: Introduction

by Marshall Farrier|8/5/09

I've just started learning some basic JavaScript and have discovered how useful it can be for maintaining menus. In the following, I'll explain how to create menus with JavaScript without presupposing that you already know any JavaScript at all. Those who have no background in JavaScript should, however, be aware that punctuation is very important and pay careful attention to the punctuation patterns in the blocks of code I provide. JavaScript code is somewhat more forgiving of syntax errors than most compiled programming languages in that browsers sometimes ... more

Simple Formulas for Calculating Tints and Shades

by Marshall Farrier|2/12/10

Tints and shades provide additional color options for a GUI or website without clashing with its underlying color scheme. It is not entirely clear, however, just how in general to derive tints mathematically from a base color. Here, I'm going to present 2 simple formulas for deriving shades and for deriving tints. I'll then use the color scheme of this website to show the color range defined by each formula. While these formulas leave out many of the complications associated with saturation issues, I think they are still quite usable. ... more

Publishing Code on the Web

by Marshall Farrier|8/2/09

After deciding to create an I.T. website, I realized that I would often be posting solutions in the form of code. This site will frequently offer HTML code, CSS, JavaScript and other source code for creating desired effects on a web browser or for gathering or processing data in some special way. One could of course ask viewers to look at the source code in a separate window by applying the usual method, but I thought it would be a fun challenge (and certainly more elegant) to develop a C++ program that actually translates a page of source code (HTML, for example) into code that displays on a webpage what you see in your text editor. Viewers ... more