Day 3: Writer’s block

It could just have been the effect of having Stargate on in the background, but for twenty minutes I sat here and couldn’t think of a topic. It’s day 3 of 21 in my attempt to establish blogging as a habit, and I hope that I’m not already out of ideas. I actually tend to have a lot of ideas about halfway through making a blog post (on days 1 and 2 I certainly did, at least), and I also come up with things throughout the day — perhaps I should note them down. If we can’t have one real topic, then let’s touch on a few smaller ones!

Decimal Time

Simple concept: 10 hour days with 10 ‘minutes’ each hour, and 10 ‘seconds’ within that, and so on. I think that using the same names for different units gets especially confusing though, so let’s ditch them and go with SI prefixes:

units for decimal time; zero point eight six four seconds equals one nan, of which there are one hundred thousand in a day.

What I find to be striking about this is that the units seem usable in real life. A nan is functionally equivalent to a second, and it’s faster and easier to say. A mic (I’d say “mike”, but you can argue about pronunciation if you like — it’s from “micro”) is the least useful, but it’d be more functional to say “just a mic” than “just a sec” or “just a moment”, because we often need 10-20 seconds when we say that. A mil is extremely similar to a minute, and a cent at about 15 minutes is a very common unit of time we work in already.

Okay, so what’s the big deal? Why bother, right? I’d love to have some solid defense against that, but I’ve got nothing. Especially when it turns out that a great number of people have attempted to accomplish this sort of reform before and it has rarely found success. Near the turn of the century, a company called Swatch marketed and sold watches which had 1000 “.beats” throughout the day, which you would use to denote time, @264 for example.

Before that, the France made a number of attempts (or perhaps, one very long attempt) at introducing decimal time, but it regularly fell out of use. Their system was much as I’ve described here. Just look at this fun clock picture I pulled off of the wikipedia page about it:

The Chinese were at it even before that, and seem to have operated with decimal time in full swing for a very, very long time, alongside a similar system to the one which we use. So this idea is hardly original, and it’s also unlikely to suddenly take the world by storm.

Why think about it at all, then? Just out of curiosity. First, I’m interested in what it would be like to have a different standard of time: the second being slightly faster, but the minute and the hour longer. How would that affect my mind’s perception of the world Beyond that though, I’d like to try out living in a different time than everyone else. It may be the closest a boy can get to being a time traveller. I’ve also put some thought into living on unix time, just have that monotonic timestamp on a watch and try to use it to live by. It could make for a really interesting experience.

A brief related tangent

Something I have done in the past is deliberately, regularly choose to do foolish or unusual things. It’s borne out of a desire to have new and fresh ideas. My rationale is that if most people think similarly about things, then two people who have similar experiences might have similar ideas. To have a “new” idea, you have to be “first” to it, which means that you need to spend more time thinking about a problem than anyone else who has had a similar set of experiences to you.

Really good ideas then should tend to come from people who have thought about problems a great deal, or who have had unique experiences. Since you can’t magically think about hard problems for a long time, a hack would be to raise the uniqueness of one’s experiences. A simple plan to achieve that is to add rules into your daily life which cause you to go about things a little bit differently, and then maybe you’ll see what others cannot.

That’s one reason it would be cool to live on monotonic time counting forward in seconds from epoch. Or to have one hundred thousand nans each day, instead of 24 hours.

Writing better code

As I have more code to write, I find I’m getting smarter about a lot of things and seeing a lot of clever ways to use (particularly python) language features that I might not have thought of in the past. Today I learned about python dict-expressions when trying to filter a given set of columns out of an array of dictionaries. They’re new to 2.7, but have been being discussed since before 2.3 — they’re just like list expressions, except you use {} instead of []. I’m writing in a 2.6 environment, so they were unavailable, but a workaround is to pass a list expression to the dict() constructor, like so:

dict([(i, 2*i) for i in range(10)])

I was curious about what was ultimately best performance-wise, because that hack job with the dict() constructor is tough to read. A coworker suggested using the profile module, callable with

python -m profile my_file.py

and it is excellent! I had to write my own repetition into the test to get useful results(unlike with the timeit module), but it dumps total, per_call and cumulative time spent in each function, as well as a count of function calls, without any additional instrumentation. It was greatly useful — and interestingly, vanilla code without any list or dict expressions was faster, but not by a huge amount. In 1,000,000 tests, a double-nested for loop to iterate over the array and save individual columns took 8.250 s of total time, while the dict-expression (on python 2.7) took ~10 seconds, and the list-expression in the dict-constructor took ~11 seconds. I couldn’t find any way to simplify or speed up the expressions, so I wonder if that points to some cases where expressions are just slower than vanilla code.

Rain on the trees

I’ll finish up with a cool phenomenon I saw today as rain started to fall on the trees outside my window at work. There was no appreciable wind when the droplets started to fall, and the trees outside are very young, so that you could see each leaf bounce as it got hit by the rain. Letting my eyes unfocus a little to watch the pattern of leaf bounces was particularly rewarding as the rain became heavier; it made a magnificent optical effect. Keep an eye out!

That which perceives itself

I’ve been putting some spare cycles into thinking about humanity as a superorganism lately. At times, it’s hard to not think about. I am hardly well read on this subject, let alone authoritative, so please take the “thinking aloud” that follows with the proverbial grain of salt.

What the hell is a superorganism

In simple analogy form: you are to your cells as humanity(a superorganism) is to you, or as a huge colony of ants is to each individual ant.

Ground-back

Long ago, somewhere in the universe, multicellular life arose. It has some inherent advantages over single celled life, namely the ability of cells to specialize and perform unique tasks. If you’ve been to an introductory economics class, you will have heard about how specialization is doubleplusgood productivity-wise, so these little multicellular buggers often found themselves among the fittest. Hence, they survived.

Many of the parts of you that make up “you” are specialized cells, which perform very specific tasks. So much so that when you cut these pieces out they don’t really make sense. You don’t have specific control over individual cells in your body — you can’t tell cell 23 from the left of your thumbnail, 8 rows deep, to “heal up now” or to “go fetch a drink”, but clearly an individual, comprised of trillions of cells, manages to perform on a macro scale.

Human Groups

Now consider groups of people. Imagine taking a biologist’s fine-tooth comb and organizing and categorizing them: religious groups, national governments, municipal governments, big businesses, little businesses, clubs, volunteer organizations, guilds, militaries, educational institutions, health institutions, transit commissions, unions — I could probably sit here and keep naming organization types indefinitely.

Then you could classify them by size, age, purpose, shape (leaders, branches, etc). And then you could likely figure out a timeline of them – for example, tribal organizations (now endangered) evolved in some places into local municipal governments, which were precursors to national governments. There’s a complex web of interconnection and some organizations exist strictly to feed off of others, some organizations compete for the same resources, and some organizations even seem to eat other organizations.

The obvious point is that an organization is directly comparable to a regular biological organism. They typically have centralised command groups, communications/action channels, and often what appears to be a collective will. It’s pretty damned cool.

Think about it

This is where it gets interesting. When considering this, two natural directions arise: first that humanity as a whole likely counts as an organism unto its self, and by thinking about it as such, you may be helping it to take the first steps toward becoming a truly self-aware being. The second is that you, a self-aware being, have just provided enough evidence (for non-biologists) to sit back and freak out over the notion that your actions are not yours, but are merely the collective will of your trillions of constituent cells.

The problem of “you”ness aside (we’ll leave that for buddhists to ponder at the moment), I’d like to turn to some questions that arise out of this topic.

Identification

What would a self-aware human organism look like? I think that the entire planet as a being only became a possibility very recently (in the past few decades), when communication speeds and quality became so great. Each individual bit of humanity has a significantly higher capacity for awareness of the state of the whole with access to the internet.

What else would there be, though? Could we, as the constituents of this organism, even recognize it fully? Perhaps there are ingredients needed beyond communication and specialized internal organs; what are they? That’s one I’ve been thinking about a lot: what remains to be made, done, or thought that will help the whole of humanity to realize itself?

Esotera

The last thing that I want to bring up is what our communication is in this model. When I write this and store it somewhere, is that “part of the memories” of this larger being? Are the memes which rise above the background noise this creature’s ideas? Imagine telepathy between two superorganisms — or imagine if that’s what’s going on in our own heads! Billions of voices crying for attention and building off of each other, and the rare virally successful notion in the populace of your mind becomes a joke you tell, or your plans for lunch.

I’m especially curious going forward, as we store our thoughts electronically instead of simply speaking them, we’re making them long term accessible to vast amounts of the group — maybe that sort of internal access is part of achieving awareness.

Conclusion

This was pretty rambly, and frightfully shallow, but it got the collection of questions I’ve been juggling straightened a bit. It helps to dump these things so that later, I can come back and build upon it. A reasonable bit of this thought (this time around) was inspired by a great little story about a man who meets god on a train. It’s quite entertaining — I’m not sure how people with strong religious convictions would regard it, but it asks (and poses sensible answer possibilities to) a lot of great questions.

To conclude, I suggest taking a moment to attempt to regard the whole of humanity. The vast billions of people across the world, eating and waking and dying and laughing and sharing at every given moment. The collection of all of us, together, as a thing that wants and survives — how long will it live? If we don’t know why we exist as individuals, imagine the difficulty in answering why it exists! And that all-time-favourite, is it alone in the universe? It’s great food for daydreamy thought.

Three Weeks: An Experiment

The Gist

I am going to write a blog post every day for three weeks, and they can’t completely suck.

Some background: I am the target market for self help books. I constantly wish I were doing more to improve my self and my life, and I frequently dream up big schemes, then (maybe) execute on them for a day or two. Something pulls me out of the pattern and it’s over. The dream is forgotten, and I move on.

I’ve tried a number of approaches:

  • Just do everything
  • Do whatever single thing interests me that day
  • Commit to big specific projects I think I want to do
  • Start with small things and slowly ratchet them up
  • Try to get people to care if I fail
  • Change my sleep schedule for some reason

Regular pitfalls include:

  • Missing a single thing leads to a feeling of failure, and I give up
  • Failing to have a specific interest on a given day
  • Overcommitting my time, or getting mired in setup
  • Deciding which things to start with is hard
  • Other people are rarely motivated to see my plans through
  • There’s always a reason to stay up late or to sleep in

The Next Grandiose Scheme

I would bet that you’ve heard about 21 days being the time required to form a habit, right? Go to google and type in “21 days”, it’s probably in the first two predictive results. My plan is simple enough that I’ve ignored it for years. It goes like this:

  1. Focus on a single thing for three full weeks.
  2. Repeat.

My plans on the order of “do a billion things” have never been a truly successful, so it makes sense to give things a try one-at-a-time.

Logic

Since these are relatively small packets of time, I’m able to choose topics I might otherwise fear are wasteful. I should also be able to set realistic, objective goals for where I’d like to arrive at after three weeks of focused effort. I can also freely fail at focusing and just try again — one of the intended results of performing this experiment multiple times is that my ability to drill down and focus on something new should improve. Right now I tend to get watery-eyed and feel like a nap after an hour of focus.

Documentation of the three-week effort brings some other things to the table. There’s a well-known method (I’ll call it the Seinfeld method) where a success-to-be plots a big red X on a calendar every day they’ve performed the task they want to improve at. I don’t have a big calendar in my house (though I may get one), but I do have a blog. It’s like putting my big red X marks on the lawn, and telling all of my neighbours why. But I’d hate to get half-way into a three-week sprint and fail to blog about it. Thus, my first sprint should force me to be blogging every day. In a way, I’m combining some of the earlier strategies:

  • This is a small start.
  • I’m telling others.
  • I’m working on something that interests me.

As time goes on, my writing should improve, and you will have the chance of learning something, since I’ll often report on my activities by explaining them.

Off on a tangent: a hack I’ve learned is to trick myself into starting a large project by convincing myself to do one very easy but related task, then riding its momentum. An example is doing the dishes: rather than set out to “do all of the dishes”, I just decide to rinse a single dish that is nearly clean. Once the water is running and I’m rinsing the dish, I may as well wipe it. Now I have a wet cloth and running water, and I’ll reflexively grab another easy looking dish. As the pile grows, momentum builds.

Once more for effect

So this is my first easy dish: just write a blog post today. That’s all I have to be aware of each day, and on Monday, May 28th, I’ll find another easy dish to start.

 

My take-way from TEDxGuelphU

Water is amazing. Artists can have some great insights to share. Cartwheels fill time like nothing else. Dancing is a great equalizer. Straws are weak (in the face of elastics). Hagfish slime is cool. It’s worth thinking about how to change the world. Science, economics, happiness, conflict, the beautiful world itself, and money all have tremendous and difficult to understand roles to play in accomplishing complex positive changes, but through our connected nature and a collective sense of shared responsibility, we might just have a chance.

I extend my thanks to all you speakers, guests, committee members, tech crew members, hospitality staff, and everyone else who help make sharing ideas possible. Good show. Now let’s not relax too long, because the world won’t wait around.

Correction: I do know what subsets are, I swear

A few months ago, I wrote a post entitled “A nice way to generate all subsets within python“, and you know what? There were some issues with that post. They were pointed out to me by one Owen Jacobson, and I feel like a dork, but not the good kind – more like a fail-dork, or something. Maybe the word for that is fdork.

Anyway, the issues, in Owen’s words, are:

1. from imports in functions have gone away in Python 3; I’d put those at module scope, instead. The other alternative is to use import collections as c within the function and to qualify references, as with c.Iterable.

(I know, imports within functions are an attractive idea, but the resulting semantics are very odd. The first call to a function might, or might not, alter the interpreter’s global state depending on what other imports have already run, and might, or might not, take significantly longer than usual depending on how quickly imports are resolved! Not fun, as I learned to my detriment.)

2. This seems like a great place to use generators and the yield expression. It’d put the decision about whether or not to hold n! permutations in memory or simultaneously or not out in the caller’s context, where there’s more information to make that decision against, and it’d replace four lines of code with one: return c.permute(args).

3. Neither function actually returns all of the subsets of the set formed by their respective argument lists; they return all permutations, instead.

I would like to briefly respond, and by that, I mean own up.

To the first point: neat! This makes a lot of sense – I have been staying away from reading about Python 3 at all, which is not very wise.

To the second point: that’s really smart. It didn’t even occur to me to write this as a generator, partly because I’m not super familiar with the nitty-gritty of generators in python, but upon seeing this I am all “ohhhh, yeah”.

Finally, to the third point: Owen is right; the code I wrote totally doesn’t produce all subsets, so what gives?!

I believe that my initial thought was to use the ‘all_subsets’ function (which should have been named ‘all_permutations’ from the start) to generate all permutations of an n-bit string, which I would then use to generate all subsets. In the past, I’ve made much uglier approaches to generating every bitstring — particularly by calculating each successive permutation manually. This felt like a nice shortcut! The problem is that I only implemented half of it, and then forgot what my original thought was. And then forgot to actually think about what I was saying.

Lessons learned:

1. Make sure you’ve finished what you set out to do before blogging about it, or at least, make sure your posts and reality are approximately congruent.

2. Even if a technology’s adoption (e.g. Python 3) feels infinitely distant, it isn’t too soon to become acquainted with it and to think about writing code which will be less broken when I have to update it. New technology usually exists to solve problems, and in that respect, often points to smart idioms which I can adopt now.

3. Generators are very sensible things to use in utility functions that produce more than a single piece of data. They allow the program to move along faster, and reduce immediate storage requirements, placing the decision in the hands of the function’s user whether or not holding their full result in memory is necessary. I should read up a bit more about how to use them in Python.

4. Owen’s pretty sharp. Thanks for the awesome response 🙂