Monday, April 20, 2009

JFreeChart Item Rendering

So, it seems that the only way built into JFreeChart to render lines is one segment at a time, rather than making it all into one path.

And yes, this can make a different when you, say, have dashed lines with many points along the way. Thick lines can also make certain end/join types cause trouble. (Sorry, too lazy to put up example pictures at the moment.)

Is there any way to make it draw a whole line at once?

Friday, April 17, 2009

GPGPU in our Eyes

Been reading Beautiful Evidence. With all the emphasis on information density, it makes me think about our minds as parallel processing engines. But you still need to get the data in there. Eyes are a really great way to input high-resolution 5-dimensional data (2 spacial, 3 color) for most people. Way better than reading words. Well, unless the picture can be conveyed in a few words.

This also reminds me of systems like numpy or MATLAB or such things where the language is slow but if you can get data into the low-level primitives, you can chunk things fast.

On a side note, I wonder how easy it is for people (especially those who are fully blind) to learn to make sense of bas relief data by touch.

Wednesday, April 8, 2009

Mono Gets Continuations

Looks like Mono is planning to one up Java (and Microsoft's .NET) again. It's continuations this time.

Miguel seems to be all about enabling technologies. Instead, Java seems to be about philosophy.

I'm still trying to dodge Mono for now, though.

Tuesday, April 7, 2009

OOP and Object Affordances

It occurred to me in the past week that there's a relationship between object-oriented programming and the psychological concept of real-world object affordances.

In our robotics research, we've mention Gibson's focus on how an affordance is not just about the object but about the agent (person) and the object. I can't grasp a basketball with one hand, for instance, but someone else can.

This reminds me of the topic of minimal interfaces on OOP and issues like mixins vs. extension methods. You can't possibly put everything you want about an object into its class (even with mixins). But how common are certain contexts (agents)? Only the most common things (if that can be determined) should be inside the class. That's my opinion. And the language should make other extensions as easily available as possible, now depending on your real context.

Multimethods also fit into this topic.

Quick, Regular, Open Book Quizzes

I've been thinking that weekly quizzes would help teach programming (or other subjects). They'd be online and multiple choice, focusing on concepts.

They'd be automatically graded, and open book (or internet, but maybe not open friend) would be fine, too.

The idea would be to "force" people to think regularly about the concepts. In order to answer the question, you'd have to think about it at least a little.

I say not open friend, because I don't want the help to be of the form ABBDCABADC. No thinking would be involved. Or maybe just make the answers in random order and unlabeled. Still maybe say no friends, but if they at least clicked the answers themselves, the answer-as-label might still require thinking.

Example question (and multiple answer could be nice, and I had a recommendation that partial-credit answers could also be cool):

Which of the following are expressions of type int?
  • 5
  • (int)Math.random()
  • 4.5
  • -4 + 1
  • "Hello"
  • "Hello".length()
Things like that. Maybe 5-10 questions per quiz.