Archive for December, 2009

The Unctuous Programming Lectures of Leif Andersen

And it’s official, I have made my first video lecture.  Currently, you must go to archive.org to watch it:

http://www.archive.org/details/UnctuousProgramming

If you liked that lecture, I would like to put it on youtube, so it can be streamed.  However, youtube currently requires someone to be a ‘partner’ in order to upload videos longer than 10 minutes,  which I cannot do unless I have a large enough audience.  So, if you did like that video, head over to: http://www.youtube.com/user/AndersenLeif and subscribe to me there.  When youtube will allow it, I will upload the video.

Any comments or suggestions?  Feel free to post them here.  Am I going too fast, too slow?

Edit:  I have now uploaded it to youtube, sort of.  I finally caved in, and uploaded it in parts:

Rant5-014:Free or Premium

I rant about the differences between wordpress and wordpress.  Talk about how I can’t get my stuff on youtube, and how facebook may be hacked, or maybe it’s just me.

All today, on quite possibly the most dull episode of Rant5 for a long time.

Get the show at: http://www.archive.org/download/Rant5/Rant5-014_vbr.mp3

Science, Religion, and Cliché, a plea to keep an open mind.

Image by: T?inecké železárny

What we know, how we came to be, and what is the whole point of the universe really?  These are three big questions, that seem to get asked a lot.  By religious people, who use it to point out how obvious (it is to them) that a God, or gods, exist.  And the scientists who take the opportunity to point out (how obvious it is to them) that religion is wrong, because they believe that they have all the answers.  Sure, both sides, especially the scientists, admit that they don’t know everything, the religious people saying that ‘God knows everything’, and the scientists, being a bit more agnostic, either say it’s impossible to know everything, or that it is possible, but we are very far from it, however, neither side actually acts with an open mind, despite how much they say they do.  The ironic thing though, is that by saying that, both sides are stating that they know for absolute certainty something about the universe, something, that could possibly in the next hundred or so years, be proven false, do to humanity thinking in a c completely different paradigm that we can’t even fathom at this point in time.

The point of this article is not to discuss evolution, nor to discuss global warming, which I have already have written about.  But rather, to criticise both sides, for the amount of cliché they use, the amount of straw man, snowball effect, and other logical fallacies they use in order to prove with absolute certainty (in their minds) that something is false.  Do I blame them?  No, not a bit, in fact, from time to time, I find myself doing it, which leads me to believe that I’m doing it even more when I’m not meta-conscious.  But please, try to keep an open mind.  Religious people, maybe, just maybe, we did evolve from more simple forms of life.  Or even more fundamental, maybe, just maybe, the concept of God is something that we made, even if not meaning to, in order to give us comfort, something our biology has made an integral part of us.  Scientists, maybe, just maybe, God exists, he may or may not have wanted the Bible, or other forms of scripture, to exist, and maybe  he isn’t anything like what any major religion imagined him to be, but maybe he does exist.  Maybe our idea of the scientific method is wrong altogether.  Sure, it has served us well in the past, but we didn’t actually get the scientific method by the scientific method, at some point we did have to use induction.

An Antebellum era (pre-civil war) family Bible dating to 1859.  By David Ball

An Antebellum era (pre-civil war) family Bible dating to 1859. By David Ball

When I go into a religious setting, I tend to find people who have proven scientifically (in their minds), that God exists.  I begin talking to them, and any time I point out a possible problem with their ‘fact’, they start proving it with other facts, and usually return very fast, using a circular argument, ie God made us because it’s too unlikely we could have evolved, I ask why after all is not anything forbidden, mandatory, or given enough time, anything improbable will happen, at which point they say no.  I point out how they could be wrong, and they continue to talk about how it is illogical, and against anything God would make.  I also have known people to say that they have open minds, just so long as they are good God-fearing people, isn’t that a contradiction.  What if someone were to come up with some magical way of proving he did or didn’t.  I am not a God hater, as some people have branded me as, but rather, for this subject, I am agnostic.  I see no possible way to prove or disprove God.  Even if we did find some gene, or brain activity that caused humanity to believe in God, could not some group of people state how that is sure-fire proof that God exists, as he made us in such a way that we would look up to him?  So, until I come up with some possible way to prove or disprove it, I do not care, and hope that you will continue to think of me as a descent human being, who is seeking absolute truth and knowledge, if indeed, it actually does exist.

On the flip side of the coin.  Scientists, you don’t know everything either.  Maybe we will prove that the scientific method is wrong, or missing something.  And maybe in another millenia we will prove that that new paradigm was wrong altogether too.  From my experience, everything has been relative.  Laws have been broken, Newton’s laws have been rendered invalid at a quantum level, Einstein’s Relativity and String Theory are, at this point in time, completely incompatible with each other.  Sure you may say that they’re incompatible now, but theoretical physicists will eventually find a way to make it work.  Sure, I’ll go with that.  In fact, I’ll even give you your answer.  Q.  The way to solve all of your physics problems is Q.  When asked what Q is, I’ll simply state that it is the answer that makes physics work.  Just append it onto every equation we’ve ever used, we’ll call it the fudge factor, or maybe the Picardian, it makes physics work.  Now the careful scientist will point out that this isn’t following Occam’s Razor.  Just adding a Q onto every equation doesn’t make it more simple.  And to that, I really do applaud you.  Still though, isn’t that how the five flavours of string theory managed to become converge though?  Just by throwing in an eleventh dimension.  Yes, I’m certain there is more math involved, and if any of you happen to know it, please tell me, I really do love math, science, and engineerig (after all, I am majoring in computer engineering at the University of Utah, and possibly minoring or majoring in mathematics), however, it still sounds like you are throwing on another dimension to make it work.  This is the type of science that has proven the higgs boson to exist, either it doesn’t want to be found, or we have found it.  Also, no, that is not a new thing, long before the recent study about the LHC being sabotaged by the future, physicists seamed to speculate that it the higgs existed, and we just haven’t found a way to see it, yet.  Also, what if Occam’s Razor is incorrect in the first place, after all, is it not also just an observation that was made?

At some point we do have to throw in the towel.  We do admit we don’t know everything, even the most fanatical people admit that.  And in order to stop speculating about what is true, what is good, and what we should and should not do, we just plunge in, and take a risk.  Not only that, but rarely do we just stick our belief in just the bible, or just in the science textbook.  Rather, most people that I have seen, look about them.  To a certain extent, they act as scientists.  Taking in any form of input they can get, and processing it with both reason and emotion.  With both what makes sense, and what feels right to them.  And to that, I say good job, I do the same thing.  But maybe someone has had a different set of experiences than you, maybe the way they are set up, causes them to value something differently.  Maybe there’s something we have yet to consider.  The moral of the story though, is that just because someone believes something different than you, that doesn’t mean they’re instantly wrong.  I admit it, this whole paper could be wrong.  But to me, it feels true and good, and I will stand behind it so long as it continue to feel that way.  So please, rather than constantly trying to make your argument look better by tearing others down, why not make yours better, by listening to them.  By valuing what they have to say, by considering their beliefs, despite how illogical they may seem, or may even be.  People are people, we all make mistakes, let’s grow together, whether or not there is a God, whether or not we evolved, whether or not I am just off of my rocker.

I am Leif Andersen, and I am a sceptic, who tries to keep an open mind, even if he fails a lot.

Update:  Upon further contemplation upon this subject, I don’t think this argument is specific to just science and religion.  For example, I see this to a large extent in software, where one group of people believe very passionately about  a certain way of making software, and how it should be delivered, such as open source, where as another group cares more about how it looks, and the hierarchy structure of the people that make it, such as Apple.

Rant5-013:The Facebook Episode

On today’s episode of Rant5, I complain about Facebook, and how it’s possibly all spammed up.  I talk about privacy concerns, and rap it all up by talking about Google.
Download the show here: http://www.archive.org/download/Rant5/Rant5-013_vbr.mp3

What we Rely On

For those of you who are twitter addicts, you may have noticed that Twitter recently went down.  Not just the usual fail whale, it was literally taken down by a DNS redirect.  (This should be taken as a good opportunity to change your passwords, and recheck your security settings).  However, this does give us a good opportunity to contemplate upon what we are putting into the cloud, and if we depend on it too much.  For example, the last time twitter was down, it was on main stream media, not just your usual technology shows.  When main stream media talks about something being down, could it be possible that we are relying upon it a bit too much?

When this topic is discussed though, one company, or rather one product that one company does, is usually ignored.  Is specific, Google search.  Everyone will talk about the rest of the Google Apps, and they go into too much detail about the Facebook-Twitter wars.   But when it comes to doing a simple search, the possibility of Google going down is ignored altogether.  This is particularly interesting because it is the search that ties the rest of the internet together, owning a large portion of the ads via AdSense, and most of the videos do to Youtube.  But you would not find it without Google.  Sure, the sceptics may say that everyone can just go to another search engine.  But they won’t, google has become not only a proper noun, but a verb.  I don’t say I’ll preform a query or search, I say I’ll google it.

Is it bad to have all of your content on other people’s services, or in the cloud?  No, just so long as we don’t rely upon it, just so long as we have backup copies of our data, and a proper way to access it.  This is true if the project is an open source blogging solution such as wordpress.org, or a closed source micro-blogging solution such as twitter.  The main concern is not due to data loss.  The companies that run cloud based websites care about your data, and are likely not going to loose it.  In fact, they will probably keep better care of it than you will.  However, you still must worry about them either going out of business, or going down, like twitter did.  Furthermore, it would probably be wise to read the Terms of Service of the various websites you sign up for, that way you won’t be surprised when a company does something with your data, you won’t be as surprised about it.  Perhaps something like Google Wave, and wordpress.com vs. wordpress.org, is helping with this.  For if you don’t like something on wordpress.com, you can take your ball, and go play on wordpress.org, if you are willing to run your own servers, or get a host that will do it for you.  Google Wave will potentially be even better, for when you go to wordpress.org, you are no longer a part of the wordpress.com community, but if you run your own Google Wave server, you can still be a part of the Google Wave community.  That is if google ever does make Google Wave a viable platform.

The general gist I would like you to take away from this is to keep your data safe, but you can continue to live in the cloud.

You can read more about the twitter outage at:

http://www.techcrunch.com/2009/12/17/twitter-reportedly-hacked-by-iranian-cyber-army/

Advice: Good Coding Habits

I  recently finished making a simple Java based file compressor for my Computer Science class.  The idea was to reverse engineer the professors file compressor and decompressor, and make your own.  Well, I did make my own, but oddly enough, most of the files that it compresses, tend to actually get larger than the uncompressed files.  Go figure.  Although, for the record, when compressing a 314 MB episode of TWiT, his compressor actually turned out to be larger too.

If you do want to look at the source code for it, you can find it here: https://sourceforge.net/projects/lcompress/ I’ve put it under the GPLv2 licence.

Anyway, while making the compressor, I learned a lot, in particular, comment your code.  If you were to look at my code, it is a mess.  Sure, I did format my code properly, and got all of the indenting right, and even used somewhat descriptive variables, it’s still a mess, especially as I occasionally would have to change what a variable does, and didn’t change the name to match it.  I’m not saying you should go over board, like what I believe my CS teacher was having us do at the beginning of the class (however, it may have been good for the new students), but you should still try to give a reasonable gist of what your code is doing.

Another thing that I think that helped, was to separate your projects into many different files.  I had 4, but I think I could have put it into more.  Saving your project in many different files makes the code feel more natural.  We’re not programming in assembly, so you really should make it easy to understand.

My next piece of advice is still along the same lines of the last one, an attempt to make your code more clear.  Don’t put too many methods into one file, if at all possible, break it up.  In my Compress.java I really did have too many methods in there.  While it was good that I was abstracting my code, making it work in a single line (and it also was good for clarity, I could just read the code, and understand what that block is supposed to be doing, without the need to comment it), it led to pseudo-spaghetti code.  While it was not as bad as spaghetti code, there was some method in the madness, I found myself having to scroll up and down, back and forth, to get each bit of the project.  This is easily fixed by, if at all possible, separating the code into multiple files.  Once again, try to make it feel natural, make it feel like your really building a physical project.  There is really an art to doing it right.

Finally, my last point goes off a bit from the traditional vein of making your code look cleaner.  I say this because, to my initial mind, it was slightly more complex, and made it look less clean.  But my advice is this:  efficiency matters, it’s not the end all, be all decider of code, a lot of time making clean code is more important than making efficient code.  However, if your code is too inefficient, potential users will jump ship, and go to another product, at least they will if they have any choice in the matter.  In my code, I converted an integer, to a string of 8 binary bits, I parced the string, and converted it back to a new integer, which I would then right to a file.  In retrospect, that was a very  bad idea.  I really should have modulated (%) the integer.  For example, if I modded it by 2^4, or 16.  And maybe when you think about it, it’s not that bad of a thing to have done it that way.  It would have been much more clear to a person who is used to that convention, than my unusual way of converting bytes to strings, and back again.  This is why I believe that my compressor and decompressor is much slower than my professors.

That is my two cents.  I probably will get more when I do more programming.  After all, this was my first major project.  If you have any other habits you have picked up, please share them in the comments.

Tags: , , ,

012:Not a Studio to be Found

Today on Rant 5, we complain about going off the air, and manage to come back on again. We go over ubuntu, and how they’re changing everything, and I complain about the lack of a studio where I record.

Download the show here:

http://www.archive.org/download/Rant5/Rant5-012a_vbr.mp3

Update:  I can’t believe I forgot the links for today’s show:

http://www.ubuntugeek.com/new-ubuntu-10-04lucid-humancity-metacity-proposed-art-work.html

http://www.ubuntugeek.com/shuttleworth-stepping-down-as-canonical-head-silber-new-ceo-in-2010.html

http://www.techcrunch.com/2009/12/17/twitter-reportedly-hacked-by-iranian-cyber-army/

Learning to Program

So, you want to learn how to program? Well, let me warn you, you are about to step into a world of pain, debugging, frustration, algorithm design, debugging, oh, and did I mention debugging? In between all of that, you may get some coding done, oh, did I mention debugging? However, if you do push past the pain, suffering, and constant debugging, it is a glorious experience. Well then, you have been warned.

Lifehacker recently posted an article on learning to program. And I must say that I was very unsatisfied with that article. Sure, it went over some of the basic things you could do in order to learn a tiny bit about how computers work, or rather, how to make a macro and some HTML files. However, when you compare this to the actual amount involved in Computer Science, it pales in comparison. And in compared to Lifehacker’s usual quality, I found the article with much to be desired.

As such, I have decided to take it upon myself to describe a bit about what programming, and computer science in general is all about, despite my last article complaining about how CS doesn’t really exist.  Programming, as I said in my last post, is more about engineering than anything else.  You are trying to create a series of instructions to get something done.  But there is more.  The idea of the black box, which is the idea that you take all of the details of procedure, abstract them to the point where no one needs to know how it works, and then you use that box to make life easier.  This abstraction got even more pertinent when Object Oriented Programming (OOP) came about.  Those of you know me know that I’m not the biggest fan of OOP on the market.  Yes I like it, but unlike most other people in CS, I don’t treat it like the next best thing since sliced bread.  But the idea of OOP is something like that of biology.  You have different classifications of ‘objects’, each of which are based upon the principles,  and methods of other objects that they are derived from, something like order of classification in biology.

Still though, I have seen too many places that try to teach you to program in too short of a time.  They simply say something like ‘Learn to Program with these 10 short videos”, or learn “Learn to Program in three days”, all of which is BS.  Not only is CS a life long pursuit, but so is good programming.  In short, the only that can be taught in that amount of time, may be some of the specifications of a specific language.  Teach Yourself to Program in Ten Years is a good paper on the subject.  With that being said, if you really need something to get you jump-started into the world of CS, I would recommend MIT’s LISP course, which uses the book Structure and Interpretation of Computer Programs, both the course, and the book, can be freely viewed online.  When you are ready for something a little more practical, you can find yourself a good Python Book, or the Thinking In Series is also good.

Finally, your last recourse is me.  That’s right, I will soon be doing  some tutorials with the intent to get your hands on some code.  They will be video tutorials, and they will be done with the intent to teach you about some of the actual CS that is going on, however, I won’t just pontificate about theory for the whole video, I will teach you through examples that I do.  So, here you have a choice.  I am planning on going through these tutorials in either C++ or Java.  Sorry, I really like MIT’s Lisp tutorials, and there’s already too many python tutorials out there. As for C#, well maybe, but I haven’t played with it too much, not to mention the tutorials would be in the Mono, the open source C# thingy.  (And no, I will not do it in Objective-C either, sorry mac fans). There is only really a shortage of those two languages.   The catch, I haven’t done much with C++, only enough to know that I could do it, given a bit more time.  So, you can either have the videos in java, which I can put out much faster, and which will likely be easer for you to understand (if you haven’t done much in CS or programming before, if you have, I’m sorry, these probably aren’t the videos for you), or C++, which will take me a bit longer to put together, and will likely be much less graphical.



                    

What is an Engineer, and does Computer Science Really Exist?

I was listening to the most recent episode of TWiT’s Security Now, Episode 225, Same OriginTroubles.  For the first seven or so minutes of the show, they found themselves on a bit of a sidetrack, they were talking about what is engineering, and what is required to be an engineer.  As such, I thought this would be an interesting discussion to have, especially when debating the difference between Computer Science, and Computer Engineering.

TurbineThe standard repository for all of human knowledge (wikipedia), has this to say on Engineers:

Engineers work to develop economical and safe solutions to practical problems, by applying mathematics and scientific knowledge while considering technical constraints.[1] [2] The term is derived from the Latin root “ingenium,” meaning “cleverness”.[3] The industrial revolution and continuing technological developments of the last few centuries have changed the connotation of the term slightly, resulting in the perception of engineers as applied scientists. The work of engineers is the link between perceived needs of society and commercial applications

That seams like a valid enough place to start.  Engineering is the useful application of science.  So, while scientists are always trying to break things down, and get everything to the smallest possible level, engineers are taking these discoveries, and building them up, in order to make a richer, more powerful world.  Seams simple enough.  Most people in engineering degrees are going to be screaming at me right now, saying I should talk about black box abstraction, but to them I say that will be a topic for another day.  (For those of you who are interested though, black box abstraction is a process in which you take the gritty details of a machine, and simply remove them.  In it’s place, you put a spot for inputs, outputs, and enough documentation to let your users, whether they be end users or more developers, know how to run the apparatus, you can find more information by watching this video from MIT).  Also, those who are particularly cranky about the pseudo debate over evolution and ID (intelligent design) will be begging me to talk about how this either proves that evolution or ID existed and the other could not have possibly happened.  Alas, to them, I also say  no, this is another topic for another time.  If you would like to discuss this, there is a comments section below.

So, this line breaks down dA computer clusterramatically when we discuss computers.  In particular, where does computer engineering end, and computer science begin.  Or, should we go along with the philosophy of “Hackers and Painters” and state that there is on such thing as computer science, but only hacking, and systems administration.  It seams as if academically, the dividing line between computer science and computer engineering is software and hardware.  If you are working more with hardware, you are doing computer engineering, and if you are thinking about software, it’s computer science.  I would like to state that that is completely and utterly untrue, at least based on this definition of engineering, it is false.

Before I go any further in discussing the matter, I must state that like everything else in this world, I am incredibly biased.  I am currently majoring in Computer Engineering, however, I am debating about double majoring in mathematics as well.  If I don’t double major in math, I will certainly minor in it.  As such, I tend to think that that Computer Engineering is something that you can get a degree in, where as computer science is something that can only be learned as a pseudo hobby.  Not something you do in your spare time, but something that can only be learned by doing it.  Analogous to getting a degree in entrepreneurship, why would anyone ever want to do that?   If you want to be good at start ups, you need to play the game, not get a degree in it.  Likewise, if you want to be a good computer scientist, or ‘hacker’, you need to practice, not simply sit and pontificate on some algorithm.  This way of thinking has me so biased in fact, that I would rather hire someone who has got a degree in mathematics, and has dome series computer hobby projects, than hier someone who has got a degree in computer science, at least, depending on the job I wanted done.  If I wanted a computer designed, I would rather higher computer and electrical engineers.

Well, based on the previous paragraph, you can see where I draw the line.  I think that computer engineers, whether they be software or hardware engineers, make things.  They are the people that designed the computer as we know it.  They tend to have a low level knowledge on how the system runs, but can also operate on a higher level.  On the other hand, computer scientists think of the computer as a black box.  Yes, while engineers also think of stuff on as a black box, after all, if any one engineer were to suddenly be able to hold the entire workings of a computer down to an atomic level, or even something like a desktop computer being thought of on the capacitor level, would simply loose their mind.  Believe me, I’m trying to do it, and I have lost my mind already, does that stop me from trying though?  No, not really.  Still, computer scientists look at a computer and see a machine that is capable of calculations.  They are then handed a toolset or an SDK, at which point they mathematically figure out what they want to do.  Oddly enough, this sounds like engineering too me.  So what else separates compute science?  Well, system maintenance, and other IT based stuff.  Computer Scientists work to try to make a computer system, such as Unix or NT, stick together, so that it will be sustainable in the future.  However, that still sounds like trying to build something that will last, based on engineering principles.  Thus, we have only broken down computer science into two parts, comptuer engineering, and system administration, in which a person has little experience on designing computers, and only has used them to such a great depth, that he knows how they work.

Thus, from the great words of the people who made the Wizards’ Book, computer science isn’t really about science, nor is it about computers.  End of story.  I suppose this is where I am supposed to rap things up and make a nice conclusion.  But I won’t, I’ll just end it like that.   Do you think I’m off my rocker?

Food Fails

One of my good friends, the co-host on the currently defunct TWIBS podcast, has sent me a letter, which he wishes me to share with you.  It tells the story of a major failure he has had recently, it gave me a good laugh, so I thought  would pass it on to you.

Here’s a story for you that happened to me round about friday. Some of the spanish elders met a woman and referred her to us, because she didn’t speak spanish. They even set up an appointment for us on friday. So we go to meet this woman, having no idea of what might happen. We get to her house and there are BIG plates of food waiting for us. I had already eaten lunch, so that would have been nice to know that we would get food. The woman is Hungarian, and made meatloaf and something that I can only describe as ‘Hungarian Death Rice’ because of how spicy it was. There were huge mounds of this stuff on the plates, and she wouldn’t be satisfied until we had eaten all of it. Once we managed to choke down all the food on there, she whisked our plates away, and before you could say Mahonri Moriancumer, she had placed in front of us a large slice of Peach pie, each, and told us to eat. I was so full that I had to chug some water with each bite so as to get it down. Once we had eaten everything, she said she would give us some of the Hungarian Death Rice to take home and asked if we would like some coffee before we left. Of course, we don’t drink coffee. She put tinfoil over the bowl of death rice and placed it into a Victoria’s Secret bag that she had. We then walked 5 blocks back to the car carrying a Victoria’s Secret bag. We were so embarrased that it never occured to us until we got into the car to wonder why a 65 year old hungarian woman had a Victoria’s Secret bag in the first place.

Sheesh, talk about eating too much.  If you have any other good stories you would like to share, feel free to post them in the comments.

Tags: ,