Archive for the ‘Uncategorized’ Category

Old-school BASIC

Tuesday, August 3rd, 2010

We need more programming languages like BASIC. Not the thoroughly modernized, object-oriented, jazzed-up descendants of the language — I mean the original BASIC. Specifically, a language which can be readily understood by anyone reading it who has a background in algebra — and one which can be easily learned in a few minutes’ time.

I recently came across (okay, went looking for and found) the original paper describing 1964 Dartmouth BASIC. It’s amazing how clear the example code is — and how well-thought-out the stated goals of the language are.
Compare the following “Hello, World!” programs in BASIC and JAVA…


BASIC:
10 print "Hello, World!"
20 end


Java (Android code):
package com.paad.HelloWorld;

import android.app.Activity;
import android.os.Bundle;

public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}//onCreate
}

Java (required XML for Android):
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello, World!"
/>
<LinearLayout>


That’s a LOT of crap, just to put “Hello, World” on the screen! Not only that, but how would a beginning Java programmer know all of the names of the required functions, and which parameters they take? Java is supposed to, among other things, shield programmers from the “complexity” of languages like C. I think I’ll stick with the “complexity,” thanks.

Not only that, but an additional point of failure has been introduced: the code now depends on a schema that resides on a webserver at schemas.android.com. Should this webserver go offline (for instance, the Android platform goes out of fashion, the organization running the site goes bankrupt or just doesn’t have a good backup policy in place, or whatever), the code is now broken — dependent on an external reference that is no longer there.

Desktop Supercomputing

Wednesday, May 19th, 2010

Sometimes modern technology is fun, too. Especially when it involves GPGPU video cards with 128 processor cores, which can be used for parallel-computing tasks. Even more so, when modern systems support up to three of them. The combination of an interesting course on parallel computer architectures (including nVidia’s CUDA) and the availability of good deals on eBay for two additional video cards of the same make and model as the one I already had turns out to be the perfect recipe for getting started in homebrew supercomputing.

So far, I have them running the SETI@home BOINC client. At first, there was some kind of configuration problem — the work units hardly seemed to progress at all (much slower than the CPU version of the code). Since the initial estimated time for the CUDA version was much less, I figured something was wrong.

A quick Google search came up with a possible solution — disable SLI (gotta remember to switch it back on for Oblivion and Flight Sim), add “dummy plugs” to the two secondary GPUs, and extend the desktop — with Aero disabled — across the two dummy monitors.

It worked — and now the three GPUs are each crunching SETI work units roughly 20x faster than the CPU version of the code. (Overall, the relative system throughput just went from ~8 to ~70 or so.) I’m starting to see what nVidia means about the benefits of manycore computing, on problems like this.

Paleotech Transportation

Tuesday, January 19th, 2010

In other words, bipedal locomotion — walking!

My friend DOSquatch (not his real name, but it’s quite appropriate) has recently started a personal weight-loss program (and is doing quite well.) He has inspired me to get back into my routine of walking home from work (at least part of the way; it’s 4.7 miles, so I only do the entire distance when it’s reasonably light out.)

An interesting way to stay motivated, doing something like this, is to add up your mileage and then use a mapping program to chart your progress towards some distant goal. The “Virtual Me” is currently walking — very slowly — towards the Space Needle, in Seattle, WA. He’s very nearly to Harrisburg now (~90 miles), having started in Philadelphia!

Some geek observations on the art of walking:
* Cool weather is your friend. There are limitations to speed, and one of them is heat dissipation. I go a lot slower when it’s 80 degrees out than when it’s 50.
* Uphill can be just as easy as straight and level, provided you’re willing to go slower. Shorten your stride and pull it down a gear or two — no problem.
* People generally don’t walk very fast. I’m by no means athletic, but my standard cruising speed when walking tends to be a lot faster than most (~3 mph / ~5 km/hr). I’m not sure why this is, since I know many of these people could run circles around me if they cared. Weird.
* Know your neighborhoods. The nice thing about my route home is that there are plenty of options to stop and take the train along the way — there are twelve subway/trolley stations along the way, including the two near work and where I live. Some neighborhoods (and some SEPTA stations) are nicer than others, and that factors into my planning, too.

Redefining the word innovative…

Wednesday, May 6th, 2009

Take a look at the work of Theo Jansen. This guy is a paleotech artist par excellence — creating animal-like mechs out of hollow pipes, bottles, and plastic tubing. His “strandbeests” (“beach creatures”) are fascinating; he claims to have actually reinvented the wheel with the unique motion scheme they use — and he might be right.

The really interesting part, for me (and probably the reason why the strandbeests’ motion looks so natural and fluid), is that Jansen uses a genetic algorithm to design these creations.

His eventual goal is to have the ‘beests roam the beaches of Holland, living off of the wind and using their simple mechanical nervous systems to avoid dangers such as the ocean surf, dry sand, and storms.

I came across his work this evening while judging some student projects built for a freshman Engineering Technology course. One of the projects used a walker mechanism based on Jansen’s work.
Kids these days(!)

Coolest. App. EVER.

Tuesday, March 31st, 2009

I’ve just discovered Crayon Physics. Remember playing with crayons as a kid and imagining your drawings coming to life?

Well, imagine no longer. This is an excellent example of why computers are so cool. I’ve known about this for maybe a day or so, and already I’m thinking of it in terms of some of the Great Games I’ve known: Zork, Flight Simulator, Oblivion, etc.

Don’t bother with the instructions; just let your inner kindergartener out to play with it and you’ll figure it out in no time.

Take a look — it’s really amazing.

EDIT: (No, this is not an April Fool’s joke.)

In Soviet Russia…

Tuesday, March 24th, 2009

…memes perpetuate you!

OK — how I wound up having the “first” comment on the first video on YouTube, I’ll probably never know. Especially since I know for a fact that I wasn’t the first to comment (click the button to show the replies marked as spam if you don’t believe me). But judging from the number of “d00d u haz teh f1rst YouT00b commend eVar!” replies I get, I’m in danger of becoming a meme.

Apparently the word was coined by Richard Dawkins, though — so it’s not all bad.

im in ur youtubes confusing ur memes