September 30, 2010

Some Professor Layton Prolog!

Time to combine two of my favorite things: Professor Layton and obscure languages! There was one puzzle (of the hardest difficulty) that I could have spent 40 minutes working out, but instead spent an hour and half solving in Prolog (for those unfamiliar with Prolog, check out this post for a description of what this magic language is!).

I'll post the puzzle and solution here; hopefully someone finds it fun!


No 151 from Professor Layton and the Diabolical Box: Colin's Score


Four students took a test where every question had two possible answers, A or B. Each question was worth 10 points, for a total of 100 points.

The students' test results were posted as seen below, but the teacher forgot to tally Colin's score. Colin was heading to the teacher's office when Mary called him back, saying they could figure out his score using the results from the other tests. Can you figure out Colin's score?

Mary: 70 points


12345678910
BBABABBABB


Dan: 50 points


12345678910
BAAABABAAA


Lisa: 30 points


12345678910
BAAABBBABA


Colin: ?? points


12345678910
BBAAABBAAA

-----

Below is the program I wrote to solve it. Verbose by contemporary language standards, but almost no thinking required, and the answer in an instant! Note the original version didn't have so many comments; these are to guide the curious reader. Sadly, github's gists don't know how to color Prolog syntax. Also, due to this terribly lame layout, I would suggest the 'view raw' feature at the bottom of the gist to see it in plaintext glory.



Edit: I also gist-ed my Prolog poker solver, which I wrote about in my first Prolog post. It was my very first prolog, and there are probably shorter ways of doing what I did, but hey! Give it a looksee and hope you enjoy it ^_^

September 26, 2010

Repost: Professor Layton and the Hell Yes

My last blog before this got digitally bulldozed: I was hosting on a pay-per-webserver and when I got a new credit card forgetting to update the account, they sent one spam-collected warning before they deleted my site. Luckily I was able to salvage most of the posts via Google Cache, with the hope that I could write a script to de-WordPress-HTMLize them, and upload again so they could see another day. I haven't done it yet, but might still. The main reason I haven't is because a) those posts had lots of images I hosted on the server as well, which makes them uglier, and b) those posts are like these, but much more boring.

But I might re-post one or two every here and there. Here's a re-post from September 4, 2009, when I was playing Professor Layton and the Diabolical Box. I just got the sequel, Professor Layton and the Unwound Future (official site, trailer), and most of my sentiments are still the same:

-----


Anybody following my tweets for the past 4-5 days knows I've only really tweeted about one thing: Professor Layton and the Diabolical Box.

This is a breath of fresh air. Not even: I've written before about growing up during the Hollywoodization of the games industry, and in that context games like this are a fresh salad in a strip mall full of Krispy Kreme's. This game is a bargain for twice the price.

It would take a much-better planned post to cogently and coherently explain this game's genius, but to take a line from the movie Spy Game, I'll try to achieve "twice the sex with half the foreplay":

  • The game's puzzle mechanic is innovative and damn fun. While scores upon scores of mini-games and puzzles in the larger game isn't new (Nintendo owned and made a fortune off this mechanic previously with Brain Age, Mario Party, etc.) Layton's puzzles operate in a radically different context. Most games have puzzles that are competitive and/or timed, with their primary mechanic some physical or reactionary task and how rapidly you can achieve it (mash buttons! Simon says!).

    The context of these puzzles change everything. The puzzles are non-competitive. You have unlimited time. They are cognitively fun, stimulating puzzles.

    I feel that Parappa the Rapper sort of emerged in this way, in that timed button presses weren’t themselves new (TASVideos demonstrates that completing most games could be thought of as a sequence of timed button presses, but Excitebike is a better example of a game with it as a central mechanic), but the context and presentation made it feel new.

  • This game is beautiful. Also like Parappa, the game launders its play style though gorgeous original artwork and design. Who can't love Professor Layton, with his quaint accent, speech, and manners? Who can't love Don Paolo, the eeeeevil scientist who is such a cartoon villain? Who can't love the soundtrack, the villagers?

  • It's always great to have a touch interface that doesn't suck. Have you ever tried designing a touch-screen interface? Or used one? Most of its proponents swear touch interfaces are more "natural," but most touch software sucks. This game feels great, however, so much so that my brother's girlfriend could feel inclined to pick it up and log 15 hours of game time in 4-5 days.



If you have a DS, get these games. If you don’t, ask to borrow mine ^_^

September 23, 2010

Vimcakes, Backin' Up Song

I found an awesome little post on Vim, which itself links to other excellent Vim posts. BFS these links, kids, and learn you a console editor if you haven't already!

Also, I meant to squeeze this video in here somewhere, by the guys who did the Bed Intruder song:



Source material here. But do you see this? We have a hilarious remix coming from an attempted rape, this one from an attempted robbery ending in gunshots, and the last post was about the internet taking down an 11 year-old.

Remixes man, how do they work?

September 21, 2010

Because I backtraced it!

Here's another story of Internet lore, documented pretty well here at Know Your Meme. I've posted before about remixes 1, 2), and the internet making a story huge, and this one kind of combines the two.

First we have an incredibly foul-mouthed, unusually sexually knowledgeable 11 year-old girl:



Before we continue, lets learn a few things here:

  • This girl did wholly dumb, irresponsible things (there's a lot more than this video). She's 11 so you can only blame her so much, but parents: please be involved in your children's lives.

  • While I don't think what follows is at all appropriate, she isn't faultless. Frequently in conflicts both sides are guilty; just that one side might be guilty on the scale of three counts of murder and the other "only" involuntary manslaughter.


So the greater trolls at 4Chan see this, and pounce. They google bombed her, file fake police reports, call her mom pretending to be the police, spam her inbox, &etc. &etc. &etc. She's left to a smoldering pile of ashes, when her dad makes her sadness unintentionally hilarious:

Another thing, parents: don't make threats you can't back up. Saying "I'm her father!" doesn't incite fear in kids the way it used to, and don't invoke "calling the Cyber Police!" unless you've actually spoken to them.

Look at the girl in the first video, and ask if that kid would have been threatened by the father in the second video.

I only mention this story because it led to one of my favorite remixes:



It's not as entertaining, of course, when you know the whole story. Gawker has another write-up.

A few other reactions to this story:

  • Another reason why computer science is great to study! It's a hell of an investment, since technical knowledge follows you everywhere (don't forget that it's just amazing as hell, too).

  • I look forward to when everyone's lives are more public. In the midst of the Christine O'Donnell brou-haha is that she admitted to once dabbling in Witchcraft. Ignoring the fact that if Obama or Pelosi had 'dabbled in voodoo' or warlockery, her supporters would be having a conniption, to me the greater point is that people can start to forgive poor choices or experiments people have participated in because we all do.

    I really hate that employers look on Facebook for incriminating photos to "gotcha" with, even if the photos aren't incriminating. Don't confuse me: if your employer finds you snorting a line of coke on your Facebook, I think they're totally right to deny you the interview, since that's completely stupid. I'm talking about the case where they find a picture of you holding a Corona, then go "oh shit he's out of the race because he should know that I'll look on here, and he has a picture with a beer!"

    Lame employers, I'll save you the trouble: beer,beer, beer, party, party. Now a better question, did you go to a party? Is it surprising that in 5 years of undergrad, I did? Denying me an interview from 5 photos over 5 years of the ~600 photos of me on Facebook tells me I'm better off without you, because you don't want to talk to or hire people, but some imaginary, outdated standard of a person.

    Tying it all together: as more 11 year-olds rant stupidly into a camera, or misspell on their status updates, or have dumb photos up, we'll be better prepared to be reasonable as well.



Need cheering up? Robot Unicorn Attack! Or my favorite this week, the Haskell alphabet!

September 16, 2010

Living Openly

I just wrote a long blog post talking about why it sucks playing Zerg in Starcraft 2. But friends, there has been too much whining on this blog of late! It's time to bring back two things we've missed for some time: computers and whimsy!

Haters Gonna Hate

So a few things: I'm living the dream, and finally installed Linux on a personal box. It's a small step (this is my laptop, not my main) but Perfect is the Enemy of the Good, and after using Mac, Windows, and Linux at work, it's incredibly obvious which direction I'd like to move in for the future.

Currently I'm running Ubuntu. I wanted to run Debian like we did at Brown CS, but I'm too much of a weenie at the moment. Besides, Ubuntu's easy as a dream to set up, and I've done it for work twice already. Naturally, I'll be using XMonad as my window manager ^_^

I've written twice that I've "picked up" ScrabbleCheat again, but they were lies. This time I've actually picked it up again (see the commit history!) and it's finally going in the right direction. I had a substantial amount in the first tagged release, but that approach (the anagram solver) was ultimately doomed because it didn't take the board into account when generating words for moves. If I ever get productive again, I'll write about this process, this has been the most fun I've had coding in a while.

Part of the fun has been because of Erlang, which has just had another release. There are so many reasons to use Erlang, and this application contains almost none of them (not super parallelizable, no need for hot-swapping patches, binary syntax, or fault-tolerance). That being said, I really miss my functional programming, and refactoring calls to a series of folds and maps just feels nice. I can't imagine how powerful I'd feel if I'd properly learned macros, or had use of Haskell's type system. Those are for the next ones ^_^

Finally, Diaspora open sourced today. It's too early to really tell anything about its future, but I'm thinking of looking at it and seeing what they did. If we're lucky, the community will take well to this I can finally stop being a dumb fuck who trusts Zuckerberg.

(Note that while I don't love all aspects of the product, my family will always be eternally grateful to Facebook for helping us communicate to so many, so easily during the roughest parts of Annalisa's recovery. I also think their approach to engineering, like many of the coders I know there, is brilliant).

Finally, I'm turning in my iPhone in late October and getting me an Android (probably an Evo), since I'll be paying that bill pretty soon and will use the opportunity to go to a more open land, containing the closed platform I work on ^_^.

So that's it, kids! Open source OS, programming an open-source hippie language, slowly migrating out of Facebook while decking it out with a new, more open phone. All that will be left will be a bed that's also a Reprap.

Since Day 1

I'll try to post more; I still sleep next to too much cardboard and styrofoam, and will probably be comfortably moved in and adjusted after Christmas ^_-.

September 14, 2010

Updates to previous posts

On my Eat, Pray, Love post, Lindy West over at The Stranger wrote a review of the movie adaptation that more or less echoes my sentiments (like I imagine for Ms. West, the sentiments get vicious primarily for entertainment value). If you haven't seen her Sex and the City 2 review, its similar in style, tone, entertainment, and parallels with how I feel.

--

On my Jason Robert Brown/living as an artist post, I hadn't read his post recently enough to see his updates, which are marvelous, and demonstrate that I've been a little unfair to him. I think my points still stand, but I'll just quickly comment on one point in the updates: he links a great rundown of why most arguments for downloading are bunk, and mentions something similar to mine. He states the "it's a broken business model anyways" fails because some artists (like JRB) do succeed in it, and the presence of a counterexample is enough to refudiate that.

I'm afraid I'm not buying. It "works" for so unbelievably few artists its essentially broken. Lynn Nottage, a playwright produced more in the last decade than Shaw, Brecht, and Wilde, still doesn't feel comfortable giving up her day job.

In any system there's going to be someone who wins. During my sister's medical crisis, she received excellent care; this doesn't change the fact that we have the worst healthcare system in the modern world. I'm glad it works for JRB, the most famous living musical theatre composer. But for virtually everyone else, even if you do make it to the recordings/royalties stage, agents and middlemen (and ha! illegal downloaders) will kill your earnings.

Remember, I'm not saying it's okay to download illegally, just stating that people absolutely will, and to hope they don't is like lying on the beach hoping the tide doesn't rise.

--

Finally, probably the most significant, on the post about that redneck who wanted to burn Korans. I've changed my mind a little to broaden my disdain; the original post was mostly angry at him and Americans. Now I'm just mad at pretty much everyone.

Again, let there be no confusions: we're being a bunch of idiots here. We have guys screaming "Kill All Muslims", and Fox once again shows they would rather stir up dangerous hate for obscene profit rather than make slightly minimized obscene profit through safer methods. I hate to be that kid who links the Daily Show, but they really nailed it:

(also... that Imam is awesome).

But we go back full circle to the reason for Everyone Draw: Ayatollahs issued fatwas on the book burners. So we're back to muslim terrorism over free speech. So I'm back to hating on idiot Muslims (and urging moderate Muslims to to fight them before they throw stones (err, bad choice of words) anywhere else).

Finally, I'm angry at the world. President Obama? The Pope? Really? I'm with Yglesias, "guy burns books" can't be a global event anymore.

Okay. Time go get Glad, there's been lots of bile on this blog recently. I'll close with my favorite headline, stolen from reddit:

"Is anyone else OUTRAGED that atheists plan on building ABSOLUTELY NOTHING at Ground Zero!?!?!?

September 8, 2010

Life Update/Book Burning


Time for a small life update, as the posts have slowed down for a while and some narration is due:

I just moved to San Francisco after graduating from Brown in Providence, RI. For a myriad of reasons I didn't spend much time at home over the summer, and have been living in and out of boxes since May. Just last week I moved in to my new apartment, and will slowly, surely become a normal well-adjusted human being again.

Despite the change in locale, the main reason I've not updated (or been so fast to move, or had much time to play) is that I'm happily and proudly an engineer at Adobe Systems, working on their AIR product. It's really a fantastic product, I suggest you all give it a look.

Products built on AIR that I particularly like are Times Reader, TweetDeck, and (in a silly and simple way) Webcam To Gif. It's the first time I'm programming professionally, and I can't be happier.


Mouth OpeningNervous Eyes
DENIEDOh yeah


Of course, it also doesn't help that Starcraft 2 was released on my second day of work. I rarely get to play, but when I do, look out for sicp, the Platinum Zerg Menace on the US server.

Occasionally, I can still program for fun. I picked up ScrabbleCheat again and virtually re-wrote the little I had: the previous approach was quickly demoable, but hits a wall as soon as you try to generate moves from an existing game board. Besides, the sooner I finish that, the sooner I can work on my AIR app, SlashR ^_-

---

Now, forgive the language, but there's no better way to describe it: there's some stupid-ass shit happening right now regarding Muslims in this country. First there's the manufactured Cordoba House controversy (I think Greenwald sums it up best: if you think past a fourth-grade level about the opponent's arguments, what they really want but obviously can't say is a Muslim-free zone of unspecified distance. This set of photographs is telling.).

Then we get arson of a mosque in Tennessee.

The most personally insulting is "Burn a Koran Day," since it's clearly an unoriginal, hateful knockoff of Everyone Draw Mohammed Day (I describe the event and my participation here). Clearly, they misunderstood Everyone Draw since they're doing it all wrong.

Never mind the fact that these are Christians, apparently:


In Everyone Draw, there were direct threats and acts of violence being perpetrated in response to a specific, concrete expression of freedom of speech, the result of which unambiguously terrorized people from exercising their Constitutional rights. If we were threatened and attacked by McDonalds, we'd be agitating McDonalds.

The people behind Burn a Koran Day aren't in any direct danger and don't have their rights directly threatened. They're doing this simply because they hate and wish to hurt all Muslims simply by virtue of being Muslim. If they try to give an explanation, it's normally some vague babble of being a response to 9/11. Please. Yes, some (crazy few) Muslims want to kill you and I. I'll bet that so do some (crazy few) Jews, some (crazy few) handicapped people, and some (crazy few) vegans. This doesn't mean I should eat a lobster-bacon cheeseburger while caning an invalid just to prove a point.

Is their religion stupid? Definitely. So is yours. You all have the right to peacefully practice your silly superstitions, and you have every right to insult them as badly as you want. Neither of you have the right to escape criticism, and those of you planning this are the most stupid, hypocritical, and pathetic people of this news cycle (and there is some stiff competition).

Really kids, what would Jesus do?