Sleeping Cyborg

Jonathan David Page talks about whatever he happens to be thinking about. Sometimes other people join in.

Email · @parathetic (Twitter) · @jdpage (Github)
Subscribe to feed


A collection of cool people and projects.

Look ma, I’m a writer! & my glorious return to blogging.

by on 1 November 2013
in , , , , , , , , , , , ,
with some comments, maybe.

Regarding to the "posting links regularly" thing I mentioned in the last post, I need to make a remark:




hahaha. ha.

Okay, now that that's over with, I can get down to business.

Read more…

Digest for 5 April 2013

by on 5 April 2013
in , , , , , , , ,
with some comments, maybe.

Today marks 50 years until first contact with the Vulcan.

The Mozilla Javascript team posted a really interesting article explaining how the SpiderMonkey engine works and what they just did to make it better.

I finally got around to reading an article which turned out to be one of the better analyses of the social media phenomenon. I call it an analysis because it doesn't say "social media is a Bad Thing", like a lot of the more sensational article-writers (including myself, at times) do. It talks more about how some patterns of social media are Bad Things, which is more constructive since it can lead to ways to fix those patterns.

Bad Catholic published a guest post with perhaps the single best explanation of the Catholic obsession with the Virgin Mary that I've ever read.

And finally, I've decided that I am going to start posting digests (like this one) with links to interesting articles and some remarks on them.

Approximating Pi Redux

by on 20 December 2012
in , ,
with some comments, maybe.

No, it isn’t Pi Day, or anything resembling it. I was editing some stuff, and I noticed the original “Approximating Pi” article. I’d been meaning to rewrite the code since I learned about continued fractions, and since I didn’t have anything better to do, This is a lie. I do, in fact, have a number of things to do that various people might define as “better”, but I didn’t feel like doing any of them. I felt like sitting around in my bathrobe and writing Python. I decided to do so. A detailed explanation follows the source code, since this is less mathematically facile than the previous version.

Read more…

Why I Hate Politics

by on 12 September 2012
in , ,
with some comments, maybe.

Okay, there are a couple reasons I hate politics1. The one I want to talk about right this instant is this one which I'm sure many engineers2 agree with: that the system itself is broken. Yes, the Constitution, as written, is a great basis. It's flexible, largely balanced between various branches, contains provisions for its own modification, pretty fair, protects human rights: all good stuff. Then again, a lot of people feel this way, and they can argue about politics all day. What is my point?

My point, and my problem, is that I regularly find myself looking at a political question and, rather than choosing a side, find myself unasking3 the question. In other words, I take the position that the question itself is wrong. Not only that, but when someone presents an argument against my opinion based on another government policy, my response ends up being "actually, that's broken too." (This response tends to be pretty well-received.)

I'm sure many other people with much more sense than I feel this way, but for some reason I find it crippling when it actually comes down to acting on my opinions. Perhaps they see the system, and realize that it's too entrenched4 to change, and so decide to make the best of a bad lot. Now that I am able to vote, I find myself struggling more and more to decide what the best course of action to take there is. I wish to vote, but I also don't want to vote for someone championing a suboptimal solution.

Perhaps I'm just too much of an idealist (read: hipster5) for my own good? How does everyone else handle this?

  1. When I say "politics" in this article, I specifically mean USA politics. Not because I think it more important, or because I like it better, but simply because I am far more familiar with it than other countries' politics. Perhaps what is written here is more widely applicable, or perhaps not. But I feel that this is a useful bit of context to have here. 

  2. An engineer's dream is to be told "You can tear this all down and start over from scratch with no strings attached, and design it in exactly the way you feel best." Legacy solutions are often kludgy and inelegant, and large-scale examples of clean, elegant engineering are sadly rare due to the fact that they go from small and clean, to large and patched, because a) it's really really hard to design systems which scale cleanly, and b) requirements change over time. In my terribly humble opinion, this particularly goes for bureaucracies6. But it is just that -- a base. And what we have currently built on it is, in fact, very flawed in a variety of ways7

  3. Take, for example, the question, "Have you stopped beating your wife?" (This is actually the traditional example!) Of course, you've never beaten your wife, so both "yes" and "no" are incorrect answers. Yet any other response does not answer the question, since it is a yes-no question. Therefore, one might suggest that the question itself is wrong, rather than any of the answers. You might therefore "unask" the question. Most people will do this implicitly by saying something like "I never started." Explicitly unasking the question names the problem so it can be discussed. I first ran into the concept discussed philosophically in the context of Zen Buddhism as discussed in Hofstadter's GEB8. In one chapter, he discusses the idea of mu -- a response which unambiguously indicates that the question was faulty. (One of my favourite things about being in the Honors program at Uni is that I can respond to a question with "mu" and not always get a funny look back.) 

  4. Is it? 

  5. It has been asserted (I use the passive voice intentionally) that the word I should use here is not "idealist", but "hipster". This is because I used the word "metadiscussion" once, and apparently only hipsters can use "meta". However, that is a rant for another day. 

  6. Sad but true: I can't spell "bureau" or anything derived from it without looking it up in a dictionary/spellchecker. 

  7. Trendy things to rant about as flawed: patent law, copyright law, social security, tax law, lobbying, campaigns, effectively over-strong executive branch, federal government is too strong, federal government is too weak, and any number of other things which are not the point. 

  8. Hofstadter, Douglas. Gödel, Escher, Bach. New York: Basic Books, 1979. 

Excerpt from “The Everlasting Man”

by on 1 September 2012
in , , , ,
with some comments, maybe.

A man did not stand up and say 'I believe in Jupiter and Juno and Neptune,' etc., as he stands up and says 'I believe in God the Father Almighty' and the rest of the Apostles' Creed. Many believed in some and not the others, or more in some and less in others, or only in a very vague poetical sense in any. There was no moment when they were all collected into an orthodox order which men would fight and be tortured to keep intact. Still less did anybody ever say in that fashion: 'I believe in Odin and Thor and Freya,' for outside Olympus even the Olympian order grows cloudy and chaotic. It seems clear to me that Thor was not a god at all but a hero. Nothing resembling a religion would picture anything resembling a god as groping like a pigmy in a great cavern, that turned out to be the glove of a giant. That is the glorious ignorance called adventure. Thor may have been a great adventurer; but to call him a god is like trying to compare Jehovah with Jack and the Beanstalk. ... Polytheism fades away at its fringes into fairy-tales or barbaric memories; it is not a thing like monotheism as held by serious monotheists. ... Finally it did satisfy, or rather it partially satisfied, a thing very deep in humanity indeed; the idea of surrendering something as the portion of the unknown powers; of pouring out wine upon the ground, of throwing a ring into the sea; in a word, of sacrifice.

The Everlasting Man, by G. K. Chesterton. From "V. Man and Mythologies", which is rapidly becoming my favourite chapter in the entire book. I had to resist the urge to quote more.

EDIT: On the next page:

Certainly the pagan does not disbelieve like an atheist, any more than he believes like a Christian. He feels the presence of powers about which he guesses and invents. St. Paul said that the Greeks had one altar to an unknown god. But in truth all their gods were unknown gods. And the real break in history did come when St. Paul declared to them whom they had ignorantly worshipped.

A Simple(ish) Explanation of Haskell Function Signature Madness

by on 22 August 2012
in , ,
with some comments, maybe.

A clarification regarding my use of the word "simple(ish)": I am assuming, firstly, that you are already comfortable with programming in an imperative language such as C, Java, or Python, and secondly, that you already know at least a little Haskell.

Haskell type signatures, to the uninitiated, are a little odd. Take the following simple two-argument function:

plus :: Int -> Int -> Int
plus a b = a + b

If you're coming from an imperative language, you might be tempted to read that signature as "this function takes an Int and an Int and returns an Int". That'll do in most cases, but it isn't really true. And the fact that it isn't true is a really cool feature of Haskell.

The little -> arrow is a right-associative operator. So you whould read Int -> Int -> Int as Int -> (Int -> Int), which doesn't help anything at all, because now it looks even worse. And now here is the kicker: all functions in Haskell take exactly one argument. One. Even our plus function there. Which is odd, because it sure looks like it takes two arguments. The thing is, Haskell does a little magic trick for us (which isn't really magic). This magic is called currying.

The trick is that when you do plus 2 3, two things happen. First, 2 is applied to plus. Application is a fancy way of saying that an argument is given to a function. This application results in a new function, which also takes one argument. 3 is applied to that function, which one might notate as (plus 2), and returns an Int, 5.

In short, plus 2 3 is the same as (plus 2) 3. So the Int -> (Int -> Int) means that plus is a function which takes an Int, returning a function which takes an Int, returning an Int.

So why is that useful? Well, consider the builtin function map, which has the signature:

map :: (a -> b) -> [a] -> [b]

Basically, it takes a function which takes a thing of type a and returns a thing of type b, and an array of things of type a. It then spits out an array of things of type b, which is generated by applying the function to every argument the array of things of type a.

So map (\b -> plus 2 b) [3 1 4 1 6] returns [5 3 6 3 8].

Now, remember that (plus 2) returns a function, right? So you could also do:

map (plus 2) [3 1 4 1 6]

and get the same result.

tl;dr: Calling a Haskell function with not enough arguments basically returns what you might think of as a half-called function. It's got some arguments already, you just need to supply the remaining ones. And it's just another function.

Approximating Pi

by on 23 July 2012
in , ,
with some comments, maybe.

You didn't get a post for July 22, so here's some Python which finds approximations for pi.

Update 20 Dec 2012: See also the revised version utilizing continued fractions.

The Higgs Boson: An Elusive Little Something

by on 7 July 2012
in , ,
with some comments, maybe.

The Higgs particle, or the Higgs boson, has begun to captivate the world of science, and surprisingly for a complex physics issue has crept into popular culture under the alias of "The God Particle". But in all seriousness, what is it, and how did it earn such a ridiculous title? To answer this completely you would either need a physics major or an extreme devotion to science, so in an effort to avoid a boring post I will keep it to the basics here.

The Higgs boson is a theoretical type of particle known as an elementary particle, which are the most simplistic known particles and are considered to be the building blocks of the universe. The actions and behaviors of these particles are described through what is referred to in physics as the Standard Model, but when this model was first introduced the math seemed to indicate that these particles had no mass thus requiring further explanations to their behavior. The simplest and most widely accepted theory is that these particles interact with a field in such a way that they produce a phenomenon known as mass. However, for this field to exist, there would need to be a counterpart particle. This field, process, and particle came to be known as the Higgs field, the Higgs mechanism, and the Higgs boson after one of the physicists who pioneered this theory.

So basically, the Higgs boson allows everything to have mass. Pretty important, but not what I would consider to be a "God particle". This unfortunately inaccurate nickname takes its roots from the book The God Particle: If the Universe is the Answer, What is the Question? in which Leon Lederman talks about particle physics. Lederman's reason behind calling the Higgs boson the "God Particle" was that nothing else is currently taking up so much money or is as key to our current understanding of the universe. This in turn sparked a media frenzy over "The God Particle" and leaves us at where we are today.

So what of this elusive Higgs boson? Is it real or only a theory? Within the last few days the scientists working on the Large Hadron Collider at CERN in Geneva, Switzerland have released a statement that they have found evidence of a particle matching the theorized properties of the Higgs boson. Thus these questions may be answered within the coming weeks or even days. Perhaps we will have something new to be the next mysterious "God Something". Until then we will just have to wait and see.

Guest Writer, Zach Parker