2018/08/01

The pendulum

When doing research about developing applications on both the Windows Desktop and the Windows Phone environment, the question comes to pass: shouldn't you "just" develop a web application?

When raising the question whether applications should be hosted on "a server" in "a datacenter", or whether everything should move to "the cloud", it's important to keep in mind that nothing´s new under the sun.

Let me tell you about a pendulum.



The pendulum is not a myth. It is a fact. From the dawn of computing, there has been one. To put it accurately, there have been many. The pendulum I'm talking about is a pendulum of doing thing local (on your own computer) and on a server (your "local" computer being only the terminal). Sometimes it swings to one side, sometimes to the other. Look at this:
  • During the 60's, every computing action took place on a local computer. Those were the days, my friend :-).
  • During the 70's, mainframe-terminal combinations became the way to go. An enormous leap, because from a regular workplace, you could access those large machines!
  • During the 80's PC's became powerful enough to do everything themselves
  • During the mid-90's till the '00s the Web Bubbles showed up. Everything was on the web and should be moved to the web. Google was booming
  • The '00s: Mobile devices became more powerful (Windows Mobile and Palm - iPhone only appeared in 2007). However the need for synchronization rose, the actual content was stored locally on your phone and PC. (Even with the first iPhone in 2007, this was still the case). Remember TomTom, running on top of PocketPC and having all maps on board?
  • The '10s (starting around 2008): Although mobile phones became even more powerful, the increasing number of devices per user and the availability of affordable broadband wireless networking lead to a shift back: smartphones started to interact directly with their servers, storing and downloading only the data needed to fulfill the user´s need. The rise of the cloud moved even more applications "back to the server".
The pendulum swings. At the extrema, borders are extended. When swinging back, technologies are abandoned - but the good parts remain.

    2014/11/20

    If you ever need to determine daylight saving time in Europe, here's the T-SQL script

    Or, as the Dutch call it, 'zomertijd' and 'wintertijd'

    CREATE TABLE #daylight_saving (
      date_utc DATETIME,
      is_dst BIT,
      date_cet DATETIME
    )

    INSERT INTO #daylight_saving (date_utc, is_dst, date_cet)
    VALUES
    ('2014-11-20 14:36', 0, '2014-11-20 15:36')
    , ('2014-11-20 23:59', 0, '2014-11-21 00:59')
    , ('2014-03-30 00:00', 0, '2014-03-30 01:00')
    , ('2014-03-30 00:59:59', 0, '2014-03-30 01:59:59')
    , ('2014-03-30 01:00:00', 1, '2014-03-30 03:00:00')
    , ('2014-10-26 00:59:59', 1, '2014-10-26 02:59:59')
    , ('2014-10-26 01:00:00', 0, '2014-10-26 02:00:00')

    SELECT
      CASE
        WHEN date_utc <
          DATEADD(
            HOUR
            , 1
            , DATEADD(
              DAY
              , -DATEDIFF(
                DAY
                , 6
                , CAST(YEAR(date_utc) AS char(4)) + '0331 00:00:00' -- last day of March
              ) % 7
              , CAST(YEAR(date_utc) AS char(4)) + '0331 00:00:00' -- last day of March
            ) -- last Sunday of March
          ) -- last Sunday of March 01:00 UTC = DST start
        OR date_utc >=
          DATEADD(
            HOUR
            , 1
            , DATEADD(
              DAY
              , -DATEDIFF(
                DAY
                , 6
                , CAST(YEAR(date_utc) AS char(4))+ '-10-31 00:00:00' -- last day of October
              ) % 7
              , CAST(YEAR(date_utc) AS char(4))+ '-10-31 00:00:00' -- last day of October
            ) -- last Sunday of October
          ) -- last Sunday of October 01:00 UTC = DST end
        THEN DATEADD (HOUR, 1, date_utc)
        ELSE DATEADD(HOUR, 2, date_utc)
        END date_cet_calculated
      , date_cet
      , date_utc
      , is_dst
    FROM #daylight_saving


    2011/02/28

    Even older than Raskin

    As promised, a post about Fitts's Law - the second post about GUI paradigms.

    Paul Fitts was an Ohio State Univerty psychologist who developed a model about human movement (wikipedia).  It turned out to be a very accurate and usable model, predicting how fast we (humans) can accurately aim at a target depending on the size and the distance of the target. This model is called Fitts's Law.

    The reason why Fitts's Law became so widely used in GUI design is because it's well applicable to the usage of pointer devices such as the mouse - it predicts, for example, why it's so easy to hit targets that are on the edge of your screen (and even easier to reach targets that are on the corners of your screen). For details, see the (somewhat dated) article on AskTog: First Principles of Interaction Design. Or, for a straight-forward explanation of the impact of Fitts's Law: see Particletree's Visualizing Fitts's Law.

    The reason why I post about it is the reason that we're still discovering new ways about how to apply a well-known law from 1954:
    - In 1954, Fitts's law was "discovered"
    - In 1984, Fitts's Law is used "for real" for the first time (I think) in a Graphical User Interfaces (GUI) with the Apple Macintosh, having a menu bar always on top of the screen which is very easy to target
    - In 2003, Apple introduced Exposé with Active Screen Corners, making effectively use of these easy-to-use areas to operate functions in your computer
    - In 2009, Windows 7 was introduced - using the edges for arranging your windows quickly - just smash a window to the top to maximise it, to the left to fill only the half of your screen et cetera.

    That means that, 54 years after Fitts developed his model about human movement, we're still finding new ways how to implement it the right way. That's a long time - about 10 generations. And it makes me look forward to what ways we'll find the next 30 years about how to operate touch devices :-)...

    2011/02/25

    About User Interfaces

    Last week I did some research for a tiny project I'm doing at the University of Amsterdam.

    This project is about the development of User Interfaces through the years. For example, back in olden days your monitor was... well... just a speaker! Imagine a processor running ticking at 8 kHz, and the checksum of the "input bits" being redirected to a speaker. It turns out you get a strange kind of melody. If you were to see a stream of dots passing by at this speed, you wouldn't recognize an unevenness in the pattern. But when one bit is missing, the pitch changes dramatically - so the monitoring proceeded by ear. dr. Gerard Alberts has posted some videos of these early computers but I can't find them right now (so I'll post 'em later).

    Anyhow, while looking for history on User Interfaces I stumbled across the book "The Humane Interface" by Jef Raskin. Ordered it at the university library, and read it last week. It's a really good read, and triggered me by thinking about how User Interfaces are supposed to work. Raskin explores User Interfaces from the viewpoint of humans and human shortcomings (very interesting!). Some human shortcomings (such as the time we need to switch from one task to another) can be exploited by UI's. Read the wiki page, and if you're not convinced, read the book :-). Some of the points Raskin states are (points are from Wikipedia, explanation is mine):
    • Modelessness. Computers shouldn't be in different "modes" where they react different - for example: using ctrl-c for copying text in one context and ctrl-c for terminating a program in another are different modes where the same action triggers different behavior.
    • Monotony of design. System / UI designers should figure out the best way to do something, and only implement that one - it confuses users when dozens of options are offered to do one task.
    • Every action must be undoable. Programmers have known this for long and name it version control ;-). The effect is, however, that save-buttons should be obsolete. A computer should never discard your work. This also diminshes the need for dialog boxes
    • Elimination of warning screens. People tend to automate tasks, almost making it a reflex to click away a dialog box.
    • Universal use of text. Icons are okay, but should be accompanied by text so it's obvious what they do
    • When you stop using your computer, you shouldn't have to wait for booting, but continue with the task where you left off
    Especially the undoable functionality struck me. Of course, there will be operations where it's (because of law restrictions) needed to explicitly save things. But still, a computer should simply never, never discard my work! When the lights go off and I turn my computer back on, my work should be still there.

    This was 2000. Eleven years ago - nearly two computer-lifespans (you remember, in 2000 you still played around with Win ME, when you were on Microsoft. The first stable Microsoft-consumer-OS - Windows XP - wasn't even completed at that moment!).

    What you should know, however, is that Jef Rasking designed the original Macintosh interface. Not all of his ideas were implemented, though. Today the new specifications of Mac OS X 10.7 (Lion) were made public. And imagine what? Three in a row:

    • Auto Save - "Say good-bye to manual saving. Auto Save in Mac OS X Lion automatically saves your work - while you work - so you don’t have to."
    • Versions - Versions records the evolution of a document as you create it. Mac OS X Lion automatically creates a version of the document each time you open it and every hour while you’re working on it. If you need to revert to an older version or retrieve part of a document, Versions shows you the current document next to a cascade of previous versions (...) so you can see how your work looked at any given time. 
    • Resume - If you’ve ever restarted your Mac, you know what’s involved. First you save your work, then close all your apps, then spend valuable time setting everything up again. With Resume, that time-consuming process is a thing of the past. Resume lets you restart your Mac — after a software update, for example — and return to what you were doing. With all your apps back in the exact places you left them. In fact, whenever you quit and relaunch an app, Resume opens it precisely the way you left it. So you never have to start from scratch again.
    Amazing - ideas from eleven years ago (technically already no problem for over a decade) still inspiring today's computer makers. Of course, Apple will claim this as their invention. We know it isn't, but still they're the first to include the features in consumer-grade OS - makes it (for me at least) worth considerable when buying my next computer..

    Next time I'll digg in some more UI-stuff with Fitts's Law (even older than Raskin)

    2011/02/24

    Twin-platform-development on Silverlight for Desktop and WP7

    It's been a while since I did my last post. I'm hoping to do more posts several weeks, and become eventually a real active blogger. Just kidding :-).

    From now on, I'll use this blog to posts about my research project (my bachelor's final project). The project will be about developing an application on different devices; whereby the focus of the project will be about the Windows Desktop and the Windows Phone. For me as a Linux-user pretty new, but I'm curious to the stuff Microsoft has to offer! (and for that sentence I will be brought to death before the Open Source Inquisition).

    At the end of the research, I will produce a whitepaper containing advices, best practices and pitfalls about developing on two different devices. Besides, I will deliver a Proof of Concept-application that I will develop myself. My research will be largely based on literature (scientific papers and articles), community content (weblogs, general articles) and written-down experience.

    The next couple of posts will be about my explorings of the Microsoft-universe; if you're interested about my quest and findings: stay tuned!

    2010/10/12

    Windows Phone 7

    I'm not fully convinced about the Windows Phone 7 ideas, but they have some cool videos really taking on me - one called "Really?" and another called "Season of the Witch".

    The cool thing about the concept is that Windows Phone is not another mobile OS immersing you in its experience. As Steve Ballmer stated: "You get in, out, and back to life." - so the videos are making fun of everyone always everywhere looking at their mobile phones. And they've got a point there. Maybe we have no need for another "beautiful phone" phones using even more of your time. Not another phone that you just "keep using" because it looks so beautiful and works so well. Maybe it's time for phones using less of your time, that don't go in the way of communicating with others, but still let you do the things you want to do.

    Or, maybe it's time for users that can handle priorities. Maybe it's not the phone that needs change. Maybe it's the people and their behaviour, which is not changed by a different type of mobile phone. Even then, the videos are still funny.

    To finish: one quote from the developer videos (announcing the most recent tools available): "Go get 'em. Be inspired, be awesome, stay nerdy" :-).

    Android 2.2 - update

    Ok, so even Android 2.2 isn't a silver bullet ;-).

    After using it for a while, I had to turn of JIT-compiling, because it made my phone .. well .. run slower. The only reason for that I can think of is a lack of internal memory. Binary code simply is larger - and thus uses more memory than bytecode does, and my two year old G1 - being the first Android handset - hasn't that much RAM  (around 74 MB, compare that to the myTouch and iPhone 4 having 512 MB).

    Still, it's an amazing system. A state-of-the-art Smartphone OS running quite smooth on quite old hardware. Thumbs up for Cyanogen (and a $10-donation).

    2010/08/15

    Android 2.2 - Android grown mature :)

    At first, I could hardly believe it - on my two year old (!) G1, I installed a new Android OS and it actually ran faster than any before! After digging in, I could hardly believe another thing - that Google managed to go on for three years with "scripted" apps that knew no compiling... But finally, Android seems to have grown mature.

    Highlight for the moment (running it for only two hours now)
    - JIT: speeeeeedy :)
    - Gallery - integrates with Picasa, and the "stack peek" we know from the iPad is implemented in a really nice way. Ever been looking at a Photo, and after a while realised that is what floating in 3D while following the direction of your hand? It's a WOW. Two thumbs up for Android - (ok, and for Cyanogen, who makes this available for my old G1)

    2009/04/29

    Defaultism

    Three decades ago, a software company named Microsoft successfully started to use a new marketing device: the OEM license. With a pre-installed OS on you new-bought PC, users didn't think anymore about which OS to use - the default, pre-installed OS did indeed meet much requirements, so why should you ever take the effort of looking further?

    Much has changed since then, but one thing has not: users are still using mainly the software bundled with the computer or OS, until it lacks important possibilities or they already have experience with a piece of software not present by default. Of course, I am guilty of this behavior as well: back in the days I was still using Windows, I started using a Linux distro because I was very sure it was better. But I became disappointed: as an unexperienced user, not all peripherals did work right out of the box, and messing with configuration files in Vi is quite difficult if all you ever worked with was Dreamweaver. I didn't start using Linux until I got a smooth working distribution out of the box by default settings (or by few and very easy configuration). This behavior I call defaultism.

    Most of the Linux users don't act that way. At least, they think they don't. Because they install an OS that's not bundled with the computer by default. After some playing around with desktop enivronments they start looking around and they start discovering the shell. And more and more they become aware of the powerful possibilities. But this is where it ends for the most people.
    For most Linux distributions, BASH (the GNU Bourne Again Shell) is default. And it's a pretty good one. It's powerful, relatively easy to use, there is a lot of documentation about it on the internet and - hey, it's default! Sometimes users try other shells like the C shell, the Korn shell, TCSH or ZSH. However, by default, the shells aren't configured the way Bash is. So they experience the shell as "difficult", say it has a "lack of possibilities" or isn't "accessible" enough. All because a decent configuration file is absent.

    Last months I've become enthusiast about a particular shell - ZSH. But not before I got a useful .zshrc file - the ZSH config file you have to store in your home directory to make it useful. ZSH is much faster than Bash, extremely configurable and available on nearly every Unix-box. Including Mac. Including BSD. Including every Linux distro I've known so far.

    Right now I discover I'm falling back into defaultism again - all I do is making some minor tweaks to existing zsh config files to get it working my way. I don't dive deep into the zshrc file structure to fine-tune it to my wishes. Again, I'm sticking with default settings.

    Same story with Vim: I discovered Vim, got used to the basics and became very excited about the ease and efficiency of use. Still I didn't dive into the configuration to make it even more useful. I didn't explore all possibilities but a few - although they're very useful and even now Vim outperforms any other editor I've ever used. But still I stick to defaults.

    "Never change a winning team" is well-known, but applied somewhat too easy. I think as computer users, sometimes we don't know whether we're winning or not.

    Definitely, in many cases we know. As a beginning C programmer, I knew I wasn't winning when I din't use Makefiles. As a decent company, you know you're not winning when you don't have a website (Besides, are you decent at all without a website?). But in that case, as soon as you will get the opportunity, you will leap up and make sure the winning gear will be in house - before losing even more.
    However, sometimes we don't know whether we're winning or not. I never knew I was not winning when I used Linux without using the shell. Until I experienced the advantages. I never knew I was not winning while sticking to Eclipse or gedit. Until I discovered the advantages of Vim. And I'm aware I will be winning when I set applications to my preferences.

    Undoubtedly there are improvements out there still unknown to me. Everytime I choose the non-defaultist's way there are. So I got to keep my eyes open for the non-default way to keep winning.

    (P.S. wanna get excited too about ZSH?
    ZSH: the last shell you'll ever need (Fried CPU)
    ZSH for productivity (Prashblog)
    Phil!'s ZSH prompt
    ZSH description from ArchLinux wiki)

    2008/10/06

    VIM tutorial

    We hebben gezien dat veel van jullie nog werken met de editor Kate / Kwrite. Weliswaar zijn deze editors toegankelijk en snel te begrijpen, ze werken voor een programmeur behoorlijk inefficient (bedenk alleen al eens hoe vaak je op de spatiebalk moet rammen tijdens een sessie programmeren of wat een moeite het kost om een loop in z'n geheel te indenten).

    We zouden jullie willen aanraden om VIM te gaan gebruiken. Uiteraard kunnen we jullie niets verplichten, maar VIM heeft voordelen als:
    - alles te bedienen met het toetsenbord ZONDER ingewikkelde toetscombinaties (Ctrl-Shift-Alt Z e.d. zul je niet tegenkomen)
    - de aanwezigheid van verschrikkelijk geavanceerde functies (waar veel IDEs niet aan kunnen tippen), maar tegelijkertijd het binnen een seconde opgestart zijn en draaiend op de traagste systemen (of over je SSH-verbinding)

    We kunnen hier nog wel even doorgaan met een lofzang op VIM, maar dat doen we niet. We zouden jullie willen aanmoedigen om VIM uit te proberen.
    Omdat VIM een kleine drempel heeft om ermee te beginnen, heeft Tim een tutorial geschreven. Deze staat hier.

    2008/09/20

    SSH & SCP for Windows -> PuTTY

    For those first-year students still on Windows, I'll post two articles.

    The first one is on how to get the SSH-functionality while you're still running Windows, the second one will be (I hope within a week) to post another article - about migrating to Linux.

    When you want to access your UvA-home folder and you have only a Windows environment, here's the solution: PuTTY. PuTTY is a program that has the SSH-functionality, and you can simply run it from the Windows-shell (cmd.exe).

    I won't give too many details over here - just try to download it, you won't have to do any installation (many people carry PuTTY with them on a USB-stick because of that). The PuTTY SCP program is called pscp.

    Download PuTTY here:
    http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

    (I hope you know how to use a Windows commandline..)

    2008/09/19

    SCP (follow-up to SSH)

    (If you don't know how to use SSH, first read the previous post)

    Another post for the first year students of UvA..

    SSH starts a remote shell, enabling you to work on a computer and have full control while you're on the other side of the world (but also if you're sitting next to it, of course). A little downside is, that you - when you're physically on another pc - cannot access your local pc from within the same shell. To move files to and from remote pc's over a SSH connection, there's another tool in Linux, called SCP.

    (Before copying anything using scp, you don't have to log in to a ssh server. Of course it is possible to copy anything after logging in, but in that case the "local" file is in reality the "remote" file, and the "remote" file is a file on another "remote" server.

    Syntax is quite simple if you're used to ssh:
    scp user@host:/path/to/sourcefile /path/to/destinationfile
    of course it will work in two directions:
    scp /path/to/sourcefile user@host:/path/to/destinationfile
    and, instead of destinationfile you'll also be able to specify a directory:
    scp user@host:/path/to/sourcefile /path/to/destinationfolder/
    use of wildcards is also permitted.
    scp user@host:/path/to/sourcefolder/* /path/to/destinationfolder/

    So, let's copy a all .txt-files from our UvA-home directory to the directory at the pc I'm now working on:
    scp scienceaccount@sremote.science.uva.nl:~/*.txt .
    (the last "." stands for "current directory")

    Or, copy everything in my UvA-home directory to the directory called "uva_homedir" on the PC I'm right now working on:
    scp -r scienceaccount@sremote.science.uva.nl:~/* ~/uva_homedir

    SSH

    A special post just for our beloved first-year students at UvA :).

    It might well happen that you're at home and while having a beer with your dad (or anyone else) you remember you forgot to e-mail your assignment you was working on to yourself. Trouble. You just planned to finish your assignment tonight, but now you left everything you did at the university!

    Well, I got some good news for ya: SSH.

    On any Linux-pc with a working internet connection, just open a shell and type:

    ssh user@host

    to open a secured remote shell (where user has to be the user to log in on the remote pc, and host has to be the address of the remote pc).

    In case of the University of Amsterdam, user will be your science-account, and host will be sremote.science.uva.nl, so:

    ssh scienceaccount@sremote.science.uva.nl

    After connecting (this will take about half a minute) you'll be welcomed by the FNWI welcome screen, and asked for your password. While you type in your password, the cursor will NOT move - this is default on UNIX shells.

    After logging in, you'll get your bash shell and can access all your files directly. However, the policy of the sremote server requires us to ssh from there to a physical pc - no calculations are allowed at the sremote server (some people have been banned for that).

    So, after logging in, choose a pc (ow124, ow125, .. ow141 and so on) and type:

    ssh ow124

    (because you are already logged in, your current username will be used, and because you're on an internal network you don't have to specify a domain name or something).

    From that on, you can perform everything you can on a UvA-PC. Even running graphical programs (nautilus, firefox, try it!).

    If the graphical part doesn't work, give SSH the parameter -X (capital x). This will enable X forwarding.

    If you're in a Gnome Desktop Environment, you can also select "Connect to Server.." from the "Places" menu. Login credentials:
    Service type: SSH
    Server: sremote.science.uva.nl
    Port: (default, leave empty)
    Folder: (default, leave empty)
    User name: Your science account user name
    Name to use for connection: Be creative :).

    After clicking "connect" you will be asked for your password. Now you have your SSH connection integrated in Nautilus!

    2008/02/16

    Opening your VAIO - part 2

    My SONY VAIO notebook. In the previous post you can read something of my not-working keyboard, so now I have to open it again.. While taking some photos of course :-).

    The first thing we have to take off is the battery.
    To access anything inside the laptop, we first have to remove silver panel just above the keyboard - because some of the screws are beneath that panel.
    To take this panel off, take out all screws on the red marked positions (at the image, not on your laptop - unless you've marked them red yourself like I did).

    Now take out the DVD drive. This is because there's a tiny bracket positioned over there - if you don't release it, the front panel won't come off

    The tiny bracket. Push it away with a small screwdriver.

    Now, take that small screwdriver again, to push away some more brackets. Try to find them (it's quite easy if your screwdriver isn't too large and you are careful) and release them with a "click". When the front panel is no longer fixed on the front side, it's time for the next step.


    At the back side of the front panel, there are more brackets - I've marked them on these photos. Be careful! Maybe you've to change the position of the laptop screen a few times to release the front panel totally. This I find the most difficult point myself.


    The front panel's off! In order to remove the keyboard, only three more screws need to be removed. The first two are just on the place where the front panel used to be.
    The third one is on the other side. Remove the cap protecting your memory modules (that's the one in the center) and in the upper right corner of there's our final screwed friend.
    Now the keyboard should be free! You can take it off - be careful with the cable (it's long enough, but anyway). Maybe in another post I'll show how to open the rest of the notebook, but I think this will be enough for today.

    2008/02/15

    Opening your VAIO - part 1

    A while ago, when trying to install certain version of Mac OS X Leopard on my VAIO-FZ19VN notebook (OSX86), I read somewhere that my Intel wireless network card would not work in Mac OS X, but according to some people on the net it should be easy to replace.

    And I got myself two notebooks over here! No, that's not because I have too much money, and no, it's not a PC and a Mac, alas.
    My second notebook, an HP laptop, I bought second hand from my mother. She used it for about 1,5 year and about that time errors began to happen. Strange lines across the screen, and the system hanging time after time. Nowadays, I even can't install Windows - only some Linux-versions will boot in this strange machine. But it HAS a wireless network card - Broadcom, so it should work under Mac OS X.

    It was not very difficult to open my VAIO, if I had known how. Anyway, I figured it out without damaging my notebook.
    Once it was open, it became clear that the slot containing the network card in the VAIO was different from the slot in the HP, so I had to put the whole laptop back together, without any changes made.

    Next day, when I was entering in the minutes at a meeting, some of the keys on my keyboard stopped working. So I had to substitute each "r", "u", "f", "j" - and some other keys.
    And I had to open my notebook again - my keyboard cable was not connected properly.
    This second time opening my notebook, I've taken some photos for all VAIO users out there who want to open their laptops for one or another reason. I'll post them in my next post