Saturday, 2 November 2019

The Marvels of Multiplexing

Multiplexing actually allows us to do some amazing things. For instance, without it, your mobiles phones wouldn't work, and you wouldn't be able to watch television or listen to the radio. Basically, the concept of multiplexing is being able to send multiple signals across a signal channel, and being able to isolate those signals at the other end. There are three main forms of multiplexing - Frequency Division, Time Division, and Code Division. We will be looking mainly at Frequency Division and Time Division, though we will touch upon the fourth-dimensional wonder that happens to be Code Division (which is what most of our modern mobile phones operate on). To put it simply, for multiple signals to be able to share the same medium, the medium must be somehow divided to enable the signals to share the same resources.

Frequency division multiplexing is where the signal occupies the same frequency all of the time. This is an analog method where the bandwidth of the medium is greater than all of the bandwidths of the signals combined. Time division multiplexing is where the signal occupies all of the bandwidth of the medium for short intervals of time. This is a digital process where the data rate of the transmission medium is greater than the data rate of all of the signals combined. The following diagram below hopeful will give you a better understanding:


Frequency Division Multiplexing

As indicated above, frequency division multiplexing is where multiple users are separated into a number of frequencies, which do not overlap, in order to send them continuously along with the same medium. This is the system that was used for the original analog television and radio broadcasts. Each of the channels is separated by guard bands to prevent interference. This method was also used on the old circuit switching telephone network. The signals are sent into a multiplexor at one end, separated into their various frequencies, and sent along with the medium to where a demultiplexer at the other end will then separate the signals.


Let us take the example of the telephone again. At one end each of the phones generates a signal and the signals are sent to a modulator that modulates them onto a carrier frequency. These frequencies are then multiplexed into a single composite signal and transmitted over the telephone network.

At the other end of the network, the multiplexed signals are passed into the demultiplexer where the signals are filtered into the original channels. The signals are then passed into a demodulator where the original signal is received and passed through to the receiving telephone.


However, this technique involves analog signalling, and this is more susceptible to noise. So, now that we know what it is, let us do some problems that involve multiplexing.

So, we have this medium with a bandwidth of 12 kHz, and we have three voice signals each with a bandwidth of 4 kHz. So, the medium has a bandwidth between 20 - 32 kHz, so what we do is that we shift each of these voice signals into a different bandwidth as such:

Voice 1: 20 - 24 kHz; Voice 2: 25-28 kHz, Voice 3: 29 - 32 kHz.

We then combine these signals and send them over the physical link, as such:

Now, there is going to be the problem of interference, particularly when we have the multiplexed signals so close together. We can solve this through the use of guard bands. Basically, a guard band is a narrow band to each side of the signals that does not carry any of the signals. As such, the signals are less likely to interfere with each other.

So, say we have five channels, each of them carrying a signal of 100 kHz. How wide a bandwidth do we need if we are going to include a 10 kHz guard band? Well, first of all, we do not need a guard band at either end of the signals at the end, only between two signals. So, there are five signals, and as such there will need to be 4 guard bands between these signals. The bandwidth of the five channels is 100 kHz, and with four guard bands that means we need a total bandwidth of 540 kHz.

Time Division Multiplexing

Well, that seemed easy enough, so let's move onto Time Division Multiplexing and play some number games with them.

So, as mentioned, TDM is used widely in digital communications, and it is where the signals occupy all of the bandwidth but only for short segments of time. As such this allows several connections to be able to share the high bandwidth of a link. The time slots are pre-assigned and the sources are fixed, and a slot is allocated even if there is no data to be assigned to that specific slot. While I've already posted a diagram of the various multiplexing methods, another one won't go astray.

Now, along with these frames, a synchronisation bit is also added at the end of each of the frames. This is to enable the receiver to synchronise each of the frames coming in - basically so that it knows where one frame ends and the end frame begins, so that it can make sure that the divided bits are then placed in their proper place. Without this synchronised bit, the result will end up being a jumbled mess.

One thing that should be noted is that TDM tends to use pulse code modulation to modulate the signals onto a carrier signal to then send onto the line. When the signals are modulated, they are then multiplexed and sent onto the mainline.

So, if we have eight channels, and each of these channels produces 250 characters per second, and each of the characters are 8 bits, what is the data rate of each source? Well, 250 characters of 8 bits each are being produced, so that would be 250*8 which will produce 2000 bps (bits per second). We can reduce that to 2 kbps. 

Now, let us calculate the duration of each character. So, if the source is producing 250 characters per second, then the duration of a single character will be 1/250 s, or 0.004s, or 4 ms (1 ms, is 1/1000th of a second).

Now for the frame rate. So, if the frame carries one character from each source, then 250 frames need to be sent per second. The duration of the frame will be the same as the duration of each single character from a source.

So, as mentioned above, the data rate of a link that carries n connections must be n times the data rate of the connection to guarantee the flow of data. For instance, if three 1 kbps are multiplexed together the transmission rate will be three times the rate of the connection, or 3 kbps.


The data rate of the link is n times faster and the duration is n times shorter.

So, we have a multiplexor that combines 5 10 kbps channels using a time slot of 2 bits. Each frame will have 10 bits, namely because there are 5 channels, and 2 bits are taken from each channel, so 5 x 2 = 10 bits.

Now for the frame rate. Each channel is producing 10 kbps, and each frame is taking 2 bits per frame. this means that there will be 10 000 bits being produced per second, dividing that by two gives us 5000, so the frame rate will need to be 5000 frames per second.

The duration of the frame will be 1/5000, that is 0.0002, or 0.2 ms, or 200 μs.

Now, the bit rate of the link. Since there are 5 channels, of which 2 bits are being taken for each frame, so 5 x 2 = 10. Also, 5000 bits are being produced every second, so 10 * 5000 = 50 000 bps, or 50 kbps.

Now for the duration of the bit, which is 1/50000, which produces 0.00002, which brings us to 20 μs.

Finally, let us calculate the number of bits in each frame. So, there are five channels, and each frame takes two bits from each channel, so 2 x 5 = 10. However, if you were to answer 10 you wouldn't quite be correct, namely because we also need to take into account the single synchronisation bit added to each frame. This, each frame actually has 11 bits. Thus, when we are calculating the bit rate, we need to take into account the synchronisation bit. As such, our calculation above is incorrect. It is 10*5000, but 11 * 5000 = 55000, or 55 kbps. A single bit certainly adds up.

Asynchronous TDM

The problem with the above is that there is the potential for waste. Basically, slots are allocated even if there is nothing to put into the slots. So, what asynchronous, or statistical, TDM does is that it allows for us to eliminate this waste. For instance, with Statistical TDM, time slots will be allocated based on demand. So, when data is received the multiplexor scans the channel to see which channel is producing data and if it is producing data, then it will assign the data to any free slots until the frame is full.

Not surprisingly this way is much more complicated, so can break down during peak periods. Also tends to be used only in low bandwidth Local Area Networks.

Another thing to consider is the Digital Subscriber Line or DSL. This is a system where both digital data, and voice, would be multiplexed over the same line. ADSL indicates that this is done in an asynchronous manner. I still remember when DSL was being rolled out. In much the same what that not everywhere is connected to the NBN, back in the late nineties, when we were moving from dial-up to ADSL, not everywhere actually had ADSL active. That seems to be a very distant memory these days.

Code Division Multiplexing

Here we can now use multiple devices on the same frequencies (using the whole bandwidth) at the same time, but the signals are divided using different codes. Basically, when one is speaking on the phone, it is turned into a digital signal, and when a 1 is transmitted, it is done using a code, while a 0 is transmitted using the inverse of that code. The signal at the receiver's end only picks up the ones with the correct code - any other signals are treated as noise and discarded.

Anyway, to finish off, here is a short video, from Youtube, explaining what DSL actually is:


Creative Commons License

The Marvels of Multiplexing by David 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 at david dot sarkies at internode dot on dot net

Sunday, 13 October 2019

Joker - The Flip Side of a Dark Coin

Joker
2019
Joaquin Phoenix, Robert de Niro
Directed By: Todd Phillips
IMDB: 9/10, Rotten Tomatoes: 90%

Yeah, I have to admit that the Batman universe is pretty dark, so when we come to the origin of one of his most famous adversaries, then we are no doubt going to be delving into a world where no person should really ever think of going. Mind you, I'm not entirely sure if you can truly consider this to be an origin story, and if you have seen this movie you will probably know what I am talking about. However, I should warn you that if you haven't seen the film, then this post is certainly going to contain quite a lot of spoilers, and it would be best to actually go and see the film before considering continuing. If you do continue, don't tell me I didn't warn you.

Anyway, here is the preview that you have no doubt seen:


Where Are We Going?
Well, let us start off with a bit of a synopsis, not that it will do any good. In fact, when I read the Wikipedia synopsis I couldn't help but think that it was way off. Then again, I suspect that whoever wrote it probably didn't understand what was going on, or simply had their own view of it. Mind you, since Wikipedia is constantly changing, it is actually difficult to make any such claims, though I can refer you to the version that I read, as opposed to the version that you will see now.


Anyway, the film begins with Arthur standing outside a shop waving a sign when he is accosted by a gang of youths, who then proceed to beat him up in an alley (honestly, why do people insist on walking into alleys?). Well, we then return to his place of employment where he is disciplined for losing the sign, and one of his colleagues also gives him a gun. He then returns home where we learn that he is living with his mother.

Look, I could continue, but the thing is that this is a pretty complex film, with quite a lot going on, and to describe everything of importance probably will take up the entire blog. However, to cut a long story somewhat shorter, I'll simply mention that he has this desire to become a comedian but simply doesn't seem to have the nounce to be able to pull it off. Except, he is invited onto a talk show by the host Murray Franklin, who he then proceeds to kill.

Mind you, I probably should also mention that he was previously on a subway when he is assailed by three guys in suits. Well, he happens to have his gun on him, so he shoots two of them, and as the third attempts to escape, he shoots him as well. Mind you, we then hear that these guys were fine upstanding citizens and that they were killed in cold blood.



I'll also mention his mother, who, like Arthur, seems to be suffering from mental illness. The thing is that she is convinced that she had an affair with Thomas Wayne and that Arthur is the child. However, the evidence seems to be pointing in the direction that she is delusional and that Arthur was actually adopted - which doesn't quite add up, and I'll explain that later.

So, the film ends, with Arthur in a cop car, having been arrested for killing Murray Franklin live on television. As they are driving to the station, the car is t-boned by a truck, and Arthur is pulled out of the car and placed on the hood, where he then stands up to the shouts of adoring fans. But it doesn't end here, because we then cut to an asylum where Arthur is locked up, and the film ends here.

The Saintly Rich
Let us start off with this concept. This is something that the film completely turns on its head, and completely undermines the story we are told in the previous iterations of Batman. Except there is one problem - we never actually get to know Thomas Wayne. Sure, we know that he is Batman's father and that he is brutally murdered after they wander down an alleyway after watching a film. Well, the interesting thing is that we never actually get to know Thomas Wayne - his death takes on a mythical quality, and he is in away elevated as a saint. This film does otherwise.


The thing is that we get to see a completely different side of Thomas Wayne if the events in the theatre are anything to go by. It is clear that he is a self-severing individual that really shouldn't be adored in the way that he is adored down the track. Yet, the reality is that nobody actually gets to see this side of him. You know, it is like many people at the upper echelon's of society - they are so cut off from the people below that they really don't understand the struggles they face. Well, it actually goes one step further, in that they create stories about them, and then proceed to blame them for being in the situation that they are - the thing is that if they made it, then others can as well

This is clearly demonstrated with the three brokers (or whatever they are) who are killed on the subway. We know what they are like, and we know that they are brutes. Like, they start off assaulting a woman, and upon discovering Arthur Fleck, and discover that he is, well, not quite normal, they decide to start picking on him instead. Yet, interestingly, none of this is mentioned after they are killed. Well, one could say that there were no witnesses, except there was - the woman - she knew exactly what was going on.

Still, even if she did come forward and actually reveal the truth about their characters, I highly doubt that this would be broadcast - it just does not fit with the narritive, and that is that these people are the good guys, and the person who murdered him didn't do it in self-defence - why would he, they are upstanding members of society - but rather he did it in cold blood.

Of course, if the riots are anything to go by, and the fact that the rioters are all dressed up as clowns, it is pretty clear that not everybody buys this story, and there is a suggestion that these people actually believe that they got what they deserve.

Lighting the Gas
In some of the commentaries that I have read the concept of gaslighting seems to regularly come up. Yeah, this film seems to be replete with examples of people being gaslighted. Look, I referred to a couple of incidents above, namely with Thomas Wayne, and with the three murdered brokers. The media is constructing a narrative, and in a way hiding the reality of what is going on. In a way, they are reconstructing all of the historical events.


The Wikipedia definition of gaslighting is as follows:
Gaslighting is a form of psychological manipulation in which a person seeks to sow seeds of doubt in a targeted individual or in members of a targeted group, making them question their own memory, perception, and sanity. Using persistent denial, misdirection, contradiction, and lying, gaslighting involves attempts to destabilize the victim and delegitimize the victim's belief.
However, this is actually where the genius of the film comes about, because halfway through we are thrown into complete doubt as to what is real and what is not. I'll go into further detail of that later, but the thing is that we are lead to believe that he was in a relationship with this woman, but it turns out that it was all in his head. This means that there are a lot of things that we don't know.

For instance, there is this thing about the gun. Arthur is given a gun by a colleague for protection, and then when he is entertaining kids at a hospital, it falls out onto the ground. Obviously, he is immediately given the sack, however, while he is talking to his boss, we are told that he actually approached this colleague asking for the gun - so, what version is the truth - was his given the gun, or not?



Well, I suspect that it was the first option, namely because it becomes evident that nobody really likes Arthur - he is just too strange. So, they are going to make any old excuse to try and get rid of him. The thing is that people simply don't believe anything Arthur says, and they know that if they lie, then they are going to be believed. In a way, what we are seeing is that Arthur is perpetually being gaslit, because he is different, and in doing so they are driving him further into insantiy, to a point that they know that they can say, and do, what they like with him, knowing full well that nobody is going to believe him.

So, what about Penny Fleck. We are told one thing, and then another. Did she sleep with Thomas Wayne or not. Well, everything points to the fact that she is delusional, including the contents of her psychiatric report. Yet, there are a couple of things that don't add up - first of all, there is the photo that suggests maybe she was telling the truth, and then there is the huge question mark over whether she would have been eligible for adopting somebody. If she had a history of mental illness, I'm not sure if the adoption agency would have let it through.

Of course, there if also the third bit of evidence, and that is that Thomas Wayne is a fine, upstanding, member of society - he is going to be believed over some employee. In fact, he knows that, which is why he can get away with it. Of course, he is going to deny everything - he doesn't want to have a paternity suit come his way. Yet, what about the psyche file - is it at all possible that he has enough power and influence to change it - quite possibly, especially if he has psychiatrists in his employ. In fact, having worked in personal injury, it is quite easy to get a psychiatrist to commit somebody if you are willing to pay the money, and we do know that there is an awful lot of corruption out there.

Another this that stands out is the whole 'I actually like you, despite nobody else doing so'. We see this a few times in the movie, and I suspect that we have all had that happen to us as well. You know, when some absolute cretin treats you like dirt, and they then follow up with 'but I'm your friend'. In many cases that is working to actually destroy you mentally, and put you under the thumb of somebody who really doesn't have your best interests at heart.

Is he an Incel?
This is quite an interesting question, and one that I believe needs to be explored considering the fact that there are some criticisms being level against the film in this regard. Now, Incel stands for involuntary celibate, and they are generally people who take their frustrations out on the world at large for the position that they are in. Mind you, it is actually quite a nasty feedback loop, because if you blame your problems on others, it is only going to make you even more unattractive, and so on and so forth.

I remember dating a woman years ago who told me something that I actually find quite helpful:

Looks don't mean anything, but confidence does. You could be the most attractive person in the room, but if you have no confidence, if you have a bad personality, nobody is going to want to touch you. However, you could be the ugliest person in the room, but if you have the confidence, and a kick-arse personality, the the world is your oyster.
So, the big question, is Arthur Fleck an incel? I'm not entirely sure. He certainly doesn't act like it, not at first. But as he is driven further and further into insanity, we begin to see him lash out at people. He kills his boss, he kills his mother, and in the grand finale, he kills Murray Franklin live on national television. Yeah, in a way he is taking his frustrations out on people, but you can hardly call them innocent. His boss certainly isn't.

What about Murray Franklin - is he deserving of death? Well, it is interesting that Arthur tells a rather gruesome joke and is chastised for it. Yet, we see Murray constantly using Arthur as the butt of his jokes, and this certainly goes down pretty badly since we do know that Arthur does hold Murray in high regard. Mind you, what we also discover is that the original plan is to kill himself on television - he wants his death to be much grander than his life. Well, that certainly changed pretty quickly.

Is he the Joker
Now, this is the biggest question of them all. Notice how the title of the film is 'Joker' as opposed to 'The Joker'. That is certainly quite misleading, especially since we go into the film believing that it is the origin story of The Joker. Well, it is what one would call a bait and switch. Personally, the way Arthur's character is constructed, I'm not entirely sure whether we can consider him to be the 'Clown Prince of Crime'. This isn't just because of the ending, but also because of who he is.

Honestly, Arthur Fleck just doesn't seem to have it in him - he is simply too disconnected from reality to be able to fulfil that role. The thing is that the Joker might be crazy, random, and out to sow chaos wherever he goes, but the one thing I get is that he still has his wits about him - this is certainly the case with Heath Ledger's Joker, as was the case with Jack Nicholson.


The other thing is that while he might be able to inspire people, and he certainly does inspire people, I'm not entirely sure if he will be able to lead people, not in the way that The Joker is able to lead people. Then again, what we have is a symbol, a symbol of somebody rising up against society, a symbol of somebody lashing out against the structure that exists.

What we also have are an awful lot of people who have decided to take on his form. At the end of the film, the entire city is full of people who have dressed up as clowns. Then, of course, we have the ambiguity of the ending, particularly since it is more than possible that he was actually killed in the car crash. Remember that early on in the film he suggested that he feels more comfortable in an institution - well, that is where he ends up in the end, and it certainly is much cleaner than the asylum that we saw in the film.

Anyway, there is so much more that I could write, such as the nature of mental illness as portrayed in the film. Yet, in a way, Arthur's condition seems to go far beyond that to be bordering on being complete disabled, in the same case as his mother. It is also interesting that it seems that his mother has also is unable to discern reality, except for the fact that the whole affair thing is quite ambiguous as well.

However, I guess it is time to bring this to an end. I'm sure there are many other thoughts on the film, but these, well, these are just mine.
Creative Commons License

Joker - The Flip Side of a Dark Coin by Dave 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

Friday, 27 September 2019

Introduction to Databases

Okay, now we come to one of the fundamental uses of computers, and that is basically storing data. In fact, data is pretty much everywhere and like it or not, we are not only using it constantly, but we are also generating it. For instance, every time we look for a place on Google Maps we are accessing data, and in turn, if we have 'location sharing' turned on, and our phone in our pocket (or in our hands scrolling through our newsfeeds), then pretty much everywhere we go is being recorded. Actually, to add a further point, every search we enter into Google, and every website we visit is not only being recorded, but is also being stored in a database. Sure, we might be using DuckDuckGo instead of Google, and we might have private browsing turned on, but the thing is that all of this information is still being stored, namely in the databases managed by our ISPs (namely because the government has specifically legislated that this is done).

So, this subject basically covers two things - how data is stored, and how data is accessed, and to say that these two things are vitally important in our modern society is somewhat of an understatement. Look, I could go into the ethics and problems with all of this, but at this stage what I'll be writing about is the fundamentals of Database Management, as well as information regarding SQL (Structured Query Language), which is the language that is used to search databases (and while many people pronounce it as Sequal, I still like to call it Squirrel).

Anyway, to get an idea of how a database is set up consider the diagram below.


As you can see above, there are three layers to the database - the user, the Database Management System (DBMS), and the databases. The data in the database is actually stored on the hard drive, and the DBMS is the program that is used to store, access, and change the data in the database, but first of all let us consider the user.

Users

So, you could say that there are three types of users: the Administrator, the Developer, and the End User.

Administrator: This person pretty much has complete control over the database. They will be the one who builds the database from the ground up, and they also define the schema, which is basically how the database is laid out, how the data is stored, and the structure that the database takes. The administrator is also the one that grants privileges to other users, and you could say that they are the givers, and they are also the ones who take away.

Developer: Some of the major websites are a bit sly when it comes to handing out the role of the developer. The reason I say that is that these databases, despite the fact that they do rake in huge amounts of money, manage to get people to do this for free. Mind you, the role of the librarian on Goodreads, and the actual developer problem to drift apart in places.

Anyway, the developer basically manages the database, and have certain roles assigned to them from the administrator, including updating data and also being able to retrieve data that an end-user might not be able to. For instance, a Facebook user can only perform certain searches on the website, whereas a developer would be able to perform much more detailed and extensive searches, such that a user might not be able to do.

End-User: Yep, these people are us, though in some cases, such as the insurance company where I used to work, they would also be the average employee. Once again, it is difficult to assign specific roles considering that some end-users, such as the claims consultant, will tend to have much greater access to the database than the customer, who will only have access to information relating to their particular insurance policy. However, all things being simple, users generally fall into one of these three categories.


Schema

This word was thrown about above, and basically, as mentioned, is how information is stored in the database. The schema is determined by the administrator and deals with what sort of data is being stored. Further, the schema also sets out restraints on the data that is being stored in the database. However, to explain it better, let us use a real-world example, namely a customer database.

So, a company will have a list of all their customers (and note that companies tend to go to great lengths to build such databases, and will do many things to attempt to get you onto that database). So, a customer will have a customer number, and the restraint will be that each customer has to have it and that it has to be unique. Then there will be other things, such as a name, an address, an email address, and maybe even a date of birth.

Now, this will be written as such:

customer(custNo, name, address, email, DoB)
 
This is known as the relationship schema, basically how the data on the customers is recorded. 

Metadata

Now, there is also this concept of metadata, something that has basically be bandied around a bit in the halls of power of late (we don't want your data, we just want your metadata - George Brandis - though you can find out more about what these laws mean here.). So, what is metadata - well, it actually isn't your data, it is just that which identifies data - namely the schema is a form of metadata. Further, there is also the type of data that is stored here. So, the name will be text, as will be the address. The email is a specific type of text, while the date of birth will be a date.

Metadata also deals with constraints on data, as mentioned above, and also includes user privileges and the like. Though, honestly, now that I know what metadata actually is, it sort of makes me wonder how that information is going to be at all useful for the government to keep track of us, though this does sort of bring us to our next point - SQL. One thing that metadata allows us to do is to search and retrieve data.

SQL - The Language of Search

As I mentioned above, SQL stands for 'Structured Query Language' but as it turns out, it is more than just a simple language of search. However, before I continue, the best way to learn any programming language is through practice, and one of the best tools available happens to be W3 Schools. Unlike other sites, this site is completely free and allows you to practice to your heart's content. So, while I will in later posts be talking about SQL and how to use it, these websites are actually much better for practice.

The thing with SQL, as I have already mentioned, is that it is more than just a language for searching for things in a database. It is also a 'Data Definition Language' meaning that it is a language in which you can design databases and set out the schema. It is a 'Data Query Language' which basically means that you can use it to search for information in the database. Finally, it is also a 'Data Manipulation Language' which means that you can use it to change data in the database.

Oh, and you may have seen this cartoon:

Source: https://xkcd.com/327/
Well, our wonderful mother is actually using SQL here in its data definition form. In fact, as you get to know SQL much more you will be regularly encountering the phrase DROP TABLE.

The other thing about SQL is that it is a 'declarative' language, meaning that you use it to tell the computer the problem you wish to solve. This differs from a 'procedural' language in that there you tell the computer how to solve the problem. The thing with declarative languages is that they tend to be short and simple, though the problem does arise where you don't actually know whether you have entered the instructions correctly or not.

To give you a bit more of an example of the difference, say we want to count the number of customers we have in our database. Well, we would use the following command:

SELECT count(custNo) FROM customer;

Here is the same program in the C programming language:



Concurrency

Databases operate on the principle of concurrency, which means that multiple users need to be able to access it at the same time. Actually, I still remember a database I used to use at work, and one of the biggest problems we had was that two people could not access the same claim at the same time - it would throw up errors. They did eventually solve the problem, but it did take quite a while.

Now, when an operation is performed on a database, a process known as a transaction, it must result in an all or nothing approach. That means that it is either fully completed, or nothing happens at all. There are no half measures when it comes to databases. The other thing is that once the operation has been performed, the database needs to be saved, otherwise everything will be lost. Then again, that goes with quite a lot of other programs as well.

So, this comes down to a system that is known as ACID:

Atomicity - this is the all or nothing approach.
Consistency - like atomicity, when a transaction is performed it must go from a consistent state to a consistent state, meaning that after a transaction, the results cannot be negative.
Isolation - basically each transaction performs in isolation from all the other transactions being performed. Namely, the database needs to prevent the users from interfering with each other.
Durability - the effect of the transaction, once completed, can never be lost.  
So, I'll finish off here with another diagram, just so you get the picture.

 
Creative Commons License

Introduction to Databases 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

Sunday, 15 September 2019

MoMA comes to Melbourne Part 2

Since I really can't decide what works or art to include in my post, and what works not to, I have decided to split this post (though this is something that I seem to do quite regularly when it comes to a lot of these posts on the various exhibitions that I have been to). Anyway, in the previous post we had been following the evolution of art up to the 1920s, but now we move further on, to another style, with one artist we may all be familiar with - Salvador Dali.

Inner & Outer Worlds

What seems to be happening now is that artists began to move away from a lot of the abstract art that had developed over the 1920s, particularly the styles were the artist basically only painted colours as shapes, something that had somehow grown out of cubism, as exemplified by Picasso. Now we move into another realm, one much more surreal, with the likes of Salvador Dali, Yves Tangey, and Rene Margritte.

Thus surrealism was born, a movement that basically arose out of Paris. Here the artists had become much more meticulous, and in fact were able to create imagines, and panoramas, that were not only precise, but also seemed to stretch the boundaries of reality. In a way it seems that they had not just moved forward, and away, from the works of the impressionists, but also back to the world were precision in art was much more important.

Yet Europe was racked by disorder and turmoil, and with the treat of war rising once again, many of the artists decided to move elsewhere, and suddenly found themselves over the ocean in places like the United States, Mexico, and Cuba. Here the artists would influence, and in turn be influenced by, the styles that had developed therein. Anyway, let us start with a painting that we are probably all familiar with:


And here we are, Persistence of Memory by Salvadore Dali, a painting that he describes as his most 'imperialist fury of precision'. In a way he is trying to capture the idea of memory, something that seems to be able to take solid shapes, and objects, and to be able to morph and transform them into something completely different. Here we have once solid watches, oozing off the side, as another is attacked and destroyed by ants. We also see in the distance, yellow cliffs, a memory of Dali's homeland in Catalonia, disappearing into the vague white area of forgetfulness. Yet there is something persistent about memory, and there are thing which, no matter how hard we try, or how long time passes, just always seem to remain, something that is no doubt also represented by the clocks.



This painting is called Gare Montparnasse, or the Melancholy of Departure, which was painted by Girogio de Chirico. Gare Montparnasse is a station located in Paris, which happened to be located near where Chirico would work. This is a painting of contradictions, with the vanishing points just not quite working out the way that they are supposed to work out, which causes us to feel confused, and in a way a little uncomfortable. Another thing is that the title is about a departure, yet the train seems to be arriving, and further, the clock suggests that it is midday, yet the scenery feels that it is really another time of day. Was this all done on purpose? Quite possible, and maybe it is designed to throw us off, and make us think, especially since the painting, despite it's title, does feel a lot more upbeat and warm, and melancholy and depressing.



Well, it seems that there was nothing written on the little plaque underneath this painting, except of course for the title, Mama, Papa is Wounded, and the name of the painter, Yves Tangauy. Mind you, it isn't as if they really said anything all that amazing about the meaning behind the painting, but yeah, sometimes it came be pretty difficult to understand the meaning, even if the artist actually had a meaning. Once again, like the previous paintings, there is this shifting perspective, and also appears to be an apocalyptic landscape. The suggestion is that it evokes memories of the First World War, and of course there is this dark cloud manifesting there, as if the world itself is bleak and the horrors are still hanging around. This is all despite the fact that the world was experiencing huge economic progress, but no doubt this had a lot to do with trying to escape the horrors of the war.


Sometimes it is good just to paint things and let other people try to interpret what it is all about, but I'm still one of those people that feel that a painting (or any work of art) that the artist doesn't have some personal meaning that they are trying to express really has no value, except for maybe its aesthetic value. Anyway, this painting, by Jean Viro, is called The Portrait of Mistress Mills in 1790, which is modeled after an earlier painting of Isabella Mills. Of course, this looks nothing like the original painting (which is on display in the National Gallery of England, and you can see it here). It a way the metamorphosis is almost comical, as if the artist is making a mockery of the original painting. Then again, these paintings were an attempt not only to capture the subject's youth, and beauty, but also as a means of gaining some form of immortality.


And here is another painting by the master of turning a dirty paper napkin into a priceless work of art, Pablo Picasso (though this was hardly painted on a dirty table napkin), and is called a seated bather. Well, it doesn't look like she (and I suspect that the subject is female) is wearing any clothes, though it could be that the term bather refers to taking a bath as opposed to going for a swim. Yet the head I find really interesting - it is as if it is a microcosm of the painting as a whole. It certainly does not seem to be an actual head. In fact the entire body looks disjointed, almost as if it isn't a single person, but rather a collection of objects that have been thrown together that, if we look at it from another way, we can easily say that yes, this is a person.


This artwork is called Red Head, Blue Body by the Swiss artist Meret Oppenheimer. Yeah, it's difficult to come to an understanding of the meaning of this work of art, much like many of the works that appear in this collection. Of course, it can come down to 'what you will', though many critics resort to the use of colours. Personally, I don't care, but the thing that stands out is how the head, which is clearly supposed to be a human head, is connected to the body by a piece of string. In a way, to me at least, it suggests not just the fragility of the body, but more so the fragility of the neck, as if these to parts of us are just weakly held together.


This painting, simply called Gas, is apparently an amalgamation of many gas stations into a single image. In a way it captures not only the essence of modern America, as defined by the gas station, but also in a sense an aura of loneliness. Many gas stations seem to exist by themselves out on empty country roads, and while things may seem quiet, they also symbolise the lifeblood of modern Amercia, the fuel that keeps people moving from place to place, an important cog in the wheels of commerce.

Art as Action

So, now we move into the realm of the New York Surrealists of the 1950s. The previous years, those of the surrealists, focused on introspection, no doubt exploring the world that had emerged from the tragedies of the Great War, and in turn hurtling towards another, one that no one wished to get involved in. However, now we emerged from the ashes of this second war, with Europe and Asia rebuilding while the United States was now sitting on the top of the pile.

This was the beginning of what is now known as The American Century, and it is here that we begin to see the American artists move to the foreground, particularly out of New York, America's true cultural centre (not Los Angeles, as some have suggested, since while Los Angeles may be the cradle of Hollywood, in reality it is New York from which many of the great artists and writers of this era emerge). Here we are introduced to Jackson Pollock, and down the line we also come to meet Andy Warhol.


And here we are, Jackson Pollock's Number 7. Yeah, people are going to look at this and ask themselves 'what sort of rubbish is this?'. In fact, that is what was said when the Australian Government bought a Pollock for a huge amount because, well, it is just paint splattered on a canvas. The reality is that anybody could do something like this - it really doesn't take much skill. Sure, there is the claim that the painting represents the dance that Pollock was doing around the canvas, and others admire the style, but the truth is, Pollock, like Duchamp, is challenging the art world, and in many cases it is the name to which this artwork is attached that defines it, as opposed to the art itself. The reason nobody else can do a 'Jackson Pollock' is because there is only one Jackson Pollock out there. If I were to do the same thing, no doubt people would simply laugh, and accuse me of simply trying to copy him.

Okay, a red canvas that happens to have a bright red line painted down the middle of it. Well, if Jackson Pollock can create a painting worth millions of dollars simply by dancing over a piece of canvas while pouring paint onto it, then Barnett Newman can do exactly the same thing with a simple line. In fact, the plaque next to it talked about how it was a breakthrough style of abstract expressionism with a single line both uniting, and dividing, the canvas. Sometimes I wander who came up with these ideas, though it could simply have been Newman explaining to the art critics why they should even bother taking note of something like this. Of course, an empty room could do a lot as well.

Things as they Are

Now we arrive at the 60s and the emergence of the artistic styles known as Pop-Art, Minimalism, and Post-Modernism. Peter Salz criticised many of the artists of the time, claiming that all they were doing was reproducing things as they are, but in a way these artists were capturing the essence of the modern world, and celebrating America's coming of age. Pop-Art, in a way, was taking consumerism and turning it into an artform, while Post-Modernism was helping objects understand the meaning of their existence. As for minimalism, well, I guess a line down the middle of a canvas sort of says everything you need to know about that (not that Newman was a minimalist artist).


It is interesting, in a comic book, the above image would, well, simply be part of a story, and in fact we would probably read it and pass over it without much though. What Roy Lichtenstein did was that he took this single panel, put it in a frame, and hung it on the wall. Well, that started off a huge craze, though of course Roy Lichtenstein is the one that gets all the credit for it. Look, I don't even think I need to mention the comic (Sacred Hearts) because this image no longer forms part of the comic, and is now a piece of art in and of itself. In a way it does capture the essence of modern society, where we would rather die that admit that we need the assistance of somebody that we despise. What the true meaning of this panel was is now lost to time, because all that remains is the image.


Everybody knows what the map of the map of the United States looks like, but to Jasper Johns it was something more than that. In his words, he wanted to take something that we generally only give a furtive glance towards (unless of course you happen to be a map nerd, like myself) and turn it into something that will not only grab our attention but force us to look at it more closely. Well, taking a map of the United States, putting a frame around it, and hanging it in an art gallery is certainly going to do that, especially with all the art nerds spending countless ages trying to work out what it actually means, or just simply admiring the art for arts sake. Of course, he went further than simply getting a Rand McNally's map and framing it, because he created the map himself, much in the style of the Abstract Expressionists of the not too distant past.


In a sense much of modern architecture seems to be pretty much the same, at least when we look at them in isolation. However, when Bernd and Hiller Becher traveled about West Germany documenting various scenes of a declining industry, especially the towers that stood over coal mines, it become evident, particularly when put together, that even in an industrial world, a world where function is preferred over form, that everything seems to have a unique aspect to them. This is the case when we look at what initially appears to be a collection of photographs of 'Winding Towers' only to discover that no two are actually alike.


Honestly, it wouldn't be a MoMA exhibition without something on display by Andy Warhol, the king of Pop Art (well, I might be exaggerating things a bit there though). Mind you, I've already written a piece on him, especially since the NGV had an exhibition on his works as well. So, the above work is called, not surprisingly, Marilyn. It is a collection of screen prints, a medium that Warhol quite liked working with (and in a sense is a defining medium of the modern world). What these images capture is, well, the many faces of Monroe, particularly since this beloved actress sadly died of an overdoes at a rather young age, and not long after this work was produced


The above screen prints are in a way similar to the album covers we see above. The reason I raise that is because art, in many cases, is generally seen as being unique (to an extent, since means of mass producing works of art, such as through woodcuts, have been around for quite a while). However, with the inclusion of these album covers on the walls of the MoMA indicates an idea that art does not necessarily need to be unique, in the sense of being a unique object, such as a painting. Rather it is the image, an image that can be reproduced multiple times in multiple places. In fact, for this display, the designers of the covers are also included, though it turns out that, like a lot of commercial products, there tends to be more than one mind going into idea.


Honestly, I'm not sure which direction this is supposed to go, though I suspect that I have it upside down, if we base it on the direction it is supposed to be played. Yes, I know, this is an electric guitar, and yes, it was hanging on the wall of a museum. If you are familiar with your instruments though, you will recognise this as a Fender Stratocaster - probably the most popular electric guitar on the market. In fact, the designer, Leo Fender, who was an amateur electrician, designed it to be able to have interchangeable parts, and to also be able to be customised for the user. Then again, since my ability to play a musical instrument is basically non-existent, I guess I just have to admire the product of other people's work. However, one could almost consider this to be a work of art that is used to produce works of art.



Creative Commons License

MoMA comes to Melbourne Part 2 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

Sunday, 1 September 2019

Controlling the Flow

Once again we seem to be going over some old ground, particularly the second half of my post on the Intricacies of data transfer. However, there are a number of things that weren't discussed, and this is what we will be looking at, namely error control and flow control.

Both of these functions occur on the data link layer, which is a layer on the OSI model that exists above the physical layer. It is here that data is packaged into frames and then sent down to the physical layer where the data is then passed on to the destination. Basically, the functions that the Data Link layer looks after are addressing, packetising, error control, flow control, and access control. Now, we have already looked at error control previously, so now it is time to look at flow control.


At its basic level, flow control is a mechanism that is used so that one computer is not overwhelmed by a heap of data being sent to it by the sending computer. The process works on the sender sending a frame and then waiting for an acknowledgement before sending the next frame. This is flow control at its basic level. Further, there is a timer on both sides, so if the timer runs out on the sender's side, that indicates that the frame was not received, or if it was received, it was received with an error, so it sends it again. A similar function occurs on the sender's side, though what is being sent is an acknowledgement as opposed to the frame.

So, at the data link layer, the sender sends a series of frames each containing the data and some control information (known as the header). When the frame is received, the receiver then processes the data before passing it on to the higher level. Normally there is a buffer where frames are stored while they are being processed, and the sending entity needs to avoid sending frames at such a rate that the receiver is unable to process them in time resulting in a buffer overflow.


Stop and Wait

This is the simplest form of flow control. Basically the sender sends a frame, the receiver receives it, processes it, and then sends an acknowledgement. However, the acknowledgement will be for the next frame in the queue. So, if the sender sends frame 0, the receiver will respond with acknowledgement 1, or rather ack 1. This tells the sender that it should now send frame 1, which is the next frame in the queue. Once that is sent, received, and processed, the receiver then sends ack 0, which, once again, requests the next frame in the queue.

If the receiver is getting overwhelmed, it can stop the flow by not sending an acknowledgement, and then only send one when it is ready to receive the next frame.

Okay, time for some more maths, namely because when determining the length of the timer, we need to know a few other things, such as how long it will take for the frame to get from the sender to the receiver. So, first we have the transmission delay, or the length of time for the frame from the first bit to the last bit to leave the sender, and we get that by using the following formula:

T=L/R, or Time = Length of Frame/Transmission rate.

So, we have a frame that is the size of 12000 bits being sent along a medium that is a 100 Mbps link. The formula will then come out as follows:

T = 12000x(1s/108 bits).

We came up with that because the formula would be 12000/100 Mbps, which is 12000/108 bps, or 12000/(108/1). When we are dividing by a fraction, we actually flip the fraction and then multiply it, as such, which produces 12000x(1s/108 bits), however since 12000 x 1s is 12000, we end up with 12000/108 bits. Once again, we switch the sign of the indicie and then multiply it:

12000/10-8

We round down:

1.2 x 10-4

And plug the problem into our trusty calculator, which produces:

0.00012 seconds.

Well, let us fix this up a bit:

0.12 milliseconds

And that is the transmission delay, or the length of time it takes for the first bit to the last bit to leave the sender.

Next we go to propagation delay, which is the length of time it takes for the first bit to travel from the sender to the receiver. We get that using the following formula:

T = d/s, or distance divided by the speed that it takes for the bit to travel through the transmission medium, with the upper limit being the speed of light (and we aren't taking into account quantum entanglement here, namely because we haven't worked out how to utilise it). Signals traveling along copper wire travel at 2x 108 m/s

So, let us look at an example, namely the propagation delay between Cairns and Melbourne (which is about 4000 km).

Here it is on a map.
4x 106 m / 2x 108 m/s

4x 106 m x (1s / 2x 108 m)

4x 106 m / 2x 108 m

2 x 10-2 s or 0.02 seconds, or 20 milliseconds.

Sounds pretty slow doesn't, in the grand scheme of things. No wonder we need a proper working NBN.

The reason that we went through all of that math is basically to help us understand how long the timer should be set, because if it is set too short, then the whole flow control system will fail.

Sliding Window

The sliding window protocol is a way of speeding up this process. The stop and wait protocol can be pretty slow, because the frame has to be sent, and then the sender needs to wait for the acknowledgement, or the timer to expire, before sending the next frame. So, we solve this through the use of buffering. Basically the frames are stored in a buffer, and are held in the buffer until the acknowledgement is received, and when the acknowledgement is received, the sent frames are discarded and new frames are then loaded into the buffer. So, the receiver will have a buffer size of W, and the sender can send up to W frames without having to wait for an acknowledgement, as below:


Like the stop and wait protocol, the acknowledgement contains the number of the next frame expected. This works well for error control also, since if one of the frames received is in error, then that, and the subsequent frames, are discarded and an acknowledgement is sent for the frame that was in error. There is also the RNR, or receive not ready, which means that the frames have been received, but it is not ready to receive any further frames. So at the sending end, the sequence number of those sent is maintained, and as the acknowledgements are received, the window grows. A similar function occurs at the receiving end.

In the case of duplex system, there needs to be two sliding windows at either end. In this situation we can utilise a method called piggy backing, which means that each frame that is sent carries a frame, and an acknowledgement, as such:

When Errors Occur

Well, as mentioned, both sides need to buffer data just in case an error is received. If an error is received, the sender continues to send the data until an acknowledgement is received that the frame was received correctly. The sender needs to buffer data to resend any frames that were either lost or damaged, while the receiver needs to buffer data just in case frames are received out of order.

Also, acknowledgements may not be received, which means that after the time out, the sender will resend the frame. When the receiver receives the frame that it has already received, it just discards it and resends the acknowledgement. This diagram might be useful:

Then there is also the Go Back N ARQ, in which the size of the frame is always 1. However, the sender does have a buffer, just in case an acknowledgement is not received.


We also have the idea of the negative acknowledgement. So, if a damaged frame is received, then the receiver will send a negative acknowledgement requesting that the frame be resent. If there is no buffer at the receiving end, frames will continue to be discarded until the correct frame is received. However, if there is a buffer, then subsequent frames will be received, and when the damaged frame is resent, it can be reordered into where it was supposed to go. The greater the size of the buffer at the receiver's end, the less repeat transmissions that there are, though this makes it somewhat more complex to implement.


So, that is flow control, and error control. Next time we will look at multiplexing, or how we send multiple signals along the same channel.

Creative Commons License

Controlling the Flow 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