Archive

Archive for the ‘Programming’ Category

On Intelligence

September 21st, 2009

I just read this amazing book on how the brain works called On Intelligence by Jeff Hawkins. It outlines in simple language a comprehensive and detailed theory of the brain and a definition of intelligence that’s truly aw-inspiring. I’ll let him go into more detail personally in this TED talk, in which he goes over many of the most important points of the book.

Programming

Re-Wiring the Brain

May 10th, 2009


Not to belabor the point (since the previous two topics have dealt with this topic), but in case you were wonder which mindset (fixed or growth) is closer to reality, the science clearly supports the notion that a person’s skills and intelligence are under their control.

Train your brain –> Get smart. Be lazy –> Stay stupid.

Simple as that.

Programming

From Dance Captain to Coding Genius

May 1st, 2009


[ Photo of Jennifer by Kunjan ]

Gen-Y’s are smart people, but unfortunately for them, their parents and teachers thought it was a good idea to shelter them from all of life’s difficulties… including the frustration of solving problems. It doesn’t help that these children were showered with empty praise growing up for mediocre ‘achievements,’ which took no effort, to boost their self-esteem. When everyone gets a trophy, the result is children who’s confidence is only exceeded by their incompetence. In this sense, former president Bush may just be the first of the Gen-Y’s (though he’s way too old). For more detail, read Narcissistic and Entitled to Everything! Does Gen Y Have Too Much Self-Esteem?

This is the story of how I helped Jennifer start to develop problem solving skills at 22 years old, by teaching her a little about programming. If you’re a programmer reading this, you’ll probably be tempted to laugh and call her stupid, but understand this — Jennifer is a smart girl. She graduated high school with a 4.0 GPA. Problem solving, however, is a different kind of skill which takes a lot of time and hard work to develop. Unfortunately, her education failed to teach this. Fortunately, it’s never too late. Read more…

Programming

How To Be Smart

April 27th, 2009

Earlier when I covered talent, I transformed all of you commoners into virtuosos of all arts. Since I’m on a roll, it’s about time I tackled intelligence. Fascinating research publish by Dr. Carol Dweck in 2007 draws a clear distinction between the mindset that makes a person ’smart’ or ‘dumb’ backed by strong evidence. It’s a pattern I’ve noticed again and again, so I’m really glad to see my suspicions confirmed. I must be ’smart.’ (Yes! I got the label! Haha).

http://www.stanford.edu/dept/bingschool/rsrchart/dweck.htm

So please, avoid the trap of a false dichotomy between ’smart’ and ‘dumb’ people. You can conquer the world. Whether you actually do is entirely up to you.

Thoughts?

Programming

How fast can you read this?

April 4th, 2009

When my friend Steven Johnson was telling me about speed reading recently, I was skeptical. I assumed as conventional wisdom goes, that the faster you read the less you retain. Interestingly, research says the exact opposite. In general, the faster you read the higher your comprehension. This is because we have a limited short-term memory, and words have little meaning in isolation. When you read fast you can better access the full meaning of the sentence or paragraph.

So, I decided to do a speed reading test. I got 240 WPM at 80% comprehension. I’m only slightly above average. “Excellent” readers can read 7 times that speed with the same or better comprehension! Needless to say, I have a ways to go. I’m considering using zealog.com to track my reading speed daily. Improvement takes deliberate, sustained practice. I think measuring progress would help keep me on track. I need to practice perseverance, too, plus I would be learning whatever material I choose to use, so 3 birds with one stone. Perfect!

Programming , , ,

Talent Through Insight

February 26th, 2009

The question of talent is something that I’ve been grappling with for months now, ever since I became serious about guitar. However, this applies to much more than playing music. It’s just the best example of a skill in which most people tend to believe “either you have it or you don’t.” I was haunted by thoughts like ‘What if I’m not musically talented, and I’m wasting my time?’ After all, I have a friend who took guitar lessons for 5 years and today he never plays anymore. If he does, it’s mediocre at best. Then there’s the 16 year old guitarist from Black Oxygen, who has been playing for 2 years and can grind out the most shiver-inducing licks as if by divine (or perhaps, satanic) inspiration. I, myself, had one of the roughest starts imaginable, so you can see why I was concerned. So for months, I’ve thought, and researched, and experimented, and discussed, and thought some more (hence the blog title), and here’s what I came up with. Read more…

Programming

Eager vs. Lazy Lifestyle

February 21st, 2009

If you’e one of my millions of loyal readers (:D), you might be starting to think that this blog doesn’t have a topic.  You’re partly right, after all, I did name it Tony thinks to keep my freedom of subject. But right now I’m going to tie in my first three posts, like a masterful drama with characters and events that seem unrelated, but come together in the end (Snatch and Slum Dog Millionaire come to mind). Don’t believe me? Read on!

I think successful people more often than not come up with metaphors for life to keep them going. My favorite example are my entrepreneur friends Yu-kai and Jun from FD Career. They say that corporate gets you donkeys; Entrepreneurship gets you the princess, haha. Yu-kai talks about what he calls his “Diablo epiphany” in high school. It happened at a time when he was had worked hard to achieve high skill and status in Diablo, but the game’s popularity was waning. He felt empty inside because all his hard work was for not, and now he would have to find a new game to start from square one. What’s a really great game, he thought, that you can get really high status, and people can’t just get tired of and quit? The answer is obvious — life! Overnight, he was transformed from a hardcore gamer with little to show in real life for his efforts, into an ambitious entrepreneur who lived life like a hardcore gamer. Since then he has started multiple companies, some of which are still around and successful, has an impressive roll-a-dex with thousands of friends and important connections, his blog gets nearly 2 thousand unique viewers a month with steady growth, and he is a powerful leader who people want to follow. I would say he’s made significant progress towards success on a grand scale. Not bad for an afternoon of thinking, huh?! Read more…

Programming

Ronald the Bu– er.. Street Musician

February 21st, 2009

His skin was weathered and clothes were torn, but the feeling with which he played told me that he really was a street musician, and not just a bum. The music really mattered to him. I put the sandwitch next to him on the bench, and sat down tentatively, beginning to eat mine. When he finished his song, he thanked me kindly. We got to talking, and I found out he had led a very interesting life. His parents were in the millitary, so they moved around a lot. He said he never really had a home, instead he roamed around the country on buses and trains playing his music on the street to survive. Currently he had settled to Lawrence for the time being staying at the homeless shelter, which is relatively nice.  It’s unconventional, but it’s an honest living and a lifestyle choice, and I see that as perfectly legitimate, and I told him so. He truly was content with life which is more than many of us home-ful (haha) people can say.

However, his life was by no means glamorous. Read more…

Programming

Stackless

January 12th, 2009

I’ve been reading about Stackless Python for concurrent programming and it sounds flippin’ fantastic. The most famous application, Eve Online,  is very impressive.

There’s a really great tutorial on Stackless Python for those new to concurrent programming but familiar with Python written by Grant Olson. I did find one issue in the digital circuit code example, though.

I tried this with Python 2.5.1 and Python 2.6 to no avail. When I tried half-adder example, the output is incorrect.

A simple inputA(1) should give the output:

Result = 1
Carry = 0

Instead, it gives just:

Carry = 0

Or with debug mode on:

Setting input to 1
AndGate received 1 from <__main__.Switch instance at 0x012A5968>
AndGate's new state => 0
Carry = 0

I modified the EventHandler class’ listen method to the following:

def listen(self):
    while 1:
	    val = self.channel.receive()
	    self.processMessage(val)
	    if isinstance(self,AndGate):
	        debugPrint("AndGate outputs: %s" % self.outputs)
	    for output in self.outputs:
	        if isinstance(self,AndGate):
		    debugPrint("AndGate is outputing to: %s" % output)
	        self.notify(output)

And this is the result:

Setting input to 1
AndGate received 1 from <__main__.Switch instance at 0x012A5968>
AndGate's new state => 0
AndGate outputs: [<__main__.Reporter instance at 0x012A5DC8>, <__main__.Inverter instance at 0x012A5EB8>]
AndGate is outputing to: <__main__.Reporter instance at 0x012A5DC8>
Carry = 0

As you can see, even though the And gate has 2 outputs (a Reporter and an Inverter), it’s only sending a message to the Reporter. Where did the message to the Inverter go?! Oddly enough, adding this to __main__ resolves the problem:

inverter((andGateA, andGateA.state))
inverter((andGateA, andGateA.state))

The output now (debug off) is:

Carry = 0
Result = 0
Result = 1
Result = 1
Result = 1

Now the final values it settles on (carry = 0, result = 1) are correct. It also works in the 3 other possible cases. So, for some reason the output from andGateA is not being sent (or received) properly by the Inverter. Any ideas? I’m stumped as to why. Could it be a bug in stackless? It is still in alpha…

Programming

Welcome!

December 31st, 2008

This is the first entry of a what I hope will be a long and productive blogging career. In anything I do (and I think for most people), taking the first step is always the hardest part, so here it is. The first step. No more endless planning and pondering. Action!

I’ll keep it short because I feel like I should be working on my iPhone application project. Unfortunately, I can’t talk about in detail because of an NDA. I need to sort out with Michael (my “employer”) exactly what that covers, but I will be sharing general iPhone development perls of wisdom I gather along the way. The design is very temporary and will change drastically, but like I said I just wanted to get something out there to get the ball rolling. I want to thank my friends Yu-kai and Jun for inspiring me to join the social media community.

Welcome readers!

Programming