Philosophical Multicore

Sometimes controversial, sometimes fallacious, sometimes thought-provoking, and always fun.

Archive for the ‘Programming’ Category

Is there an app for that? Not yet — but there could be!

Posted by Michael Dickens on January 3, 2010

Do you have an idea for an iPhone app that you just wish you could have? Well, now is your chance. See, I’m the kind of guy who likes money. So if you have an iPhone app that you wish existed and you’d be willing to pay 99 cents for, let me know and it just might magick itself into existence. (No guarantees, but you never know!)

Advertisements

Posted in Computer Science, Fun, Programming | 1 Comment »

Ruby Wins Brownie Points

Posted by Michael Dickens on December 1, 2009

Today I learned that Ruby‘s random number generator uses the Mersenne Twister, the greatest pseudorandom number generator known to man — both faster and higher quality than the commonly-used linear congruential generator.

Posted in Computer Science, Math, Programming | Leave a Comment »

Objective-C is the Coolest Language

Posted by Michael Dickens on November 10, 2009

At least according to Numb3rs. After I saw another Objective-C reference, I figured that the writers must have something for Objective-C. Maybe one of the math consultants does Objective-C. But I think a very likely reason is that Objective-C just looks cool. It’s not my favorite language (I don’t even like it that much), but I definitely can’t argue with the fact that, if you don’t know what is going on, it looks freakin’ cool. You use brackets for method calls. Come on. How can you not love that? And the unnecessarily long method names that are supposed to make the language easier to read but really don’t. Those are just great. (I couldn’t find any good pictures, but check out this video.) Compare that to, say, Lisp.Lisp

Yaaawwwnn. Too many parentheses. But Objective-C has a real “hacker” feel to it.

(P.S. The actual coolest language is Scala.)

Posted in Computer Science, Math, Off-Topic, Programming | 2 Comments »

The Best BF Program I’ve Ever Written

Posted by Michael Dickens on November 9, 2009

I wrote a BF program which calculates every prime number from 2 to 100. This is it:


[-]++>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[>[-]>[-]>[-]>[-]>[-]>[-]>[-]>[-]<<<<<<<<<[->>+>+>+>+<<<<<]>>>>>[-<<<<<+>>>>>][-]++[->+>+>+>+<<<<]>>>>[-<<<<+>>>>]<[<<<<->>>>-]<<<<[<[-]>[-]>>>>>[-]>[-]>>>>>>>>>>[-]<<<<<<<<<<<<<<<<<<[->+>+>>>>>+>+<<<<<<<<]>>>>>>>>[-<<<<<<<<+>>>>>>>>][-]>[-]>[-]>[-]>[-]<<<<<<<<<<<[->>>>>>>+>>+<<<<<<<<<]>>>>>>>>>[-<<<<<<<<<+>>>>>>>>>]<<<<<[->>>>+>+<<<<<]>>>>>[-<<<<<+>>>>>][-]>[-]>[-]>[-]<<<<<[->>+<<]>>[<[->>+>+<<<]>>>[-<<<+>>>]<[>+<<-[>>[-]>+<<<-]>>>[-<<<+>>>]<[<-[<<<->>>[-]]+>-]<-]<<<+>>]<[-]>[-]>[-]>[-]>[-]<<<<<[->+<]>>[-]>[-]<<[->+>+<<]<<<<-[>>>>>>[-<<+>+>]<<[->>+<<]<<<<-]>>>>>>[-]<[-<+>]<[<<<<<<<<->>>>>>>>-]<<<<[-]<<<<[->>>>+<<<<]>>>>[>>>>>>>>>>>>>+<<<<<<<<<<<<<[-]][-]>[-]>[-]<<<+[->+>+>+<<<]>>>[-<<<+>>>]<[<<<<->>>>-]>>>>>>>>>>>>[->+>+<<]>>[-<<+>>]<-[<<<<<<<<<<<<<<<<<[-]>>>>>>>>>>>>>>>>>+]<<<<<<<<<<<<<<<<<]>>>>>>>>>>>>>>>>[<<<<<<<<<<<<<<<<<<.>>>>>>>>>>>>>>>>>>[-]]<<<<<<<<<<<<<<<<<<<<+>-]

Since I’m using a slow Python interpreter, it takes a long time to finish. But it still works.

Posted in Computer Science, Math, Programming | 6 Comments »

Ruby versus Python

Posted by Michael Dickens on November 7, 2009

I have some experience programming in both Ruby and Python, and have long wondered which is superior. Many people love Python, and many others love Ruby. Both of them, in my opinion, are at the pinnacle of easy-to-use languages; they are both dynamically typed, multi-paradigm languages. Here is a comparison of the details, with the winner in bold.
Read the rest of this entry »

Posted in Computer Science, Math, Programming | 2 Comments »

Java Virtual Machine

Posted by Michael Dickens on November 5, 2009

The Java Virtual Machine (JVM) allows a compiled Java program to run on any platform. That sounds pretty cool, right? You don’t have to worry about the fact that different platforms use different assemblers, because it runs on a virtual machine. But it’s pretty fast. Not as fast as a purely compiled language, but a lot faster than an interpreted language such as Python. Isn’t that a great idea?

But you know what would be even better? If everyone just used the same platform. (Preferably the one that I am currently using.)

Posted in Computer Science, Math, Programming | 1 Comment »

Ruby’s Loops

Posted by Michael Dickens on November 3, 2009

The Ruby programming language has many ways to do what you want. For example, it has no fewer than nine types of loops. Here I have each loop, and how you would express it in C. For some of these, I made up the names. And sometimes I called them loops when they are actually iterators. But I can do that if I want to.
Read the rest of this entry »

Posted in Computer Science, Math, Programming | 5 Comments »

Extreme Geekiness, Squared

Posted by Michael Dickens on October 25, 2009

From this delicious Stack Overflow thread.

Top 10 things likely to be overheard from a Klingon Programmer

1. Specifications are for the weak and timid!
2. You question the worthiness of my code? I should kill you where you stand!
3. Indentation? I will show you how to indent when I indent your skull!
4. What is this talk of release? Klingons do not release software. Our software escapes leaving a bloody trail of designers and quality assurance people in its wake.
5. Klingon function calls do not have parameters – they have arguments – and they ALWAYS WIN THEM.
6. Debugging? Klingons do not debug. Our software does not coddle the weak.
7. A True Klingon Warrior does not comment on his code!
8. Klingon software does not have BUGS. It has FEATURES, and those features are too sophisticated for a Romulan pig like you to understand.
9. You cannot truly appreciate Dilbert unless you’ve read it in the original Klingon.
10. Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!

Posted in Computer Science, Humor, Math, Programming | 1 Comment »

Turing Machine Interpreter

Posted by Michael Dickens on October 19, 2009

I have written a C program that interprets a Turing Machine. It comes with a few sample programs, and the source code is available. You should check it out and see what you can come up with.

A Turing Machine is equivalent to every computer ever. If a Turing Machine can do it, any computing device can do it. But the problem is, Turing Machines are really simple, making them really hard to use. The best program I could write was one that added up two 2-bit numbers and then halted. I didn’t spend all that long on it, so I’m sure you could come up with something better. But download the file and see what you can do. A short tutorial is included inside.

Posted in Computer Science, Math, Programming | Leave a Comment »

Brainf*ck

Posted by Michael Dickens on September 29, 2009

WARNING: Offensive language ahead! That is, if you’re offended by a completely logical name that makes eloquent usage of the English language.

Read the rest of this entry »

Posted in Computer Science, Math, Programming | 2 Comments »

 
%d bloggers like this: