Wednesday, October 19, 2016

How did google get started?


Google is coming to campus today and all the events are hosted in Jepson Hall.
While you can learn much about  Google’s hiring process, culture, job and/ internship opportunities, are you curious about how did Google get started?

Start:
Google started with two students Larry Page(at age 23) and Sergey Brin (at age 24), who were pursuing their Ph.D. at Stanford University. While they were collaborating on a search engine called BackRub in 1996, which was written in Java and Python and ran on several Sun Ultras and Intel Pentiums running Linux.

They achieved great success with the server and officially launched Google.com as a domain on September 15, 1997. The company was formally incorporated on September 4, 1998. The name Google was a word play on mathematical term "googol," which means ten raised to the power of a hundred (10^100). This term represented their mission to organize a seemingly infinite amount of information on the web.

Development and Today:
Instead of allowing pop-up advertisement in the search engine, Google only allows is single text ads. Even though the home page was still marked "Beta (development stage)," many articles already argued that Google provided better search results than its competitors. During the dot-com bubble, Google was also referred to as "the future of the Web", especially by stock market investors.

Over the next ten years, Google took a series of acquisitions and launched many applications including Google Group, Google Toolbar, Google News, Google Images and so much more. In 2004, Google had IPO of 19,605,052 shares of Class A common stock takes place on Wall Street. Opening price was $85 per share. It also owns websites including YouTube and Blogger. In August 2015, Google reorganized its interesting as a holding company named Alphabet Inc. 

--------------------------------------------------------------------------------------------------------------------------
Picture References:
1.https://www.google.com/search?q=google&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiB5_nPkOfPAhVIHT4KHQQuBMMQ_AUICygE&biw=1249&bih=589#imgdii=7IKHjqDTO__xIM%3A%3B7IKHjqDTO__xIM%3A%3B2stnn3dUTo2FjM%3A&imgrc=7IKHjqDTO__xIM%3AICygE&biw=1280&bih=628#imgrc=mRJiumYp6_53fM%3A
2.https://www.google.com/search?q=Larry+Page+23+and+Sergey+Brin+24&source=lnms&tbm=isch&sa=X&ved=0ahUKEwji746UkefPAhXKWz4KHefRCCIQ_AUICSgC&biw=1249&bih=585#imgrc=hXyZDfTlNsffUM%3A
Writing References:
1. https://www.google.com/about/company/history/
2. http://www.steegle.com/about/google-101-facts/1-11-how-it-all-began
3. https://en.wikipedia.org/wiki/History_of_Google

--------------------------------------------------------------------------------------------------------------------------

Friday, October 14, 2016

Javacode, Java Virtual Machine, and machine code


Have you every wondered when you program with Java, why do you always have to compile your code? What does the ".class" file mean? Well, the answer is that your computer does not read English words, and the compiler takes your code and translate into machine-level code. This process is more complicated for Java. Your code is first translated into bytecode and then executed by JVM (Java Virtual Machine), and finally processed by the computer, as shown in the picture above.

Bytecode
Bytecode is the output from a Java compiler and is a form of instruction set designed for efficient execution by a software interpreter. It is composed of numeric codes, constants, and references (normally numeric addresses). Each bytecode is has one, or in some cases two bytes that represent the instruction (opcode), along with zero or more bytes for passing parameters. Below is an example of the bytecode:

Java Virtual Machine
JVM (Java Virtual Machine) is a virtual machine that executes bytecode outputted by Java compiler and enabled the computer to run the program. Java is powerful, because once a program is compiled, it can be run on any platform without having to be rewritten or recompiled. A Java virtual machine can interpret the bytecode one instruction at a time or interpret the bytecode with just-in-time compiler.

Machine code:
While humans understand languages, computer's CPU (central processing unit) only understand machine language, aka machine code, which is the most elemental language of computers, comprising a long sequence of zeros and ones.  Each machine code gives CPU an instruction to perform a simple operation or to store data in RAM. 
--------------------------------------------------------------------------------------------------------------------------
Picture References:
1.https://www.google.com/search?q=java+virtual+machine&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiW_ZSk5trPAhUGVT4KHd2UBfgQ_AUICygE&biw=1280&bih=628#imgrc=mRJiumYp6_53fM%3A
2.https://en.wikipedia.org/wiki/Java_virtual_machine#/media/File:JvmSpec7.png
3.https://en.wikipedia.org/wiki/Java_bytecode
Writing References:
1. http://durofy.com/10-major-differences-between-c-and-java/
2. https://en.wikipedia.org/wiki/Java_virtual_machine
3. https://en.wikipedia.org/wiki/Machine_code
4. https://en.wikipedia.org/wiki/Java_bytecode
5. http://www.theserverside.com/definition/Java-virtual-machine-JVM
--------------------------------------------------------------------------------------------------------------------------

Monday, October 3, 2016

Alan Turning - Turning Machine


Alan Turning is often described as the father of computer science. He was an influential computer scientist, mathematician, logician, cryptanalyst and theoretical biologist. His work laid foundation for algorithm and computation with Turning Machine.

This blog post explores the idea of Turning Machine, which is a hypothetical machine but can simulate any complicated computer algorithm.

Turning machine is an abstract model that consists of an infinitely-long tape which acts like the memory in a typical computer or any other storage devices. It is consisted of four parts:

  1. A tape that is divided into cells, one next to the other;
  2. A head that can read and write symbols on the tape;
  3. A state register that stores the state of the Turning machine;
  4. A finite table of instructions.
The machine is a 3-symbol machine, which means that it can only process the symbols 0, 1 and " "(blank). The picture below is an simplified example of the Turning machine. The squares on the tape are usually blank at the start and can be written with symbols.
The machine has a head, that is positioned over one of the squares at a time and the head can perform three basic operations:

  1. Read the symbol on the square under the head;
  2. Edit the symbol by writing a new symbol or erasing it;
  3. Move the tape left or right by one square so that the machine can read and edit the symbol on a neighboring square.
--------------------------------------------------------------------------------------------------------------------------
Picture References:
1.https://www.google.com/search?q=alan+turing&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiQxLfqqr_PAhWI5SYKHQmuDXsQ_AUICCgB&biw=1280&bih=627&dpr=2#imgrc=_JwUeA8tUcu3AM%3A
2.http://www.express.co.uk/news/uk/553128/Alan-Turing-Notebook-crack-the-Enigma-Code-auction-1-million
Writing References:
1. https://www.theguardian.com/science/2015/apr/13/alan-turings-notebook-sells-for-more-than-1m-at-new-york-auction
2. https://en.wikipedia.org/wiki/Alan_Turing
3. https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/turing-machine/one.html
4. https://en.wikipedia.org/wiki/Turing_machine
--------------------------------------------------------------------------------------------------------------------------
The picture above shows the Turning's original handwriting detailing his work on the foundations of mathematical notation and computer science. The notebook was sold for  for $1,025,000 (£698,000) in a sale of fine books and manuscripts at Bonhams auction house.

Wednesday, September 28, 2016

Algorithmic trading robot

Sales and trading plays a central role in the financial stock market. Algorithmic trading has increasing popularity over the past few years, it can do so much more than a human trader. The picture below shows the percentage of algorithmic trading over the entire market transaction. 

What is Algorithmic trading?
Algorithmic trading uses computers to program a defined set of instructions for placing a trade in order. It is often used by banks, pension funds, mutual funds and hedge funds, and it was developed as a cost saving mechanism, because institutional traders need to executive large orders in markets that can not support all of the size at once. By setting by variables such as time, price, and volume, computers(algorithmic trading robot) can watch the stock market constantly and execute traders, whenever the conditions are met. Another benefit of algorithmic trading is that human trader does not have to watch the stocks constantly and repeatedly, which saves time for them to work on other projects. Since computers processes information at a higher speed and thus higher frequency, algorithmic trading generates more profits than a human trader.

How do you build a algorithmic trading robot?
MetaTrade4(MT4) is an electronic trading platform that uses the MetaQuotes Language 4 (MQL4) for coding trading strategies. It is one of the popular softwares to build a  algorithmic trading robot.

I will show you part of an example below with the free and open-source Quantiacs Toolbox which supports both Python and MATLAB by building a Heikin-Ashi indicator.
def HEIKIN(O, H, L, C, oldO, oldC):
    HA_Close = (O + H + L + C)/4
    HA_Open = (oldO + oldC)/2
    elements = numpy.array([H, L, HA_Open, HA_Close])
    HA_High = elements.max(0)
    HA_Low = elements.min(0)
    out = numpy.array([HA_Close, HA_Open, HA_High, HA_Low])  
    return out
Heikin-Ashi Candle Calculations
HA_Close = (Open + High + Low + Close) / 4
HA_Open = (previous HA_Open + previous HA_Close) / 2
HA_Low = minimum of Low, HA_Open, and HA_Close
HA_High = maximum of High, HA_Open, and HA_Close
Heikin-Ashi Calculations on First Run
HA_Close = (Open + High + Low + Close) / 4
HA_Open = (Open + Close) / 2
HA_Low = Low
HA_High = High
This is the beginning part of the code and you can read more from this link: https://quantiacs.com/Blog/Intro-to-Algorithmic-Trading-with-Heikin-Ashi.aspx. 

The code for algorithmic trading is very complex and advanced, but isn't it so encouraging that we start to understand the basics like "array" and "return"? Once, a finance professional told me, "we can teach you about algorithmic trading, as long as you know some basics of the computer science, even if you only took one computer science class. But even that basic knowledge will give you a good starting point." I did not truly understand what he meant until when I wrote this blog and googled the code for algorithmic trading. I open the website, expecting to know nothing about the codes, but I was excited to find that I do understand some basics. 

--------------------------------------------------------------------------------------------------------------------------
Picture References:
1.https://www.google.com/search?q=algorithmic+trading&biw=1280&bih=625&tbm=isch&source=lnms&sa=X&ved=0ahUKEwiq_fb-zLjPAhUGPCYKHexED24Q_AUICSgE#imgrc=llwEXhaZbAXpnM%3A
2.https://en.wikipedia.org/wiki/Algorithmic_trading#/media/File:Algorithmic_Trading._Percentage_of_Market_Volume.png
Writing References:
1. http://www.investopedia.com/articles/active-trading/101014/basics-algorithmic-trading-concepts-and-examples.asp
2. https://en.wikipedia.org/wiki/Algorithmic_trading
3. http://www.investopedia.com/articles/active-trading/081315/how-code-your-own-algo-trading-robot.asp
4. https://quantiacs.com/Blog/Intro-to-Algorithmic-Trading-with-Heikin-Ashi.aspx
--------------------------------------------------------------------------------------------------------------------------
Check the video below for how the basics of algorithmic trading

Friday, September 23, 2016

Amazon - Robotics and inventory management

Were you ever amazed by the fact that you can receive one-day free prime delivery at Amazon?
Have you ever thought about how did Amazon manage all of its inventories?
The answer is AMAZON ROBOTICS.

Traditionally, inventories are managed and moved around by conveyor system or forklifters. With increasing popularity of eCommerce, it is increasingly important to effectively manage the inventories. With Amazon Robotics, items are stored on portable storage units, as shown in the picture above. Amazon robots are way much more efficient and less error-prone than the traditional method.

This is how the robots operate:
When an order is entered into the database system, the software analyzes all of the items in the order and locates the closest robot to the each of the item and directs the robot to retrieve the item. The robots are controlled by a centralized computer with secured WiFi network for communication. The robots move by following the QR codes on the floor and have sensors inside to avoid collision. They also have powered wheels that allow them to rotate and move around.

When the robot reaches the target location, it slides underneath the pod/rack and lifts the pod/rack off the ground through corkscrew action. Then, the robot carries the pod back to the human operator to pick the items and returns the pod back.

Amazon has two types of robots: the "G" drive for light pods weighing up to 750 pounds and the "S" drive for larger racks and pallets weighing up to 3,000 pounds. Both kinds of robots are designed to operate on rotating schedule for 60 minutes and then to be recharged for 5 minutes.

The systems behind the robots are essential to how robots work. The sophisticated fulfillment system processes hundred of orders per second. When an order is placed, the system analyzes the shipping location and products, depending on the product type and availability. Also, the system assigns the priority to each product based on the customer's delivery preference. AmazonPrime same day shipping order has the highest priority, while a "Super Saver" order might wait a several hours before processed.  Once the priority is determine, the system sends order to robots to locate and move pods to assigned packing station.


--------------------------------------------------------------------------------------------------------------------------
Picture References:
1.https://www.google.com/search?q=amazon+robotics&biw=1280&bih=625&tbm=isch&source=lnms&sa=X&ved=0ahUKEwjNrurj-6bPAhXC24MKHU_KDMAQ_AUIDCgA#imgrc=BtRv2fLlZbf_XM%3A
2.https://www.google.com/search?q=amazon+robotics&biw=1280&bih=625&tbm=isch&source=lnms&sa=X&ved=0ahUKEwjNrurj-6bPAhXC24MKHU_KDMAQ_AUIDCgA#imgrc=mNBuqcz1JaweIM%3A
Writing References:
1. https://en.wikipedia.org/wiki/Amazon_Robotics
2. http://www.informationweek.com/strategic-cio/amazon-robotics-iot-in-the-warehouse/d/d-id/1322366


--------------------------------------------------------------------------------------------------------------------------
Check the video below for how Amazon Robotics work!

Wednesday, September 14, 2016

Zootopia - Fur technology makes Zootopia's animal believable



This is the last post about computer graphics and I want to ended it with my third favorite Disney movie- Zootopia. It tells a stony about anthropomorphized animals trying to realize their dreams and living in a metropolitan city. The movie is a comedy but also sheds lights on race relations and diversity.

Were you impressed by the fur of all the animals by real they all look? Animal means fur. In fact, one Animal in Zootopia Has More Individual Hairs Than Every Character in Frozen Combined.

Similar to how disney studies water waves in Finding Nemo, the Zootipia team are composed of directors, engineers and animators. They spent eight month studying animals and they went to San Diego's Safari Park, Disney's Animal Kingdom and all the way to Kenya to observe their movements and habits. To make look real, the team went to Natural History Museum and studied fur under a microscope and under lighting setups.


To make the animals look realistic, Disney's trusty team of engineers introduced iGroom, a fur-controlling tool that had never been used before. The software helped shape about 2.5 million hairs on the leading bunny and about the same on the fox. A giraffe in the movie walks around with 9 million hairs, while a gerbil has about 480,000 (even the rodent in the movie beats Elsa's 400,000 strands in Frozen).

The software gave animator so much more flexibilities that they could easily brush, shade and brush the fur. iGroom iterates very quickly and this immediate feedback enables the team to play around to achieve the effect they want. 


Next week - Robotics at Amazon 
--------------------------------------------------------------------------------------------------------------------------

Picture References:
1.https://www.engadget.com/2016/03/04/fur-technology-makes-zootopias-bunnies-believable/
2.http://fusion.net/story/275485/zootopia-police-racism-race-relations-commentary/
Writing References:
1. One Animal in Zootopia Has More Individual Hairs Than Every Character in Frozen Combined- http://io9.gizmodo.com/one-animal-in-zootopia-has-more-individual-hairs-than-e-1761542252
2. The fur-reaching tech of Zootopia- https://www.fxguide.com/featured/the-fur-reaching-tech-of-zootopia/

--------------------------------------------------------------------------------------------------------------------------

Another reason that I like Zootopia is their DMV scene. Have you ever been frustrated with the inefficiency at DMV? Everytime I go to DMV, the experience is painful and it seems like I need to wait there forever. Zootopia followed the comedy principle and famously slow sloths runs DMV in the movie.

Friday, September 9, 2016

Finding Nemo - The art of computer animation and water flow simulation


Last post discussed the snow simulation in Frozen, which is my favorite movie. 

As a Disney enthusiast, I will continue the discussion of computer graphics with the example of Finding Nemo(my second favorite movie) and explore the art of computer animation. John Lasseter, the executive producer of the film, said:“This movie absolutely raises the bar for Pixar and for the art of computer animation... The film is breathtakingly beautiful and filled with real drama, real emotion and depth, as well as great comedy."

Compared to the challenge of snow simulation Frozen, the biggest challenge in Finding Nemo was water flow simulation. First of all, the actions, textures and other details of water flow are hard to describe in English language and the staff at Disney had to invent new vocabularies in order to communicate. In addition, Disney invited scientists to present lectures on wave, swells and other motions. The team member even took a trip to Hawaii to study the water and sea life. 

Finally, water simulation was achieved by pioneering the new techniques in digital lighting, which were used to create realistic-looking water. Digital lighting is a technique that brightens evert scene in the same way as stage lighting. It further presents the emotion of each scene and better defines key, fill and bound lights. 

Key, fill, and bounce lights and room ambience are all defined and used to enhance the mood and emotion of each scene. Lighting takes its inspiration from the moody color scripts created by the art department. The underwater setting with lighting effect 

The water simulation technique was so realistic that the team decided to push back and de-emphasize to make the film more cartoony.


--------------------------------------------------------------------------------------------------------------------------
Picture References:
1. https://www.google.com/search?q=Finding+Nemo&biw=1280&bih=583&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiL0LmjtoLPAhUDZCYKHdl5CW0Q_AUIBygC&dpr=2#imgrc=4MsDpdUl--_MpM%3A
2. https://www.google.com/search?q=finding+nemo+animation+disney&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjLwarktoLPAhVLPCYKHUnjCnMQ_AUICSgC&biw=1280&bih=583#imgrc=dc-kQA_h1JgL9M%3A

Writing References:
1. Use of Technology - http://pixar-animation.weebly.com/use-of-technology.html
2. The Making of Finding Nemo - http://www.cgsociety.org/index.php/CGSFeatures/CGSFeatureSpecial/
the_making_of_finding_nemo
3. Finding the Right CG Water and Fish in 'Nemo' - https://renderman.pixar.com/view/computer-graphics-at-walt-disney-animation

--------------------------------------------------------------------------------------------------------------------------
If you like Finding Nemo as much as I do, you can actually realize the dream of living with Nemo at Finding Nemo Rooms at Disney Art Of Animation Resort in Walt Disney World.  See below for the picture of the room.