Sunday, June 26, 2016

Is your progress bar short? Make it longer with this weird ancient trick!

F12 Developer Tools to change the DOM

Is your country not in the combobox? Is an ad coming on top of your video? Is the button disabled?... :)

P.S. These tricks are usually harmless (or at least they should be). Most of the times they deal with unimportant client-side content. One rule of thumb though, if you are the creator of a website - make server-side security checks if certain actions change states in the server! Client-side 'prevention' is useless precisely because of tricks such as the one above.

P.P.S. This can easily go into the subject of Cross Site Request Forgery (or rather how to protect against it)


Friday, June 3, 2016

Just ... junk

Firefox: Junk after document element

(appeared while dynamically populating a div with content retrieved via ajax. The content ended with a <script> element which apparently is considered junk)

Saturday, May 14, 2016

Exhausted? Out of ideas? Going to the bathroom might help

As a programmer - and probably other intellectual activities which imply sitting at a desk and thinking - i am more often than others in the position to try to solve some difficult engineering challenge. I feel i can do it in an elegant, almost genius way, yet i can't quite grasp it. I don't want to go with the 'brute force' approach which might often be suggested by surrounding people and might imply that i rewrite some module almost completely. I want to reuse existing code and i want to build reusable code myself, for the future, to stand the test of time.

I think this is a place where character shines through. I might stay for a few hours and seriously think about the issue. I try various avenues of attacking the problem but never quite solving the entire puzzle. Sometimes after this tiring search i come up with nothing. And then, in a fit of exhaustion, i go to the bathroom.

Bathroom relaxation
The bathroom is a magical place and my belief is it will become increasingly magical in this technological future where we are all connected and can't take a moment to think for ourselves. (Some don't even appreciate silence enough to seek it from time to time. But that's another subject) It's magical because there is this oasis of silence, of private time - where not only you can hear yourself think, but most importantly: where your brain is wired to relax.

Your brain knows that when you go to the bathroom you can (and should) relax because the purpose of the bathroom itself is to get you rid of all kinds of residue (which can't happen effectively without relaxation) - your brain knows this and slips into the feedback loop which allows your mind to relax as well. In the case i describe above, idea by idea (almost involuntarily) i go through whatever i tried and whatever distracted me - and the mind discards some of this population of thoughts - because that's what you do in the bathroom. You discard stuff. The mind, now relaxed, just like a muscle, can 'lift more weight' and can try to tackle the problem from angles which might not even have been visible before because the search itself was exhausting it.

So i'm not a doctor but.. when you feel like going to the bathroom or taking a break.. maybe it's not a bad idea to actually do it :)

Saturday, May 7, 2016

Expected 12 but was 12

I wrote some code to recognize browsers and decided i need a test for it...

JUnit assertion error

Can you guess the reason? :)

Sunday, May 1, 2016

3D CSS - Best viewed with classic 3D glasses!


Muhahaha this is 3D



Press the Closer & Further buttons above and look at it with classic 3D glasses, like this:

3D glasses

Saturday, April 30, 2016

Adjust your vertical scroll

For some time i was wondering why it felt less productive and more difficult to work on my work PC compared to my own PC, on really the same code editors and IDEs .. Until i started paying attention to the things i tend to unconsciously repeat: like how much time i spend scrolling through code or documents.

I scroll using the mouse wheel but i never used to pay attention to how much content i scroll through by rolling the wheel one notch. At home this value was higher than at work so i scrolled for a lot more time at work. Problem can be solved this way:

Go to your mouse settings (in Windows 10 it's in Devices & Printers > rightclick your mouse > click Mouse settings), specifically the Wheel tab and set a value for the number of lines to scroll that is right for you.

Mouse Properties - Wheel tab - Vertical Scrolling

For myself, i noticed 13, 14 lines makes a good value. I can scroll through a lot of content at once without breaking continuity (the brain always needs to know exactly where in the document i am as it builds its "content model", otherwise it needs to recreate this model from scratch when this continuity of understanding is broken - scrolling a very big number of lines at a time will do that - for myself i noticed that 15, 16 is already a bit too much).

Wednesday, April 20, 2016

First post

My pen name is Frederic Theodore Sandman (short: The Sandman) and i'm a software engineer working in a multinational company. One day i might reveal my identity but at the moment it is not important. Over the years i gathered funny events, strange ideas and life tips that i want to share with people who are aspiring towards something, just like me... And here we go!