Monday, January 9, 2017

Delayed Sleep Phase Disorder

I've always been the lazy one in class. The one who was rushing to get into the classroom before the teacher (not often successfully), who'd get alarm clocks as birthday gifts, who'd never show up for morning lectures. Until a break-through self-diagnosis came to my life:

Delayed sleep phase disorder

I somehow made it through school, because we had afternoon lessons every second week. I somehow made it through university, because lessons didn't start at 9am every day, and it wasn't mandatory to attend either. Eventually I'd even "fix"  my sleeping schedule - mostly during the summer, where I could wake up at, say, 10am and still feel happy and fulfilled, instead of having to wake up much earlier for school. It never lasted more than a few weeks though - I'd always relapse after just one day of having to stay up late, or even after being told "why did you wake up so early? The other kids usually wake up around 11!"

However, a "normal" 9-to-5 job is what really hit me hard on the head.

At the very least, I can't say I didn't try. I was also lucky that they weren't very strict about punctuality, otherwise I'd have been fired after a couple of months. After countless times of hitting "stop" instead of "snooze", or of dreaming that I got up and started getting ready, I found an application called "Sleep as Android" where you can configure it to only show a snooze option up to a certain number of times, and where you can't stop it from ringing unless you scan a QR code, which I printed and stuck in the bathroom. So, yes, I tried. I even thought of using "Sleep as Android" as a sleep-phase alarm, except it rarely worked. I was usually in a very deep sleep phase during the time when I had to wake up.

And so I did wake up, and I did arrive at the office around 9. I could only start working around 10 - and we're talking about being able to open the files I was working on and start staring at them. I'd usually do something trivial until lunch time, then start being productive after lunch, so my productivity was much lower than usual. But somehow my performance was still adequate, so this ended up being the least of my worries.

The physical symptoms of waking up at "normal" times were, IMHO, the worst. I also seem to need more daylight than the average person, and I'm more affected by the lack of it, so during the winter, where I'd spend practically all of my daylight hours inside the office, I was really suffering. Headaches and exhaustion were very common. The first three days of the week were still bearable, but on Thursday I was starting to feel extremely tired. On Friday I was practically a walking zombie, longing for the night to arrive, so I'd feel awake (as always) until after midnight, but then I could at least sleep 12 hours to make up whatever I still could. I was feeling depressed and irritable. My appetite was also decreased, especially during breakfast and lunch. However, bad sleep was also affecting my metabolism in a way that made me eat less and still gain weight.

As for simply going to sleep early, it didn't work. I was often at the peak of my alertness and productivity at exactly the time when I had to go to sleep. Therefore, even if I did force myself to go to bed at that exact time, my brain was still alert and therefore I couldn't fall asleep until much later. No, binaural beats didn't work either. But at the very least I can't say I didn't try.

The most difficult part was waking up in the morning and having to decide whether I'm legitimately feeling ill or it's just my average wakeup. My waking exhaustion was often so intense that I failed to perceive other symptoms I had. I'd often just go by instinct and decide to call in sick despite feeling simply too tired, only to surprise myself around 13:00 when I'm waking up later than usual and can actually feel that I have a cold or a stomach flu.

I found myself to be much happier, more relaxed and productive after I got a job with more flexible working hours. The next step is probably to get an official diagnosis. Even though I don't have a use for it right now, I think there can be unforeseen situations where it might seem useful, and an official doctor's diagnosis will allow me to negotiate more easily than a simple self-diagnosis.

Dear reader, if you see yourself or a friend in these lines, please try to do something about it. Try to negotiate better living conditions for yourself, or offer them to your colleague. Give the aforementioned Wikipedia link to your friend and see if they recognize themselves the way I did. I silently suffer every time I think about how many people label themselves "lazy" and continue living unhealthily but "normally".

Tuesday, December 23, 2014

Why do people pay for water, anyway?

The title might strike you as a bit odd. However, do bear with me for a while; soon you'll understand why I'm asking that.

See, water is a non-scarce resource. It's wholly possible that, from the time someone puts a pipe inside a river, the water flows indefinitely without further expense. One could go ahead and take 10, 100, 1000 litres and (assuming that the pipe's capacity isn't maxed out) the next person that goes there will have no problem getting the water s/he needs.

It follows that, if people were only interested in saving money, they could just go to the river and take some for themselves. Or, if their morals were lax, they could abuse the already-existing infrastructure, and break a pipe to divert water to their homes.

Of course, no-one does that. People in ancient Rome did it, but not nowadays. The reasons ought to be obvious:
1) Tap water is of high quality
2) It's incomparably more convenient
3) It helps support the people who work to bring you your water
4) You can take as much or as little as you like and
5) You can get your water without needing to pay beforehand.
(Some reasons might strike you as odd. But, again, bear with me.)

Now, imagine you lived in a place where, if you want to get some water, you have to pay before-hand; no opening the tap now and paying your monthly bill later on. All companies sell bottled water; one or two have home delivery, while others need hours of driving to get to, so you have to go out of your way to reach their store, and pay inflated prices for it. Plus, their bottles come with some really annoying caps that need a special tool to open, which they give you when you buy from them. And... outside your house is a river.

What would you do in such a case? The amount you bought might vary, but everyone (and I do mean *everyone*) would get water from the river at least part of the time. It's much more convenient! And, on the rare occasions that you want some water which you're sure won't make you sick, you could go through the effort of getting those silly bottles.


In case you didn't notice, the above paragraph was an extended analogy for the software market nowadays.

I first read that simile in a blog; I remember the blog's name being "rethink copyright", but googling that phrase gave me no results. Anyway, they ran their mouths and keyboards about how people would get their water from untapped springs if given their chance, and that's why people copy software as well. And, at some point, it dawned on me: that's not what happens. Instead, people pay for water, and quite happily too, in exchange for the advantages outlined above.

So, what would a tap-water-model look like for software? Steam is the closest thing we currently have, but it's still a ways from achieving it fully. For one, we'd have to get rid of the "pay before enjoying" restriction. Secondly, we'd have to get rid of the "pay all or pay nothing" restriction. So, imagine this:
You fire up Hydroxane, your gaming program. You see a new game that strikes your fancy.
You press "install and play" and the program does exactly that, really swiftly, installing the first levels so you can play, and downloading more of them as you do. (No DRM, obviously.) You play for 10 minutes, or 1 hour, or something to that extent, then you realise you don't really like it that much. So you uninstall it. At the end of the month, the program sees that you only played for 10 or 60 minutes, and bills you accordingly, for an amount that's much less than the price of the full game.
The next day, you find a game that you really like. 3 hours pass by in a flash. Hydroxane pops up a notification: "Hey there! Would you like to pay the rest of the price to buy the game forever, or would you like to keep paying as you play?" From there, you choose the option that's most convenient for you.
Torrenting? Psh, who has time for that? You can sample the game so conveniently, cheaply, safely and remorselessly! Why download the entire game at once, and risk catching a virus in the process?

The day that the software industry (or, why not... the digital entertainment industry in its entirety?) adopts the tap-water model might still be far away. However, until that day, it will remain a neat example of how people can pay for non-scarce products and still enjoy it.

Sunday, May 4, 2014

Cat errors

When I patch the production server:
























When I'm fixing someone else's code:


When I'm missing a run-time dependency:


When I'm using the wrong loop variable:


Stack overflow:


Images taken from:
http://i.imgur.com/DzEpxIn.gif
http://assets.diylol.com/hfs/46c/a4e/e99/resized/business-cat-meme-generator-server-crash-you-ve-gotta-be-kitten-me-06517c.jpg
http://stream1.gifsoup.com/view8/4646849/funny-cat-fail-o.gif
http://31.media.tumblr.com/tumblr_lx7ysqa3ux1r92ioho1_400.gif   
http://quicklol.com/wp-content/uploads/2013/08/spinning-lights-fan.gif
http://d24w6bsrhbeh9d.cloudfront.net/photo/4892266_700b.jpg

Wednesday, February 12, 2014

Kanji for travelers

You can find several sites with useful phrases for travelers. However, in Japan you might easily find yourself unable to find the toilet, or to understand a coin's value (bills also use Western numbering, but coins only have kanji!) So, here's a list of (what I hope should be) most of the essentials :)

One useful tip is to always print out the kanji of everywhere you want to go, including station names, and keep it with you! Or, if you can't print it out, copy/paste it (or keep a screenshot) on your phone.

Start here first

お手洗い Toilets (you may also see it as トイレ, or more rarely, 化粧室)
Men
Women

Moving around

up
down
right
left
入口entrance
出口exit
east (for station exits)
西west
north
south
open (for elevators)
close
station (train)

Food and drink

small
medium / inside
large
water
tea
pork
beef
bird (look for it as part of other kanji!)
fish (look for it as part of other kanji!)
egg
rice (raw)
ご飯rice (boiled)
寿司sushi
野菜vegetables

Watch out

注意caution
禁止forbidden
危険danger
警告warning

Money

yen
one
two
three
four
five
six
seven
eight
nine
ten
hundred
thousand
ten thousand

Sightseeing

神社shrine
temple
公園park

Time

Sun/Sunday
Moon/Monday
Fire/Tuesday
Water/Wednesday
Wood/Tree/Thursday
Gold/Money/Friday
Ground/Saturday
Year
Hour/Time
Piece/Minute
Second (1/60 minute)

Transportation (optional)

歩行者Pedestrians (this is your lane when walking!)
自転車Bicycles (this is your lane when cycling!)
電車Train
地下鉄Metro (underground train)
自動車Car
バスBus
空港Airport
Still alive and breathing? :) If you still want to study more, I suggest that you learn the Katakana. 95% of what's written in Katakana is actually English! Find a nice page with mnemonics and prepare your flashcards!

Wednesday, November 6, 2013

How (not?) to design an operating system

IOS/OSX: Take 3-4 use case scenarios for example, forget the words "for example" and implement only those to perfection.

Android: Don't bother use case scenarios - just go with the functional requirements and let the user jump through hoops.

Symbian: Have an extensive list of functional requirements, as well as an extensive list of limitations. UI response time is not a functional requirement.

Windows: Those are the specifications, mockups and APIs from 60 years ago. It is important to not change them, because that's what people are used to.

Linux: Companies A, B and C design solutions X, Y and Z respectively. Meanwhile, solution W is community-born somewhere else. After endless flamewars on mailing lists, each distribution adopts one standard, but people end up using them all concurrently.

ChromeOS: The main design principle is that "everything is a browser". As a result, casual browsing works fine, but anything more complicated is out of specs.

Meego: Implement something good for the community, good for the company, great for both newbies and advanced users, then proceed to announce the end of it before the first device is out.

OpenBSD: Our main concern is security. After all, it's harder to break into a system that doesn't work at the first place.

Friday, April 26, 2013

How not to design a web site

Earlier today, while I was on my computer, my brother walked in, asked if he could use it for a second. I gave him my Android-running tablet and kept minding my business. A while later, he came back saying "ugh, it's a Flash webpage and it won't run on Android, can you look up something for me please?"
While listening to music, I opened the URL he told me to. However, I was listening to music at that time... And of course, as expected of a Flash website, it started playing its own music... My first reaction was to turn off my speakers, and then I looked for the tiny "Mute" button on the webpage".
At this point, I was obviously a bit frustrated. Now, imagine yourself owning that webpage. Do you want your visitors to be frustrated by just opening your page?
More and more users lately browse the web on a tablet. By using Flash, you are automatically excluding these potential visitors. Furthermore, you hijack back buttons, middle clicks, copy-paste, and so on. Not to mention that Flash is one of the most anti-SEO things you could do to yourself. As this site points out (it's a worthy read), not even Adobe's own site uses Flash!
Now, about music... Please, have some respect for those visitors who are already listening to something else. Or who don't like your music. Or who just put their baby to sleep. Or who clicked to open 4-5 new tabs in a row, and are rushing to close the one (or, even worse, two!) that started yelling behind their backs. And, if you are still not convinced, at least have some respect for corporate visitors, potential clients of yours, who open a website in their office and suddenly get ridiculed at the face of their boss. Another worthy read over here has even more reasons for you to read and enjoy.

My personal favorite example of "how not to design a website" used to be a restaurant (they changed their page now).
Imagine a hungry customer, wanting to order food from them and looking for the menu. This customer is welcomed by a "Loading..." screen, then is greeted by ... a house... OK, but where's the menu?...
Oh - actually, you can interact with the house's windows. After some clicky maze, you are given two options:

  1. See the story and cooking secrets of our best dishes
  2. Look at the menu
There it is, FINALLY! You click 2, just to see another "Loading..." screen, and a beautiful animation taking the house away. At this point, if you haven't looked for another restaurant yet, you're probably closing this page and looking for something else. There it goes - one more lost customer.

Now, given my blog's audience, you may think I'm preaching to the choir. On the other hand, it's us who should raise awareness about this issue. The poor site owner may not be that tech-savvy, and might even be enjoying this good-looking page. It's up to us to email them and kindly inform them that it's not a good practice at all. Don't blame the recipients of the email; it's most likely that they aren't aware of all these reasons. Be polite and try to help them understand.

Monday, December 24, 2012

Ho Ho Ho!

- How does Santa have time to bring gifts to all children in the world?
- He gets online and uploads them! That's also why you don't see him!
- How about the sleigh and the reindeers?
- He just doesn't want to hog his home's connection, so he goes to each country's central server and uploads the gifts in batches, one country at a time.