we get signal

2009-08-25

Leveling up in Project Euler: Cube

(tags programming, Ruby, Clojure, Project Euler)

I leveled up in Project Euler! Woot! I'm now a Level 2 "(Regular) Cube".

Project Euler: I leveled up to a Cube!

I solved 59 out of 252, and 45 more than last time. BTW, when I solved the 25th problem, I awarded the "Regular Tetrahedron". These awards are part of the five Platonic Solids. Cool.

Project Euler: 59 out of 252 problems

I'm still using Ruby, basically Ruby 1.9.1 on Windows via the yet-to-hit-1.0-status RubyInstaller. It's much faster and smaller than the One-Click Ruby Installer, which is now officially dead.

I also re-solved some of the initial problems with Clojure. It's hard to wrap my head around it, though.

Now back to playing some games!

Labels: , , ,

2009-03-17

Please don't file bugs

(tags programming)

"Please don't file bugs. At this point there are so many gaping holes that finding bugs is not the problem and dealing with them is just a distraction."

Taken from the early pre-alpha build of linux Chromium, the Google Chrome-derived browser.

Labels:

2009-03-14

Discrete Math Achievements: Project Euler

(tags programming, Ruby, Project Euler)

I sure need to put these type of posts into my programming blog, but obviously I don't have one at the moment. Still check it, programming Achievements. A whole lot cheeper than DLC.

Project Euler, or You put Achievements in my Programming

Project Euler is a programming site that revolves around posing discrete math problems like finding the sum of all the prime numbers below two million (problem 10). You create an account for free, you fill in your attempted answer, and if you get the answer right, you get a green icon and access to the discussion forums on that problem. I think the best part is it shows your status in Xbox Live-like Achievement icons and also it shows how many people have solved the same problem. Plus the guarantee that the problems are posed such that you will be able to solve them in 60 seconds execution time using a modern computer gives me instant feedback.

I still have some work to finish just to shrug off my newbie status, eg. to reach first level rank I need to solve 25. The problems aren't too hard, though I am concerned that I am using I am brute forcing a lot using Ruby. Yes Ruby. Using Ruby feels natural to me, because the flow of thinking, typing, and running is uninterrupted (using the REPL inside Emacs is just golden). I am also trying to solve the problems in C++ (it's not that bad) and Clojure (actually haven't started yet). But first I explore using Ruby.

And here I am thinking I should be trying out Python because it has better multi-platform support (Windows is a first-class citizen), execution speed faster than Ruby, and I don't have a problem with whitespace as syntax. While I'm at it, I should just try on JavaScript and Common Lisp versions as well. Or go crazy and try to do it in AutoHotKey, Visual Basic 6 (this one pays money, I'm sad to say), Windows Command Shell, or even Gnu Bash. Yeah right.

These aren't really "push-ups" for regular programmers though, because I think they are far removed from regular application programming, which is just pretty much pushing data from one place to another. Plus I'm pretty sure there are no compiler questions, given that Euler manning the post. But I think it's great practice for thinking about efficiency vs premature optimization (at the design and execution level, etc).

Labels: , ,

2009-02-01

Considering desktop programming: Qt

(tags failure, programming)

I got back into using C++ at work, and it's pretty fun now. So now I'm looking at doing some desktop programming for fun. Good timing too, because the cross platform open-source GUI toolkit called Qt is going LGPL. Some Qt programs that I use enthusiastically are Google Earth and VLC (0.9 series). Let me not forget KDE, which I use whenever I go for a graphical Linux (which is rare but still). Basically Nokia swallowed the relatively little fish called Trolltech and now wants to spread this GUI all over the place.

This opens up options for using it at work, or at least for my hobby programming. I was dreading to learn the MFC, and ATL/WTL would be great but I would have to buy a recent Microsoft compiler to get the good stuff. With that kinda money I could be buying a new PC. :-/

The license change won't happen till March. This doesn't really affect me, since I don't intend to use it for work yet. There is that license clause which states you can't use the open-source version to jump start your commercial development. Nokia can't really check you're playing by the rules through technology, but it would look real suspicious releasing a full featured 1.0 product only days after buying a commercial Qt license.

Oh and I'm still considering Java Virtual Machine targeted programming. But not Java. Hell no. I'm thinking of dabbling with JRuby or Clojure. The latter has me high on hype fumes with its Software Transactional Memory this and Lisp-but-even-better that. Since Qt has bindings with Java, that means I can used it from these JVM hosted languages as well.

I need to practice more programming. This will probably impact my game playing. No more long RPGs for me. Haha, famous last words.

Labels: ,

2008-02-14

Code philosophy review

(tags programming, Ruby, Lisp, failure)

After the disappointment that was Paul Graham's Arc and the bewildering "Portrait of a Noob" by Steve Yegge, which insisted that comments and static typing are useless metadata, I found Planet Emacsen contributor Bryan Murdock's pointer to the discipline and punish blog a refreshing change.

No scratch that. I am questioning my reality now. That programming blog, which takes a practical and weathered engineer tone, has great links about questioning recent programmer fads, especially the current whipping boy (and my favorite comfort squeeze), Ruby.

All of these great posts I got from discipline and punish blog. Suffice it to say I subscribed.

I am afraid to post anything now about programming now. Best to just keep quiet and fap to Emacs.

Labels: , , ,

2008-01-19

New darlings? Ruby 1.9.0, Scala, Git

(tags programming, Ruby, Scala, version control, Git)

Here's some software related things bumping around in my mind.

Ruby programming language logo

Well the programming language Ruby 1.9.0 was released last month to much back-slapping. I've been sitting on this topic for the last few weeks, and not evidently learning very much, even though there was an native language interview between the two important developers on this release, Yukihiro Matsumoto, the original Ruby designer and Koichi Sasada, the sole person responsible for the 1.9 virtual machine. I originally referenced the Ruby Inside article "Ruby 1.9 Is Released", which had a link to a great side-by-side version testing post by Dave Thomas, but the InfoQ article "Ruby 1.9 - When Will It be Production Ready" gives a great overview after a few weeks of reaction. In short, it's not production ready now. :-( Yes I know that wasn't the point of the release.


I understand that the new virtual machine in Ruby 1.9.0 gives some better performance, but it sounds like NIH syndrome. What about Java's JVM, which has better multiprocessor and multithread support? Not that I know how to use it, but when I do, I'm sure glad that JRuby will be around to support it. Then again I haven't needed those things but I'm not writing those big trusty (web) apps. Okay okay, JVM is a whole other can of worms, and Matsumoto et al is good to stick to the platforms that he knows the best.

The part of programming blogosphere that fawned on Ruby on Rails and alternative programming languages is now casting a bright light on Scala, a programming language built on top of the JVM. I don't know anything about it and I haven't read anything yet that makes me want to use it. There is the theory that the programming bloggers making money and recognition off of books and teaching seminars continually look for the next language, decrying that you are missing the silver bullet (of the moment) if you don't pay attention. Personally I'm all for the invention of new tools, but I hate learning syntax all over again. DWIM, now. At least there are reviewers with loud blogs to read... yeah, I know I should evaluate it for myself.

Git logo for the Windows port git on Msys

Lately, I've been researching Git, the distributed source control management software invented by Linus Torvalds who is also the person who created the kernel Linux. (Does he really need my introduction?) It's been out for more than two years and is very stable because tens of thousands of users have been pounding on it every day. However only recently the Windows port that I want to use, git on msys, has been coming along really nice. Wow, the graphical explorer apps gitk and git gui now just works. I am still a Subversion and TortoiseSVN junkie, even introducing it at my work for the past 3 years because anything is better than zip files with dates on them. Ugh. Although one part of me cheers that many open source projects now are using Subversion instead of archaic CVS, another part wants them to skip to Git. Come on, everybody's doing it. Well it's not a black and white issue though, you can combine CVS with git, or Subversion with git, for example Git for SBCL Hackers (usually using CVS) by my Common Lisp source, Bill Clementson.

I don't think I can foist Git onto work at the moment. The Windows platform is really a second-class citizen from the Git developers perspective, and it shows when core operations break or refuse to function. Well it doesn't lose data, just that checkouts don't work, etc. I also test on a Linux OS-based VM, so I know true for various values of true. I've figured out how to expose a git repository via the web using Apache and WebDAV on Windows, which is my perferred way of publishing. I'm making a short checklist and questions that I want answered, and so far the evaluation is not very satisfactory. But I enjoy the concept of distributed, offline version control.

In fact git is just another straw on my camel-fied back that makes me question my Windows dependence. If I continue to play my game consoles, my primary reason for maintaining my home Windows machines is reduced. Recently I was disappointed that the version of Asus Eee notebook PC coming to Japan will have Windows XP Home installed, instead of a Debian-like Linux distribution. And my drool for the Macbook Air reminds me about how OSX is turning into a great programming development environment. Why should I continue to deal with Windows idiosyncracies? Oh okay, work is forcing me to use it and I like PC gaming (on occasion).

All this cursory exploration is putting me off of my goal of learning Common Lisp. Ugh.

edit: added some pictures, some links

Labels: , , , ,

2007-12-08

Steve Yegge on improving Emacs with JavaScript

(tags Emacs, Lisp, Javascript, programming, Ruby)

I must have been dozing off while reading his latest blog post the first time. Steve Yegge, formerly stealing thunder by writing a Ruby on Rails clone in JavaScript called Rhino on Rails, is now adding his touch to Emacs:

I should also mention I've been working on an Ecma-262 compliant JavaScript interpreter in Emacs-Lisp...

The short synopsis is that I'm building a complete JavaScript environment in Emacs-Lisp, with two goals: (1) create a world-class JavaScript IDE for Emacs, and (2) permit writing Emacs extensions in JavaScript, since (2a) people aren't exactly flocking to elisp, and (2b) JavaScript turns out to be a better language, now that I know them both in excruciating detail. Emacs is a great environment that needs a better extension language, and JavaScript seems well suited to navigate the popularity-vs.-elegance tightrope I'm faced with.

That's the elevator pitch: puts people to sleep in 20 seconds, guaranteed.

No, Mr. Yegge of Google and Effective Emacs fame, you have got me excited! :^)

I hate to say it, but despite the countless of hours I have been tweaking with it, Emacs Lisp is not a production language (though it must be really stable to be on version "22" (really though its version 1.22 but they dropped the 1 decades ago)). It sure doesn't have a great library situation. Then again, this infurates me because I thought Emacs Lisp "higher on the totem pole" than JavaScript, because of its macros and Common Lisp as a close relative.

JavaScript must be the world's most run language, though, because it is the basis for client-side interactivity in all major Internet browsers applications. It is Prototype-based language like Self, Lua (not just a scripting language in World of Warcraft, of course) and Io. JavaScript also lives as the Firefox extension language and as Windows Scripting engine JScript and countless other things. JavaScript allows you to flexibly model with object-orientation, but I don't see how this lets you extend the base language like Lisp macros. I mean, who wouldn't want the ability to redefine what "is" is?

;; Emacs Lisp
(flet ((is (&rest args) (what-I-define-is-is args)))
(what-was-the-question-again))

Since Yegge is only devoting 3 hours of time and will probably be able to release something in a year from now, I'll have time to bone up on more JavaScript and maybe I'll learn that I can rewrite "is" in Javascript and mean what I say.

// JavaScript
function (the_question) {
var is_original = is;
var is = what_I_define_is_is( arguments );
return the_question( arguments );
}(what_was_the_question_again);


Unfortunately this is the best I could come up with and it still doesn't do what I mean. :-/ Or is it Microsoft Windows Script Host 5.6 is unreliable? :-( Maybe I need this?

But you know what, there are already modules that allows you to write Emacs Lisp extensions in another language. For Ruby, there's el4r or EmacsLisp For Ruby. It's not as ambitious as Yegge though, because he's shooting for a JavaScript to Emacs Lisp byte code emitter and a IDE. I myself am not exactly writing Emacs stuff in Ruby though, despite my rabid fanboyism. :-(

Labels: , , , ,

2007-12-02

Extracting the rest of the fun out of Unreal Tournament 3

(tags game, Unreal Tournament, FPS, failure, programming, quotation)

Well Saturday afternoon was altogether a disappointment on the Unreal Tournament 3 front. I can't play UT3 and have fun at the same time because of my slow computer Project Sugar. For example, on the first campaign map, which is just one-on-one deathmatch with your character's sister "Jester", my computer freezes then revives then freezes, in about 2 minute intervals. If I turn off the ATI video card "VPU Crash Utility", I can complete the map but with these painful 30 second black screen interruptions. :-( Never mind that the graphics are rendered at 320x200 with double-sizing and the mouse feels laggy. At least I can log in with my "CD-KEY" so its not pre-h4XX0r'd.

So I decided to see what else I can do. I ran the Credits, probably the last thing I would do if ever. Now I know why the install directory is 6+ GB. There's pictures of all the developer and artists in there. Heh.

UT3 Credits Roll: Tim Sweeney
Tim Sweeney: "It is easier to change the world than to adapt to it."

Tim Sweeney is one of my personal programmer heros. I would personally rank him over John Carmack because the former is frequently thinking about higher-level programming idioms as well as making game engines. Well it's my humble opinion that making programming easier for people has more priority than tuning to the machine. Maybe this is an ivory tower versus everyman battle, since John Carmack is also very inspirational with his code-for-all open-source stance.

I was a bit surprised with his low-key presence in UT3. Then again he's reportedly off in the clouds thinking about the next game engine, Unreal Engine 4.

Instead of thanking his support, Sweeney chose to be inspiring. This seems to be a rephrasing of a George Bernard Shaw quote: "The reasonable man adapts himself to the conditions that surround him... The unreasonable man adapts surrounding conditions to himself... All progress depends on the unreasonable man." Go progress!

UT3 Credits Roll: Cliff Bleszinski
Cliff Bleszinski: "Love is the triumph of imagination over intelligence."

Cliff Bleszinski is also one of my heroes, not just because we share first names. He's a gamer turned game dev and is really good at map flow, speeches and hyping. But I don't know if he programs or what. I do know he's pretty artistic with his CliffyB's Ownage Map selections from UT99 and UT2004 (sadly dead link?). His quote is acutally directly lifted from H.L. Mencken. I still wonder why Mencken said that originally.

In any case, UT3 will be sitting on my hard drive unused. And, no I can't extract the music because its locked up. Looks like I'll have to buy the soundtrack. Whoa, this site has all the soundtracks I have been wanting recently, Halo 3, UT3, and Mass Effect.

Labels: , , , , ,

2007-07-31

Intellectually stimulating: Open-Source Convention

(tags programming, conference, presentation, video)

Two people on my blog reading list pointed out the O'Reilly Open Source Convention 2007 free presentation videos. Just go to that page and start click on the videos to be amazed.

John Lam of IronRuby fame pointed out Microsoft Research and Haskell primary architect Simon Peyton-Jones's talk "Transactional Memory for Concurrent Programming". This talk is pretty much about designing programming languages to give you more abstraction with regards to the upcoming multiprocessing push. Haskell already has this idea, but it sounds similar to an Erlang concept.

Also I watched Ben Fry's "The Processing Development Environment" but making programming easier for non-programmers is not one of my primary interests.

I also stayed for a video by the Intel guys explaining their new open-sourced C++ compiler toolkit in "Outfitting for Multi-core Parallelism". I loved how they had a suit guy and jeans guy. James Reinders as the suit guy adjusts his vocabulary to be receptive to the open-source advocates, despite being head of Marketing of Open-Source Products (or is it just an act?).

But I didn't watch all the videos, and I almost missed a great one if it wasn't for Bryan Murdock's linkage to it "Yegge on Branding (Marketing, eww)". Steve Yegge of the Amazon, Emacs, and lately Rails on Javascript fame, gave a open-ended talk called "How to Ignore Marketing and Become Irrelevant in Two Easy Steps"about creating a successful brand. The biggest problem he claims is that the term "open-source" definition is so loose that it is not an effective brand. As a presenter, Yegge makes me motion sick because he moves around a lot, but nevertheless he is very articulate and spontaneously funny.

In making this post watched them all again, thus making me late to go out. I'm going to have to watch the rest of the videos later.

Labels: , , ,