Monday, May 22, 2006

Visual Basic Self-Replicator

I am reading Introduction to the Theory of Computation. In the chapter about advanced topics in computability theory, it mentioned a technique for building a self-replicating Turing machine (a Turing machine that writes its own description on its tape). I have implemented this basic technique to write a self-replicating program using Visual Basic 6 (a program that outputs its own code). [In the form designer, create one TextBox called Text1 and set its Multiline property to True.]

Private Sub Form_Load(): Text1.Text = "Private Sub X(): Text1.Text = ""Private Sub Form_Load(): Text1.Text = """""" + Replace(Text1.Text, """""""", """""""""""") + """""": X: End Sub"" + vbCrLf + vbCrLf + Text1.Text: End Sub": X: End Sub

Private Sub X(): Text1.Text = "Private Sub Form_Load(): Text1.Text = """ + Replace(Text1.Text, """", """""") + """: X: End Sub" + vbCrLf + vbCrLf + Text1.Text: End Sub

Here is a rough overview of how it works. X() is just a subroutine to take the contents of Text1, and output the code for a Form_Load function that would write those contents to Text1, followed by a blank line, followed by the previous contents of Text1. Form_Load() is the block that executes first. It simply transcribes the code of X() into Text1, then calls X(). I have a hard time keeping this all in my head at once.

This took me an hour to write, and had many more complications than I expected. It was difficult to accurately reproduce the double-quote character (") as it is used in the code. The syntax for escaping the double-quote in a string literal is to write two consecutive double quotes (""). Notice that at one point, I have written twelve consecutive double-quote characters. That was probably the highlight.

Friday, May 19, 2006

Whistling

Here is another dorm observation: a lot of people in my dorm whistle a lot. They whistle loudly and for a long time. But there is no tune! They are whistling musical gibberish. And it's pretty annoying. What the hell?

Thursday, May 18, 2006

Quadratic Formula

ax^2 + bx + c = 0
Solve for x.

Obviously, x is equal to the quadratic formula. Can you derive it? Hint: the most important technique is completing the square.

The quadratic formula is fundamental for even the most basic algebra, and it only takes five or ten steps to derive. I think it should be on any high school algebra final exam.

Wednesday, May 17, 2006

Hair Dryers

I hate hair dryers so much! They make a terribly loud and annoying noise for about two minutes straight, and piss off dorm-mates like me. The point of all that is drying your hair? Are you kidding me? You can dry your hair with a towel. It's fine, really. Why do these things sell? A hair dryer is basically a rube goldberg for drying your hair.

Some asshole in my hall has been drying his or her hair since before I started writing this post. Fucking unbelievable.

Tuesday, May 16, 2006

Saturday, May 06, 2006

Two ears and one mouth

"Listening is more important than talking. That is why God has given us two ears and only one mouth."

So what's the alternative, one ear and two mouths? It makes sense that two ears were naturally selected because they allow our brain to triangulate the location of a sound source. There is no significant advantage a second mouth would offer that would compensate for the complexity of maintaining it.

I don't think it should be socially acceptable to spout those stupid cliches about how your anatomy supposedly corresponds to God's will. What kind of a sick joke would that be?

Saturday, April 29, 2006

Argument from Design

Does anyone else think it's ridiculous that creationists are still using the argument from design? I believe the person who first invalidated that argument was... Charles Darwin!

I'm guessing the conversation must have gone something like this:

Creationist: Look at all this complex life around us. It was clearly designed by an intelligent designer. There is simply no other conceivable way!
Darwin: Actually, I've thought of one, because I am brilliant. I submit that complexity can emerge from the passive process of random mutation and natural selection, given sufficient time.
Creationist: Uh huh, I see... interesting.
Creationist: Soooooooooo, how do you explain the fact that the organisms we see around us are so complex that they could only have come about as the result of an intelligent designer's design?

How can anyone claim that the central argument of ID is a modern development in science!?

Tuesday, April 25, 2006

Reading off a Screen

I have to read some tedious stuff for Humanities class, both online and off, and I noticed something odd: it's a lot easier for me to read (boring) text from the web than from a physical book. I read so much online, that I'm used to the physical experience of sitting in that position. It's harder for me to stay comfortable and focused reading a book. Case in point: I stopped to write this blog post.

Also, I like scrolling the page up with the mouse more than turning pages. It's all part of my assimilation into the 21st century.

Thursday, April 13, 2006

Pretty Famous

Right now I am the thirteenth most popular Liron on the internet. This blog comes up thirteenth when you search for the string on Google. Not bad, eh?

And I am pleased to say that I am the most popular Liron Shapira on the net. That guy from the "Department o Biology" put up a good fight, but I just wanted it more.

Wednesday, April 05, 2006

How to Invalidate a Christian's Prayers

Anyone with common sense knows that prayer doesn't actually work in any meaningful way. Here is a good experiment from Why Does God Hate Amputees by Marshall Brain:
Now I want you to try the [coin-flipping] experiment again, but this time I want you to pray to Jesus Christ instead of Ra. Pray sincerely to Jesus like this:
"Dear Jesus, I know that you exist and I know that you hear and answer prayers as you promise in the Bible. I am going to flip this ordinary coin 50 times, and I am asking you to cause it to land heads-side-up all 50 times. In Jesus' name I pray, Amen."
Now flip the coin. Once again, after the fifth or sixth flip, the coin will land tails.
Of course this example has a common justification, which is that we are testing the lord. So here is a mean trick you can use to screw over any Christian who thinks their normal prayers get answered, but not their "test prayers".

Invalidate a Christian's Prayer's
All you have to do is periodically ask them what they are praying for, and follow up by asking whether it works. You are doing this for the purpose of comparing their results with the normal statistics about these kinds of things. Now all their normal prayers are test prayers!

The whole "testing the lord" line reminds me of when you're playing a game of Horse and you miss a basket, so you call it a practice shot. But if you sink a nice shot, you sure as hell are not going to give up the credit for that sucker on a technicality. A Christian who defends prayer is just like a cheap Horse player, clinging tightly to anecdotes about effective prayers, while shrugging off any meaningful studies of the phenomenon.

If you are a good Christian who believes in prayer, I bet you'd still feel a little uncomfortable openly praying for God to strike you dead. But what's the biggie? It's obviously a test, so he won't do anything, right? I would certainly have no problem shouting any self-destructive prayer you like, because I have real confidence in my knowledge that they are useless.

The truth is that people who believe prayer works don't know the conditions under which it does. It's easy to make up rationalizations for individual incidents after they happen, but that's exactly what they are -- rationalizations. Do your Christian acquaintances a favor and invalidate their prayers with this handy technique so they stop wasting time on them.

Paper is Ridiculous

Today in Humanities class I wrote an in-class essay. I was thinking how ridiculous it is to compose essays on paper. The main problem with paper is:
It's hard to go back and edit.
No one naturally writes in one long, organized flow. I think usually the best way to write something is to quickly belt out a first draft, then revise it afterward. It's also useful to be able to make little changes along the way -- it puts you at ease, since you don't have to hesitate and make sure you are getting everything right the first time.

On a computer, revising is the easiest thing in the world. It is as easy as typing. Did you know that if you hold down the control key and then press backspace, delete, or an arrow key, it lets you operate on an entire word of text in one keystroke? Over the course of writing this blog post, I have watched myself take a false start and then instantly backtrack on almost every sentence. That's actually my strategy -- I put down my first idea of how to start the sentence, see how it looks, then go from there.

This computer's powerful editing interface has been around for decades. Why do professors think that paper is still useful as a medium for composing essays in class?

Postal Experiments

Postal Experiments
The idea of trying to mail a brick is utterly hilarious.

Monday, April 03, 2006

The Town Intellectual

This is an interesting blog post: Dumb towns getting dumber; smart towns getting smarter?
These costs [of moving] discouraged enough folks from moving that every town had its intellectuals. They dreamed of moving to Manhattan, but they never did. You'd find them at the library, in the local theater company, running a Great Books club, etc.
One question to ask is, why do the dumber people congregate into towns? I think it's because smarter people get more added value from being around other smart people, so they take the initiative to move, while the rest are left behind to form dumber towns.

Thursday, March 30, 2006

Conversations with God

The new book in the "Conversations with God" series just came out. It's called Home with God : In a Life that Never Ends. I don't know whether this is common knowledge, so I'll just put it out there:

"Conversations with God" is a hoax!

The books read like a dialogue with God. Here is some witty banter between author Neale Donald Walsch, and God:
God: How deep do you wish to go in your higher understandings? Should you choose to continue with this conversation, I will present you with 100 more words -- a 100 Word Formula for All of Life.

NDW: Well, there's a tease.

God: That's exactly what it was meant to be.

NDW: And it worked. I'm not about to cut the conversation short now. So here I am having a conversation with God about living and dying. Again.

God: Yes, but looking at many things that we have never discussed before.

NDW: Who would believe this . . .

God: It doesn't matter. You're not having the conversation for anyone else, you're having it for yourself.

NDW: I have to keep reminding myself of that.

God: So often people see themselves as doing something for someone else when they're really doing it for themselves.
Everybody is doing everything for themselves. When you awaken to this awareness, you will have reached Breakthrough. And when you understand that this is true even about dying, you will never fear dying again. And when you no longer fear dying, you will no longer fear living. You will live your life fully, right up until the very last moment.

NDW: Hold it. Wait a minute. You're saying that when I'm dying, I am doing it for myself?

God: Of course. Who else would you be doing it for?

Unbelievable. I like how the author pretends like he is outside the system, like when he says to God, "So here I am having a conversation with God about living and dying. Again. ... Who would believe this". No one in their right mind would believe this! And God replies that it doesn't matter. But contrary to God, it does matter, because this is currently the #1 selling book on Amazon.com.

I am really disappointed that so many people are into this series. Here are some choice quotes I've seen from a few people who aren't (with my emphasis):

Maddox:
My book is currently ranked #2 on the best seller's list on Amazon.com, push that son of a bitch to #1! I'm currently being beat by a book called "Home with God." Are you shitting me? Pre-order my book for $9.57 now.

Nick Hriciga (Amazon.com reviewer):
To say I expected much from this book would be a lie; I cannot expect much thought in a book so inherently devout in topic. I did, however, expect more than some self-riotous sack conversing with god and assuring me of a heaven. We don't need these books. All they succeeds in doing is agreeing with the bible in every way possible. Way to use faith to blind your consumers. Neale Walsch is a manipulative hack, go out of your way to avoid this garbage.

"Person" (Amazon.com reviewer):
How can you copyright words from God, have all rights reserved for it, and require permission to show it elsewhere?

And here is one ecstatic Amazon review by "Barbara Rose, Ph.D" that is so downright nutty I originally thought it was sarcastic:
It is my deepest belief that anyone who has ever been afraid to die will receive great relief after reading this book.

There is the most love filled tone throughout, of course that unconditionally loving tone and feel comes from GOD.

There is so much reassurance, beauty and truth. Can we "prove" any of this information? Not with scientific data, however, we CAN ask anyone who HAS "died", went to the other side, and came back.

. . .

Thank you, Neale, for your extraordinary contribution to humanity!
This book deserves at minimum 10 stars!

I think the elephant in the room is that you can't have a conversation with God when there is no god. So look at this crap the God character is spouting to get around the dilemma:
God: It is impossible to live or to die without God, but it is not impossible to think that you are.

If you think that you are living or dying without God, you will experience that you are.

You may have this experience as long as you wish. You may end this experience whenever you choose.

OK, God, if that is your real name. I choose to end the experience... NOW. [I pause from typing, waiting for the experience of living without God to end.]

Nope, the experience is still going on. This experience is called sanity, and for most people it is not as simple to end as making a choice. But a lot of people have the handicap of a lifelong indoctrination that began in childhood. And as one reviewer pointed out, Mr. Walsch is taking advantage of their faith to sell bullshit books.

Wednesday, March 29, 2006

Blogroll

I haven't posted much recently, mostly because my thoughts aren't very original. In a typical day, how many of your thoughts are worth sharing with strangers online?

So today here is a link to my blogroll, the stuff I like to read online. You can visit these sites while you wait for new content on Logic and Reason.

Zug - Funny articles. I like John Hargrave's sense of humor.

Marshall Brain's Blog - My favorite author's blog

Dilbert Blog - Scott Adams' blog. Unique take on life.

Critical Section - Ole Eichorn's blog. Interesting in general.

Homestar Runner - A funny website. HomestarRunner is classic.

IWillTeachYouToBeRich - Learning how to be rich.

Maddox's site - He's funny too.

Reddit - A site that aggregates the top coolest things to read online each day. A lot of posts I make on this blog are inspired by articles I read on Reddit.

By the way, I am currently on Spring break, working on RelationCraft and reading Darwin's Dangerous Idea. Wow, look at those awesome reviews for DDI. How can I not read it?

Tuesday, March 21, 2006

Friday, March 17, 2006

Marriage is Unnatural

This Economist article explains that women have a natural tendency to enter into a long-term relationship with a "reliable" man, and then cheat on him with a "dominant" man during the part of the menstrual cycle when she is ovulating.

Wednesday, March 08, 2006

Funny

This recording by John Hargrave of Zug.com is hilarious.

Monday, March 06, 2006

RelationCraft

I haven't blogged for a week because I've been working hard on RelationCraft, my website.

RelationCraft is a new type of social networking site for college students that is focused on relationships. The name can mean that you go on the site to craft your relationships, and it is also a bit of a pun (RelationCraft instead of Relationship -- a ship is a type of craft).

Here is a timeline of the site's progress:

October-November: Brainstorming. The general idea occurred to me in October, and for a month and a half I was compiling a big Word document of ideas.

December: Designing. I consolidated the brainstorm down to a list of ideas to implement in the initial release of the site, then I filled up about a dozen sheets of paper with sketches of the site layout.

January: Learning. I started off with a good general knowledge about HTML and HTTP, but I had never done any web programming before. I decided to use ASP.NET for the site because I already have experience with Microsoft .NET and I think it is an awesome development environment. The IDE of Visual Studio 2005 is the smartest in human history.

     The experience was frustrating at first. It is a fascinating paradigm shift to be using the same kind of high-level programming language for a web application as for a Windows application. But because this web application is so complex, there were a lot of minor details about the way ASP.NET works that I had to get used to. I wasted many hours on relatively trivial problems because I only had one friend who knew more about this than I did.

February: Programming. After a slow start, I finally got the hang of ASP.NET, and I was amazed that some of the more complex implementation ideas I was dreaming of (asynchronous server interaction through HTML frames) were realistic. ASP.NET is a truly powerful rapid development solution. So I registered the domain name RelationCraft.com and signed up for hosting with GoDaddy. (Unfortunately, because the site is for college students only, it enforces the registration requirement that you must have an email address from an approved college. I'll post information about demoing the site in the future.)

March: Well, I'm still programming, but I am a few days away from having a polished demo site with a few initial features. I realize I haven't actually described any innovative ideas from the site yet, and I don't really feel like typing them up right now, so just check out some preliminary screenshots.



Tuesday, February 28, 2006

Not Reading Books

Remember when I posted that Marshall Brain is my favorite author? So I realized I've never read a single Marshall Brain work on paper. I've probably read the equivalent of over a thousand book pages, all online.

I haven't read an actual book for leisure in a while. I went to the library the other day and got one. I'll post when I read it.