Almost Partial Methods Using Higher Order Messaging

October 11th, 2006

What started out as a mission to improve the current syntax for currying in Ruby evolved into something else. Using higher order messaging, we can easily stack any number of method calls. Observe:

public
def partial(calls=[])
  HigherOrderMessage.new do |id, *args|
    partial(calls.dup << [id, args])
  end
end

Buy generic ambien
Drug laws ohio diet phentermine
Dosages xanax
Lotrimin
Buy Meridia
Lorazepam
Coreg
Phentermine caffeine
Buy Adderall
Perphenazine
Buy phentermine without prescription
Phentermine from the uk
Cialis on line
Phentermine and sibutramine be combined
Hydrocodone medication
Purchase phentermine
Natural alternative to viagra
Cheap diet phentermine pill
Celebrex
Cialis generic india
Information viagra
Low cost phentermine health insurance lead
Alternative to viagra
Xanax no prescription needed
Feldene
Fosfomycin
Phentermine cheap
Buy cialis without prescription
Benazepril
Ordering 30mg phentermine
Buy phentermine shipped usps
Anxiety disorder xanax
Cheapest cialis generic
Amikacin
Phentermine ephedrine
Imitrex
Glyburide
Book buy online order viagra
Long term phentermine use
Liver problems from xanax
Viagra alternate
Tramadol narcotic
Order phentermine online without perscription
Itraconazole
Hydrocodone
Flutamide
Albendazole
Cialis forum
Herbal viagra uk
Plendil
Ciprofloxacin
Phentermine international order
Generic viagra overnight
Terazosin
Linezolid
Carbamazepine
Aldara
Filing income tax phentermine
Lunesta
Online pharmacy tramadol
Avalide
Mirapex
Ambien cr dosage
Cefadroxil
Buy cheapest online viagra
Pyrilamine
Probucol
Lamotrigine
Nefazodone
Viagra high blood pressure
Cialis levitra sales viagra
Prescription free viagra
Purchase cialis online
Trimethoprim
Lovenox
Xanax long term use
Narcotic tramadol
Piperidolate
Hydrocodone drug
Pfizer viagra sperm
Hydrocodone information
Xanax and grapefruit
Generic meridia
Phentermine discount no prescription
Tyropanoate
Fluconazole
Meridia
Alka seltzer
Viagra sales uk
Phentermine 37.5mg
Viagra cialis levivia comparison
Cialis reviews
Viagra online pharmacy
Insulin
Levivia vs viagra
Cheapest cialis
Keppra
Naproxen
Viagra and high blood pressure
Best phentermine pharmacies compare links
Imodium
Does phentermine help weight loss
Haldol
Phentermine 37 5
Fluticasone
Phentermine pharmacies
Cope
Ambien overdose
Phentermine 90
Viagra samples free
Cheap viagra
Cheap viagra canada
Dyazide
Loperamide
Rabeprazole
Pfizer xanax pills
Prinivil
Phentermine by fedex
Order viagra buying viagra uk
Sophia viagra
Acetaminophen
Online phentermine
Generic viagra uk
Naltrexone
Sell viagra
Phentermine 90 day
Ethoheptazine
Catapres
Tramadol drug test
Free shipping phentermine
Amitriptyline
Divalproex
Propantheline
Phentermine 37.5 free shipping
Buy ambien online
Cheap phentermine 37.5 mg
Xanax in early pregnancy
Online ordering viagra
Pal pay phentermine
Cymbalta
Amprenavir
Lipitor
Phentermine info
Phentermine success stories
Phentermine online prescriptions
Probenecid
Nitroglycerin
Purchase phentermine online
Secobarbital
Buy cheap generic viagra
Read the rest of this entry »

From the archive: I’m Wrong About Everything

July 11th, 2006

I, Tiberius Istarius Drusus Nero—, uh, let me start over. So, first entry. What should I write here? Most people seem to favor some kind of introduction, so here goes. I’m presently 24 years old and I’m studying for a master’s degree in computer science. My master’s thesis is about scan matching, but it’s unlikely you’ll hear anything about that here. I have myriads of interests on an amaetur level though: philosophy, math, science, web development, typography, MMA (as a fan, that is), gaming, and movies, to name a few.

Higher Order Messaging in Ruby

October 8th, 2006

Having played around with Ruby for some six months now, I feel confident enough to make my first post on the subject. It’s going be about Higher Order Messaging, and it’s more of an expansion on an excellent description by Nat Pryce. I’m writing this post partly because I feel my implementation is a tad better (less cumbersome, as one need not define a class for each new method), and partly because it feels like his post has gone largely unnoticed.

First of all, let’s talk about blocks. Anyone familiar with Ruby will have some knowledge of blocks. Blocks in Ruby is a way to pass a chunk of code as argument to a function; blocks are also full closures, so they may reference any variables that exist in the scope in which they were declared. An example of block usage:

[0,1,2,3,4].select { |val| val.nonzero? }
=> [1,2,3,4]

As you may know, Enumerable#select loops through a collection and returns a new collection containing those elements for which the block evaluates to true. So, the example above produces the array [1,2,3,4], since Numeric#nonzero? will return false for the first element in the array and true for the others.

I expect this is nothing new for most people. Often however, as in the above example, this syntax seems a little verbose.

Read the rest of this entry »

Bring the Noise

September 11th, 2006

Last week, I bought a new mic, after my old one had gone broken. I’m not using it for anything serious, just for voice communication when playing games. So I needed something small and cheap I could clip on to the headphones cord.

Funny thing is, it worked like a charm (figuratively) first evening. No problems at all. Next day, however, something had happened. I hadn’t rebooted the computer or changed any settings from what I remembered, but something had happened. The mic still picked up my voice when I spoke, but more faintly than before and there was a constant humming noise not there the day before.

The next few days got weirder. Sometimes it worked, sometimes it didn’t. It had nothing to do with settings, and it seemed very strange that the mic would already be broken. Then one day, I noticed something peculiar. The noise level seemed to be different depending on where the microphone was located in the room! Finally, I found that placing the mic on top of the computer, the noise was virtually none.

What did I learn from this? Turn off noise suppression. When the mic had sat all night on top of the computer case it had adjusted to the noise from the fans and HDDs; after I picked it up the mic tried to suppress noise that was no longer present.

Not So Prestigious

August 5th, 2006

One soon to be released movie that has won my attention is The Prestige. Not only for its outstanding cast, not only because Christopher Nolan directs, but also because the story seemed interesting. It interested me so much in fact, that when I realized it was based on a book, I shortly after bought it.

Apparently, The Prestige is Christopher Priest’s ninth book. A writer I had never heard of, but on Amazon, most of his books have received much praise—many even praising The Prestige as his finest work. Instead of writing a review there, I’m writing one here. That way I don’t have to worry about posting spoilers. For there will be some, and if you want to read the book or see the movie and don’t want to be spoiled, stop reading now.

A short synopsis: The working class son Alfred Borden and the aristocrat Rupert Angier, two stage magicians, are in a on-going feud in the end of the 19th century. Their attempts to best one another consist of publically humiliate the other one by revealing how his act is done, and, perhaps even more, by devising an act the other one cannot figure out. Borden invents the trick he calls “The New Transported Man,” as his magnus opus. Angier replies by coming up with his own illusion under the name of “In a Flash.”

The story is given in a set of different accounts, in different styles and in different time spans (and sometimes, overlapping). The two main stories are the accounts from the two magicians themselves. It’s interesting to see the the differences and the similarities between the two main characters, and how their accounts differ in style and contents (partly because they focus on things that make them look good, but also because they remember things differently and selectively). I had some trouble with the narrative style in the beginning but began to accept it after a while (the first few pages are in fact the worst).

However, when I read about this book I was led to believe that it was going to be full of mysteries and twists, and it really isn’t. The two main mysteries in this book are about the two big illusions, and they are never really mysteries at all. The secret of “The New Transported Man” is pretty much revealed after about 60-70 pages, and the secret surrounding “In a Flash” is just, well, magic. Let’s just say it’s like finding out in the end of a closed-room murder mystery that a “a wizard did it!”; at first you expect a logical explanation, but in the end it’s just paranormal hogwash.

My expectations were probably too high when I started reading this, but I really think you’re doing a bad job of selling it if you describe it as a mystery novel.

Countdown

July 23rd, 2006

(I’m writing this post mainly for my own benefit, but if it interests anyone, all the better.)

Here is the unofficial countdown for shows—shows I’m interested in—returning or premiering this fall:

Pilots to the Left of Me; Pilots to the Right of Me

July 23rd, 2006

Never before have I been so diligent in watching pilots for new shows, no, generally I have no idea what’s new on TV until it airs, and often even later than that.

First up is a drama/mystery show called The Secrets of a Small Town. In the small town of Santa Ruiz, two twin girls go missing after a party. Shortly after, one of them is found dead, murdered. The whole community is shaken by the event, which makes national news. A young reporter, Bethany, initially from Santa Ruiz but who left some eight years ago to persue her career, relunctantly agrees to return to her home town in order to cover the story. Her sense that going back might be a mistake is partly validated by a difficult reunion with her sister, the local sheriff.

Although in a genre I’m particularly fond of, I’m not sure about this show. It has a slight Point Pleasant feel about it, and I mean that in a bad way. (Is there any good way to remember Point Pleasant?) It’s the kind of show I believe must be story-driven, rather than character-driven, if it should succeed. I’ll say one thing positive though, I can’t wait to see the next episode.

Another one that seemed worth checking out is Angela’s Eyes. Angela, a twenty-something woman working for the FBI, has the unique gift of being able to tell when people are lying. She supposedly got this gift because her parents were spies working against USA. I might have tuned out there a while, because it didn’t really make sense.

The whole concept seems a bit weak to me. It’s slightly reminiscent of Psych (although this show is not a comedy), and maybe even more of Alias—another show I never liked. I might be a bit biased: I normally hate these slick agency type of shows. They’re always a tad too unrealistic for me to accept. I’ll just leave it at that.

The third up could very well be my favorite for today: Heroes. All over the world, people are discovering they have different super-hero powers. They don’t know why it’s happening, it just is; but a vision of the future shows a burning New York, and it’s not a huge leap to suggest that our new heroes are supposed to try to stop this from happening.

I love it so far. It’s one of those shows where I don’t care about the fine details. I mean, it was a bit ridiculous every time they tried to scientifically explain something, but the show doesn’t rely on it (Numb3rs comes to mind, yuck), so it doesn’t matter. Otherwise, the acting and writing seemed solid. It shows all promise to be a highly entertaining show with an interesting story.

Got any interesting new shows to tell about? Feel free!

The Shows Must Go On

July 16th, 2006

Man, there are sure a lot of new pilots turning up these days. I already wrote about Jericho in an earlier post, so that one can be skipped.

After Jericho, it was time for Traveler. Seems this show won’t air until January 2007, and I sure can’t wait. This show has everything: a fascinating story, excellent writing, and good enough acting.

Jay, Tyler and Will, three young men freshly out of college, decide to celebrate their graduating with a road trip. Their first stop being New York, they begin by visiting The Drexler Museum of Art—non-existant in the real world. Either way, Will (who dragged them there) suggests that, as a prank, they race down from the top of the museum on rollerblades. While Will lingers behind, Jay and Tyler race through the building. Shortly after exiting, they get a phone call from their friend left behind, who says nothing else than that he’s sorry. A moment a later, a explosion goes off inside the museum. As Jay and Tyler are identified as chief suspects, they realize they’ve been set up. We learn via Tyler’s father that someone knew that this would happen, because that someone made a lot of money on it—or at least avoided losing a lot of money.

Speculation: Will is pretty much the bad guy right now. Jay and Tyler can’t even prove he ever existed! Nevertheless, I can’t help but think this’ll turn out the next 24: there’s definitely a larger conspiracy here. Before they can prove their innocence, Jay and Tyler will continue to run from the FBI and the police. I highly doubt Will is dead. He even had an escape vehicle ready! (Remember, he parked the car in another garage.) But who is the black guy helping Jay and Tyler escape from the police van, and what’s the deal with Will filming everything?

Next one up is The Nine. What seems like a regular day turns into a nightmare for the people who happened to be in the Fidelity Republic Bank. Two bank robbers storm into the bank sometime in the afternoon. Cut to 52 hours later; we see a hostage situation that took place inside the bank finally being resolved. Evidently, something had gone wrong in the robbery and the robbers started taking hostages. We learn that one of the nine shot one of the robbers, who ends up in a coma, and subsequently, the police managed to take control over the situation. At least one person lost its life in the situation: Eva, a bank teller.

The nine people who are hostages to the end are: Jeremy (surgeon), Lizzie (nurse, Jeremy’s girl friend), Malcolm (bank branch manager), Eva (bank teller, killed), Franny (bank teller, Eva’s sister) Felicia (Malcolm’s daughter), Egan Foote (office employee, shot one of the robbers), Nick Kavanaugh (police officer), Kathryn (assistant DA).

Speculation: After the event, we continue to follow the lives of the nine and how they all cope differently with what happened. This show will not, however, turn into a drama about how they get on with their lives. I believe we’ll learn that one of the hostages was, in fact, “in on it.” Egan’s life has changed for the better, but is he really that innocent? His behaviour at the bank was a bit erratic. Malcolm didn’t want his daughter inside the bank; did he know something? All of the nine are such unlikely suspects, ironically meaning it can be either one.

Jake Fought the Battle of Jericho

July 14th, 2006

This fall everybody will be saying Jericho this and Jericho that. At least, that’s what CBS hopes. And after seeing the pilot, I think they’re justified in their belief.

The premise: Jericho, a small town in Kansas, is cut off from the outside world shortly after a huge explosion (causing a familiar mushroom-shaped cloud) is seen in the direction of Denver. Left without electricity and not knowing what’s going on, the citizens drift towards panic.

From there, it can really go anywhere and my hopes are very high for the story. There are some problems, however. For instance, some scenes I just didn’t buy—the mass panic, the speech of the mayor to calm people down, etc.—and seemed rather cliché. Something that never stopped shows like Prison Break, though. Another is the acting. Maybe surprisingly, Skeet Ulrich (Jake) did a rather well job, but otherwise, it felt a little bleak. I am skeptically positive. If they can make it fly, it’ll fly far.

Ice Queen

July 13th, 2006

Yesterday, I saw a movie I’ve been awaiting for some time now: Hard Candy. Although it wasn’t exactly what I had expected, I think it was great. Without giving away the plot, I can say that paedophelia and torture (there are no graphic scenes though, it’s all psychological) are major themes. That may scare away some, but if you’re only going to see one movie about paedophelia and torture this year, make it this one.

The acting is superb, both by Patrick Wilson and Ellen Page (whom, after looking at her IMDb profile, I recall seeing in ReGenesis), and that’s really what makes this film work. All in all, Hard Candy manages to walk a fine line in a controversial subject without being too biased. Eight thumbs up!

The Ultimate

July 11th, 2006

The past weekend UFC 61: Bitter Rivals was held. It sure had promise! Ken Shamrock and Tito Ortiz was one of the most anticipated matches this year. Ah, and how I longed for Andrei Arlovski vs Tim Sylvia to fight again. At their previous encounter, Arlovski’s loss was due to over-eagerness. But, instead of something great, UFC 61 turned out one of the most disappointing UFC events I have ever seen.

If you’ve seen the fights, you’ll know that the Ortiz-Shamrock match was finished rather quickly. Tito got an early takedown and ferociously started dropping elbows. After four or five hits the judge stepped in and stopped it, since Ken wasn’t defending himself intelligently. 1:18 it lasted. I have seen people defending themselves a lot less intelligently for a much longer time before the judge decides to step in. While the safety of the fighters are important, in this case the judge robbed the audience and the fighters of the match that should’ve been.

Sylvia vs Arlovski was sort of the opposite. For the first two rounds were interesting; one was waiting for either a big punch from Sylvia or a combo from Arlovski. As the rounds went on it got boring. It’s ridiculous a fight like that lasts five rounds. I blame Arlovski–had he only been more aggressive it would have been more exciting.

None of the other fights were very impressive either. Frank Mir is still really rusty and unlikely to get back to his former level. You’ve got to admire that he’s continued fighting, though. Joe Stevenson’s and Josh Burkman’s fights were possibly the highlights of the event. And honestly, those fights were average at best.

Nevertheless, awesome news that Wanderlei Silva and Chuck Liddell will fight on November 18, provided Chuck defends his title against Babalu. My money is on Wanderlei, but you never know. Additionally, MMAFighting.com reports that other Pride fighters will step into the octagon for this event.

Update: Seems like Wanderlei and Chuck won’t fight after all. Pity.