Monday, 26 November 2018

Patterns - Putting it Together

Well, we have spent an awful lot of time looking at how to get feed back and make things work for users, however we haven't looked at actually putting things together yet. Well, a part of that has to do with this subject not having anything to do with programming, but designing apps actually involves a lot more than simply writing code, crossing your fingers, and hoping things work.

Now, there is a lot of people who talk about not reinventing to wheel, and in a way this applies to app development as well (and when I say app development, I'm pretty much referring to anything, not just those things that you have on your mobile phone). There is this thing called consistency, and there are a lot of ways that previous developers have used to make their app work. In fact, if you look through many of the websites you will notice that there are a lot of things that happen to be similar, a pattern if you will, and it is these patterns that we will be looking at here, well at least patterns in general, but we will be moving onto patterns as they relate specifically to mobile devices, namely because they happen to be in a world of their own.

The Flow Zone

So, we are going to start of with a theory developed by a gentleman named Csikszentmihalyi (try saying that with your mouth full of crackers) and it is called the theory of flow and sort works as follows:

You see, to get people hooked to your product you need to keep them in the flow zone. If the challenge is greater than the users abilities they will give up in frustration, however if their abilities are greater than the challenge, then they will become bored. As such, you need to balance it out so that they remain entranced. Obviously, there needs to be some adjustments based on the skill level, which is why we also have novice and advanced settings, so that once the novice becomes bored they can then move on to the next level.

The thing is that you don't want to interrupt that flow, you know with pop-ups and the like, because users are likely to get distracted. I'm sure you've heard of people locked away in their room for hours at a time playing games - well that's because they are in the flow. Facebook keeps us in the flow by constantly giving us new things on the feed. As soon as the feed starts to repeat itself, or the content becomes repetitive or dull, we lose the flow.

But remember the interrupt. Sometimes we need to get people's attention, but keep them in the flow. This is how the so call 'free-to-play' games work. They get us into the flow, and then hit us in the wallet to keep us in the flow, but they do it so as not to throw us out of the flow.


This is a term that refers to how much effort it takes for somebody to work out how to use something. The easier it is to figure it out, the lower the excise is. Now we are not referring to the work itself, but the effort required to figure out the controls. Notice that where there happens to be monopolies, the machines tend to be pretty horrendous to work out how to use. The Melbourne public transport ticketing system is a good example:

Honestly, I tend to be pretty tech savy, so I generally work out how to use things anyway. However, despite the fact that supermarkets are attempting to move to automated checkout systems, they still need to employ people to show customers how to use the machines, and they're pretty horrendous to use anyway. I'm sure we have all heard the dreaded 'unexpected item in the bagging area'?

Well, maybe this is the problem:

In fact, I when I was in London, they actually had somebody in the Tube stations whose sole job was to show people how to use the automated ticketing machines, and even though London is a very tourist heavy city, it sort of does defeat the purpose of having an automated system, particularly if somebody is always going back to this particular person for help when they want to top up their Oyster Card. Then again, having a machine is cheaper, and quicker, and takes up less space, than ticket windows, and you generally need only a couple of assistants, at most.

Oh, and I probably should also mention that even if you have the instructions on how to use the machine printed clearly for pretty much anybody to see, you can be assured that they will simply ignore those instructions and look for somebody to help them.

Now Onto the Patterns

Patterns are a way to address the issues with flow and excise. Remember back to our Heuristic Principles, particularly consistency and standards. Well, that is important to be able to get somebody to use your app and to continue to use your app. If a method is consistent across a broad range of apps, then all of a sudden the effort in working out how to use the app drops dramatically. This is why we use patterns. Look, that doesn't actually mean that patterns are set in stone and are immutable like the Ten Commandments. No, they evolve in the way pretty much everything else evolves, and that is why we need to keep a look out to see what works, and what is being used, to know which patterns are popular at this time.

Want to get a good idea of the patterns that are currently in use. Well, check out this pattern library. Actually, I could just leave it at that, but lets move on a bit (and I'm sure I'll be coming back there again).

Titled Sections
Well, this is basically a pattern that uses titles to divide up various bits of the screen, or at least the menu options. This helps keep similar options together, and allows to easier navigation, or use of the checkboxes.

Card Stack
The best description of this pattern is probably to point you to the top of your browser where there are a number of tabs. Well, that is probably also called tab browsing, but the term card stack also applies.
Closeable Panels
Honestly, just go to this website here, it's a great example. It's also referred to as the accordion patter, or a collapsible panel. Well, they also have a tabbed panel, and you will notice that there is a difference between the collapsible panel and the accordion, namely that with the accordion at least one panel is open, while with the collapsible panel you can pretty much close all of them.

Page Layout Patterns
Firstly there is the left to right alignment, which probably has a lot to do with the fact that we (at least those of us who speak Indo-European languages) read from the left to the right. As such it is sensible to have your webpages go from the left to the right. It is probably going to be a lot different if you are creating an Arabic or Chinese language website, since they don't read from left to write, but that isn't something that we need to consider here.
Next is the diagonal balance. I'll so you a picture so you know what I mean:

Have you ever wondered why the save and cancel buttons are in the bottom right corner? No, of course you haven't because neither have I, but that is what they mean by the diagonal balance. I guess it once again has to do with how we Europeans process things from left to right. When reading we start at the top left hand corner and finish at the bottom right. However, I can assure you that now you know you will suddenly start seeing it everywhere.

Responsive disclosure
This is basically where options are hidden from view unless a specific button is pressed. In fact if certain buttons are pressed (or boxes checked) then sometimes things will be greyed out to prevent them from being used. Here is an example of this below:

Of course, we also have the situation were options are greyed out until a certain action is performed, which is referred to as responsive enabling.


Okay, while this goes without saying, it should still be said: the most important should be the most prominent, and the least important the least prominent. Take a newspaper column for instance - big headline to grab the reader's attention, smaller head line to tease them some more, bold first paragraph to explain the salient points, and then the rest of the article which only the die hard people will read to the end. 

In this case we should be using white space - in fact as Google proved, white space can be good - in the world of UX design, nature doesn't abhore a vacuum, it loves it. We should also have contrasting colours, and contrasting fonts - it makes things stand out all the more. What we are trying to do is to encourage the user to move their eyes over the page in the correct order, but also in a way that is natural for the user.

So, we should be using the same basic layout through the entire app, but we should also be doing it in a way to assist the user to freely navigate the app, and most importantly, not get lost. A user that gets lost or confused is a user that isn't coming back (unless of course they have no choice).

Now, consider Google's home page. Actually, no, let's take another website that is very similar to Google but doesn't do things that Google does:

This is a great example because what we have is the task that needs to be performed front a centre - that is to search for something. Like Google, there is basically nothing else on the screen. Here the user is focused on the task at head, and pretty much everything else (including the link to a page where they carry on about how privacy is important to them), is of secondary importance.

Navigating the World Wide Web

We have a number of ideas here as well. One is the pyramid system (and I'm really not sure why they call it that), but we have a home page, a way for navigating the pages sequentially, and also ways to pretty much get anywhere from the home and back again. Also, there is a pyramid structure where pages have parent and child pages.

Sometimes you might encounter a popup box, and you aren't actually able to continue or do anything until this popup box is dealt with. This is known as stop navigation, and is sometimes used for security purposes so that you don't accidentally leave the page before a transaction is completed which may result in you losing money. Mind you, the usual method is taking you to a blank page with the words 'transaction in progress, please don't shut down your browser or move from this page'.

Sometimes when you are navigating through pages, at the top you might see something like this:

home>Page>Page>Page>You are here

This pattern is referred to as the breadcrumb, namely because like the breadcrumbs (or the string in Theseus' case) that you leave behind as you are wandering through a maze (though why breadcrumbs is beyond me because bread is food, and rats eat food, particularly breadcrumbs, which is why Theseus had a much better idea) it enables you to go back to where you came from. You could always use the back arrow, but sometimes you arrive at a spot without having gone through the intermediate steps, and maybe those steps are where you want to go.

The progress bar is generally used when filling out surveys and forms, and you have probably seen that when doing so (especially if you are filling out government forms). They basically tell you how far through the form you are, and how much longer you have to go.

Finally, I'll mention the colour coded sites, and an image will probably help with this one:

This is very helpful where your pages may be the same, but the content is slightly different. The above site is a real-estate website, and uses the colours to indicate what type of product you are looking for. One is for buying a house, another for renting a house, and there are other pages such as share accommodation and also selling a property.

Content Organisation

Okay, wizards probably aren't all that common these days, but are generally used when installing software. Basically the design is to guide the user through the process, and to only request information when certain points are reached. Wizards can also be used to create profiles, particularly if we don't want to put too much information on the page at once. Another area might be where you are lodging a claim for an insurance company online.

There is also the concept of extra's on demand. Normally we are just given basic features, but if we want to use a more detailed search option you can actually request that by clicking on the button. This is an example of the heuristic where advanced users can arrange more advanced searches, or even if one can't find a specific object through a search, they can select options to narrow down the options.

Oh, and also there are the intriguing branches. These are basically hyperlinks, but it is used to great effect with Wikipedia. If you have been onto the site recently you will note that there are a huge number of links to other pages, and even options to go to a page that provides a specific part of the article in much greater detail. Hyperlinks simply aren't for referencing fake news.

Onto the physical layout, multiple windows are becoming less common, namely because people really don't want to have to deal with a heap of clutter on their screen. Instead we use card stacks, or tabbed browsing. However, we still have tiled panes, where the main content is in the centre, but in the left column we might have a menu (even a titled menu), a search bar at the top, and other information down the side.

You might also have noticed that some pages offer different ways to view the content - say as a list, or as tiles. This is something that is coming more common. There is generally a button near the top that you can press that changes the organisation of the data. Oh, and there are also the various sort options, such as sorting hotels by price from cheapest to most expensive, though ironically that isn't the sort that you arrive at the page on.

And Finally - Actions

Well, these are patterns that the user is going to perform, either by clicking a button, pressing on a menu, or dragging and dropping a picture. Once again there are patterns that apply. I'm sure we have all used a word processor, and they are a classic example of drop down menus. In  a way they are like titled menus, but the contents of the menu are hidden until the user clicks on them. We also have smart menus that will change depending on what functions are needed.

Next we have the action bar. Sticking with word processors, these action bars basically contain shortcuts for pretty much the most commonly used processes and are usually at the top of the screen. Actually, Blogger has an action bar, and the action bar also consists of drop down menus, for instance if you want to change the font, or the text size.

As for the all important done button, well, that should be prominent, and of a different colour. Once again, looking at Blogger, the 'publish' button at the top of the screen, is orange whereas everything else is off grey. The reason for this is that it is probably the most important button. However, at the bottom of the page is the 'send feedback' button, which I am tempted to do so request that they include super and subscript functionalities. Obviously they wish us to see it so that we can send feed back if we wish.

Now, some final things that once again apply to the heuristics. For instance, a progress bar applies the visibility of system status heuristic so that we know where we are and how long we need to wait. There are also preview screens so that we can view something before we actually go ahead and post it. In fact blogger has a preview button, though ironically it does not have a functionality to allow you to see how the page will appear on a mobile device or a tablet.

Maybe I should send some feedback.

Creative Commons License

Patterns - Putting it Together by David Alfred Sarkies is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This license only applies to the text and any image that is within the public domain. Any images or videos that are the subject of copyright are not covered by this license. Use of these images are for illustrative purposes only are are not intended to assert ownership. If you wish to use this work commercially please feel free to contact me

Wednesday, 21 November 2018

Processing the Pipeline

So now we return to our beloved CPUs and delve in deeper at to how they operate. We have already had a brief overview but now we return to look at their inner most workings.

So, first remember the instruction cycle: fetch - decode - execute - store? Well, as mentioned, each part of the cycle takes one clock tick, so basically for a computer to go through the entire cycle will require four clock cycles. Meaning that the time it takes to complete the one instruction is four cycles, and once that is complete one can then move on to the next instruction. It is sort of like, well, the process of making a burger - you take the order, you cook the beef, you make the burger, and then you hand it to the customer. Imagine, say, if the next customer had to wait until the first customer had got their burger so that they could be served. It would be pretty annoying, wouldn't it. This is why they introduced a process called pipelining.

Pipelining is basically like the assembly line, or the modern fast food restaurant. In our example above, once the first order is taken and the beef is being cooked, the cashier then takes the next order. Once the beef has been cooked, the beef cooker then receives the next order and cooks the beef for that order, while the first order is having all the goodies added to it. Now, the process itself still takes the same amount of time, it is just that you are now able to make more burgers  - basically the throughput increases, so that instead of taking 16 cycles to make 4 burgers, you are actually able to make 4 burgers in 7 cycles.

The same works for processing instructions inside a CPU, as the diagram below shows:
Pipeline, 4 stage.svg
By en:User:Cburnett - Own work This vector image was created with Inkscape., CC BY-SA 3.0, Link

So, as you can see, once one task has been completed, the next task begins, so while the speed of the tasks isn't necessarily any faster (you can only do that by increasing the clock speed), the number of tasks that can be completed over a period of time (the throughput) increases. In a way, it is like adding three extra people to the task of making the burger. Oh, and this is actually pretty simplified since CPUs have broken these specific tasks down even further, so you will have CPUs that now have at least 14 stages in the cycle.

However, that doesn't necessarily mean that everything is fine and dandy. Now, take for instance, using our burger analogy, that the stages are calculated based on a simple cheeseburger. However, an order comes through for a grand deluxe burger. Well, all of a sudden one of the stages takes longer to complete than for the simple cheese burger, which means that the next burger along the line has to wait until the grand burger deluxe has been completed before work can start on the next burger. Once again, the same is the case with CPUs, and what happens is that the process stalls, because the next instruction cannot start until the current one has been completed. The terminology is referred to as a 'pipeline stall'. Further, when the complex instruction is completed and moves on, this creates a point where no work is able to be done because the next instruction has been delayed, which is referred to as a pipeline bubble.

Once again, we have a diagram to help us understand what is happening here:

Pipeline, 4 stage with bubble.svg
By en:User:Cburnett - Own work This vector image was created with Inkscape., CC BY-SA 3.0, Link

So, in the above example, the fetch stage for the second instruction has taken longer, which has created a gap, or a bubble, between the first and the second instruction where a part of the processor is sitting idle.

Now, there are other ways stalls can occur, which are also referred to as hazards. First of all we have your typical hardware fault, however there is also the problem of branching. Basically instructions are fed into the processor one after the other - in fact that is how they are fetched from the memory. However, one of the instructions that reaches the execute phase tells the computer to jump to a completely different part of the memory and fetch what ever instruction is there and execute that. Well, what's happened is that we are at stage three and there are already two other instructions, instructions that are no longer needed, in the pipeline. Once again we have a stall because these instructions have to be discarded and we suddenly start again a square one, and we find that for a period of time the processor is sitting idle.

There is a way around this, and it is called Branch Prediction, where the computer tries to predict where a process will branch out to a different part of the memory and act before needing to flush any instructions in the pipeline. However, this can be a bit of a double-edged sword because if the computer gets it wrong, then all of a sudden it is stuck with all this data it doesn't need and will need to flush that data out as well creating, yep, a pipeline stall.

Now, before we continue, lets have a chat about speed. First of all, speed is measured in seconds, but not the seconds that we have on our clocks, but much much much smaller increments of time: micro-seconds and nano-seconds, and even milli-seconds. Here is a nice chart that sort of explains things:

Now, the number of clock cycles that occur in the period of one second is referred to as the frequency (sort of makes sense) and is measured in Hertz. You might have heard this in reference to radio communications, and that is pretty much the same thing, except we are measuring the number of waves that pass in a second. So:

  • A kiloHertz (kHz) is 1000 cycles per second;
  • A megaHertz (MHz) is 1 000 000 cycles per second (a million);
and you guessed it,
  • A gigaHertz (GHz) is 1 000 000 000 cycles per second (a billion).
So, take the CPU in this computer, an AMD Phenom II which has a clock speed of 200 Mhz. That means that my CPU processess 200 million cycles per second, and divide that by four, it means that it can process up to 50 million instructions per second (working on the four stage instruction cycle). However, the question is raised as to how long does it take to process a single instruction? Well, you work it out by inverting the frequency. ie:

1/200 000 000 = 0.000000005.

Let us break this down a bit to work it out: 0.000 000 005. So, we have 8 zeros before our five, so the answer will be 5 x 10-8, which is 5 nanoseconds, and that is comparatively slow considering the age of my desktop. Oh, and multiple that by 4, and it takes 20 nanoseconds to complete a four stage instruction cycle.

Well, that was fun, let's do it again for my laptop. Well, it is an AMD A9 Radeon that operates at 3000 Mhz. So, we break that down to basically 3000 million cycles per second (which equates to 3 billion cycles per second). In fact, that should actually be 3 Ghz. So, lets find out how long a cycle is:
1/3 000 000 000 = 0.000 000 000 3,

This translates to 3.33 x 10-10 , which translates to 3.33 nanoseconds for a single clock cycle (and 12 nanoseconds to complete the instruction cycle).

Superpipelining and Such

Well, it looks like things just might get a little more complex. First of all we have superpiplining where the processor brings in the next instruction before the first fetch instruction has been completed, which once again doubles the throughput of the system. Once again, the problem is that if you have to flush the CPU because of an incorrect branch prediction (or even no branch prediction) then all of that has gone to waste.

We also have the superscalar architecture, which will perform two instructions in parallel, once again increasing the throughput. What this actually tells us is that two processors aren't always the same, even if they are advertised at operating at the same speeds. Sure, they emblazon 4 Ghz Intel on the computer package, but that only tells us one thing about the processor. Look, if it doesn't actually have any pipelining, then it might not actually be better than the 3 Ghz processor that has superscalar pipelining.

Anyway, another diagram to help us understand what I'm gas bagging about here:

Mind you, that's all by the by because these days computers are both super piplelined and super scalar, and are also pretty deeply pipelined, it's just that you can never seem to find these particular details (such as how deep the pipeline actually is) on any of the spec sheets.

However, there are problems, namely that while they may operate at greater speeds, and greater throughput, they are also chew through quite a lot of power. Then there are the problems with pipeline stalls, especially if the branch prediction, is, well, rubbish. In fact, an older CPU actually might turn out to be more efficient than one of these new, beaut, super-pipelined monstrosities.

In fact, it has now been discovered that a processor with a whopping 31 stage pipeline is only slightly better than it's predecessors.

About those Cores

So, how many cores does your CPU have? This desktop has two, the TV box in the lounge room has four, and the laptop has 5. Oh, I can't forget the mobile phone - that has 8. So, what are these cores? Well, simply put, they are basically CPUs. When we talk about multi-core processors we are basically talking about multiple CPUs being squeezed into a single chip. This basically helps with, once again, throughput, but also with multitasking. Basically computers can really only do one thing at a time (unlike humans who can do multiple things, such as driving a car while listening to the Beatles and drinking a beer), however we are sometimes given the illusion of multiple things occurring a single time. Multiple core CPUs can change that. Once again, here is a diagram:

And here's another example to take a look at, this time a little less abstract:

That sort of puts it into perspective. Also notice how the CPU also has an onboard graphics processor as well. They really know how to make things compact, and this has been enhanced as well. If you open up your computer and look at the size of your CPU you will notice that it is about a sixth, or even less, the size of this processor. Oh, and we aren't even talking about mobile phones yet.

Now, another thing is that you simply cannot put a multi-core processor into your computer and expect an immediate performance upgrade. The thing is that the software needs to be configured to be able to do this. Sure, most of that is done automatically, but you may have to wait a while for your computer to down load the Windows updates to allow this to happen.

Oh, and there is also the cache that I should mention (but I will get to in more detail in the post on memory). Basically the cache is memory that is inside the CPU. There are three levels, ironically called levels 1, 2, and 3. Now level 1 and 2 cache are generally associated with specific cores, while level 3 cache is shared among the cores. What cache does is that it stores instructions and data so that the CPU doesn't need to repeatedly return to the RAM to get its next set of instructions. Once again, good branch prediction is required to actually know what needs to be stored in the cache.

Like pipelining, multi-core processors also tend to be pretty power inefficient, but they to have the advantage of increasing performance, and cost.


Okay, this is where it gets a little tricky. Multi-threading can only work on superscalar CPUs (remember them?). Anyway, this is where a task can be divided up into multiple threads, and these threads are then executed concurrently. Sound's confusing, well it is, namely because this is one of those really new ideas that has been designed to increase performance. The other thing is that it enables the process to take full use of the CPU, so if a part is sitting idle, it can then execute another thread. However, there is another advantage in that the threads can actually talk to each other and work off of each other.

However, and there is always a however when it comes to these things, and that is that for multi-threading to work, in the same way that multi-core processors work, is that the software needs to be configured to take advantage of this benefit. Now this is where the problem lies. The thing is that not all software can take advantage of this, so developers need to consider, when developing their software, whether multi-threading will be a benefit to their program.

On to Mobile Phones

Well, everybody seems to have one of them these days, and they pretty much function like a miniature computer. Well, there actually is a difference between the architecture within your computer and on the mobile phone, and that has a lot to do with the CPU. Now, your typical computer uses what is called a CISC, or Complex Instruction Set Computer, and the mobile phone uses what is called a Reduced Instruction Set Computer. What does that mean? well, I'll try to explain.

Now, you know how we have been talking about instruction cycles? Well, CPUs are programmed to recognise a series of instructions and how to execute them. The difference is that a CISC processor has a much larger library of instructions than does the RISC processor. Basically, what a CISC processor does is that it can compress multiple instructions into a single instruction, while the RISC processor has a limited set of instructions and must pretty much go about the long way to get the same thing done. Language can be a bit like that. For instance, the word for mobile phone in German is Handy. Where we have two words to describe something the Germans only have one. That is sort of the way the differences between CISC and RISC can be viewed.

Basically, programs for CISC processors tend to be much shorter and succinct, while programs for RISC processors tend to be much longer and much more convoluted. That is actually one of the reasons why half the apps on your mobile won't actually work without an internet connection - the program isn't on your phone, it's on a server elsewhere, and the phone only accesses the instructions that it needs to execute at that particular time. This isn't necessarily a problem with normal computers, though with pretty much everything moving online there will be a time that the only program you fire up on your computer will be your browser.

Let me try to show it mathematically:

Consider the equation above. Now, the seconds per cycle will stay the same, so we can get rid of that, and we can also assume that the program is 1, so all we need to do is to consider the number of instructions. Now, as the number of instructions increase, the number of cycles per instruction will actually decrease, however when the number of instructions decreases the cycles per instructions increase. As such the result for a CISC processor will actually be smaller than the result for the RISC processor. So, what is happening, is that RISC is sacrificing the cycles per instruction for a less complex processor, and that can be solved through pipelining.

Now, the advantages of the CISC processor is that complex instructions can be stored in the hardware, which means that there is less work for the programmer to do. As such, there is greater support in the CISC processor for high level languages (that is human readable computer code as opposed to low level languages, which is much, much closer to the 0s and 1s). Now, with the RISC processor, you need more instructions to perform the same task, however this means that the CPU has more space for general purpose hardware as opposed to all this space taken up by an instruction set. With pipelining available, the speed can actually be quite similar.

Take this example of multiplying two numbers together:

Mult A,B

LD R1, A
LD R2, B

(Basically we are loading A and B into registers 1 and 2, multiplying A and B, and then storing the result in register 3, though with pipelining, tasks can be done simultaneously).

RISC processors are smaller, and more energy efficient. Once again, if you look inside your computer you will see this massive thing sitting on top of your CPU. This is the heatsink and the fan, designed to keep the CPU cool. Well, the problem with smartphones is that you can't actually fit them into the device, so having a power hungry processor is simply going to result in a device that will not work. Also the design means that you can combine the entire chip set into a single chip (known as an SOC). If you look at mobile phone specs for, say, my phone (a HTC One M9) you will note that they say that the CPU is an Octa-core processor, however the chipset is a Qualcomm Snapdragon. The reason being is that the chipset actually contains a lot more hardware than does the conventional CPU.

The Graphics Card

Remember how I mentioned the graphics processor that was onboard the CPU. Well, it turns out that graphics cards also have their own processor. Look at the one below:

See how there are a couple of fans on it. Well, these days the GPUs (graphical processor unit) are much more power hungry than they were back in my university days. Actually, I was going to say that I don't have a graphics card in my computer, until I realised that the monitor is actually plugged into one, and the system specs says that it is a GeForce g98:

Yeah, it's pretty old. Anyway, the major difference is that CPUs are designed to perform a wide range of tasks where as the GPU are generally designed to perform the same task over and over again. As such you will find that a a lot of the fancy aspects of the modern CPU have been tossed simply to add additional cores. The thing is that graphics processing isn't all that complex, it is just performing the same task over and over again, which is why having the CPU do it is sort of a waste. Oh, and it is also the reason why bitcoin miners also like to use graphics cards for their work (though there are much better ways to mine bitcoin).

Creative Commons License

Processing the Pipeline by David Alfred Sarkies is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This license only applies to the text and any image that is within the public domain. Any images or videos that are the subject of copyright are not covered by this license. Use of these images are for illustrative purposes only are are not intended to assert ownership. If you wish to use this work commercially please feel free to contact me

Saturday, 17 November 2018

Farenheit 11/9 - Mike vs The Trumpet

One of the interesting things that I noticed when I was looking up reviews of this movie on the Internet was how it flopped at the box office. In fact, I'm not really all that surprised, not so much that Michael Moore doesn't have his adoring fans, but rather the professional critics really don't see the world in the same way that Michael Moore does - it was never his intention to 'make money' out of this film, just as it was never his intention to win an Academy Award, which he did for Bowling for Columbine. Mind you, like a lot of these groups, it is all well and good when he challenges others, but when turns around and lays his criticism against us then we tend to get rather annoyed. In fact, he even mentions that Jared Kushner was a big fan of his movie Sicko, though I'm not entirely sure if he would be saying the same thing about this film.

I probably don't need to actually say anything about what this film is about, because it is probably quite obvious - Donald Trump. Well, not so much the Trumpet himself, though he does appear regularly throughout the film, but rather it is about the system that installed him as president. In fact, he takes aim quite squarely at the Democrats as well as the Republicans, particularly since there is also the suggestion that at times the Democrats don't even try to win, or when they do they are so indistinguishable from the Republicans that there is no point in voting for them, or even going out to vote. As the saying goes, it doesn't matter who you vote for, a politician gets elected.

Things are a little different here in Australia, namely because our voting system is quite different, which I'll get onto shortly, but the thing in the United States is that it isn't so much the people who go out and vote, but the people who simply do not care. Sure, there are arguments both for and against compulsory voting, namely that in a democracy it is your obligation to participate in the political process, while the opposite is also a valid point, and that is that in a democracy you should have the freedom to stay home and not vote. In fact, there is this other odd quirk in that elections always happen on a Tuesday, which makes me wonder how people are able to vote, and go to work. However, they do have postal voting in the United States as well, and I believe they also have absentee voting.

The Lucky Country

Well, I mentioned that I would say something about our system of voting, and that is that we have compulsory voting, and we also have what is known as preferential voting. Preferential voting is that you have to number all of the boxes on the voting slip and then cast your vote. Then, when the votes are counted each of the votes are tallied by who was number one on the ticket, and once all the votes have been counted then they keep only the two largest, and divide the remainder by their second, third, and forth preference (depending on how many people are on the ticket) until one candidate has more than 50% of the vote. This is actually a pretty good method of voting because not only are you getting two votes for the price of one, but you are never wasting your vote - if the person you put down as 1 is knocked out, then your other preferences are then counted (and it also means that you don't have to return for a runoff election). 

What this means is that while we do have two parties in our system, it means that these parties won't necessarily become entrenched, as we are currently seeing elsewhere. There have always been independents in the Australian parliament, but one of the reasons for this is because once an independent gets elected, then they can be very hard to remove, namely because the punters see that they aren't necessarily controlled by the party machine, and they also they tend to put a lot more effort into working with the electorate, and tend to build a lot of support from their constituents. Needless to say that the major parties really don't like them, namely because they don't have all that much control over them or the way that they vote.

Then there is the thing with compulsory voting - if we have to make the effort to get out of bed, walk down to the voting booth and cast our vote, then we are going to make sure that our vote counts. As it turns out, the number of informal votes is surprisingly low, though you always get that young person who really doesn't care and ends up drawing a penis on his ticket. Surprisingly though, we seem to be one of the very few countries who has such a system, though we certainly don't take it anywhere near as seriously as some countries where the participants will literally dress up in their best clothes to go and cast their vote.

Biting The Hand

I guess that is one of the major problems when it comes to politics, and that it is really, really expensive to get elected. We always hear of candidates funding themselves, or raising money through small supporter donations, but the thing is that sooner, or later, you are going to need more, and a lot of the low hanging fruit is basically gone. This means that when the big offers start to come in then it is just too tempting to say no, especially when your coffers are empty. The problem then arises that these people aren't giving you money for nothing - they want favours, and it is not always in the form of tax cuts (though they can be a huge bonus when they come through). 

Honestly, this is probably one of the biggest problems in politics, and that is the money. You need money to get elected, and you need money to keep on getting yourself elected. In fact, there was a movie, Brewster's Millions, where the protagonist had to spend a heap of money in a short amount of time, and not have anything to his name at the end. Well, he decided not so much to run for mayor, but to run a campaign where he encouraged people to basically vote for nobody. The thing is that if you don't get elected, then that is an awful lot of money down the drain.

Australia has an interesting system where you are paid money based on the number of votes you receive. Once you pass a threshold the more votes you get, the more money you receive. The idea is that you are reimbursed for any money that you spent on attempting to get yourself elected, but there are people out there who have turned that into a rather nice little money spinner for themselves. Yeah, we also have a register where any donations over a certain amount must be declared, and politicians aren't allowed to profit from the government either, in that you can't award contracts to companies that you own, or companies that you have financial interests.

A Party of Losers

This was one really interesting thing that Moore raised in the movie, and that is that it seems as if the Democrats want to lose, or that they are so used to losing that they simply don't even try anymore. Okay, we had the Obama campaign that got him elected on a message of hope and change, but despite the fact that I still quite like the guy, the reality is that none of this hope and change actually came about. In fact, during his presidency the police became even more militarised, we had the riots break out in Fergusson, and the drone war was expanded without end. Yet Obama's campaign was a well orchastrated campaign, even though as far as I'm concerned, the stock market crash of 2008 was what got him over the line (and he not only orchastrated the bailouts, but did nothing to actually punish the perpetrators of the crisis). 

The Democrats are an interesting party though, considering that originally they were the party of the slave states. In fact after the civil war there was no way that the Republicans were ever going to win an election in the south. Boy have times changed, and changed a lot because it seems as if there has been a monumental switch. Remember, the Republicans were the party of Lincoln and Teddy Roosevelt, the man who broke apart the corporate monopolies that dominated the country. Yet you could never imagine somebody of the callibre of those two men leading the Republicans to a presidential victory these days. What happened? Why is it that the party that courted the slave owners is now the party that courts the black vote, and is also the party that produced America's first black president?

I'd suggest FDR and LBJ. Franklin Delano Roosevelt was the Democratic president during the Great Depression and World War II. Not only did he enact social reforms but during the war would come down heavily on any company that was suspected of profiteering from the war. Gee, it is a shame that these war profiteering clauses don't exist in contracts today, particularly since war is big business. As for Lyndon Baines Johnson, well he was the president that presided over the civil rights act. Wouldn't it have been interesting if there was bipartisan support for this bill, meaning that the bigots and racists would have been left out in the cold. Well, unfortunately that didn't happen because when it became clear that the Democrats had become the party of reconciliation and civil rights, our good friend Tricky Dick decided that it was high time to start courting the South. Yeah, the south have never forgotten the civil war, and being a coloured person in the South isn't a fun experience.

Yet there is also this thing about the Democrats being the progressive party. Well, I'm not entirely convinced about that. Obama was supposed to be one of the most progressive Presidents in recent memory, and it seems as if little in the way of progressive policies actually were enacted. The banks are still raking in millions of dollars in profits from people that don't have any money, the corporations still control Congress, and the Dakota Access Pipeline was still being built through Indian land. Sure, there are arguments that the Democrats are facing an uphill battle when it comes to corporate money and media attention, but honestly, with Trump's hatred of the media you would have thought that they would have rallied to the Democrats side? Well, these midterms certainly didn't bring about the blue wave that everybody was expecting, but then again that just may have been a good thing.

Hiding in Plain Site

Well, Michael Moore certainly made some insinuations in his film, insinuations that I am not going to repeat, namely because there is no hard evidence that what he was suggesting was what actually happened. Sure, Donald Trump may be sexist, and may be racist, that is clear enough from watching his rallies and things that he has said, but there is a line that one should be very, very careful not to cross. Sure, I'm not entirely sure Moore had crossed it, but he certainly came close.

Anyway, his suggestion was that one of the best ways to commit a criminal act is to actually do it so that everybody can see you doing it. Look, I'm not entirely sure if that is probably the best advice to give a would be criminal, but I think he does have a point. In many cases this has more to do with committing fraud, and treason, as is suggested, than simply being a street criminal. Remember, there is a big difference between street crime and corporate crime - street criminals inevitably get caught.

However, while there are a lot of allegations regarding his business dealings, and the suggestion that as a business man he was pretty bad, in fact so bad that there was a point that banks wouldn't lend to him, which meant that he allegedly had to go and get his finances from Russia. However, like many in the corporate world, finding out the truth can be really difficult indeed. You know, isolating debts in shell companies, and using bankruptcy laws to be able to get away without repaying your debts. In fact there is a suggestion that Trump is who he is because he never pays up. Actually, this is the case across the board, and one of the reasons why solicitors always take money up front - half the people that you are dealing with are most likely those who will never, ever cough up. I've known plenty of these types of people, and they certainly raise the ire of many around us. I guess that is why Jesus made the comment that when we lend out money to people, don't expect it back.

Let's talk about Russia? Is it actually treason for a head of state to seek to normalise relations with a country? Well, actually, I don't think it is, but that isn't the question, is it? I think the question arises more with the alleged interference in the 2016 election, before he was president. I suspect that if he was having meetings with the Russians, particularly where there were sanctions against the country, and  making arrangements to help him win the election, then the charges could well be there. The problem is that treason, and in fact any crime, simply do not exist as an open and shut case. Sure, we may suspect that things were going on, but we need to be able to prove that these things were going on, and that he was complicit in them, and that is where the problem lies. It appears that there have already been resignations in that regard, but the investigation is still ongoing, and I wouldn't be surprised if nothing actually comes from it. 

The Trumpet

Honestly, I'm starting to get sick of people referring to Donald Trump as an idiot. Honestly, if he was an idiot he would have not become president of the United States, particularly without connections or backers. According the Michael Moore, when he first made his announcement it was basically treated as a joke. In fact, he believes that it was a joke, if only to get back at CBS for paying him less than Gewn Steffani (something that I could quite easily believe). Well, it seemed to snowball from there, particularly since all of the news networks started running with it. They weren't running with it because they admired him, they did it because they thought the whole idea was ludicrious. Well, I guess you can't pay for coverage like that, which in reality he wasn't. 

Then let us look at how he completely decimated each and everyone of the Republican presidential hopefuls, hopefuls that had far more connections and far more experience than he had. Yet there is something that we completely forget about the Trumpet, and that is that he is able to make sure that he is the only person in the room that is heard. Sure, we may not consider it a polite conversation or civilised debate, but the reality is politeness and civilised debate are rules for losers, and strong men will break those rules. Honestly, it doesn't even matter whether they are caught out or not, because once people are thinking about it, it is very hard to stop them thinking about it.

Look, these Republican candidates were all seasoned veterans, yet they were literally steamrolled by Trump. In fact Trump simply did not pull any punches when he was destroying them. Consider Jeb Bush, whom he attacked over the Iraq War debacle. In a way that was a stain on the Bush family that they are not going to be able to remove. As for Trump, what about his stains, surely he has many of them. Well, that is what the genius of his method was, he kept on deflecting the attention away from himself towards his opponents, and those aspects of him that couldn't be deflected, he wallowed in it. Oh, and it wasn't just his Republican challengers, as we are well aware, he completely decimated Hillary as well, and the hack that her campaign office suffered certainly didn't help.

Anyway, let us consider his ability to be able to do and say things that many of us would feel incredibly uncomfortable saying in public. Take for example his racist and misogynistic rhetoric, such as referring to all Mexicans as rapists. Look, this is nothing new. In fact this has being going on in the United States, and other places, for ages. Under the civilised surface there is a seething racist against those who do not look like us with the belief that they are taking us for a ride and leaching off of our country. Honestly, it doesn't matter that the biggest leaches actually sit on Wall Street, and in the corporate offices - the complexity of the modern corporate society obfuscates that, and even then, these guys (and they usually are guys) provide us with the jobs. As for the minorities, well, they are out there to be seen, and they are even going as far as undercutting our wages by working for significantly less. Actually, that is a problem because honestly, nobody is going to hire an American to be a maid if they can hire a Mexican for a lot less - it is the basic laws of economics. In fact one American I knew told me that unless you hired illegals, you simply were not able to survive in the cut throat business world.

Yet this was in the lead up to the election, let us consider what he was doing after the election. Well, he immediately started claiming that he was the subject of voter fraud. Now that sounds odd - why would the guy who won the election be complaining about voter fraud. Well, once again that is one of those tricks where you start getting people to think about voter fraud. Okay, at first I thought it had something to do with him not being able to accept that he had lost the popular vote, but when we consider his nature, it actually isn't all that surprising that he was upset that he lost the popular vote. Surely a majority of Americans liked him, and would have voted for him. Well, I think it goes in deeper than that, but making the suggestion that there actually is voter fraud going on, and thus making it harder for minorities to be able to get out and vote, not that it is actually all that easy anyway, with it being on a Tuesday, and with voter registration, and some really strict voter id laws that literally remove whole groups from the roll.

But we are starting to see it come about now during these mid-terms. Allegations of voter fraud, especially where the vote is really tight. It seems as if they can attempt to swing the votes in their way, or even discount a heap of votes, then maybe, just maybe, they might be able to beat off the challenger. We are seeing this in Florida, and also in Arizona where there is a large number of postal votes. Oh, and not to forget that they make it much easier to vote in Republican areas than in democratic and minority communities.

Anyway, these are just my thoughts, and I probably could go on for a lot longer, except that I will probably end up just rabbiting on, However, will we expect Trump to win in 2020, well, it really comes down to the Democratic party and whether they have learnt their lesson from 2016. Also, it will come down to whether Trump will leave willingly, or continue along the voter fraud line. However, there is also the issue that Moore raised that he might not even be willing to call it quits after 2024, and may now be laying the foundation to extend his presidency beyond that or even postpone the 2020 election. If you don't think that is possible, well honestly, anything is possible. For instance, earlier there was an apparent alert about a missile heading towards Hawaii, only to find out that it was an mistake. Surely, surely, surely something might come about to give Trump the excuse to give himself emergency powers. The problem is that when it does happen we probably won't be in the right mind to really see what is going on and like the sheep that we are, give it to him.

Creative Commons License

Farenheit 11/9 - Mike vs The Trumpet by David Alfred Sarkies is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This license only applies to the text and any image that is within the public domain. Any images or videos that are the subject of copyright are not covered by this license. Use of these images are for illustrative purposes only are are not intended to assert ownership. If you wish to use this work commercially please feel free to contact me

Tuesday, 6 November 2018

And More Testing - It Never Ends

Well, they also call this user behavioural analysis, but in the end it is simply more userbility (not usability, but user-bility) testing, and as I have indicated it basically never seems to end. I guess that is not surprising because the reality of the commercial world is that you either change or die. Okay, that actually isn't all the pleasant for the plebs, namely because they have little say in the change, and while corporations carry on about those who are resistant to change, I can assure you that if your job simply consists of answering phones, no matter how much you may hate the change, your opinion means squat. In reality, the people you have to worry about who tend to be resistant to change happens to be management - you see change is good, as long as it doesn't affect them.

However, the reality is that society changes, and users change. If another platform offers a better service you can be assured that your users will desert your platform for the other - just ask Yahoo and Myspace - you can be assured that they discovered that the hard way. This is also why sites like Facebook and Google also seem to always be on top of their game, and also spend up big on their UX departments - they don't want to happen to them what they effectively did to others.

Anyway, usability testing can actually be mapped out in the following way, as Whitney Hess demonstrates:

In a way this is a three dimensional grid - we have an axis that moves from attitudinal to behavioural, from qualitative to quantitative, and also in a contextual way. Considering context, note that we are looking at three forms - whether the product is being used or not, and whether it is being used in a natural or a scripted environment. One of the key things with user testing is that we really shouldn't be telling them how to use the app, but observing how the app is used. In one sense each method has its own pros, and cons, and you can also see that they all appear on one part of the graph.

One of the interesting things is considering the natural use of the product, and also taking into account privacy. Notice that there are methods like data mining and message board mining, as well as eye tracking studies. There are already concerns that that little camera on the front of your phone, and in fact the GPS tracking system, and other input systems are mining more information about you than you actually realise. However, it seems that some of these companies have mining programs that will trawl the internet looking for flags regarding their product. In fact, if a customer made a disparaging comment about the company I was working at over the internet, their social media department knew about it (in the same way that they would know you slagged the company over the internet as well). Note also that these methods sort of edge towards the indirect method, meaning that information is being collected, as opposed to being requested.

Another thing about UX design are the anacronyms (though you do find them in pretty much any industry). The first one is the HIPPO, or the highest paid person's opinion, or the ZEBRA, zero experience (or evidence) but really arrogant. I'm sure you know those guys - they don't get to where they are because they actually know anything, but rather because they are able to make the right friends at the right time. Dealing with these people is a gift, and a skill, because there is always the chance that they can completely destroy a project, and the ironic thing is that they never seem to actually take the blame for destroying the project. However, that probably needs to be addressed elsewhere by somebody else who has much more experience in behavioural science than I happen to have.

The key thing here comes down to evidence. Look, honestly, there are going to be times when, despite the evidence that you have gathered, people are simply not going to want to listen  - take climate change for example. The thing is that people always have things (whether it be money, or reputation) on an opinion, and people simply do not like to admit that they are wrong, especially when it results in them losing face. However, that does not mean that we simply cannot dispense with collecting evidence - evidence helps us understand how our product is being used, and how we can make it better - and stay ahead of the game.

So Onto Testing User

Well, this is the obvious point but what we are trying to do is to use the scientific method to gauge user behaviour. Getting them to use it in the natural environment helps if, say, you happen to be Google or Facebook (or even Yelp), but sometimes that simply isn't possible, especially if your product hasn't been released to the market. However, lab testing, while useful, can also be fraught with problems since it happens to be within a controlled environment. For instance, if the user knows that an expert is there, the user is always tempted to ask the expert for help. On the other hand, testing remotely can sometimes reveal incomplete data, namely because you are not privy to things such as thought processes.

Let us consider eyeball tracking for an moment because ironically it can reveal a lot of interesting information. Take a look at this Wikipedia page:

This actually reveals a lot of information as to how people are viewing the site. Notice that the user looks at the introduction, at the contents, but very rarely at any of the main text. Interestingly they also seem to look at the top of the navigation bar. Eyeball testing can be used to see what information people look at and how they relate to your app. In the Wikipedia example, I can attest to being one of those people that tends to only read the introduction.

Now for a couple of videos, the first being on a UX team trying out usability testing on fruit of all things, and some of the results may surprise you:

No surprisingly, the Google development team also have a number of videos on Youtube regarding usability testing, here is a method known as Guerilla Testing, where you go to a cafe and randomly ask people to test your app.

Preparation is Key

Honestly, things do simply appear out of thin air, and while some people are able to operate on the spur of the moment, nothing ever beats preparation. This is the same with userbility testing. We should first of all have a plan, but we should also have a script, resources, and an idea of where the testing should occur - in a cafe, or in a lab. We need to know what we are testing, what we want from our test, who we are going to be testing the product on, when and where, and what outcomes we are seeking. In fact, we should be putting as much time as we can afford to into preparing the test.

Further more we should be screening the test subject, and in doing so we should be asking specific questions. For instance, instead of asking what their favourite websites are, ask them to list their top ten websites. Ask them how often they would use a similar app, and also give them a list of important features and whether they appeal to them or not. We don't want open questions because open questions can lead to vague answers.

Having a tight script is also very important, as this provides consistency. The thing with a good script is that it gives the users a feeling of professionalism, and expertise. It isn't good if we are working off the cuff, particularly since we might forget something for one person that we would ask of another and so forth.

When it comes to the lab, we also need to be prepared. For instance, we can't have it in a high traffic area where the user is likely to be disturbed. We need good lighting, and we also need to be able to observe without the user feeling uncomfortable - a one way mirror can be great in this regards. Also, while it goes without saying, good equipment is also another requirement.

Now, we get down to the tasks. We need to know what tasks the user will be performing, the approximate time the tasks will be taking, and what possible deviations there might be from these tasks. In addition to that we need to be prepared in recording our observations, what we are expecting to see, and what we actually see. Finally, there comes our post test survey, were we can delve into the users thoughts on the product, the likes and dislikes, and of course room for improvement.

In Progess

Now that we have the tasks, we should hand them to the user one at a time. The thing is that handing a whole stack of paper to a user and asking them to work through them one at a time can be quite overwhelming. Think about that to-do pile at work, and the thoughts of whether you are actually going to be able to complete it. We should also use the 'think aloud' process, that is that the user really shouldn't be keeping their thoughts to themselves. What we want to know is the thought process, and we would like to encourage the user to share them with us.

Honestly, we need to remind the user that we are not testing them, we are testing the application. As such we can't make them feel that they have failed in the task. If there is a failure, in reality it is the application, and the design process that has failed. This is not a university exam. However, we also need to avoid guiding them through the application. That sort of defeats the purpose of the whole testing process. If the user isn't able to figure something out, then maybe we need to go back to the drawing board and try to work out how we can solve it.

Another thing we can consider is controlled and natural testing. This is done a lot in the medical research industry, where one group is given a tablet and the other a placebo, and the results of both are studied. In a way we can present two groups of users with two different versions of the products and watch to see how each group responds. In fact you may have experienced that yourself with apps that you used, though you generally don't realise that you are a part of a controlled experiment.

I probably should mention the concept of alpha/beta testing. You may have encounter the term 'beta' test previously. Well, you have pre-alpha where the UI has been completed but functionality not so much. Alpha testing is usually done inhouse to test for bugs and flaws. Beta testing is done through a limited scope with outside users, before the pre-release and the eventual release. Look, I've heard people carry on about how they have received the beta test version of a game, but really, it isn't the finished product, it is just a version where they haven't ironed out all the problems yet.

Oh, and there are other resources, such as Google Analytics, which you can also use in addition to your testing.

To Recap

Well, this has been a bit of a slog, but it is an important facet of UX development. Anyway, there are effectively three phases: the strategy, which is the start where the designing and thought processes take place, the execute, which is the go and no-go, and is where much of the development and implementation occurs, and the assess, where we look over the results of what we have gathered, and how we can implement them in the future.

Finally, remember, that qualitative is describes, and quantitative counts, and both are useful for understanding how users respond to our product.

Creative Commons License

And More Testing - It Never Ends by David Alfred Sarkies is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This license only applies to the text and any image that is within the public domain. Any images or videos that are the subject of copyright are not covered by this license. Use of these images are for illustrative purposes only are are not intended to assert ownership. If you wish to use this work commercially please feel free to contact me