Elod P Csirmaz’s Blog: 2015

1 November 2015

Semi-transparent (opacity != 1) elements render above fixed element

One may see a strange effect where a semi-transparent element is rendered above a static element like a fixed page header. This is because giving an opacity other than 1 to an element creates a new stacking context. A possible solution is to add z-index to the static element. See the effect and experiment with the solution in the fiddle below:

17 October 2015

Alleviate hand pain while typing and coding - part 1

Disclaimer: There are numerous causes of hand pain, and what helps one person may actually harm another. I'm only sharing my experience and the tools I found useful in the hope that they might give you some points to consider. If you are worried about your health, please consult a doctor or health professional.

I had been typing, coding and programming for quite some time before I noticed a strange sensation in my hands. It was definitely painful; a minor-ish but worrying sharp tense tingling that got worse with every movement I made to press a key or move the mouse. So I started researching what could be causing this and what can be done (not typing was not an option - that's how I earn my living), and fortunately I found a configuration that made the pain completely disappear. Here's what helped me.

Part 1: Posture and hardware

Chair and wrist rests: I had played the piano for some years and I knew that there, one is supposed to press down on the keys from above. The wrist should be almost straight - a continuation of a horizontal forearm - with the fingers dangling downwards towards the keys. While I found that hovering your hands quite high above a computer keyboard is just too tiring, adopting this position for a couple of minutes, and using wrist rests for the keyboard and mouse definitely helped. I also raised my chair so that my elbow would be at the same height as the keyboard and my forearm would be horizontal. A well-designed and customisable computer desk and professional office chair are a must if you spend hours sitting in front of a screen.

Ergonomic keyboard: If you move your wrists close to each other (as you do when you type as the main part of a keyboard is relatively short), you'll notice that looking from above, your forearms are not parallel - they are at an angle. Then, one usually turns their wrists outwards to make the hands themselves parallel and the fingers line up in a straight horizontal line following the rows of keys. This turning outward apparently puts quite a bit of pressure on the wrists, so the next thing I tried was a curved keyboard, and it helped tremendously. There are cheaper ergonomic keyboards out there that could offer some relief, and more expensive ones that organise keys in a curved valley within easy reach from the resting position of your hands. You may need to experiment to see which one is the best for you.

Touchpad: Last but not least, I replaced the mouse. I noticed that I got most of the pain when I tried to move the mouse up and down while keeping my wrist still. This involved bending my thumb and fingers out and in which movement gradually became quite painful. I experimented with trackballs, (there are ones that you move with your thumb and ones that you move with your index finger or other fingers) but I found it difficult to position the cursor with them, and I couldn't find any model with a middle button. Also, although there are models with a "scroll ring", I never found them comfortable to use, and scrolling became a nightmare.

So I opted for a stand-alone touchpad with multiple buttons for left-click, right-click and middle-click. The more buttons the better really, as you can perform complicated actions (like opening a link in a new browser tab) with a single movement that may otherwise require key combinations. Scrolling is also usually very easy to configure either with multi-touch where you can use two fingers to scroll, or to use the edge of the touchpad for this purpose. Another advantage of a stand-alone touchpad is that you can position it where it's the most comfortable to reach.

Temperature: I also found that the pain is a lot worse when my hands are cold. Before I started using my current keyboard and touchpad, at times I wore thin gloves (the type the leaves the tip of the fingers free) which can be useful especially if you're using a laptop with metal housing, which simply moves the heat away from your palms.

For me, these adjustments helped and, combined with reconfiguring my software and creating custom keyboard layouts (which I will detail in a new post), they mean that now during the 10 or so hours I spend typing I don't get any pain at all. It does come back however when I have to use a laptop with a flat, straight keyboard - a reminder how important it is to pay attention to your body.

8 October 2015

Humpty Dumpty

Humpty Dumpty sat on a var
Humpty Dumpty had a great undefined.
foreach King's horses
    and each() #king .men
MapReduce Humpty
    Second law of thermodynamics.