Sudoku Time

It’s been more than a week since my last post, so I decided to finally post again. This time I actually have a somewhat good reason for not posting. I have been developing a Sudoku solving program. I thought that it would be an interesting challenge to do a Sudoku solving program that relies only on logical deductions and never on brute force trial and error. Right now, it solves all of the easy and medium Sudokus, but it can’t solve most of the hard ones. After taking a look at this site though, I’m not sure if I’ll continue developing it. It turned out to be a far more complicated task than I imagined, and if I want to continue its development I have decided that it would be best to restructure the whole program, so that’s why I’m still not sure what to do. On one hand it seems like a fun challenge to program each one of the solving algorithms, but on the other hand there are just too many of them. I’ve also been reading some stuff about Sudoku solving programs and apparently there are some Sudokus that so far can only be solved by trial and error programs. As things stand now, I do plan to at least restructure the program and add a couple of the simple solving algorithms, but I have yet to start doing it. The funny thing about all this is that I usually don’t like sudokus.

Aside from programming, I’ve been watching some more anime. This time it was Elfen Lied. You can read my thoughts on it here. I also lost numerous hours of my time to Motherload and Super Serif Brothers. Motherload was very fun at first, but once you go deeper it just gets frustrating, I lost to a lava pit because I didn’t know what it was and thought I was digging up a ruby. Then I played again following the advice I found on digg’s comments and was killed by a gas pocket completely unaware of its existence. As for Super Serif Bros, it was great. For some reason I didn’t expect a text based game to be so hard, but I am still surprised at how much I like it.

I also wanted to post about this house. I’m not convinced that it’s a very good idea, but it certainly is interesting. A couple of pictures and a diagram of the house are available here. Also, this house reminds me of this other house, which I also wanted to post about. Source: digg.com

On a blog related note, I received my first comment spam today. Apparently while I was away from the blogsphere comment spam evolved. The comment read “Love the blog -I always look forward to the posts here !!”, so at first sight, one would think that it’s not really spam, but when you look at the url of the poster it becomes clear that it is. Just in case I’m wrong, and Lisa is indeed a loyal reader of my blog like she claims (and she is without a doubt reading this), then I apologize. Next time please use a less suspicious URL that does not advertise stretch mark removal creams.

Elfen Lied

I first heard about Elfen Lied on the IGN Boards, where some people said it was great, others said that it was “too disturbing” for their tastes, and everyone only seemed to agree that the opening music was great. Then I read its page on the Wikipedia which basically starts off with: “The story contains graphic nudity and a great deal of blood and gore, as well as psychological violence and extreme graphic violence.” By now I was already expecting it too be the goriest most disturbing thing I’ve ever seen. But it wasn’t. It certainly does have “nudity”, “a great deal of blood and gore”, “psychological violence” and “extreme graphic violence”, but none of it is there just for the sake of it. There is a reason why each one of those “disturbing” aspects is there. From what I had read, I actually thought it was going to be bloodier, sometimes people get cut up in half and there’s not that much blood coming out of them. Even Kill Bill is bloodier.

If you continue reading the Wikipedia article in search for what Elfen Lied is about you’ll reach a link to a Wikipedia entry titled “Elfen Lied body count” and then a description of how the show starts, which basically says that there is a naked girl killing everyone she finds. And its not wrong, but that’s not at all what Elfen Lied is about, at least not in my opinion. Basically, what I’m saying is just a remix of the good old “don’t judge a book by its cover”.

Elfen Lied is great in many aspects. The animation is good, and the backgrounds are simply beautiful; the music (especially the opening song) is great; the story keeps you interested throughout the series; most of the characters are very deep; and even though I don’t understand an ounce of Japanese, I thought the voice acting was good. However the depth of the characters is what surprised me the most. Each character has his or her own story and their actions reflect their background. In particular Nyü/Lacy’s character is simply amazing. In theory you should hate the character but in practice you end up liking her. Somehow although she is the one doing the most brutal killings, the others turn out to be the bad guys. Actually this is my favorite thing about Elfen Lied, it’s often hard to tell who’s right and who’s wrong. Most of the characters seem to either be doing the wrong things for the right reasons, or the wrong things because they were pushed into that position, and only a few characters seem to be doing the right things.

I won’t say anything else about Elfen Lied because I don’t want too spoil too much about it. But if you have a chance you should consider watching it, I highly recommend it.

Clips, Gods, Robbers and Ads

There are lots of links that I’ve been meaning to post, so here they are:

One red paperclip – By now you have probably heard about this already. A guy from Montreal, Canada decided that he would trade a paperclip for a house, and recently after 14 trades he finally got a house. I always remember the item trading in the Zelda games when I hear about this.

What’s Next iPod Guy (PDF) is a pamphlet from Jews for Jesus which compares Steve Jobs’s life to the life of Jesus to try to convince you of joining their organization. Very weird, but kinda interesting. Source:Boing Boing

Pantyhose as a Fashion Statement is an extremely funny video of a guy who tries to go shopping while wearing a pantyhose over his head. The reactions from the people at the stores are priceless. Source:Digg

Finally there’s a very cool McDonald’s billboard in Chicago. The shadow of the “M” is over a different breakfast item depending on what time it is. Source:ChicagoBusiness

Alchemists and Samurais

It’s time for another post. Apparently these “updates” are weekly now…I didn’t intend for it to be this way, but I’m just too lazy or too busy with other things to post until a week of not posting goes by and I start feeling guilty about leaving my blog.

So, what’s new this week? Basically, now I’m an anime freak. I finished watching Full Metal Alchemist along with the Full Metal Alchemist: Conqueror of Shambala movie. Both the TV series and the movie were extremely good. So I figured I should get my hands on some more anime and I ended up Googling “top 10 anime” and came up with this list. Then I looked up all of those in the Wikipedia and decided which ones I would try to get my hands on. So far I’ve been able to get Rurouni Kenshin OVA, FLCL, Haibane Renmei, and Serial Experiments: Lain. And I’m still trying to get Last Exile. Those were the only ones that really caught my attention. I’m also trying to get the Grave of the Fireflies movie, although that’s not on the list.

So far I have only watched Rurouni Kenshin OVA and one episode of FLCL. A word of advice for those of you looking for “Rurouni Kenshin OVA“. There appears to be a lot of Rurouni Kenshin stuff, but you’re only looking for the first of the OVAs, that’s the one that’s REALLY good. Your looking for: “るろうに剣心―明治剣客浪漫譚―追憶編” or Rurouni Kenshin – Meiji Kenkaku Romantan – Tsuioku Hen, or Rurouni Kenshin: Tsuioku Hen, or Samurai X: Reminiscence, or Samurai X: Trust and Betrayal or any variation of those names. They’re all the same thing! However, anything else that says either “Samurai X” or “Rurouni Kenshin” or “るろうに剣心” is not what you are looking for. There’s a TV series, a movie, and another OVA. Chronologically the first OVA comes first, then the TV series and finally the second OVA. I’m not sure where the movie fits; as far as I can tell it goes somewhere inside the first OVA. From what I’ve read the TV series is not too bad, but the style is very different from the first OVA and it’s less serious and more like a romantic comedy. The fans seem to hate the second OVA because it does not follow the manga. And the movie…well, I haven’t read anything about it.

But let’s go back to the first OVA. It’s very good. The animation is simply amazing. In some of the scenes the animation is mixed with live footage and it looks beautiful. For example, at the beginning of the third episode there are some great scenes where the water was taken from live footage but the rocks inside it where re-drawn to fit the style of the animation. But it’s not just about the animation; the characters, the story, the score, are all great too. After watching it, you’ll understand why so many people praise it. Do yourself a favor and just watch it.

As for FLCL, although I’ve only watched the first episode, I can tell that it is one of those things that even though you don’t fully understand it, you know it’s good. It’s actually the first anime that I had to watch dubbed. I tried watching the subtitled version first but there was too much going on and I couldn’t keep track of what was happening and read all of the subtitles in time. I know that the translation for the subtitled version is a lot better than the translation for the dubbed version, but I really had no choice.

Other than watching anime, I’ve been editing the video of my sister’s wedding, and hopefully I’ll be done this week. Once I’m done I’ll go back to trying to post some more stuff to my website. In other news, Google finally added my site to their index! Hopefully that’ll get someone to come here.

From Legos to String Theory

I decided it’s time to start posting some links, so here are some links I found yesterday along with another link which I’ve been thinking about posting for some time.

GAM3R 7H30RY – This is a book available online about gaming. I haven’t read it all, but what I’ve read so far is pretty good. The only problem is that their layout is not zoom-friendly which makes it hard to read without tiring your eyes. I actually contacted the people in charge of the layout to try and help them fix the problem, but after a couple emails they stopped answering back.

Imagining the Tenth Dimension – This is the website for a book that explains where are the ten dimensions that string theory talks about. There are some great explanatory videos in the section called “Imagining the Ten Dimensions” in the Flash version of the site. Source:digg.com

LEGO Star Wars – These are some LEGO Star Wars movies, there are three different short movies. Revenge of the Brick is the newest one and probably the best. But all of them are quite funny and definitely worth watching. Source:digg.com

Cars

Last Saturday I saw Cars. Before its release everyone seemed to be speculating that Cars would be Pixar’s first “unsuccessful” movie, and in a sense they were right. When Finding Nemo was released it was Pixar’s most successful opening, the same happened with The Incredibles, but Cars broke the trend. Its opening weekend at the box office fell below both Finding Nemo and The Incredibles placing it as Pixar’s thrid most successful opening. But, does that mean anything? Of course not. Cars is every bit as good as any other Pixar movie.

Animation-wise, it looks a lot better than Pixar’s last film (The Incredibles); the lightening effects are amazing and the water is one of the best looking CGI waters I’ve seen lately (not the best ever, but still pretty good). Most of the reviews I’ve read complain about the quality of the voice-acting, but I think that the voice-acting is fine. Maybe it could be better, but it’s not bad at all. The story of the movie, as always with Pixar, is quite good and is helped by the great jokes throughout the movie. Particularly, the jokes at the car cinema during the ending credits are hilarious.

From what I have said up until now, it would seem that I think Cars is just like any other Pixar movie and that it brings nothing new to the table. However I do think that there is a big difference between Cars and the rest of the Pixar movies: the characters. Making a movie where all of the characters are cars is not an easy task. The rest of Pixar’s movies have characters that are either human or easily personified as humans, and in movies that try to convey certain emotions to its viewers this plays a critical role. With characters like toys or even fish, there’s clearly a face through which a character can express its emotions. But showing what a car feels is a lot harder, yet Pixar was somehow able to do this in Cars. My guess is that this is the reason why Cars received more negative comments than Pixar’s previous films. In particular, I think that this is why some people complain about the voice-acting; when there is no face which shows what the voice is supposed to convey, it’s hard to tell whether the voice is right or not.

Overall, Cars is a great movie, and if you haven’t already, you should go watch it. Personally, The Incredibles still holds the title as my favorite Pixar movie, but that doesn’t mean that it’s better, it just means that I like it more.

Slow But Steady

Another update on what’s going on with me. As I expected, I finished watching Friends last week, but I have now moved on to watching Fullmetal Alchemist. I had heard some good stuff about it and decided to give it a try since I don’t have anything else to do. Turns out it’s great. I’m about halfway through the 51 episodes and I can’t wait to see what happens. I also decided to stop trying to get all of the Star Coins in New Super Mario Bros, and start playing Mario and Luigi: Partners in Time. I played Paper Mario: The Thousand-Year Door a while ago and I was expecting M&L:PiT to be as good as PM:TTD, and although it’s not nearly as funny, it’s still a great game so far. I’ll try to get back to NSMB once I’m done with M&L:PiT. Finally, I also decided to continue reading Gödel, Escher, Bach: An Eternal Golden Braid. I began reading it during my spring break, but I had to go back to school before I was able to finish, and then I had exams for about 4 weeks so I had to put it on hold. So far it’s a great book, in my opinion Hofstadter sometimes goes a bit too far with his comparisons, but it’s still a masterpiece.

I’ve also been thinking about my blog. There are several things I want to post and some articles I want to publish, I just need to stop procrastinating and start writing.

Back to Business

I’m back from Canada. Actually I’ve been back for a week now, but I’ve been too lazy to post. About the article I said I was working on, well…I’m still working on it. It turned out to be a more complicated than I thought, so I’m going to need more time to get it done. Meanwhile I’ll try to start posting on my blog more often. To start off I’ll post about what I’ve been up to since I got back from Canada.

Last week I finally graduated from high school. the actual graduation was not until Saturday, but we had a graduation party on Thursday. It feels nice to finally be over with high school, I couldn’t stand some of my classes anymore. Fortunately, from now on all of my classes will be related to Mathematics which should be fun. I’m still not sure what mathematicians do for a living, but that’s what I want to study. I’m starting university on August, so I’ve still got more than a month left of vacation, although to be honest I’m not sure what I’m going to do all this time.

Other than graduating and wasting my time, I’ve been watching Friends and playing with my new Nintendo DS Lite. I wanted a Nintendo DS ever since they first came out, but somehow I was never convinced that I should get one, until the DS Lite. Right now, I have six games: New Super Mario Bros, Mario & Luigi: Partners in Time, Brain Age, Metroid Prime Hunters, Tetris DS and Mario Kart DS. The only ones I’ve really played are New Super Mario Bros and Brain Age. New Super Mario Bros is simply amazing, I already finished the game but I’m still playing to get all of the Star Coins and the alternate routes. I’ll write a lot more about it when I’m done playing it. As for Brain Age, somehow it’s actually fun to play the “brain training” programs. In case you’re wondering, I haven’t played in the last couple days, but last time I checked my brain was in its 30s which seems pretty bad since I’m actually 19. I should really get back to training to see if I can make my brain get younger. As for Friends, before I went to Canada I started watching all ten seasons, and I’m almost done. I think I’ve finally decided that Friends is my favorite TV show of all time. I wasn’t sure if I liked it better than Seinfeld, but after watching all of the seasons back to back I think I like Friends more. Right now I’m about halfway through season 9 which means that there’s only about one a half seasons left. I will probably finish watching the tenth season sometime this week; I’ve spent so much time watching Friends lately, that I’m not sure what I’ll do when I’m done watching all the episodes.

Anyway, that’s it for today, hopefully I’ll start posting more often from now on. It would help to have some visitors though. So if you’re reading this, please come back soon, or better yet, subscribe to my RSS feed.

New Articles up

Today I posted two new articles. First, I released Chaotica, a Mac OS X application to draw fractals using the Chaos Game. For more information follow the link. It’s amazing how with a few very simple rules and playing around with a few parameters you can create some very nice fractals. If you haven’t already, you should try it out. I’ve been thinking about some of the changes that would be great for future versions of Chaotica, like the ability to choose the exact positions of the vertices, or to use OpenGL to improve the performance. I’m not sure, if I’ll ever get to do this, but it’s definitely in my mind. The other article I posted comes from my old blog. It explains how to sort a list like the Finder does, I think that Cocoa programmers will find it very useful. There really isn’t much to say about this one, but if you’re interested feel free to use it, here’s the link.

I have another article planned to explain some aspects of the Chaos game, but I’m not sure of when it’ll be available. Hopefully, I’ll be able to finish it before friday, but if not, it’ll have to wait till I get back from visiting my sister in Canada.

Sorting Like the Finder

Something that most Cocoa programmers are likely encounter in their lifetimes is trying to sort a list like the Finder. At first sight, it might seem like there’s nothing special about how the Finder sorts; it looks like a plain old alphabetical sort. But it isn’t, there are many subtleties with the way in which the Finder sorts a list of documents. A simple example of this is when you have three documents called “1”,”2″, and “10”. A normal alphabetical sort would order them: “1”,”10″,”2″. But the Finder is smart enough to order them: “1”,”2″,”10″.

The basic code to sort like the Finder comes from Apple’s Technical Q&A QA1159. Using this code, I created a category for NSString which adds a method called finderCompare: to the NSString class. This way you only need to create an instance of NSSortDescriptor and initialize it using initWithKey:ascending:selector: where selector: should be @selector(finderCompare:). Then you just need to use this instance of NSSortDescriptor whenever you want to sort something like the Finder.

You can find the code for the category below, or you can just click here to download the file. To use this file you only need to add it to your Xcode project.

#import 

@interface NSString (FinderCompare)

- (NSComparisonResult)finderCompare:(NSString *)aString;

@end

@implementation NSString (FinderCompare)

- (NSComparisonResult)finderCompare:(NSString *)aString
{
	SInt32 compareResult;
	
	CFIndex lhsLen = [self length];;
        CFIndex rhsLen = [aString length];
	
	UniChar *lhsBuf = malloc(lhsLen * sizeof(UniChar));
	UniChar *rhsBuf = malloc(rhsLen * sizeof(UniChar));
	
	[self getCharacters:lhsBuf];
	[aString getCharacters:rhsBuf];
	
       (void) UCCompareTextDefault(
          kUCCollateComposeInsensitiveMask
        | kUCCollateWidthInsensitiveMask
        | kUCCollateCaseInsensitiveMask
        | kUCCollateDigitsOverrideMask
        | kUCCollateDigitsAsNumberMask
        | kUCCollatePunctuationSignificantMask,
        lhsBuf,
        lhsLen,
        rhsBuf,
        rhsLen,
        NULL,
        &compareResult
       );
	
	free(lhsBuf);
	free(rhsBuf);
	
	return (CFComparisonResult) compareResult;
}

@end