Category Archives: life

Feeling tired? You should read this

I’ve had to give this advice to a few people now, so I thought I’d write an actual post about it for slightly broader distribution.

How are you feeling? Energy levels doing ok? Or maybe you’re feeling a bit tired. In fact, maybe you’ve been feeling tired for quite a long time. It gets a lot of us.

It’s very easy to accept being constantly tired as just a natural state of being. Maybe you’re overworked, stressed or full on burned out. It really does happen.

But a lot of the time if you are feeling constantly drained of energy it is because there is something physically wrong with you and you should see a doctor about it.

It’s extremely easy to suffer from nutritional deficiencies which can cause this. It is especially easy if you’re vegan, or even just vegetarian.

I’ve had this happen to me twice – once with vitamin B12 deficiency, once with vitamin D deficiency. Iron is another common thing you could be deficient in that would cause a lack of energy, though I’ve not personally experienced it. In the case of the vitamin D it was just completely magical watching the problem go away as soon as I started taking supplements. The B12 I was more borderline so the improvement from fixing it was not as dramatic, but for people who have serious problems with it I’ve heard similar reports of magically returning energy levels.

This isn’t necessarily what’s wrong with you, and I’m not in any way competent to offer you medical advice, but if you are having problems with your energy levels and you haven’t seen your doctor about it I would strongly encourage you to go see them about it an ask for a blood test to check for standard nutritional deficiencies. It’s easy, quick and may completely change your life.

Edit for clarification: There is a lot of bullshit in the vitamin and supplement industry. Do not uncritically read this post and go “I have a deficiency! I will buy pills and it will make everything better!”. My advice is not “You have a deficiency. Take supplements” it is “You might have a deficiency. Go see a doctor and find out”

This entry was posted in life on by .

Constraints inspire creativity

It’s easy to think of creativity as something inherently chaotic and unconstrained. After all, what you can achieve within constraints is a strict subset of what you can achieve without them (that’s what “constraint” means), so you can achieve more and thus be more creative when not constrained, right?

Surprisingly, the opposite often turns out to be true.

Constraining the problem you’re working on often inspires you to be more creative. It forces you out of ruts. It’s easy to fall into familiar patterns and habits. Constraints will often prevent you from following those and force you to explore new solutions. Additionally, it forces you to think about aspects of the problem that you wouldn’t otherwise have thought about, and these new things can inspire you to think about the problem domain in an entirely new way.

Not all constraints are useful for this of course, but I suspect most are.

There’s more I could say about this, but if I expand too much on this point this post will just end up as draft #65 in my list of unfinished posts. I’ll leave you to draw your own tortuous analogy as to why that’s an instance of the effect I’m describing (it probably isn’t).

This entry was posted in life on by .

I don’t write Scala

A lot of people follow me on Twitter. I don’t mean Stephen Fry level a lot, but it’s about 8 or 9 times as many people as I follow back.

Based on a (purely visual) random sampling of this, a significant proportion of these are people interested in Scala. That’s fine. I know many such people. I could also be misrepresenting them and they’re just people interested in programming and following me because I’m a programmer (and occasionally even tweet programming related things). I’m not sure, and can’t really be sure without doing a lot more research that I’m actually interested in doing.

So I’m going to assume it’s a Scala thing, because this fits into a general perception issue I’ve noticed people have about me.

You see, I don’t write Scala. I haven’t since late 2009. I didn’t make a big deal about it, because that would have been childish, I just informed a few people in the Scala community I thought should know that I was leaving, along with a few of my reasons why, and then quietly did so. Most of them took it very graciously.

Weirdly, two and some years on, most people seem not to have noticed the complete absence of Scala related content from me. I suspect it’s because I’ve mostly dropped off their radar for one reason or another, so there’s just a vague general impression of me as a Scala person. Hopefully this post should help remove some of that.

To be clear: This is not a normative statement. Just because I don’t write Scala, doesn’t mean you shouldn’t. Scala is pretty neat. I have my reasons to not use it, but don’t wish to explain as I would find the resulting language flamewar extremely tedious. I would greatly appreciate it if you don’t use this post to start one anyway.

This is also not a statement that I hate Scala and will never use it again. I’ve no immediate plans to, but never is a long time. I expect Scala will do quite well, and if it does I expect I will at some point find myself using it again.

To forestall the inevitable question: I am currently mostly writing Ruby at work, and a whole smattering of unrelated things at home (recents include Haskell, Java, Clay, C, a little C++, some Lua…) as the whim takes me. This list is not intended to be prescriptive, and I’m not really interested in the inevitable suggestions for what languages to try next.

TLDR: I write a bunch of languages, mostly Ruby for reasons of circumstance rather than design, but Scala is not numbered amongst them. This is a statement of fact, not a piece of advice.

This entry was posted in Code, life on by .

And now for something completely different

I write about a lot of things here. Maths, Programming, Voting Theory, Cooking, Fiction and anything else that amuses me. This post however is about something I’ve never written about before (and will probably never write about again). Shaving.

I really hate shaving. I hate shaving with a passion I normally reserve for homeopaths, inconsiderate pedestrians and J2EE.

Unfortunately I also hate having a beard.

By way of compromise I tend to shave only every 4 or 5 days. After a week I’m verging on beard territory, so that’s really too long. But this only accommodates my hatred of shaving, it doesn’t reduce it.

Part of why I hate shaving is how ridiculously gimmicky it is. The shaving companies will go to increasingly elaborate lengths to get you to buy increasingly expensive products. “This razor has five blades! And they’re really small! And it has a built in vibrator, which will totally make your skin happier really!” (Perhaps there needs to be a realrazororparodyrazor site. I sure can’t be bothered to build it though, it would just depress me).

It’s insulting and it’s expensive and, what’s worse, it gives you a really shitty shave.

But there is a way out of this. A secret that Big Shaving has kept from you.

What if I were to tell you that there was a better way? That it is in fact possible to shave without a vibrator. Perhaps even with only one blade? A way to spend 25p instead of £2.25 every time you have to replace one of those damn razor blades. And that you would even get a better shave out of it. (Spoiler: I’m about to tell you that).

There is! Behold the safety razor:

Low budget take on the safety razor

It’s a classic design, one step up from the cutthroat: Most of the quality of shaving, none of the slicing your throat open and sending you to the emergency room. The cheap ones (I use Boots own brand, which I think is the one in the picture above) are typically as good as the expensive ones (because really all it is is a small semi-disposable blade for running across your face. It’s not rocket science: You make it out of decent metal and you make it sharp. That’s it). It gives you a really close shave for a really low price, the blades clean easily and last well, and it probably won’t insult your intelligence when you’re using it (though Gillette do one, so I can’t guarantee it).

It’s not better in every way of course. TANSTAAFL applies, and anyone who tells you otherwise is trying to sell you something (like the idea that you should give them 10x as much money per razor blade). The cost is that you have to be more careful whilst shaving or you’ll get shaving cuts. Not huge gaping wounds, just normal shaving cuts, and they’re completely avoidable once you’ve got the hang of it, but even then shaving is going to be a more methodical process (though not necessarily slower – I find that with a modern razor I have to make more passes in order to get a viable shave).

I wouldn’t go as far as to say to switch to a safety razor has made me not hate shaving, but it’s definitely gone a long way towards it.

Postscripts

  • I also strongly prefer shaving oil to shaving foam or gel. However I think this is less an unambiguous win and more of a personal choice, so my advocacy for it isn’t as strong.
  • It’s worth looking up some guides on shaving (though I can’t recommend any good ones as I did this a while ago and don’t remember what I used). Chances are you’re doing it wrong
  • Sorry, I have no idea whether this is good advice for shaving legs or other parts of your body. It might be. It works well for armpits. Try it and see if you want, but apologies if it turns out to be awful.
This entry was posted in life on by .

Personal Code Writing Month (PeCoWriMo)

I was thinking about doing NaNoWriMo this year. Had a story plotted out and everything. I never quite got around to it though – I started writing, but didn’t really feel motivated to continue.

But what occurred to me is that what I’m currently actually much more bothered about is not novel writing, it’s code writing. As you’ve probably noticed from the change in and absence of subject matter on this blog I haven’t really been writing much code on my own time recently. Further, work is currently full of large piles of integration and way more ruby than I’d ever care to see again.

So I’ve decided to declare November to be my personal code writing month. I’m going to do something completely different. It might not be useful to me (although I actually did start from a practical problem when deciding to do this), but it’s going to be interesting and computer sciencey and at least possibly useful to someone.

Here’s the goal. I’m writing a library for neighbour searching (both “nearest” and “within epsilon”) in Haskell. The objective is that by the end of November it will be in a state that I am prepared to bless as a release. These are the requirements:

  1. It has to have an API I’m reasonably happy with blessing as “good”
  2. It has to be well enough tested that I can say with a reasonable degree of confidence that it has no obvious bugs
  3. It has to have at least a basic benchmark suite
  4. It has to perform well enough to be able to be used on lowish (say <= 10) dimensional data sets of a few hundred thousand points (I'd like it to do a lot better than that of course)
  5. It has to have a package up on Hackage (I might change my mind on this one and relax it to “it has to be ready to upload to hackage”)

i.e. it has to be in a state where if someone goes “I want to do nearest neighbour search in Haskell!” (for some reason) I wouldn’t feel embarrassed to point them to this library.

How’s it doing so far? Well, the API is ok. Needs a bit of work, but it’d probably do for a first release if it had to.

The testing is actually pretty good. It needs to be improved to cover more interesting classes of metric spaces, but that’s a fairly simple matter which will take me all of half an hour to do when I get around to it (and then however long it takes to fix any bugs that uncovers).

The performance? Ha ha. It is to laugh. I started with the hyper optimised data structure of “keep every point in the index in a linked list” and using scanning and sorting respectively to do epsilon and nearest neighbour queries. I’m fully aware of how stupid this is of course, but the idea was that by first writing the API and tests I would then have the freedom to tinker.

I have now tinkered a little bit, and the result is an awesome system which has the properties of being both slow to build an index and slow to query the index. That’s fine. I knew it would be when I was writing it. It’s just to flush out a few of the details.

Anyway, the next step is to build the benchmark suite, and then I can start doing Computer Science to it.

This entry was posted in life, programming on by .