Humans, Robots (bwoooow dananana deooowwww)



One of the hardest things to grasp in computer science: Caching things is synonymous to predicting the future. How do i tell if i need to get what i just cached again? You make an educated guess. Or you let a human decide. I think we’ve all fallen into the trap of thinking computers should be ‘smart enough’ to deal with these sort of issues by now. I mean, how many times have i heard someone say we have more power in a calculator than the first computer in the space mission thingy. But the problem is just as philosophical as it is technical:

Computers will only ever be as capable as the person who programmed them.

Now i know I’ve just triggered a flame war, However as of writing this, that flame war will mostly consist of two random people who may or may not read this article, so I’m not afraid. As much as we’d like to actually believe Robin Williams could become human one day, we cannot pass the logical fact that every single line of code was written by a human being (Including dynamically generated code, i.e there must be a template of what code should be generated that is written by said homo-sapien).

Therefore, Computers are still subject to the same problems that humans are. Albeit computers can arrive at the problem faster and can store more problems than we could, but if we have trouble doing something, chances are a computer would too. That’s why caching is a hard problem, because in reality, we can’t arrive at a general solution ourselves. But we can guess, because of one significant difference between man and machine:

Humans are driven by intuition and context, Robots are driven by algorithms and limited input.

Although my fellow robotic counterpart can generate a gazillion prime numbers per minute and show me the best route from my current location to McDonald’s, It’s quite limited in what it can take in. Humans however are masters of context, Not only do humans take in the sights, sounds, tastes, touch and emotions of what is around them, but they can know the history of what is around them, they can think abstractly about their surroundings, they can make arbitrary links with whatever they please around them.

Thus when posed with the common conundrum of caching, Humans can reason about it where as computers cannot. If i get a letter with no date on it stating that war has broken out in Europe and Hitler is running amok, I could use reason through context of history, the oldness of the letter itself, and common sense to detect that maybe this information is out of date.

As soon as information is cached, It becomes out of date

we can’t predict the future, and we don’t have control of all external forces, therefore apart from the most trivial pieces of software, we are only ever guessing. That is why for the most part, get a human to make that decision. I.e. Refresh the page, fetch the link, reload whatever, because we were born to do it. Its in our nature to explore new things and process them accordingly.

AI is an exciting thought, but computers are made to do things that we know, not what we don’t know. If something new appeared before a machine, how would the machine tell whether it is relevant and useful and not just white noise? It can’t, But we can. our senses are bombarded with stimuli and for the most part we successfully filter out what is relevant and what is gobbldiegook.

Also, I love Flight of the Conchords.

Happy coding!

Posted in Programming, Thoughts | Tagged , , , | Leave a comment

The Slightly Great Commission

Yes, I Jared Nagle have been commissioned to build a website!… by my wife. Tis an honourable feat. And thus the first thing on my plate is deciding what technologies i should use to create it. I am greatly interested in Javascript libraries/framework. Cheif amongst candidates is AngularJS, BackboneJS and EmberJS. I choose you, Charmander! Yes that was a pokemon red reference (long live the 1990s) and Yes that was a quick decision. But not without some forethought.

After reading this blog amongst various other reviews it appears as though the decision boils down to what kind of application i want to develop. Do i want to be investing in a framework that will carry me through long term? do i want a framework that is small in size? Do i want something that is easy to learn? turns out I’m in this for the long haul so I’m gonna go with Ember. It’s at version 1.4 at the time of writing and i think thats enough numbers past 1.0 to be production ready. That plus the fact that my boss at work is considering all possible routes for developing what will be the new framework for their internal systems. And we have many requirements.

So Ember is the framework of Choice. It has many functions, a MVC framework that auto binds. This should reduce code significantly. I’m quite new to front-end development in general so I’m not quite sure how people arrange their folders and files. I’ve been test driving yeoman but that seems to be still in development. For Java development, I use Gradle as my build/dependency management/everything engine and i wouldn’t be surprised if it contained support for javascript library management.

Infact let me google that (for you)… *gradle javascript*… a brief search shows up with a gradle-js plugin. It lets you combine all your javascripts into one, minify them, run JSHint on them… etc,etc… I wonder if there are any javascript libraries in maven… well there are. They’re all under the “org.webjars”… but hang on, after going to it looks like they are just javascript libraries bundled into jars… thats not what i want. I want something like bower… well ok, I’ll just use bower then. Bower is a front-end package manager.

Seesh. There is a steep learning curve here. Ember, Bower, Bootstrap, Sass, Mocha, Html, CSS, and all that jazz. am I in over my head? I think that my overwhelmed feeling mostly comes from my inexperience with javascript and html. But as with most other things in my knowledge base, I think as i learn and keep reading constantly, I’ll eventually become proficient. It will just take time. 

Posted in Uncategorized | Tagged , , , | 1 Comment

You lost me at CPU…

just when you thought you were safe on land.

So I have two things to get off my chest:

1. That burn mark on the bus stop clearly looks like a shark is about to own that blue strip above it from behind the timetable. I’ve been staring at said scuff mark for a year now and only now had the courage to reveal its identity. I hope I am not smelling of fresh fish tomorrow when he finds out.

2. The station I start at on my travels to work was playing moonlight sonata loudly over the speakers for all the lucky passengers to add to the depression of going to work. Fortunately I am not that lowly citizen that despises his occupation, so i deflected the attacks of the alleged scientists standing behind their one-way mirrors ticking boxes.

Now that I am free of the burden of carrying around such exciting information with me, I can start to talk about all the intricacies of computers and their… hey! you can add polls to your blogs! just a second…

Sorry, I just noticed the shiny button above me and couldn’t resist waiting another second. now, back to the shiny other thing that I’m currently typing on.

So apparently computers revolve around processes’. What is a process you ask? thank you jives, I will divulge. broadly speaking, a process is a series of actions or steps taken in order to achieve a particular end (thank you google). quite unintentionally, the phrase ‘in order’ needs a comma to clearly define exactly what a process or more specifically a program is for a computer. You have a room full of technicians and artists and librarians or whatever, and you need to tell them what to do, in order, to achieve a predefined purpose. These are all important components.

Now the similarity breaks at the human level as we humans like to be able to multi-task (although i must say I am a horrible multi tasker, but i can at least brush my teeth and see how good i look at the same time). as much as your processor says it has 32 multi duo-quad cores and 50 gigawatthurtzes, Your computer is still as dumb as the first generation of computers and can only really do one thing at a time effectively. What we have right now is pseudo parallelism that is so close to multi-tasking that it has us fooled. True multi-tasking is something only the realm of quantum physics can possibly touch, but we’ve only so far been able to figure out the factors of 15. My 2-year-old could do that. Not really, that would make her a genius.

Straight from the book:

A process is basically a program in execution. Associated with each process is its address space, a list of memory locations from 0 to some maximum, which the process can read and write. The address space contains the executable program, the program’s data, and its stack. Also associated with each process is a set of resources, commonly including registers (including the program counter and stack pointer), a list of open files, outstanding alarms, lists of related processes, and all the other information needed to run the program. A process is fundamentally a container that holds all the information needed to run a program.

That last line is pretty important. It’s basically saying that processes are a box. A box that’s got all you need to run a program. But not a program in the sense that the everyday man thinks of a program. What you see as a program is probably thousands of little programs working in unison to create a single user experience. On the lower level, processes are the building blocks that make the software that we are familiar with. Whereas a web browser or app may be the higher level “program”, the actual byte code machine instruction programs that do system calls would not be as visible to the average observer. What we see happen on the surface is only the tip of the iceberg.

These small brick building boxes, that have all you need to run a program, is EVERYTHING that comprises the system you are looking at right now. a bunch of registers containing the most recent data, some instructions, data and stack values. EVERYTHING is a process. Each program boils down to a small set of operations like the keys on a piano that when composed in varying ways create the complexities of every system ever made on a computer.

That’s the part where I claim to be a composer, not just a developer. What we create is truly extraordinary and wonderful, It makes you ponder the creation of earth itself (as I am unashamed to believe in). But i digress, what seems like a complicated process boils down to the management of these simple components. Processes. If you can understand this abstract concept in it’s fullness, the rest of the computing world unfolds as everything in computing revolves around this.

As I continue to learn more about computers and their innards, I’ll tell you more. This is not only a learning experience for you, but for me as well. So let me know if you have information regarding possible in-errancies in my posts.

Posted in Programming | Tagged , , , | Leave a comment

Computers are not as complicated as you think


What happens when you place a group of smart people in a room doing some meaningful repetitive task over and over again? You get people thinking to themselves “how can I do this faster, more efficiently and requiring less user interaction”.

That is the history of computers in a nutshell.

Probably spurred on by the sudden need to decode secret messages in the second world war, People threw themselves into the computer realm and brought forth our digital ancestors. A couple of trips to the computer room with their circuit boards and live wire interfaces and someone thought to themselves “i bet I could standardize this”. Then came punch cards, after all the fuss with people waiting for someone to finish their jobs someone thought “i bet I could speed this up”. Then came tape drives. “i bet I could make this more efficient” then came pipelines, serial buses, operating systems, personal computers, motherboards, hard drives, iPods, iPhones, iThinkMooresLawIsOutOfControl.

Everything seems to have emerged out of the need to improve the process before it. Most of the systems we have today wouldn’t have been around if it wasn’t for the many people before us getting tired of doing the same thing over and over again, at slower speeds, at greater costs. The modern computer is a product of this great history chain.

So step back in time a little. Lets think about the war, The first time a computer was imagined, It was in the 18th century by a man named Charles Babbage. He had the foresight to construct with materials that were conceptually possible but practically unavailable in his time. Go checkout this [site], his invention looks quite marvellous. But I don’t think human kind was as driven to create such a monstrosity because there was no need, no looming threat that required it. But the war, That was reason to pull out every new fangled invention and yet-to-be-invented thing for the cause of self preservation. The military. War spurred the production of the world’s most useful technology.

I wonder what would have happened had war not broken out. Would we be as advanced as we are today? Would someone have good reason, time and money to consider such a machine? Computers are pretty complicated. Even the most basic systems had a multitude of components. Would the drive for industry be good enough to create the computer or did we need the thought of impending doom to motivate us?

I wonder what the computer would be composed of if it was industry not war that caused the computer to blossom. from my last post:

Who knows whether there is some greater abstraction that when applied to electrical currents and plasmatic substances will produce greater throughput and quality of work for less effort.

People are inherently impatient and poor. We strive to improve our lives in an endless effort for free time. Ironic that the most advanced societies feel like the busiest cultures on earth.

Image | Posted on by | Tagged , , | Leave a comment

Processing the processes give or take human errror.

meaningless graph

Here i go, starting back at the beginning. Sometimes i revisit the basics simply because things don’t add up higher up and it generally means that a fundamental rule is missing from my knowledge.

This morning i picked up my operating systems textbook from Uni and started reading again. It’s fun returning to the basics when you have been cruising up top for a while. It’s a new chance to test some of the assumptions you’ve made about how things work below. I’m reading about the operating system and how the kernel works. How the operating system is made up of separate layers of hardware, kernel, software and applications. And that sometimes the line between kernel mode and user mode is blurry.

This is important. Why? because sometimes the truth is blurry in the real world. I’m not suggesting there isn’t such a thing as absolute truth. That’s an argument for another day (a fun one at that :P). What I mean is that people make software, and when people make things, they make it with incomplete knowledge. Who knows whether there is some greater abstraction that when applied to electrical currents and plasmatic substances will produce greater throughput and quality of work for less effort. But right now we have the good ol’ process abstraction. Without it we wouldn’t have modern computing! If it was more complex we would probably have too much trouble understanding it especially when it comes to parallelism.

As long as humans make stuff, we’ll make it imperfectly. And I wish i realized that earlier on. There are so many libraries out there that have been locked into a particular implementation simply because too many people now depend on it’s API to get things done. when the author realizes his mistake, It’s usually too late. When taking on new projects and exploring new libraries, one needs to anticipate mistakes. Not that we shouldn’t have faith in peoples ability to test and produce quality code, but if we expect perfection from everything we come across, we will become sorely disappointed. think about the first things you produced as a programmer, were they perfect. hopefully not or I’m going to cry.

That being said, some very smart people made the kernel and windows operating system, and It’s usually not the hammer that gets blamed if the hammerer can’t hit his nails. There is a small set of processes and tasks that a programmer has to have confidence in, without that confidence, It’s hard to predict whether anything will work. Even when we think we are calling the most low level function, we are 99% of the time delegating that task to some kernel or even physical hardware mechanism that we did not write ourselves.

So keep striding. nothings perfect, but decide what you will put your trust in. build up a set of libraries that you trust, that the community has already thrashed and when you’re feeling extra adventurous, be that guy that thrashes an alpha or beta library for the sake of helping the guy out. but by no means put these things into production use unless it has been tested to the max. especially financial applications. It’s just not worth the risk.

P.S. I put the extra r in on purpose.

Happy coding!

Image | Posted on by | Tagged , , | Leave a comment

2 Stops to go

ImageHi fellow followers!


As it stands, I have 0 followers… zip, nada, none. I don’t see that as an obstacle to blogging though. I’ve set myself a challenge of seeing how much i can write in-between the last two stops. I’m exiting a tunnel as i type to cross the Harbour bridge. It was quite foggy this morning and the sun is glaring through the train window onto my screen, flickering on and off and causing something of an epileptic fit in my eyes… well not really. This is just a filler of words. Hey! the train is slowing down.

We’re on cruise control now. barely doing 20 km/ph. So in the spirit of my last post, I floundered around in my mac desktop this morning. I even had a little snooze. Then i started thinking about my goals. I thought, “what is the smallest thing i can do?” I decided it was making sure my company’s code compiles to version 1.6 of java.

1st stop!

Just a quick interlude there, The next stop is closer now. Only about a minute left to type. Quick spell check… yup good. just had to put a hyphen in-between ‘in-between’ haha. I need to make up a word for when you use the same word in a sentence like that. I know multiple cases where I’ve made that observation and wished that there was a word to describe it. Ok, Time to wrap up. I’m entering the tunnel to arrive at North Sydney station now.

If you want to follow me, I will be pumping out rants like this one on a more regular basis. Maybe you’ll find me talking about more interesting things in the future. Now is more of a practice until I get used to the Idea of writing.

Posted in Uncategorized | Tagged | Leave a comment

It’s happened again

My motivation seems to follow cycles. There are times when I’m super inspired and excited about every little bit of coding technology out there, and there are days where I open up my IDE and stare blankly into space. I’m in one of those days. It seems as if now is a great time to start blogging.

I imagine everyone has this problem. I can’t be the only one who doesn’t know what to do next. Being a full time employee and a husband and father, I don’t get much time to increase my skills in programming. It’s mostly on the train where i get the chance to program, and lately this week I’ve been at a loss for what i should be doing next.

As an experiment, I decided I would switch operating systems from Windows to OS X (I run Windows on my Macbook Pro using Bootcamp). The project I’m working on at the moment didn’t build straight away and I had a great time learning all about unix file permissions and all the wonderful tools out there you can fill your mac up with. after a few failed builds of the java project, I finally managed to work out the semantics of unix correctly and now I’m sitting here with a terminal typing the same command over and over again because i can’t seem to figure out what to do next. At home I have setup a JIRA server where i can jot down my ideas in task form for future reference. Everything looks so hard and complex. I think I’m just having trouble setting small, measurable, achievable, reasonable goals. (S.M.A.R.[T.], I don’t know what the T is for… can’t be bothered googling).

Ok. the train has arrived… cya.

Posted in Uncategorized | Leave a comment