Monday, November 29, 2010

New algorithms are painful in any language.

I think this set of examples from helps to show the pain of unexpected algorithms. It's a simple case, but note that none of the examples is remarkably clearer or shorter than most of the others. Library and language niceties often help for common use cases (hashtables, sorting, matrix multiplication, ...). With time, the set of what's common grows. Most programmers don't need to write new algorithms. But if you do, you can't always expect your language or library to save you.

Monday, November 8, 2010

Trying to exit Java

Just before the Oracle vs. Google lawsuit, I started a Java project for my PhD research. It was my first Java project in a while. I do more C++, MATLAB, and Python these days. I chose Java because I know it well and it simplifies cross-platform for me. I considered JavaScript, but this project included (2D) physics. I wasn't convinced by the JavaScript physics engines out there compared to the state of JBox2D.

Well, I'm one of the folks that has been convinced that Java isn't really open source nor independently implementable. If you get in the way of Oracle revenue, they will sue you. That's not open. Sorry.

So, where do I go?

I have a language idea of my own with primary output targets being JS (for client) and C++ (for speedy batch programming or native apps), but I don't really have the time to implement that. I could use haXe. It's the most credible JS/C++ targeting language out there, in my experience, but I'm not convinced I want to go that route either.

My current plan is to improve my C++ skills. Really. Anti-C++ rhetoric is strong in the Java community, but I'm being convinced that it can be used for good instead of evil. I also plan to stay in touch with JS land. And maybe someday I'll make or use a language that targets both (such as haXe).

I just wished I'd used C++ for that 2D physics project.

Sunday, November 7, 2010

Mormon Articles of Faith: Number 1

I've recently felt like sharing some of my beliefs about more important things than tech. I belong to The Church of Jesus Christ of Latter-day Saints. In other words, I'm a Mormon. We get that nickname because of the Book of Mormon, which we believe is a record of ancient Christians living in the Americas. That, among other things, makes us different from many other folks.

We are also called LDS (Latter-day Saints, from the name of the church).

To share our beliefs, I feel like working from our Articles of Faith. (See here for what "articles of faith" are in general and here for the full list of the LDS articles.)

I'll start with our first article:

1. We believe in God, the Eternal Father, and in His Son, Jesus Christ, and in the Holy Ghost.

Here's a great discussion of this subject from Gordon B. Hinckley, who under Christ's direction was the leader of the church at the time of his passing in 2008. He had authority to speak officially for the church, and I don't.

Still, I may continue this thread and speak from my own understanding. If I do that, I may emphasize that it's what I personally believe, not what we believe. Again, I don't have authority to speak for the church, and I definitely don't know everything. But I still try to stay in harmony with the teachings of the church and with the will of God as I understand it. I do my best (sometimes). Note that even President Hinckley (the term we use for the leader of the church) used the phrase "I believe" in his discussion. Despite his authority, I think he also liked to emphasize a personal perspective sometimes. I once listened to President Hinckley speak at a soccer stadium in Guatemala City. (Here's a reference from him to that occasion in Guate.) He said (to the extent I remember his wording), "If you remember one thing from today, remember you heard Gordon Hinckley say that he knows God lives." I actually do remember very little else from his message that day.

Anyway, to summarize my take-aways for the first article of faith: I believe in a personal God, not just universal forces. Even more specifically, there are three distinct persons to which I refer as God. All three can be called "one God" because of their great unity. While I seek to follow the promptings of the Holy Spirit in my life, I understand Him less as an individual. That's just where I'm at. The Father and the Son are clearer to me, even if I haven't seen them myself during my time here on earth. The Son, Jesus Christ, came to earth (as discussed in the New Testament in the Holy Bible) as a manifestation of God on earth. He also came to be like us. He knows first hand what we go through. I find that comforting. Further, knowing the Son helps us to know the Father.

If I continue this subject, I'll have more to say about Jesus. Mormons really are Christians in the sense that Jesus is at the center of our belief and worship.

Finally, again, in case anyone skims too much (as I do): Everything I say is my personal perspective. I don't speak officially for the church by any means.

Friday, October 29, 2010

Mac OS X Lion goes full screen

As a former Amiga user, I've long been a fan of full screen apps. This is also an area where Windows and Linux have outshined Mac with its not-really-even-a-maximize-button user interface. So this new plan full screen apps plan for Lion is really interesting to me.

Sadly, I fear the Mac App Store is just the first step toward completely eliminating traditional application distribution on the Mac. We'll see where they are in 10 years.

On a side note, I do still need to pardon Apple since they removed the draconian anti-Flash clause for iPhone app development. Can't ignore them, though. They'll likely be back at things along those lines (or other troubles of similar magnitude) before too long.

Wednesday, September 15, 2010

Wishing for TextPad bookmarks in Eclipse ...

There's one feature of TextPad that's just wonderfully convenient and helpful. It's called bookmarked lines.

You can mark lines by search (meaning by regexes), you can cut or copy marked lines, go forward/backward to next marked line, see them visually of course, and do other similar things.

What's the point? It means you don't need to drop down to a shell for things like grep or such like. They're really nice, actually. I used them just constantly when I was regularly on TextPad. I can't say enough nice things about them, really.

Please, please, please, please, please could someone put them in Eclipse? (Sorry for being a beggar rather than a helper.)

If Eclipse weren't already too complicated, I'd recommend an easy swap technique between different bookmark categories. Sometimes I would want to remember certain markings when temporarily moving to others. One option is to open the same contents multiple times (such as by copy and paste to a new document), but that was a pain really. But I'm afraid that anyone in Eclipse land would make a horror out of trying to manage multiple marker categories. So just one would be great for now.

And as another point, current Eclipse bookmarks are _nowhere_ near as good as TextPad's, despite a superficial similarity. But they could perhaps be improved to provide real service.

Thanks in advance!

Sunday, August 29, 2010

Some 2005 violent death statistics

Apologies on the weak formatting, but here we go:
Why 2005? That's the most recent year for which I found stats on abortions. (So, yes my focus is biased.) Good news is that the abortion rate seems to be declining despite being a behemoth here. I have guesses of why, but I haven't studied enough to state hypotheses right here.

Feel free to add to or improve the data or to find better sources.

Monday, August 23, 2010

Oracle: We've got a bill of sale right here!

This is what Oracle reminds me of:

Cell phone Java a la Pete's Dragon follows.

Oracle: We got a bill of sale right here that says he belongs to us!

Google: You don't love him. All you've done up 'til now is break his heart. You'll abuse him, and just use him.

As for me, I'm sick of the corporate shenanigans in Java. And why didn't Google buy Sun when they had the chance? I'm getting tired of Java in general. But sorry Miguel, that doesn't mean I'm running to Mono. There are plenty more fish in the ocean.

Tuesday, June 29, 2010

In-Mouse Accelerometers

From the leaked Windows 8 plans, it seems that Microsoft is looking at a future with richer sensors on personal computers. I would love to see this happen. I'm a big fan of Apple's popularization of accelerometers in mobile devices, too. Interaction can be so much richer than just keyboard, mouse, monitor, and speakers. Ubiquitous cameras and microphones would be sweet, though creepy.

On that topic, someone in my research lab recently made a comment about how cool it would be to put accelerometers and gyros in mice. Potentially you could go without the light sensor entirely. See IMUs for more. The Wii remote is sort of like this. And accelerometer mice have been made before.

The counter argument (from someone else in my lab here) is that full accelerometers and gyros would be much more expensive than current mouse technology, especially for the same amount of reliability and precision. But accelerometers and IMUs aren't completely off the charts for price. Maybe you could go cheap and just augment normal mice with accelerometer only for now. (And the raw part is even much cheaper than the breakout boards.)

I mean, it would be sweet if you could pick up your mouse and wave it around for 3D control in certain apps and games, right?

Logitech, Microsoft, Apple, someone, please get this out there. Thanks in advance.

Thursday, May 20, 2010

WebGL and NaCl on Google Chrome on Lucid 64-bit

Just reporting that the latest dev channel version of Google Chrome runs NaCl demos (using local Python-based server) and WebGL demos beautifully on the 64-bit Ubuntu 10.04 computer I'm using. Just '--enable-nacl --enable-webgl' (and maybe '--user-data-dir=...'), and you're running.

Don't use this configuration for everyday browsing, of course. Who knows how many security holes there are.

Chrome Extensions are a piece of cake to work with, too. I hope Mozilla Jetpack gets Firefox there soon. Old-timey Firefox extensions are just painful. Well, not that I should need an extension if I have NaCl, but it's still nice. And the extension would potentially allow one load for all sites instead of separate load per site.

Hrmm. Next question, can I put Bullet Physics into Chrome NaCl without much blood, sweat, or tears? If so, I think I won the sweepstakes.

Please say we get this stuff by default in our browsers soon. Pretty please. I mean, I can't hardly believe how nice this would be.

Thursday, April 22, 2010

Google Chrome Frame is my hero.

Well, I hope it will be once it's out.

The thought of fixing IE once and for all just gives me chills.

In any case, Chrome Frame answers my previous hopes for a Gecko-based version of the same idea.

Friday, April 16, 2010

And a function never cries.

I've been getting fed up with the question of what methods to put in a class which helper methods should be elsewhere. Mixins and extension methods are two ways to address this topic. They have their pros and cons.

But I'm becoming more and more a fan of simple, top-level functions. Wither OOP. Everything old is new again for me, and each function can be an island, especially with multiple dispatch.

Well, there's that question of how to control data access and abstraction of types. I don't have it fully worked out yet, but I'm hoping to find a nice solution that keeps things as simple as possible.

Tuesday, April 13, 2010

Why developmental robotics?

The field of developmental robotics is often approached in a philosophical fashion. That's awesome and all, but there's also the practical reason: laziness. But I guess I've said this before.

Side note, I'm not sure I really get the difference between laziness and impatience.

Friday, April 9, 2010

Reason to boycott (and litigate against) Apple?

This whole iPhone section 3.3.1 thing is nasty. Sure, UIs are notoriously bad when ported, despite some examples to the contrary, but let an approver or the user base sort that out. Further, some base features (not always written in C!) are helpful across platforms even if the UI is tricked out for each.

Apple's a worse monopoly than Microsoft. I can't think enough how much I don't ever want to give Apple any money ever again.

Sadly, my convictions wane with time, but I'm not in the habit of giving Apple money anyway. One Mac Mini and one iPod a few years ago. A bit of iTunes. But I think it's time for me to write them off.

The only reason to have a Mac is to make sure apps and web pages do work there.

I wouldn't be surprised if Apple's in a long-term strategy to eliminate traditional Macs entirely. They'll have revenue reasons enough with some time as well as migration strategies for developers currently banking on Mac. Then, it's just App Store land ...

Surroundings as Database

I've been studying how a robot (or a person) can make sense of the world around them. How do you focus on (or extract) what matters most?

Some systems of describing world/environment state make these look almost like queries. If there "exists some table such that there exist chairs around it and also plates around on the table, one per chair" then I suspect it's a table set for a meal. If "I'm driving and there exists a person in front of me that is too close" then I need to hit the breaks. Things like that.

Those with DB experience see the queries just standing out. Trick is that a big DB needs indexing to be fast enough.

Look around you. Imagine all the tables, columns, and rows you could imagine describing every feature from large to small scale. That's a HUGE database. When dropped in an unfamiliar setting, we talk about "getting our bearings". I'm starting to think this is sort of like populating a DB and building indexes. Somewhat familiar settings allow us to prioritize such data loads easier.

Now, the world isn't static. Visit a place you know, and some things might have changed behind your back. Stay in one place or walk around, and slight changes occur constantly. That's like ordinary DB updates, inserts, and deletes. Should be faster than working from scratch, since most of the data is static and already indexed.

As I've written this out just now, I've become more and more convinced that this is a good model for things. Well, it doesn't need enslaved to DB idioms, but the general concepts are still so close.

Thursday, April 8, 2010

Accessible AI Research: MakeME PlayME

Just heard about MakeME PlayME from the Cognitive Computing Lab at Georgia Tech. It might not be a perfect site, but it's still a great example of exposing research to the general public. This is along the lines of how I'd like to present research (especially the 2nd-to-last bullet there). Maybe someday.

Meanwhile, hats off to the MakeME PlayME team (and other teams with similar styles).

Friday, March 26, 2010

Don't EVER pop open windows at me!

One thing that Linux (well, my Gnome on Ubuntu 8.04), Mac, and Windows all fail at MISERABLY is the whole popping open unexpected windows thing.

Really, really, really, no window manager should EVER put another window in front of me while I'm doing something unrelated. Put it behind my current window. Put a notice on the task bar. Maybe even slide out a little notice bubble in the corner, but DON'T COVER WHAT I'M DOING, and DON'T STEAL MY KEYBOARD FOCUS!

I bet enough information is already available to most window managers to cover 95% of the cases where I currently have problems. Just come on folks, don't you think you can take care of this problem????

Friday, February 26, 2010

The iPad vs. The Programmer

Whether Apple has literally used magic or not in the creation of the iPad, it seems primarily targeted at everyday users with common needs. One can't run arbitrary software on it, so it can't do the same thing for me as my Dell Mini where I frequently use Eclipse.

But the iPad can run office software, games, other apps, and HTML. My understanding is that JITs aren't supported on the iPhone, but I guess you could do interpreted program execution.

I think that HTML is the important item here. If the iPad or other limited devices gain enough traction to impact usage of traditional notebook computer, what does that do to programmers like me? I can always still be a minority notebook user or stick to desktops, but what do I do when cheap and convenient leave me behind?

I predict that such market trends will push even more app usage onto the web. Development environments like Mozilla's Bespin might eventually catch on. All I need is a browser to code, and the iPad has that.

Further, what is the best deployment platform? Sure, I can write iPad apps ... or I can make web apps which can work all around. Firefox 3.6 includes support for device orientation detection. I don't know where HTML5 or other browsers are in relation to support for such features, but I imagine it's coming.

So, where do we code? The web. What do we code for? The web. It's not a completely true story today, but devices like the iPad push it closer. Web domination marches on.