Tuesday, 12 September 2017

Internet of Things (IoT) - Next Stage of Information Revolution

The term "Internet of Things" was first coined by Kevin Ashton, cofounder and executive director of the Auto-ID Center at MIT in 1999.

The "Internet of Things (IoT)" is the next stage of the Information Revolution. 

What is IoT (Internet of Things)?

IoT refers to the connection of devices (other than computers, smartphones and tablets) to the Internet via embedded sensors. It allows devices to talk to us and talk to each other. So, IoT can also be defined as a network of internet-connected devices able to collect and exchange data using embedded sensors. 

A thing, in the "Internet of Things", can be a person with a heart monitor implant, a farm animal with a bio-chip transponder, an automobile that has built-in sensors to alert the driver when tire pressure is low or any other natural or man-made object (almost anything else you can think of) that can be assigned an IP address and provided with the ability to transfer data over a network with the help of embedded sensors. 

Earlier the data was created by people on the internet, but now the data will be created by the things (living or non-living) without any human intervention.

IoT Devices

Any stand-alone internet-connected device that can be monitored and/or controlled from anywhere. It should have embedded sensors and on/off switch. It should have the ability to represent itself digitally means it can be assigned an IP address and have the ability to collect and transfer data over a network without manual assistance or intervention. 

Due to the limited address space of IPv4 (which allows for 4.3 billion unique addresses), IoT devices will have to use the next generation of the Internet protocol (IPv6) to scale to the extremely large address space required.

Examples of IoT Devices: Smartwatch, TV,  Refrigerators, Washing Machines, Kitchen Appliances, Thermostats, Cars, Switches, Lights, Blood Pressure and Heart Rate Monitors, Smart grids, Virtual Power Plants, Intelligent Transportation and anything you can think of.

Basically, if your fridge or TV has an Internet connection, then it becomes an IoT device.

If your coffee maker connects to an app on your smartphone that allows you to begin brewing with a tap on your screen, that coffee maker becomes part of the Internet of Things.

As per IoT, Anything that can be connected, will be connected. Connect everything in this world. The Ultimate Goal of IOT is to Automate Human Life. In this way, IoT creates a relationship among people-people, people-things, and things-things.

Applications of IoT

Wearables (like Smartwatches to track health and exercise progress, sleep patterns, send text messages and calls).

Smart Home (hundreds of products in the market that users can control even with their voices).

Smart Cities (solves traffic congestion issues, smart parking, reduces noise, crime, and pollution).

Connected Cars (to assist drivers and reduce accidents).

Internet of Things Devices & Examples

Amazon Echo - Smart Home: The Amazon Echo works through its voice assistant, Alexa, which users can talk to in order to perform a variety of functions. Users can tell Alexa to play music, provide a weather report, get sports scores, order an Uber, and more.

Fitbit One - Wearables: The Fitbit One tracks your steps, floors climbed, calories burned, and sleep quality. The device also wirelessly syncs with computers and smartphones in order to transmit your fitness data in understandable charts to monitor your progress.

Barcelona - Smart Cities: The Spanish city is one of the foremost smart cities in the world after it implemented several IoT initiatives that have helped enhance smart parking and the environment.

AT&T - Connected Car: AT&T added 1.3 million cars to its network in the second quarter of 2016, bringing the total number of cars it connects to 9.5 million. Drivers don't have to subscribe or pay a monthly fee for data in order for AT&T to count them as subscribers.

Other articles on IoT:

Real World Examples of IoT (Internet of Things) - How will IoT change our lives?

Monday, 10 July 2017

Computer Science Internationalization - Unicode Encoding & Decoding

Several years ago I devised this visual and fun way to teach and practise encoding and decoding Unicode. I used this method in my International Computing class. This method involves use of pencil and eraser.

The codepoints and the UTF-8 are all written in hexadecimal(hex). The binary bits are an intermediate form for the purposes of encoding and decoding.

We start with the following form which is designed for encoding Unicode codepoints to UTF-8 and decoding UTF-8 to Unicode codepoints.
Encoding: We will start with encoding Unicode codepoints to UTF-8.

The first thing we can do is fill in the fixed bits. They are the fixed bits defined by the encoding scheme. I have entered the fixed bits in red to make them distinct from variable bits.
Now we will write one or more Unicode codepoints on the form. These will be the codepoints we will encode into UTF-8. The codepoints should be written in hexadecimal. I will use the codepoints U+0444 and U+597D.

So, how do we determine where the codepoints go on the form. We need to look at the free bits to determine the range of values that can be accommodated.

  • 1 byte row - 7 free variable bits giving a range of 0 ➔ 7F
  • 2 byte row - 11 free variable bits giving a range of 80 ➔ 7FF
  • 3 byte row - 16 free variable bits giving a range of 800 ➔ FFFF
  • 4 byte row - 21 free variable bits giving a range of 10000 ➔ 1FFFFF (the actual maximum value of a codepoint is 10FFFF)
Now we know the ranges we can put U+0444 and U+597D in the correct places of the form.

We have empty boxes into which we write the binary values of the codepoints.
Finally, we take the complete bytes and write them as hexadecimal values to form the UTF-8 encoded forms. U+0444 encoded is D184, U+597D encoded is E5A5BD.
Decoding: Now onto decoding from UTF-8 to Unicode codepoints. We will decode the UTF-8 F0AA9FB7 which I have entered onto the form. I have used spaces on the form to make the byte boundaries more obvious.
Complete the bytes by writing the binary variable values.
Extract the variable binary values to form the hex Unicode codepoint U+2A7F7.
Whilst I was at it, I completed a single byte entry. The single byte characters are ASCII characters. ASCII is a subset of Unicode.

It is a Unicode convention, when writing codepoints, to use a minimum of four hex digits. So for codepoints <1000, one should left pad with zeroes. Hence my entries U+0444 and U+0057 rather than U+444 and U+57.

Sunday, 2 July 2017

Computer Science Internationalization - Text Search

So, you have just written some Cool Code which will search for and find occurrences of specified text strings. You have access to Big Data text eg all the text in all public webpages. You will,of course, want to test your Cool Code. Letสผs perform some, seemingly, very simple tests.

Letสผs search for the word 'Scorpion'. Your code works just fine and hence finds all occurrences of the word 'Scorpion'.

Now test with the following two words.

  • Scorpion
  • Scorpion

Your Cool Code works fine as all I have done is applied some CSS styling, thus giving each of the two words differing appearance.

Now test you Cool Code with the following two words.

  • ๐‘†๐‘๐‘œ๐‘Ÿ๐‘๐‘–๐‘œ๐‘›
  • ๐’๐œ๐จ๐ซ๐ฉ๐ข๐จ๐ง

If you have only programmed for ASCII text then your now not so Cool Code will fail. These two words have differing appearance because they are not made up of the ASCII characters you are familiar with. These words use characters from the Unicode Math Alphanumeric Symbols block, U+1D400-1D4FF.

Should the Math Alphanumeric Symbols Scorpion be treated the same as the ASCII Scorpion wrt the search results of your code? In this context I think "Yes", most definitely. A person reading this blog, for example, will just perceive the word Scorpion whatever characters are used to write the word. The reader may well also visualise the insect with a "sting in the tail"๐Ÿ˜ฑ

What of current working practice?

With twitter, a user has no means of changing text style within a tweet. It has thus become common to use Unicode Math Alphanumeric Symbols to change appearance. I could, for example, use Unicode Math Alphanumeric Symbols to emphasise a word (eg Scorpion) or phrase within a tweet. The meaning of the tweet remains the same.

Google returns the same number of search results whichever of the above forms of Scorpion I use. At time of writing this is "About 144,000,000 results". I deduce Google is treating ASCII Scorpion and Unicode Math Alphanumeric Symbols ๐‘†๐‘๐‘œ๐‘Ÿ๐‘๐‘–๐‘œ๐‘› & ๐’๐œ๐จ๐ซ๐ฉ๐ข๐จ๐ง as equivalent.

Sogou ๆœ็‹— is a Chinese search engine. Using Sogou: ASCII Scorpion returns 93,341 results, Math Alphanumeric Symbols ๐‘†๐‘๐‘œ๐‘Ÿ๐‘๐‘–๐‘œ๐‘› returns 4,738, Math Alphanumeric Symbols ๐’๐œ๐จ๐ซ๐ฉ๐ข๐จ๐ง returns 61. I think it evident that Sogou does not treat my three forms of Scorpion as equivalent.

I side with Google on this.

Here is a taster of what is happening in the behind the scenes technicalities of Unicode. Letสผs take just one of the Unicode Math Alphanumeric Symbols I have used, ๐’ MATHEMATICAL BOLD CAPITAL S U+1D412. If you visit codepoints.net/U+1D412 you will see a wealth of information about this character. Of relevance to this blog is the Decomposition Mapping which is to the, oh so familiar, ASCII uppercase capital S. This Unicode information can be used to compute string equivalents which can then be used for search thus providing all relevant results.

The moral of this "Sting in the Tale" is: If you do not already know it, you must learn Unicode, it is essential.

Friday, 28 April 2017

Computer Science Internationalization - Hieroglyphs in Domain Names

I have been aware for a long time that domains such as .com support many human language scripts. Verisign's .com includes support for Hiragana, Gurmukhi, Han, Tibetan, Sinhala, Devanagari, Hangul and many more.

But what of Verisign's .com equivalents .ใ‚ณใƒ  (Japanese) and .๋‹ท์ปด (Korean)? Both of these support a multitude of human language scripts. The supported scripts for many, but not all, Domains are listed in the IANA Repository of IDN Practices iana.org/domains/idn-tables.

Whilst browsing this repository, I discovered there are sixteen domains, all belonging to Verisign, which support Egyptian Hieroglyphs which I think is totally cool! Verisign's .com, .ใ‚ณใƒ  and .๋‹ท์ปด all support Egyptian Hieroglyphs. This means one can register domain names such as:-

  1. ๐“‡‹๐“ˆ–๐“๐“‚๐“‚‹๐“ˆ–๐“„ฟ๐“๐“‡‹๐“ฏ๐“ˆ–๐“„ฟ๐“ƒญ.com
  2. ๐“‡‹๐“ˆ–๐“๐“‚๐“‚‹๐“ˆ–๐“„ฟ๐“๐“‡‹๐“ฏ๐“ˆ–๐“„ฟ๐“ƒญ.ใ‚ณใƒ 
  3. ๐“‡‹๐“ˆ–๐“๐“‚๐“‚‹๐“ˆ–๐“„ฟ๐“๐“‡‹๐“ฏ๐“ˆ–๐“„ฟ๐“ƒญ.๋‹ท์ปด

It is possible you do not have an Egyptian Hieroglyph font on your device so here are the domain names in image format.

Google provide a free Egyptian Hieroglyph font which you can download from google.com/get/noto/

Does the Egyptian Hieroglyph string I have used above mean anything? It is actually a transliteration of the English word international. I used ngm.nationalgeographic.com/ngm/egypt/translator.html for the transliteration. The hieroglyphs translator presents the Egyptian Hieroglyphs as images. So, no simple copy and paste of Egyptian Hieroglyph text. I had to match with the appropriate Unicode characters by visual inspection. I cannot guarantee I made all the correct matches but I think I have them correct.

Here are some registered and live Egyptian Hieroglyph Domain Names egyptianhieroglyphic.com/egypt/egyptian-hieroglyphics/

Friday, 31 March 2017

Computer Science Internationalization - Adaptive URL

A URL can consist of a Domain Name and a pathname. In the examples below x.y.z represents the Domain Name, the remainder being the pathname. My experience of the internet is that the pathname is usually written in English or more accurately ASCII. The below ASCII pathname represents a multi-page website in the form of a journey from home to a hotel in Korea.

x.y.z/home/bus/airplane/korea/taxi/hotel

Websites, such as Google, adapt the language of their text content according to the browser preferred display language (BL). This browser preferred language can be set by the user. Letสผs go one step further than Google and adapt the language of the URL pathname according to the BL. Here is the ASCII pathname rewritten into Chinese, Japanese and Korean.

x.y.z/ๅฎถ/ๅ…ฌๅ…ฑๆฑฝ่ฝฆ/้ฃžๆœบ/้Ÿฉๅ›ฝ/ๅ‡บ็งŸ่ฝฆ/้ฅญๅบ—

x.y.z/ใƒ›ใƒผใƒ /ใƒใ‚น/้ฃ›่กŒๆฉŸ/้Ÿ“ๅ›ฝ/ใ‚ฟใ‚ฏใ‚ทใƒผ/ใƒ›ใƒ†ใƒซ

x.y.z/ํ™ˆ/๋ฒ„์Šค/๋น„ํ–‰๊ธฐ/ํ•œ๊ตญ/ํƒ์‹œ/ํ˜ธํ…”

So, how do we implement these language adaptive URL parthnames? Firstly, we need to programmatically determine the BL. One way of achieving this is to examine the Accept-Language http header sent from the browser to the server. This will contain one or more language tags. If there is more than one language tag they are presented in priority order. Language tags can take many forms. They include: zh, zh-CN and cmn for Mandarin Chinese; ja for Japanese and ko for Korean. Now that we can determine the BL we can select the appropriate URL pathname, thus internationalizing our website with a language adaptive URL pathname.

On a Linux machine, each component of the pathname will be a directory. In my schema I am assuming an index.html or index.php, per directory. A requirement of this schema is that we do not want a directory hierarchy for each language, nor do we want an index.html or index.php for each language.

My native language is English so I will make my master pathname directory names English ie home, bus, airplane, korea, taxi and hotel. I will make the Chinese, Japanese and Korean directory names as aliases to the English named master directories. This can be easily achieved on Linux with the ln -s command, where ln means link and the -s option means create symbolic link, as opposed to a hard link.

ln -s home ๅฎถ
ln -s home ใƒ›ใƒผใƒ 
ln -s home ํ™ˆ

ln -s hotel ้ฅญๅบ—
ln -s hotel ใƒ›ใƒ†ใƒซ
ln -s hotel ํ˜ธํ…”

What if your native language is not English? In that case, create the master pathname directory names in your native language. If your native language is Korean then the master directory names will be ์ง‘, ๋ฒ„์Šค, ๋น„ํ–‰๊ธฐ, ํ•œ๊ตญ, ํƒ์‹œ and ํ˜ธํ…” and your links will be:

ln -s ํ™ˆ home
ln -s ํ™ˆ ๅฎถ
ln -s ํ™ˆ ใƒ›ใƒผใƒ 

ln -s ํ˜ธํ…” hotel
ln -s ํ˜ธํ…” ้ฅญๅบ—
ln -s ํ˜ธํ…” ใƒ›ใƒ†ใƒซ

Emoji are hugely popular so letสผs construct a totally cool Emoji pathname.

x.y.z/๐Ÿก/๐ŸšŒ/✈️/๐Ÿ‡ฐ๐Ÿ‡ท/๐Ÿš•/๐Ÿจ

ln -s home ๐Ÿก
ln -s bus ๐ŸšŒ
ln -s airplane ✈️
ln -s korea ๐Ÿ‡ฐ๐Ÿ‡ท
ln -s taxi ๐Ÿš•
ln -s hotel ๐Ÿจ

I have never encountered an Emoji URL pathname on a website and so implementing such a pathname on your website would be both totally cool and unique. You could also use an Emoji pathname for those languages your website does not support. My schema only supports Chinese, English, Japanese and Korean. If the BL was an unsupported language, such as Arabic, then the Emoji pathname could be displayed in the browser address bar instead of, for example, defaulting to English.

I have used x.y.x to represent the Domain Name, the implication being it is ASCII. We can complete the language adaptive equation by having Domain Names in supported BL languages. Thus my completed equation schema would have Chinese, Japanese and Korean Domain Names in addition to an ASCII Domain Name.

Friday, 17 March 2017

Computer Science Internationalization - EAI

As I stated in schappo.blogspot.co.uk/2017/01/chinese-email-address.html both DataMail and Google mail support Email Address Internationalization (EAI). DataMail provides a complete EAI service which includes both support and creation of Internationalized email addresses. Google Mail provides a partial EAI service, in that, it supports EAI but does not yet provide for creation of internationlized email accounts with internationalized email addresses. Thus organisations using Google Mail have an advantage over those organisations having an ASCII addresses only email service and have a head start in provision of a complete EAI service.

Given the Domain name of an organisation, the Unix host command can be used to determine the mail service provider. Here are some of the organisations using Google Mail:


่‹นๆžœ็”ต่„‘ ~: host spotify.com
spotify.com has address 194.132.198.198
spotify.com has address 194.132.197.198
spotify.com has address 194.132.198.149
spotify.com mail is handled by 10 ASPMX3.GOOGLEMAIL.com.
spotify.com mail is handled by 1 ASPMX.L.GOOGLE.com.
spotify.com mail is handled by 10 ASPMX2.GOOGLEMAIL.com.
spotify.com mail is handled by 5 ALT2.ASPMX.L.GOOGLE.com.
spotify.com mail is handled by 10 ASPMX5.GOOGLEMAIL.com.
spotify.com mail is handled by 5 ALT1.ASPMX.L.GOOGLE.com.
spotify.com mail is handled by 10 ASPMX4.GOOGLEMAIL.com.

่‹นๆžœ็”ต่„‘ ~: host twitter.com
twitter.com has address 104.244.42.129
twitter.com has address 104.244.42.1
twitter.com mail is handled by 30 aspmx3.googlemail.com.
twitter.com mail is handled by 10 aspmx.l.google.com.
twitter.com mail is handled by 20 alt1.aspmx.l.google.com.
twitter.com mail is handled by 30 aspmx2.googlemail.com.
twitter.com mail is handled by 20 alt2.aspmx.l.google.com.

่‹นๆžœ็”ต่„‘ ~: host mixi.jp # ใƒŸใ‚ฏใ‚ทใ‚ฃ
mixi.jp has address 52.198.59.66
mixi.jp has address 54.92.71.226
mixi.jp has address 52.198.89.90
mixi.jp mail is handled by 30 aspmx2.googlemail.com.
mixi.jp mail is handled by 10 aspmx.l.google.com.
mixi.jp mail is handled by 20 alt2.aspmx.l.google.com.
mixi.jp mail is handled by 20 alt1.aspmx.l.google.com.
mixi.jp mail is handled by 30 aspmx3.googlemail.com.

่‹นๆžœ็”ต่„‘ ~: host bristol.ac.uk # University of Bristol
bristol.ac.uk has address 137.222.0.38
bristol.ac.uk mail is handled by 5 ALT1.ASPMX.L.GOOGLE.COM.
bristol.ac.uk mail is handled by 10 ASPMX2.GOOGLEMAIL.COM.
bristol.ac.uk mail is handled by 1 ASPMX.L.GOOGLE.COM.
bristol.ac.uk mail is handled by 10 ASPMX3.GOOGLEMAIL.COM.
bristol.ac.uk mail is handled by 5 ALT2.ASPMX.L.GOOGLE.COM.

่‹นๆžœ็”ต่„‘ ~: host bathspa.ac.uk # Bath Spa University
bathspa.ac.uk has address 194.83.160.0
bathspa.ac.uk has address 162.13.24.154
bathspa.ac.uk has address 72.47.217.0
bathspa.ac.uk mail is handled by 10 ALT4.ASPMX.L.GOOGLE.COM.
bathspa.ac.uk mail is handled by 5 ALT2.ASPMX.L.GOOGLE.COM.
bathspa.ac.uk mail is handled by 1 ASPMX.L.GOOGLE.COM.
bathspa.ac.uk mail is handled by 5 ALT1.ASPMX.L.GOOGLE.COM.
bathspa.ac.uk mail is handled by 10 ALT3.ASPMX.L.GOOGLE.COM.
Providing a full EAI service involves going beyond ASCII. It entails supporting Unicode email addresses. Unicode email addresses such as my Chinese email ๅฐๅฑฑ@็”ต้‚ฎ.ๅœจ็บฟ

Tuesday, 31 January 2017

Computer Science Internationalization - Unicode Terminal Session

Below is an OSX bash shell command line terminal session. It is a real, working terminal session using basic unix commands. It does, though, look significantly different from a standard terminal session. If you know basic unix commands such as ls and cd, you should/may be able to work out what is happening.


่‹นๆžœ็”ต่„‘ ~: ๅฆˆ ๆˆ‘็š„็›ฎๅฝ•
่‹นๆžœ็”ต่„‘ ~: ่Œถ ๆˆ‘็š„็›ฎๅฝ•
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ไธฝ
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ๅคด ๆ–‡ๆกฃไธ€ ๆ–‡ๆกฃไบŒ ๆ–‡ๆกฃไธ‰
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ไธฝ
ๆ–‡ๆกฃไธ€ ๆ–‡ๆกฃไธ‰ ๆ–‡ๆกฃไบŒ
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ่ฏ > ๆ–‡ๆกฃๅ››
ไธ€
ไบŒ
ไธ‰
ๅ››
ไบ”
ๅ…ญ
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ่ฏ ๆ–‡ๆกฃๅ››
ไธ€
ไบŒ
ไธ‰
ๅ››
ไบ”
ๅ…ญ
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ไธฝ
ๆ–‡ๆกฃไธ€ ๆ–‡ๆกฃไธ‰ ๆ–‡ๆกฃไบŒ ๆ–‡ๆกฃๅ››
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ⇉ ๆ–‡ๆกฃๅ›› ๆ–‡ๆกฃไบ”
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ไธฝ
ๆ–‡ๆกฃไธ€ ๆ–‡ๆกฃไธ‰ ๆ–‡ๆกฃไบŒ ๆ–‡ๆกฃไบ” ๆ–‡ๆกฃๅ››
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: → ๆ–‡ๆกฃไธ€ ๆ–‡ๆกฃๅ…ญ
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•: ไธฝ
ๆ–‡ๆกฃไธ‰ ๆ–‡ๆกฃไบŒ ๆ–‡ๆกฃไบ” ๆ–‡ๆกฃๅ…ญ ๆ–‡ๆกฃๅ››
่‹นๆžœ็”ต่„‘ ๆˆ‘็š„็›ฎๅฝ•:

So, what is happening!?

Firstly I am using Unicode characters. If you search the internet you will find many examples of terminal sessions but they will invariably be using ASCII characters only. In my above terminal session I am using Unicode characters, mostly Chinese/Japanese and two arrow symbol characters.

Where are the commands such as ls and cd? I have mapped a set of commands to Unicode characters using the alias command eg alias ไธฝ='ls'

I have changed the command line prompt.

If you understand basic bash commands, I believe I have now given you sufficient information in order for you to work out what is happening in the terminal session. Knowing Chinese or Japanese gives a slight advantage but it is not essential to understanding this terminal session. The Chinese/Japanese characters I chose for the command mappings are somewhat random so it will not help you to google translate them.

I actually devised these command mappings and the terminal session several years ago. Today, I decided it was time to put it onto my blog. My main purpose was and still is, to encourage students to think beyond ASCII. I believe it has impact because it is so unexpected when one first sees this terminal session.

There can be many different permutations on the session using different human language scripts and unicode symbols. It makes for an interesting and unusual exercise for students studying unix. Absolutely no reason why one should not, for example, use emoji for the command mappings.