Friday, November 18, 2016

Firewalls










What do firewalls do?

At an abstract level, you can think of a firewall as a filter, or an intermediary between your device and the Internet (you could also think of it as a traffic officer). What a firewall does very generally is decide whether or not certain information from the internet should be allowed to enter your device, and then respectively grants or prohibits entrance to that information.

How does a firewall work - a basic model.

When information "knocks" on a device's firewall,  the firewall "questions" it to determine if it belongs to any of the following categories:

  1. "traffic sent in response to a request of the computer (solicited traffic)" (1) or 
  2. "unsolicited traffic that has been specified as allowed (excepted traffic)". (1)
If it does not belong to either category, i.e., if it has not been sent as a response to a request of the device and has also not been specifically permitted by the user, then the firewall denies entrance to the information.

References:
(1) https://technet.microsoft.com/en-us/network/bb545423.aspx
(2) https://www.microsoft.com/en-us/safety/pc-security/firewalls-whatis.aspx
(3) https://www.paloaltonetworks.com/documentation/glossary/what-is-a-firewall

Image References:
(a)https://www.microsoft.com/en-us/safety/pc-security/firewalls-whatis.aspx


Friday, November 11, 2016

Understanding PAC-Man






Back in the day, PAC-Man used to be one of the most-played games in the world! Game-play was pretty simple and straightforward - try to eat all the dots and fruit as fast as you can and without being eaten by a ghost. Everyone knew the rules, and people of all ages could play it.

Everyone also knew how the ghosts behaved more or less - they roamed around until they figured out your approximate location, and then started actively chasing you. How did they know however how to do that?

According to Chad Birch, "
Each of the ghosts is programmed with an individual “personality”, a different algorithm it uses to determine its method of moving through the maze", but there is also a logic that all ghosts share (1).

More specifically, each ghost has what is called a 'target tile', which it tries to reach, and arriving to which is the basis for the ghost's behavior. "All of the ghosts use identical methods to travel towards their targets, but the different ghost personalities come about due to the individual way each ghost has of selecting its target tile." (1)


 References:
  1. http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior

Image References:

  1. https://www.google.com/search?q=pac+man&newwindow=1&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiI6_eQraLQAhUJ7mMKHT4BBmcQ_AUICCgB#imgrc=ukfIYq6AlYNIJM%3A

Friday, November 4, 2016

The emmersion of virtual reality (VR) in video games




Earlier today a friend of mine was showing me the reactions of professional video-game testers to VR video-games, and I was thinking about how awesome VR is as a concept, but also how dangerous and detrimental it could be to society.

What is VR?
"Virtual reality is a computer-generated environment that lets you experience a different reality. A VR headset fits around your head and over your eyes, and visually separates you from whatever space you're physically occupying. Images are fed to your eyes from two small lenses. Through VR you can virtually hike the Grand Canyon, tour the Louvre, experience a movie as if you are part of it, and immerse yourself in a video game without leaving your couch." [1]

When was it first conceived?
Starting in the 1950's, experts of all sorts of disciplines have talked about or alluded to the idea of virtual reality. "The first references to the concept of virtual reality came from science fiction. Stanley G. Weinbaum's 1935 short story "Pygmalion's Spectacles" describes a goggle-based virtual reality system with holographic recording of fictional experiences, including smell and touch." [2]
People from areas like theater, literature, and computer science have found interest in this and, one of the very first applications of it was in 1968, when "Ivan Sutherland, with the help of his student Bob Sproull, created what is widely considered to be the first virtual reality and augmented reality (AR) head-mounted display (HMD) system"[2] 



References:
[1] https://www.cnet.com/special-reports/vr101/
[2] https://en.wikipedia.org/wiki/Virtual_reality

Image Sources:
[3] https://www.google.com/search?q=virtual+reality&biw=2144&bih=1051&noj=1&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiO-rmO5pDQAhUEQiYKHYcGCfsQ_AUICygE&dpr=0.9#imgrc=COd8Rc2BkzorGM%3A

Friday, October 28, 2016

Generic Programming

Generic programming is defined in Musser & Stepanov (1989) as follows,
Generic programming centers around the idea of abstracting from concrete, efficient algorithms to obtain generic algorithms that can be combined with different data representations to produce a wide variety of useful software.
— Musser, David R.; Stepanov, Alexander A., Generic Programming
or, more simply put,

[Generic programming is the process of lifting] algorithms and data structures from concrete examples to their most general and abstract form.
— Bjarne Stroustrup, Evolving a language in and for the real world: C++ 1991-2006
This is achieved by writing algorithms in terms of "types to-be-specified-later".
Generic programming is a characteristic of computer science in general, as opposed to a characteristic of a specific programming language. It deals with algorithms, and can be applied to most languages, with some differences. For example, these "types to-be-specified-later" are called generics in languages such as Java, C#, F#, Objective-C, and Swift; parametric polymorphism in ones such as ML, Scala, Haskell; and templates in languages like C++ and D;
Each language also has its own way of treating these types, with whatever advantages and disadvantages those ways may entail (there is no such thing as perfection).
Below are some more details about, and an example of Generic Programming.



 
References:
https://en.wikipedia.org/wiki/Generic_programming#Generics_in_Java
Image References:
Image 1: https://www.google.com/imgres?imgurl=http%3A%2F%2Fimages.slideplayer.com%2F16%2F5079496%2Fslides%2Fslide_1.jpg&imgrefurl=http%3A%2F%2Fslideplayer.com%2Fslide%2F5079496%2F&docid=9BEYxVSEtYQM1M&tbnid=qlXd3qo9VaSJEM%3A&w=960&h=720&noj=1&bih=875&biw=1637&ved=0ahUKEwjo7Na0qP7PAhUEOyYKHRHvAPcQMwhcKDMwMw&iact=mrc&uact=8
Image 2: https://www.google.com/imgres?imgurl=http%3A%2F%2Fimages.locanto.in%2F1195428230%2FLearn-use-of-Generic-Programming-in-Java-5_5.jpg&imgrefurl=http%3A%2F%2Fghaziabad.locanto.in%2FID_497963856%2FLearn-use-of-Generic-Programming-in-Java-5.html&docid=kKEqqPItgOTJwM&tbnid=Ov6i86DzN9gOJM%3A&w=283&h=178&noj=1&bih=875&biw=1637&ved=0ahUKEwjo7Na0qP7PAhUEOyYKHRHvAPcQMwhgKDcwNw&iact=mrc&uact=8

Friday, October 21, 2016

MRI's to be used in fetal health tests

So far, ultrasounds have been the main tool for fetal health examinations.
Ultrasounds are affordable and easy to transport, but it doesn't generate as much information as an MRI scan, which could potentially measure the volume of specific chemicals in the placenta and in fetal organs.

This method would be especially helpful for prevention purposes, to catch potential malfunctions and/or issues, before they actually pose a threat to the fetus's health. For example, as found by Ellen Grant’s group, "measurements of oxygen absorption rates in the placenta can indicate placental disorders that might endanger the fetus". The timely measurement of these rates could prove to be the determining factor for the survival or not of the fetus, and they cannot be performed using ultrasound scans.

Hence it is very fortunate that MIT's Computer Science and Artificial Intelligence research department was able to generate "a new algorithm for tracking organs through sequences of MRI scans".

Picture1 - Fetal Ultrasound
Picture 2 - Fetal MRI
 Picture 3 - Placental MRI

References:
http://news.mit.edu/2016/algorithm-mri-scans-fetal-health-1021
Image Sources:
1 - https://www.google.com/imgres?imgurl=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F2%2F2f%2FCRL_Crown_rump_lengh_12_weeks_ecografia_Dr._Wolfgang_Moroder.jpg&imgrefurl=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FUltrasound&docid=6Kozj1SQ0QlfvM&tbnid=gAWPT2uSwNGlCM%3A&w=976&h=735&bih=1039&biw=1070&ved=0ahUKEwi0-PnMme3PAhXLLSYKHRKDBMEQMwgwKAAwAA&iact=mrc&uact=8
2 - https://www.google.com/search?q=MRI+SCan&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjtityome3PAhXHwiYKHR3oC18Q_AUICCgB&biw=1070&bih=1039&dpr=0.9#tbm=isch&q=fetus+mri&imgrc=nLMWN29OmcR9DM%3A
3 - https://www.google.com/search?q=placental+mri&biw=1070&bih=1039&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiRvILxme3PAhXM5iYKHXqeB5wQ_AUIBigB&dpr=0.9#imgrc=_S7UIA0OzgzrDM%3A

Friday, October 14, 2016

Deep Dream by Google

What it is: "A computer vision program created by Google which uses a convolutional neural network to find and enhance patterns in images via algorithmic pareidolia, thus creating a dreamlike hallucinogenic appearance in the deliberately over-processed images"

How it works: 
  • detects patterns in images to enable the automatic classification of these images
  • Like GP(Gennetic programming) programs, it can be trained
  •  once that is done, it can be run in reverse, which facilitates the better understanding of the structure of the neural network.
  • After enough reiterations, imagery will be adjusted so that it results in a form of pareidolia, which is what is used to algorithmically generate psychedelic and surreal image.

Why is this helpful: It invokes the need and possibilities for further study, because its resemblance to LSD- and psilocybin-induced hallucinations "is suggestive of a functional resemblance between artificial neural networks and particular layers of the visual cortex."

Examples of DeepDream images:



Here is a really cool sample of a DeepDream video:
https://www.youtube.com/watch?v=DgPaCWJL7XI

References:
https://en.wikipedia.org/wiki/DeepDream

Image references:

Friday, October 7, 2016

GP - Fitness & Breeding

In my previous previous blog 'An Overview of Genetic Programming', I went over the general idea of genetic programming. In its basis, GP is testing certain smaller programs, determining whether they are "fit" based on a model of natural selection, and then breeding those programs. There are various ways of  breeding/creating new programs from the old one; Let's look at that in more depth:

Reproduction: The computer literally reproduces the program - i.e. creates a duplicate of it - and copies it to the new population.
Crossover: The computer takes two programs(that have passed the fitness test) and creates a new offspring program by recombining randomly chosen parts from those two selected programs.
Mutation: the computer takes an existing 'fit' program randomly, and changes a chosen part of it.
Lastly,
Architecture-altering operations: in this case, the computer chooses an architecture-altering operation from an available list of operations and applies it to one selected program , hence creating the new offspring program for the new population

References:
http://geneticprogramming.com/tutorial/

Image References:
http://previews.123rf.com/images/iqoncept/iqoncept0905/iqoncept090500016/4813642-An-illustration-of-a-DNA-double-helix-with-one-highlighted-in-red-Stock-Illustration.jpg

Friday, September 30, 2016

An Overview of Genetic Programming


     "One of the central challenges of computer science is to get a computer to do what needs to be done, without telling it how to do it. Genetic programming addresses this challenge by providing a method for automatically creating a working computer program from a high-level problem statement of the problem". [1] This is achieved by "genetically breeding" a population of programs based on Darwin's theory of natural selection (aka 'survival of the fittest'), using biology - inspired methods such as reproduction, crossover, mutation, and so forth. So, in short, what genetic programming does is it tries to simulate natural processes and apply them to existing programs, in order to transform them into new, hopefully better ones.
     But who determines which program is the 'fittest'? Well, the answer is the computers. This doesn't mean however that the computers switch on one day and are all of a sudden able to judge whether a program is worth breeding or not - there is an algorithm behind their 'decisions'. The human programmer gives the computer a set of criteria. The computer runs a program, and if it satisfies those criteria, that program is labeled as 'fit' and is then bred to form new programs, each of which in turn undergoes the same examination process. The overall control flow of this operation can be seen in the image below.




 (More details on the breeding process to come...)


 
References
[1] http://geneticprogramming.com/tutorial/
[2] http://www0.cs.ucl.ac.uk/staff/w.langdon/ftp/papers/poli08_fieldguide.pdf

Image References
[a] http://www.genetic-programming.com/evolveV2DF2003621.GIF
[b] http://www0.cs.ucl.ac.uk/staff/w.langdon/ftp/papers/poli08_fieldguide.pdf

Friday, September 23, 2016

Shortest Path Problem Extension - Traveling Salesman Problem


Let's say there is a salesman and he is trying to go from town to town to sell his products. He has to visit all the towns, but he is in a hurry to get back so he needs to find the route that will get him around the fastest.

If it's a simple problem with few towns, the salesman can find his own solution. In a case however  like the one shown above, he would need the help of the computer.

One way a computer could solve this problem is, through Opt-Swap, by taking all the possible paths between these towns (edges connecting the points), and generating a random path. Then, taking two edges at random and if swapping them is an improvement to the total distance traveled, then it would perform the swap. It would repeat that loop until it the route could not be improved by an immediate opt-swap. This however does not mean that that resulting route is the optimal one, and there are various algorithms that attempt to control for that like simulated annealing by which the computer is told to probabilistically accept non-optimal solutions earlier on in the process.

This is a very rough overview of the traveling salesman problem but if you are interested I would highly recommend watching the two referenced videos. They go into more detail and they explain it much better.

Also, I randomly ran into this: https://www.youtube.com/watch?v=8WjUVEamGKA . Very interesting! If you have 4 minutes to spare it's definitely worth watching.

References:
  • https://www.youtube.com/watch?v=SC5CX8drAtU
  • https://www.youtube.com/watch?v=-cLsEHP0qt0
Image references:
  •  http://permutationcity.10gbhost.com/projects/mutants/tspresults.gif?i=2


Friday, September 16, 2016

Shortest Path Problem - Real LIfe Applications



Ever had 10 different things to do in one day at 10 different locations and wondered what is the most efficient/less time-consuming way to do all of them? Computer Science has the solution to your problem, and it's name is 'Shortest Path' (also referred to as 'Dijkstra's algorithm' or 'Minimum spanning tree').


What 'Shortest Path' is, is an algorithm that computes which path (option) gets you to your goal (destination) with the least possible weight (cost). "In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized."

So let's assume you have to do 5 things today:
  1. Go to lunch with your Advisor (he/she is available any time you tell them)
    • location: Dining Hall
    • estimated time of completion: 40 minutes
  2. Do your homework
    • location: Library
    • estimated time of completion: 5 hours
  3. Go to Dr. Jory's office hours
    • location: Jepson
    • estimated time of completion: 1 hour
  4. Do Laundry
    • location: Gateway apartments
    • time of completion: 1.5 hours

Assuming you are starting from your room in Gateway and you want to eventually end up in your room again to sleep. Some possible paths you can take are shown below:









1 is where you start off, 2 is the dining hall, 3 is the library, 4 is Jepson, 5 is Gateway laundry room, and 6 is your room where you end up.

Taking into account the time each of these activities takes, and the distance/walking times between each of these locations, and the importance/benefit of getting each done, you would assign a specific value called 'weight' to each edge (line).

Then, for each path that takes you from 1 to 6, you would add up the weight of all the segments you follow, and whichever path ended up having the smallest value would be the most efficient/cost-effective way to go about your day.

Now for a simple task like this you may not necessarily need the help of a computing system to run an algorithm, but if you had to make a more complicated and multivariate decision, this could be very helpful.

References:
 https://en.wikipedia.org/wiki/Shortest_path_problem
 https://en.wikipedia.org/wiki/Minimum_spanning_tree#Classic_algorithms

Image References:
 https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/6n-graf.svg/500px-6n-graf.svg.png


Friday, September 2, 2016

Intelligent Personal Assistant - How does Siri work?


The last decade has shown a trending shift towards Apple products, and especially iPhones. With most of these products, comes an Intelligent Personal Assistant called Siri.
Siri is and AI system installed on iPhones, iPods, and iPads, that helps automate some of their functions, but also helps the users perform small day-to-day tasks more easily, and also serves as a search engine.
In contrast to other intelligent personal assistants like Windows's Cortana, Siri is more interactive, in the sense that it somewhat participates in dialog, seems to possess a sense of humor / a keen sense of wit. One of my favorite examples is when a user asked Siri: "Who's taller? Kobe Bryant or LeBron James?" and Siri's response was: "If you squint, you can see that LeBron James is slightly taller."
Now how can a computer system have humor? Phrased that way, the answer is, it can't. Perhaps a more proper question would be, "Where does this system find these witty responses?" The short answer is, it has been programmed to follow a specific algorithm. More specifically:
How Siri works is (in a simplified model) it takes the inputted text (or sound which it then converts to text), parses it, and looks for keywords that signify commands (e.g. "search", "call", "message") - not much unlike what a compiler does ;) . Then, it decides whether or not this information corresponds to the phone's/tablet's local database of commands/actions (e.g. "Write", "Send", or a name), or if it is more accurately described as a global problem(e.g. temperature in Chicago), that would require retrieving information from a global database. (This sounds a lot like a boolean expression!)
If it is a local command, it goes through the local database, executes the command, and outputs the result. Otherwise, if it cannot recognize the command as something local, it connects to Apple's servers and accesses their database, then links what it finds to the local database, and continues to execute and output the result.
In this simplified explanation of how Siri works, it is not much unlike any other computer program which takes an input and, through an algorithm, outputs a result or answer.
If you are interested in more details about how Siri works, thee first two links in my references are very interesting.

References:
  • https://www.quora.com/How-does-Siri-work-2
  • http://electronics.howstuffworks.com/gadgets/high-tech-gadgets/siri.htm
  • https://www.youtube.com/watch?v=loOHmMFVJcE
  • http://intelligentpersonalassistants.blogspot.com/
Image Reference: https://www.google.com/search?q=Siri&biw=2144&bih=1084&tbm=isch&source=lnms&sa=X&ved=0ahUKEwjVjeuQ6oPPAhVDHR4KHUtgAlsQ_AUICCgD&dpr=0.9#imgrc=YBUpF0WL22PW6M%3A

Automated Systems Run Loose


     Robot Taxi is a new experiment in Japan. The company is manufacturing and testing automated cars that pick up clients from their GPS location and take them to their destination, whilst attempting to provide a unique passenger experience. As the company states in its mission statement, "Select where you want to go on your mobile device, and Robot Taxi will come to pick you up. When it arrives, it detects where you are and the door opens automatically for easy boarding. Once underway, Robot Taxi selects the quickest route based on real-time traffic information in order to reach your destination smoothly and safely. Just like a good friend, Robot Taxi also makes sure you enjoy your trip by providing on-board entertainment. All the while, ensuring to use the best driving route to make your ride comfortable as well as enjoyable."
    How safe is it though for such cars to exist? How far do their sensors' abilities stretch? How inclusive and effective is their troubleshooting program? What are their limitations? Could they avid accidents caused by others as well as a person could? What if there is a glitch, or a bug in the system that has not been discovered during testing? 
     On the other hand, how would that affect society? There would no longer be the need to get a driver's license, or to be a taxi-driver so jobs would be lost but, what I find more important is, road-trips would not be the same ever again, would they?

Writing References:
https://robottaxi.com/en/
Image Sources:
https://www.google.com/imgres?imgurl=https%3A%2F%2Fi.ytimg.com%2Fvi%2FD6wgTIJ5e00%2Fsddefault.jpg&imgrefurl=http%3A%2F%2Fwww.ikfirus.com%2F2015%2F10%2Fjapan-introduce-robot-taxis.html&docid=3FBJl0Wv0KkBwM&tbnid=xSVSzcOjsDTlfM%3A&w=640&h=480&itg=1&bih=1065&biw=1070&ved=0ahUKEwiFz_u32fDOAhUBXh4KHb8wB5IQMwhVKC0wLQ&iact=mrc&uact=8

Computer Science Can Save Lives...or End Them



     With the advancements in technology and the evolution of computers, mankind has been able to accomplish great things in all disciplines. Without computers, doctors would not be able to take advantage of the precision of laser surgery, or use MRI scans to visualize a tumor in a patient's brain, or even simpler than that, automatically regulate medication dosages. Without computers, Pirates of the Caribbean would not have looked as awesome.
     Computers play a tremendous role in our everyday lives, whether we realize it or not. That however, makes them all the more dangerous. The ways in which they affect our lives and our society make it so that the simplest computing mistake could have dire consequences. Taking the example of medicine, how easy would it be to make a small computational error that would change the formula by which medication dosage is calculated, and overdose a patient, or give them less medication then they need and hence not cure them properly or in time? The answer, VERY! Similarly, how easy is it to forget one number or one variable of a 3-page code when programming a space rocket, and hence causing it to explode or take the wrong path? The answer? Extremely easy! The proof? Delta II, 1992: The graphite-epoxy casing of one of the solid-rocket boosters split 7.2 seconds into the flight, triggering the rocket's self-destruct system. Titan IV, 1998, began to pitch over the Atlantic Ocean and safety officers had to send a destruct signal. Delta III, 1998, was also commissioned a destruct signal after appearing to break up during flight. In these three cases luckily no injuries were reported, but there could have just as easily been astronauts on board those rockets at the time of explosion.

 
    The point to be taken away from this blog is not that computers are bad, but that they are important, that they have become an integral part  of our lives, seen in almost every aspect of them, that it takes extreme precision, patience, and care to be equipped to work in that field, and that all the people behind these machines carry a lot of weight on their shoulders.

Writing References:
  • http://www.floridatoday.com/story/tech/science/space/2016/09/01/spacex-falcon9-rocket-explosion-one-of-many-florida-launch-failures/89716540/
Image Sources:
  • https://www.google.com/search?q=computer+lab&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjznJfx1vDOAhXCpx4KHeAmAwYQ_AUICCgB&biw=1070&bih=1065&dpr=0.9#tbm=isch&q=scientific+computer+lab&imgrc=_YBoHKp6MA0O6M%3A
  • https://www.google.com/search?q=rocket+explosion&newwindow=1&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjlwvaz2PDOAhXEFx4KHdIkA8QQ_AUICigD&biw=1070&bih=1065&dpr=0.9#imgdii=U5stWnFA0UnfyM%3A%3BU5stWnFA0UnfyM%3A%3BFqHT1dgif5RjwM%3A&imgrc=U5stWnFA0UnfyM%3A