What are internet cookies and sessions?

What are Cookies and Sessions and how are they used by site owners? They are used to track your usage across their sites. Both store information about you as a user, which the site owner has deemed to be important for the user experience of the site. Cookies sit in the browser allowing browser-side technologies like JavaScript to access information while sessions are hosted on the server-side.

Cookies and sessions can be thought of as a text file which is programmed to store key information such as a Google Analytics ID. Cookies can be implemented by the site owner on behalf of third parties like Google; this is done so feedback on user experience (UX) of the site. Such things that are looked for include which pages on a site got views and which buttons on the page were clicked the most. It can also help with User Interface (UI) designs by conducting A/B testing – where they have one site running with two views. Based on the tracked UX and then implement which one they see as the most successful.

The rules for Cookie expiration is set via the website. By default, when you close the window and no expiration stored in the cookie information the cookies are removed. Banks would employee this method so that if you don’t click the log out, you can just close the window to get the same effect. Other sites may not want the cookies to expire at all like Google and Facebook. Since sites must set an expiry date even though they prefer their website to remember you despite several browser closings, the date is set to a very far future e.g. in 10 years. Sessions work similarly but instead of closing a window, it is set with an expiry or timeout.

Cookies and sessions do work together to keep you logged in after you close a window. This is done by a cookie that stores a session ID that corresponds to a session. Then when your next visit if both the cookie and the session have not expired it will use it to log you in. To avoid a hacker that would use the session ID stored in the cookie, best practice is to use HTTPS to encapsulate the communication while creating so only the sender and receiver can see the information. Another way is to verify your digital fingerprint i.e. check if the same computer is being used or if the IP address you’re using is the same.

Now I have heard that every time you log out of an account online specifically banking-related one you have to close the window and or browser completely. This is not true as the act of clicking the logout button tells the site that it must terminate both cookies and sessions related to the account you were using.

Sessions, while broadly similar to cookies, have a limitation and that it is limited to the site you are currently accessing as it’s stored on the server that’s hosting the site. Cookies are limited to a domain name i.e. comtechsup.com.au. However third parties like Google can put their cookies on to your site if the site builder includes the third party’s code into the site. The advantage of this is that Google can access google.com domain cookies on comtechsup.com.au as well. The site builder can pass information to google.com to make what Google collects more valuable, such as a user id. This site only shares the bare minimum information with Google such as what pages were viewed, what browser was being used and what IP Address the computer was using.

Google and Facebook can detect many actions that you do across all sites that have got their code implemented, which is one of the ways they target ads and search results for the specific user. They can even link your actions back to your account when you log in. This means that, even though you are not logged into Facebook, you were still tracked as if you were still logged into Facebook without having cleared your cookies. Facebook can associate the site activity back to you as the user. Due to how browsers work in keeping cookies and allowing access to cookies of the same domain, every tab can access the tracking cookies even though the tab isn’t directly Google or Facebook.

To anonymise yourself you could use plugins that stop the use of tracking cookies, you can use private mode in Firefox or Incognito mode in chrome. The private mode stops cookies from being used across multiple windows and/or tabs but also stops the browsers from keeping history. This can be limiting because if you accidentally close a tab or window you can’t reopen using history.

Cookies and sessions are small files stored server and browser sides of the internet communication that are helpful to businesses by learning about their customers’ usage of the site, to provide for more target adverting and/or build better UX/UI designs to achieve their goals of having a website. This means Facebook and Google are not free we are the products.

References:
http://www.faqs.org/rfcs/rfc2965.html
https://www.washingtonpost.com/business/technology/controversial-digital-ad-placement-leaves-tech-companies-scrambling/2013/08/21/3609306e-04d4-11e3-9259-e2aafe5a5f84_story.html
https://www.w3schools.com/js/js_cookies.asp
https://www.w3schools.com/php/php_sessions.asp
https://httpd.apache.org/docs/trunk/mod/mod_session.html#whatisasession

What is Simultaneous Multi-threading?

Simultaneous Multi-threading (SMT) is a feature to create multiple threads per core to provide slight performance gains in multi-threaded workloads. A thread is something you assign instructions and data to get a calculated outcome. A core is a physical processing unit and is found in the Central Processing Unit (CPU) among other equipment. Each core can either have 1 or 2 threads depending on if SMT is implemented. Intel uses its own propriety implementation of SMT called Hyper-Threading (HT), while AMD uses SMT.

Multi-Threaded workloads are pieces of software that can use multiple threads (regardless of being a core or a logical thread). These workloads it’s a bit like how 2 people work in a kitchen to make a meal that they both know the recipe of. They work together to cut down the time spent by one person on a meal.

Thread 1 (T1) will normally start getting pans ready, while Thread 2 (T2) will start on getting the boards, tools and ingredients to the prep area ready. Once the first task are done for T1 and T2, will grab at the ingredients and start. T1 will start with the meat, while T2 starts cutting/peeling ingredients for T1 to add when ready. This will go on till T2 has nothing left but to clean and T1 has finished combining the ingredients. T1 will be busy for longer than T2 because it’s the cooking thread. T1 and T2 are sharing resources and T1 in this case can reach a point where it’s waiting for the next ingredient being prepared by T2. The thread in charge of the cooking thread at this point will experience intermittent work spikes checking it hasn’t burnt.

This is how threads work allocating time to a predefined task and producing results. How SMT affects this is by creating a second logical thread on a core by replicating parts of the architecture and sharing resources with the core thread. This means resources such as the CPU cache and/or ram needs to be increased both in memory capacity and access speed.

SMT is also important as the number of cores increases, manufacturers have to make more traces between the CPU and other hardware resources such as RAM and Storage. Along with more traces the cores also needs more power to be delivered to it. Both of these combined increase the cost of the components to consumers. With SMT it allows the boards and CPUs to be cheaper while also drawing less power but can increase performance by 25 to 50% on depending on the CPU.

I tested the impact of HT on my Intel laptop by running Cinebench (a benchmarking tool for CPUs) before and after. I noticed a 30% drop when turned off in the score of my quad-core CPU. Though I did not notice an effect on the usability of the laptop in everyday tasks i.e. Web browsing, Blu-ray movies and Portal (A game).

Let’s say you want to listen to music on YouTube while you work on a large excel file for work. When the excel is calculating cells it may use 2 threads at 100% each on a dual-core SMT system, while the browser may only need 5% utilisation of the CPU and can be pushed on to a thread not being utilised. By contrast, a dual-core system without SMT the Excel file will take on 100% of both cores and when you try and get your music loaded the CPU will have to prioritise thus slowing both down.

Simultaneous Multi-Threading is the creation of a logical thread next to a core thread. Which in turn provides a method of processing faster with less power, lower costs and all the while it cuts down processing times on big tasks. Although SMT like MT is useless if the programs don’t use multiple threads.

References:
http://www.cs.cmu.edu/afs/cs/academic/class/15740-f03/www/lectures/smt.pdf

What is Artificial Intelligence?

Firstly what is Artificial Intelligence (AI)?, This is hard to define as this question also implies that we agree on the definition of intelligence and on the goal of developing AI. Howard Gardner (1983) floated a theory of Multiple Intelligence in his book Frames of Mind: The Theory of Multiple Intelligences. In this book, he listed 8 possible types of intelligence. These are musical, visual-spatial, verbal-linguistic, logical, bodily, interpersonal, interpersonal and naturalistic. AI should be able to demonstrate at least one to be classified as intelligent. According to IBM, among other things, AI must also include Machine Learning (ML) which allows it to learn from others and from its own mistakes or failures. ML as defined by IBM is a subset of AI but is sometimes mistakenly used interchangeably with AI in marketing material.

The broad goal of AI is to make computers mimic the ability of humans to learn, react and create all while interacting with their environment. AI also has the potential to think in abstract ways to solve human problems.

We have all interacted with AI in form or another whether you have known about it or not. Some games have AIs in the form of bots, think of a role playing game such as Star-Craft or computer chess. In both cases they are told the rules through algorithms of the game they are playing. In the case of the chess bot it uses a method called brute force where it tests all possible of moves the human could make and find the moves to make in response for the best outcome nor does it learn from the consequences of its own actions or that of the player. These examples do not implement ML thus excluding them from being AI by the modern definition.

Some common AI’s we have interacted with are Siri, Alexa and Google Home. These helpful assistants are narrow AI where they can only search in specific predetermined ways (algorithms). These AI’s cannot process information in abstract ways or think beyond what you asked of them. The learning that some of these assistants perform is to improve their voice recognition abilities and reading emails your emails (if you let it), but even this is not perfect though. They can also be linked to ‘Internet of Things’ (IoT) devices, which includes lights, heaters and more. They can learn what to do when you say a specific command i.e. “Siri turn off the bedroom lights”. While they are an example of verbal AI, you cannot have a conversation with them yet.

Back in 2015 Yamaha produced a robot that can ride a motorbike called MOTOBOT with spatial AI. This robot can learn to ride a motorbike by practicing on a racetrack with the goal such as doing a lap as fast as possible. Yamaha did this was so that they can test the motorbikes more consistently. They also wanted to test the limits of the bike rather than a human rider wanting to stay alive! Imagine what MOTOBOT could do if it could directly control each part of the engine and not just the throttle, brake, gears and tilt.

Can an AI with predefined rules learn to be better, to be faster and to make a better version of its self? yes, this has already happened. However, can AI learn to have a personality or emotions of its own? Learning from its environment, it may be able to emulate and understand us. It is this question that has sparked the imagination of many science fiction writers, computer scientists, and philosophers alike. A Sci-Fi robot which that emotions there’s none other than Marvin the Paranoid Android in ‘Hitch Hikers Guide to the Galaxy’ by Douglas Adams. Marvin demonstrates each of types of intelligence outlined by Howard Gardner but can also learn from multiple types of inputs. We are a long way from this with both the limitations of AI current abilities and a body for it to reside in.

References:

http://www.academia.edu/download/35264060/Gar.pdf
https://towardsdatascience.com/clearing-the-confusion-ai-vs-machine-learning-vs-deep-learning-differences-fce69b21d5eb
https://www.forbes.com/sites/bernardmarr/2016/12/06/what-is-the-difference-between-artificial-intelligence-and-machine-learning/
https://blogs.nvidia.com/blog/2016/07/29/whats-difference-artificial-intelligence-machine-learning-deep-learning-ai/
https://www.sciencedirect.com/science/article/pii/S0007681318301393
https://global.yamaha-motor.com/showroom/motobot/index.html
Hitch Hikers Guide to the Galaxy
Ghost in the Shell (1995)

WordPress Appliance - Powered by TurnKey Linux