Monday, May 30, 2011

My Favorite Programming Language

Having spent some time on technical message boards, I've seen this topic pop up a lot. “What programming language should I learn?” “What language is the best for beginners?” “What’s better C#, C++, or Java?”

When I was in high school, I was taught a stripped down version of C++ that avoided a lot of the Object Oriented concepts. When I went on to college, Java was emphasized in the intro courses and then C in high level courses. There were those courses that would force you to learn some eclectic language (x86 assembly, Scheme, Prolog). Outside of the mainstays, I’ve also run into C#, SQL, PHP, and HTML (which are not programming languages and, rather, scripting languages).
As far as what language you should learn first, in my opinion it really doesn't matter. As long as you go on and learn more about programming, your first language is going to affect you all that much. All programming languages have their pros and cons and one may solve a specific problem better than the other, but at the end of the day, it really won't matter which one you choose.
C is much simpler than a higher level language like Java or C#, however it can be less forgiving than them as well. Java gives you nicer errors whereas C relies on the programmer to catch a lot of those dumber mistakes like running over the bounds of an array. Some of that can be solved using the right IDE (Visual Studio is very good in my opinion).  C# and Java introduces Object Oriented concepts, which can be too complex for first time programmers and can add unnecessary bulk to smaller projects. I’ve also heard that Java’s garbage collection can be extremely cumbersome, as a CPU heavy task that pops up at random intervals.
Nothing beats being taught in a formal course, but here are some learning resources I would recommend:

The first is A Guide to Programming in C++. This is basically baby’s first programming book. It will hold your hand the entire way. We’ve all got to start somewhere and if you’ve never taken a formal class in programming this is the book I would recommend. The book is a little old, so, you’ll need to do a few tricks to get code to run on current versions of visual studio.

Java Concepts is a great Java introductory book. It will introduce you nicely to object oriented concepts. If you read some of the later chapters,  it will also touch on some of the higher level concepts in computer science.

Next is Computer Systems: A Programmer's Perspective. This is a very advanced book. I would almost say the material in “separates the boys from the men” in the programming world. After you’ve finished with intro books, consider picking this one up.

For C#, I recommend Learn Visual Studio’s Absolute Beginner's Series for Visual C# 2005 Express Edition. The entire series used to be available for free on MSDN, and you can still find some of it in existence on that site.

Tuesday, May 24, 2011

Photosynthesis and Cellular Respiration

I was going to make a detailed post on the formation of kidneys (mostly to make the joke “Zac Efron the Nephron”) but I found the subject to dry and uninteresting. However photosynthesis and cellular respiration is a much more interesting subject in my opinion. In a way it is the basis of all life.
Photosynthesis is the process by which plants (and certain other organisms) store solar energy in carbohydrate molecules: 6CO2 + 6H2O + photons => C6H12O6 + 6O2. This is how most new energy enters the food chain. This reaction takes place in the chloroplast. Photosynthesis is split into light dependent and light independent reactions.
That internal structure is called the thylakoid. The light dependent reaction takes place right at the membrane of the thylakoid. Basically, this reaction takes sunlight and uses it to attach a phosphate to ADP to create ATP (the energy “currancy” of the cell) and hydrogen to NADP+. The molecules hold the energy in these bonds. For a summary of the light dependent reaction, see below.
The light independent reaction (aka the Calvin Cycle) occurs outside the thylakoid in the lumen of the chloroplast. It basically uses the ATP and NADPH created in the light dependent reaction to take CO2 and create carbohydrates.
Cellular respiration is kind of the opposite of photosynthesis. Carbohydrates break down and release energy: C6H12O6 + 6O2 => 6CO2 + 6H2O + energy. The main method of cellular respiration is aerobic respiration. A lot of biological reactions operate as a cascade of small reactions, and aerobic respiration is just such a reaction. See below for a summary:
Glycolysis is a 2 phase reaction takes glucose and creates 2 pyruvates.
The pyruvates are then converted to Acetyl coenzyme A.
The citric acid cycle converts Acetyl coenzyme A to coenzyme A. This creates 2 ATP.
Electron transport generates a whopping 32 to 34 ATP!
Anaerobic respiration (fermentation) requires less oxygen, but releases less energy. Glycolysis runs and releases 2 ATP, but pyruvate is converted to lactic acid or alcohol depending on the organism instead of continuing on through respiration.
Now, you’re asking, what about all the other stuff we eat, how do we get energy from that. Well they enter at different parts of the pathway. See below.

Friday, May 13, 2011

Osama bin Laden: a Postmortem

I’ve stayed away from news posts, although I am still considering some news-round-up posts if I can find the time, and stuck mainly to content rich posts. This post will be no different, although the death of Osama bin Laden is news, there’s a lot going on in the Middle East, and I want to explore that.
I want to start out by saying I was not one of the ones out in the street cheering when Osama was killed. I just have something against celebrating the death of another person. I suppose it has to do with my belief that the world isn’t so black and white as to lump people into extremes. But, if you ask anyone who lost someone during the attacks or in the subsequent war that followed, they weren’t celebrating either. This was a time for reflection.
A lot of people like to cite the Muslim religion as the driving force behind Al Qaeda. That it was a clash of culture that led Osama on his path: “They hate us for our freedom”. While there was religious influence in the group, it was not the driving force. The Middle East is a region in which religion is all pervasive, with many operating theocrats. So, the real goal of Al Qaeda is political.
There is a huge disparity of wealth in many Arab countries; a small ruling elite controlling most of the wealth and resources, leaving the rest in poverty. It was easy for Al Qaeda to recruit terrorists when there were so many that are disenfranchised, poverty stricken. Many believed they had no future. It was easy for Al Qaeda to point their finger at ruling elite and the west, who had given their blessing to many of these rulers, and rally support against them.
But, Al Qaeda’s motives were never the problem, it was their modus operandi. Drawing support against a dictator is a noble pursuit, and many in the international community would support it. But when you attack civilian and peace time military, that is inexcusable and will label you as a murderer. And you will have to face the consequences, as Osama bin Laden did.
But, Osama bin Laden’s death was largely ceremonial. Al Qaeda’s support in the Middle East had waned. And it was not just the military operation in the Middle East that had minimized their influence.
In late 2010, a series of nonviolent protest swept across the Middle East. Known as Arab Spring, disenfranchised and impoverished citizens challenged the established dictators. In a few months, several countries had ousted their dictator and undergone revolution. People had found a way for change that didn’t require terrorism. Al Qaeda was left to watch as they became irrelevant.
Many claim that Osama bin Laden’s death was a turning point in the “War on Terror”, but that point came month ago when people chose peace over violence.

Saturday, May 7, 2011

Upgrades

There’s some big news in the death of Osama bin Laden. I want to make a post on it, and we’ll see if I get around to it. It will be up if/ when it’s finished.
It may surprise you, dear reader, that being as technologically savvy as I am, I am probably one of the last people to upgrade my electronics. However, that is not to say that I do not plan upgrades, just that financial circumstances (read: unemployment) prevent me from making the final purchase.
Let’s start with the big one: my PC. My current motherboard is this beast, which I have had for the last 5 years. I envisioned it as a kind of transition PC, but here it is 5 years later, still pulling it’s weight. I would like to upgrade it to an AM3+ or Intel LGA2011 board when they get released. Hopefully it has SATA 6Gbit, USB 3.0, PCIe 3.0, and DDR4 out of box, but that’s kind of unlikely. Lightpeak (Thunderbolt?) looks to proprietary for my tastes.

I recently received a Blu-Ray burner, but my monitor isn’t HDCP, so I can’t actually watch Blu-Rays on my PC. So, I’m looking to pick up this guy when the price drops to $280 or this guy if it goes on sale again . I could even modify it for 3D.
 My device on the go is the iPhone 3G which, as you may have heard, Apple decided to unceremoniously drop support for. But I’m still considering buying an iPhone 5 or whatever iPhone happens to feature LTE. What can I say, Apple makes a damn fine mobile OS, up until the point when they make the next model.
My laptop is similar to this bad boy. I’m honestly surprised it still runs. I made upgrades to the hard drive and ram. But I no longer have the need for a laptop, so I won’t be upgrading. But if I did I would want something with a touch screen and discrete graphics card. This is a little old or a nice ThinkPad.
Finally there’s my car. It’s almost 2 decades old. I’m not a car person. But as I previously posted, I’ve started watching Top Gear and I did a little research and would love to get the Chevy Volt when it’s price comes down.