[iOS] Pig Shot v1.1.4

iconThis is a cute little action game on iphone. You basically just pull the pig in a sling, tilt right and left to dodge or obtain stuff. If you tap the screen and the pig has eaten food, it’ll release gases and boost up the speed for a short period of time. Although the price listed on iTune is 0.99 CDN, it often get down to free so watch out if you haven’t download this one already!

This is super addicting that I normally played it till my eyes fell out. jkjk. But, just out of random and looked at the achievements in the game centre, one of them was “PLAYING FOR 2 HOURS”!! I mean, really? 30 minutes is kind of already hurt and I think there is another longer one¬†which I don’t remember. Except the fact that it kind of hurt my eye and made me less physical or sociable and other negative impacts that a game would bring, it’s a great game nonetheless and totally recommend this!! ((not trying to be persuasive at all~ ūüėČ

View in Appstore

photo 1(1) photo 3(1) photo 4(1) photo 2  photo 3 photo 4 photo 5 photo 1  

Hate Speech


Hate Speech over the Internet


Rights come with responsibility. While given the freedom of speech, people should still be responsible for what they have said. The internet has provided us a free-writing space to release our feelings and emotions conveniently. Most of the chatting and blogging sites (such as facebook and wordpress) nowadays require an account to create posts and start forming conversations. Nevertheless, these accounts can be easily faked and the language that the users have chosen are often found unpleasant and disrespectful. Not to mention other discussion-encouraging websites that does not require any login information. It is just horrible. Unlike physical attacks (which cannot be dodged easily if a person is not in shape), language abuse can be easily avoided by closing the browsers or the eyes for any offended subjects. Regardless, the impact of words might just be more powerful than any physical damage to a human body because words are inspiring and can manipulate the human’s mind directly. As a result, in order to avoid any unnecessary fights and chaos into our society, the government should enforce a law to prohibit internet use for any hatred communication towards a target groups or individuals.

Hate Speech

Animals, including humans, are emotional sensitive. Since we are allow to express and share how much we love a certain event or group of people, there is no reason to limit the spread of hatred, which is just another form of our feelings. Just out of the interest and searched the question, ‚ÄúWhat to do if I hate someone?‚ÄĚ on the internet. The answers displayed are mostly ‚Äúavoid them‚ÄĚ and ‚Äúignore them‚ÄĚ. However, what if it is someone that is unavoidable? It is impossible to ignore and stay quite all the time as the human toleration has its limitation. We all need some form of release. By telling the hatred to the general public, we can determine whether or not this feeling towards the group or event is justified by finding people in agreement. The society needs the opposite force and negative speech to realize its imperfectness. Nonetheless, while I agree that the existence of hate speech in our society is significant, hatred talks should not appear anywhere over the internet.

Why not Internet?

The difference between making hated discussion on the internet and actually presented in front of the audience is its anonymity. Although anonymity is not really anonymous because it is still possible to track down the IP address and more to figure out who this user is, people has a tendency to feel that they are not exposed as long as their faces were not on display. This way of thinking makes highly educated people uneducated and feel free to do anything. They may not be the polite and respectful self as they appear when comprehending face-to-face to the others. Words can just come out like that without filtering by the brain first. It is by no means making negative comments for improvements, but a string of pointless characters.

Secondly, the anonymous article or comments might be written by somebody with no education background at all. This can be bring misleading hatred information to the general audience as they do not have the access or methods in finding out who wrote it. In this case, it might be fine to Canadians because the majority of the people have at least high school diploma. They have a good sense of what actions are socially acceptable ‚Äúright‚ÄĚ and ‚Äúwrong‚ÄĚ. However, countries such as China still have citizens that are too poor to afford education that misleading speech and uncredited documents can easily guide them to revolting against the government. If given the identity of the writer, the people can at least distinguish the justice based on the record of that writer.

Thirdly, feeling good after expressing the hatred towards a group over on a internet is most likely to be the only positive effect. No other benefits will be given both to the writer or the target. The targeted group of individual will certainly be hurt by the unwanted statements and despise the writer. The writer’s life will be in danger as well as he/she creates more enemy. In a sense, giving the restriction on posting hatred on a website or any discussion forum is protecting the attackers also.

For example, the Vanguard New Network is an online newspaper distributing issues periodically that holds grudges against Jews. According to Waltman and Haas [1], the readers can find the names of the editor and other 22 writers. They also notified the readers that they are ‚Äú… a group of disgusted and disaffected writers driven out of academia and journalism by the Semitrical Correctness that has denatured our culture.‚ÄĚ [1] This is a perfectly rigid website for expressing their hatred because they have defined who they are and gave the readers warning of the contents. It is easy to tell that these group of people are really expressing their view and will take responsibility of their words.

The Power of Speech

By now, we should realize how powerful the language is. An good old idiom [2] by an English novelist wrote, ‚ÄúThe pens are mightier than the swords‚ÄĚ. The more people one can convince, the greater strength they will receive in defending their position. For instance, during election period, we always find candidates giving speeches that list all the benefits that they may or may not accomplish within the given power. Religions also gain the fame and status by giving speeches to spread their ideas and beliefs throughout the world. Language is a powerful tool to control the human’s mind and to manipulate our way of thinking. Therefore, we should always ensure to use this powerful tools properly and not using it blindly like machine guns. Then again, it’s the government’s duty as a parent to protect its citizen.

The Government

One of the government’s job is to create a safe environment for the people to live peacefully together. In order to accomplish so, they want to decrease the amount of the causes of fighting as much as possible. The freedom of speech on the internet, which can be read and discussed all over the globe, is the hardest control flow that the government can intrude and take judgements. The government should enforce a law on preventing internet hatred.


Because Internet allow users to hide or fake their identity easily, people don’t take responsibility for what they have written down. Language has the greatest potential impact on the humans. As a result, the utilization of the language should be carefully watched over by the government for it to ensure that peace is maintained and do not result any civil wars.


[1] M. Waltman and J. Haas, the communication of hate. New York: Peter Lang Publishing, Inc., 2011, pp. 64-65.

[2] English language cyber center, English Idioms and Proverbs. 2005. [Online]. Available:

http://oels.byu.edu/student/idioms/idiomsmain.html. [Accessed Feb. 28, 2013]

How technology benefits our social skills


What are friends? Friends, along with family, are the people that we interact with everyday. While we cannot choose what family we wish to born in or who these members are, we have a choice for making friends. Friends are usually those people who share common interest and develop interesting conversation. We all have different definitions of fun in our mind; friends are those who understand and agree the fun is indeed, fun. With the innovation of technology, we are given the opportunity to meet a wide range of people across the globe without any physical boundaries, and we can still keep perfectly in touch with our old friends. We can express ourselves more freely. We don’t need to worry about how terrible we may look physically as we use social media to form conversation. There is no need to waste time putting on make-up or thinking about what clothes to put on. With these social technologies, we talk and chat anytime and anywhere. Technology and other social tools widen our network circles and improve our abilities to interact with the other human beings.


Smart phones these days allow us to connect with the contacts more easily. With the development of 3G and wireless networks, we can call or text them any time. For example, a person can call his/her friends to join for a cup of coffee while feeling too lonely studying for exams. Beside the fact that the convenience of getting in touch with the others, imagine the case the following case:

You are sitting at the back side of the bus. The seats arrangement is designed that you are facing directly at the people on the opposite side. To avoid the uncomfortable eye ¬† contact ¬† with strangers, you took out the phone the pocket and started messaging or ¬†¬†¬†¬†¬†¬†¬† performed ¬†¬†¬†¬† other activities that you can do with your phone. Just then, you heard a voice over the ¬†¬† shoulder saying: “Hey, is that the new Blackberry Z10?”

This is speaking from a personal experience and this is most likely considered to be a rare case. Normally, if a person ignores the other, that other usually ignores it back. The scenario presented is just demonstrating that if people have the desire to talk to another, they will find every little interesting topic about the thing you do regardless of the activity. In this sense, cell phone technology not only allows us to connect with the ones already in our contacts without the bound of time and place, but it also provided us another common interest to perform interactions with strangers.

Internet: Equality

Many social tools on the Great Internet only acquire account information and no require field for personal information (such as photos, heights, or race). This means that everyone can speak equally and chat with no discrimination. Because there is no worry regarding the physical appearance, the people can express their feelings and minds more openly. With services like facebook or line, people can share their feelings or emotions to all their friends and start conversations, or send private messages to particular individual. They can choose the audience that they wish to present. Similar idea applies with most of the online multiplayer role playing games. The gamers are allowed to customize their characters in their dream and portray the actions that they justified as heroic in the virtual gaming world. To be able to create a new character is actually the first step to help the user build up their confidence. This encourages the users to interact with other characters in the game more freely and equally. Without giving away the physical identity of what a person look like, he/she is able to express their innermost feelings and be their real self.

Internet: Privacy

Because most of the social networking tools allow users to hide their identity and value the users’ privacy, organizations actually use it to help and solve issues that some people have encountered. For instance, Nancy Lublin, a CEO member, described in her video [1] that because texting is quiet and private and teenagers are just that familiar and comfortable using the device, they are more willing to ask for assistance with the personal matter by sending text messages to the organization. Not only does technology improves the interactions with the other people, but it also resolve many private problems that humans do not normally feel comfortable meeting an counselor, talking face-to-face to seek for help.

Technology and New Friends

For more people who would like to meet real world friends, there are many tools that help the users of this form too. Badoo, for example, is a social dating online service that makes sure that the account created isn’t a fraud. It needs confirmation from a text message and facebook account. Then it requires a real photo of what you look like to avoid fakers before giving the permission to start conversation with the other users. The program determines the user’s approximate location and recommends friends mainly base on that for people to meet up. Like other messaging tools, users can fill their interests so that they can find people of their kind more easily. Although it defines itself as a dating site, users can also choose to make new friends instead of flirting. Services like Badoo protects the users by making a “no fraud zone”, breaks the ice by having the user interact through messages, and meet up if they wish to.

Inefficient communications

Comparing the speed of texting with two fingers and talking to another person directly, we are losing a significant time as forming conversation in the real-time. In order to get the messages across more efficiently, people reply with only the important words and losing the accuracy in grammar and spelling more critically. This leads to a new revolution of the language. According to [3], text messaging brings a negative impact on adolescent’s grammar skills. And, of course, spelling errors is a more critical case as the smart phones nowadays have auto-correct or word-guessing features for the users to save time from typing. But, the ability to spell correctly might not be as necessary skill to have in the future. There is no need for human beings to memorize exactly how a word is spell because software applications can just autocorrect the errors for us. Documents and papers in the modern world are in printed format instead of in handwritten form. Even when having a face-to-face conversation with another person, there is no problem with the spelling either. Although not quite mature yet, there are voice recognition programs that compute all the words for humans. Thus, spelling is not a practical skill for the future generations.

As in business, companies in the modern society must have use these communication tools. Firstly, most middle or larger businesses have at least an email or phone contact for the customer services. Companies have different sorts of contact information released to the public. Secondly, on a global scale, communication for meetings between countries is possible through video chatting.

Emotions and Text

Not only we are losing accuracies in the original language, people believe that texts do not show the emotions. It is difficult to tell how we feel about a subject when we cannot see the others’ facial expressions. It is possible to get through with emoji and emoticons, but the icons are limited and when people sent these small pictures, the receiver often think that the sender is in a good mood. This should actually be an advantage with using texting or messaging tools because people can hide their “ugly” side. For example, Tina sent a message to Tom saying that she and Jimmy are going out. Tom loves Tina, but she saw him nothing more than a childhood friend. With the expressionless texts, Tom can be crying or cursing, but wish her for the happy in reply at the same time. By utilitarianism, it might be a good end since Tina and Jimmy are happy, and Tom can probably still keep his friendship with Tina. Because we all prefer people to see our brighter side and dislike being seen when feeling down, having conversation without revealing the true feelings is rather more desirable.

The safety concern with meeting new people online has raised the attentions. There are all kinds of stories from the local or global news such that people are murdered, being fooled with money, etc. when meeting online friends in real life.

Another problem that people believe in chatting with technology tools is that we are losing the ability to solve problem face-to-face. People are not making proper eye contact and get nervous easily when having conversations without the protection of screens. While it might be true that proper eye contact and uneasiness with direct conversations, we are not losing the ability to solve problems. Messaging tools is a slow yet refine process. Because our typing speed is not as fast as speaking out the words, we are giving more time to think about what the problem is and what would be the best reply.


The purpose of developing technology is to better humans’ lives. Social networking tools allow people to meet a variety of new friends while keeping in touch with the olds. The networking websites provide the features that allow people to find the others with common interests more easily. Although holding conversation over screens or devices can result language discrepancy and problems when dealing face-to-face problems, it might not be as critical because we are not likely to deal with these problems in the future. There is no need to solve problems face to face when we can have done it in a more thoughtful, efficient way such as talking over the phone or messaging. Technology helps managing people’s relationship which is what benefits our social life.


[1] N. Lublin. (2012, Feb.). Nancy Lablin: Texting that saves lives. [Online] Available:


[2] L. Suval. (2012, May. 2). Does Texting Hinder Social Skills? [Online] Available:


[3] D. P. Cingel and S. S. Sundar. (2012). Texting, techspeak, and tween: The relationship between text messaging and English grammar skills. [Online] Available:   http://nms.sagepub.com/content/14/8/1304

Compiler Notes

Notes that I should study/review…

  1. 2013-01-10-Note-18-55
  2. 2013-01-15-Note-19-45
  3. 2013-01-17-Note-19-51
  4. 2013-01-21-Note-20-28
  5. 2013-01-29-Note-18-36
  6. 2013-01-31-Note-19-06
  7. 2013-02-05-Note-14-31
  8. 2013-02-26-Note-15-14
  9. 2013-02-28-Note-18-36
  10. 2013-03-05-Note-21-41
  11. Midterm..
  12. 2013-03-12-Note-21-34
  13. 2013-03-26-Note-21-51
  14. 2013-03-28-Note-08-52
  15. 2013-04-02-Note-09-49
  16. 2013-04-04-Note-10-22

Chapter Summaries:

Summary of Chapter 9


Global Common Subexpressions: An important optimization is finding computations of the same expression in two different basic blocks. If one precedes the other, we can store the result the first time it is computed and use the stored result on subsequent occurrences.

Copy Propagation: A copy statement, u = v, assigns on variable v to another, u. In some circumstances, we can replace all uses of u by v, thus eliminating both the assignment and u.

Code Motion: Another optimization is to move a computation outside the loop in which it appears. This change is only correct if the computation produces the same value each time around the loop.

Induction Variables: many loops have induction variables, variables that take on a linear sequence of values each time around the loop. Some of these are used only to count iterations, and they often can be eliminated, thus reducing the time it takes to go around the loop.

Data-Flow Analysis: A data-flow analysis schema defines a value at each point in the program. Statements of the program have associated transfer functions that relate the value before the statement to the value after. Statements with more than on predecessor must have their value defined by combining the values at the predecessors, suing a meet (or confluence) operator.

Data-Flow Analysis on Basic Blocks: Because the propagation of data-flow values within a block is usually quite simple, data-flow equations are generally set up to have two variables for each block, called IN and OUT, that represent the data-flow values at the beginning and end of the block, respectively. The transfer functions for the statements in a block are composed to get the transfer function for the block as a whole.

Reaching Definitions: The reaching-definitions data-flow framework has values that are sets of¬†statements¬†in the program that define values for one or more variables. The transfer function for a block kills¬†definitions¬†of variables that are definitely redefined in the block and adds (“generates”) in those¬†definitions¬†of variables that occur¬†within¬†the block. The confluence operator is union, since definitions reach a point if they reach any predecessor of that point.

Line Variable: Another important data-flow framework computes the variables that are live (will be used before redefinition) at each point. The framework is similar to reaching definitions, except that the transfer function runs backward. A variable is live at the beginning of a block if it is either used before definition in the block or is live at the end of the block and not redefined in the block.

Available expressions: To discover global common subexpressions, we determine the available expressions at each point – expressions that have been computed and¬†neither¬†of the expression’s arguments were redefined after the last computation. The data-flow framework is similar to reaching definitions, but the confluence operator is intersection rather than union.

Abstraction of Data-Flow Problems: Common data flow problems, such as those already mentioned, can be expressed in a common mathematical structure. The value are members of a semilattice, whose meet is the confluence operator. Transfer functions map lattice elements to lattice elements. The set of allowed transfer functions must be closed under composition and include the identity function.

Monotone Frameworks:¬†A semilattice has a <= relation defined by¬†a <= b if and only if a¬†őõ b = a. Monotone frameworks have the property that each transfer¬†function¬†preserve the <=¬†relationship; that is,¬†a <= b implies¬†f(a) <= f(b),¬†for all lattice elements¬†a¬†and¬†b and transfer function¬†f.

Distributive Frameworks:¬†These framework satisfy the condition that¬†f(aőõb) = f(a)őõf(b), for all lattice¬†elements¬†a and¬†b and transfer function¬†f. It can be shown that the distributive condition implies the monotone condition.

Iterative Solution to Abstract Frameworks: All monotone data-flow frameworks can be solved by an iterative algorithm  in which the IN and OUT values for each block are initialized appropriately (depending on the framework), and new values for these variables are repeatedly computed by applying the transfer and confluence operations. This solution is always safe (optimizations that it suggests will not change what the program does), but the solution is certain to be the best possible only if the framework is distributive.

The Constant Propagation Framework:¬†While the basic frameworks such as reaching definitions are¬†distributive¬† there are interesting monotone-but-not-distributive framework as well. One¬†involves¬†propagating constants by using a semilattice whose elements are mappings from the program variables to constants, plus two special¬†values¬†that represent “no information” and “definitely not a constant.”

Partial-Redundancy Elimination: Many useful optimizations, such as code motion and global common-subexpression elimination  can be generalized to a single problem called partial-redundancy elimination. Expressions that are needed, but are available along only some of the paths to a point, are computed only along the paths where they are not available. The correct application of this idea requires the solution to a sequence of four different data flow problems plus other operations.

Dominators: A node in a flow graph dominates another if every path to the latter must go through the former. A proper dominator is a dominator other than the node itself. Each node except the entry node has a immediate dominator Рthat one of its proper dominators that is dominated by all the other proper dominators.

Depth-First Ordering of Flow Graphs: If we perform a depth-first search of a flow graph, starting at its entry, we produce a depth-first spanning tree. The depth-first order of the nodes is the reverse of a postorder traversal of the tree.

Classification of Edges: When we construct a depth-first spanning tree, all the edges of the flow graph can be divided into three groups: advancing edges (those that go from ancestor to proper descendant), retreating edges (those from descendant to ancestor) and cross edges (others). An important property is that all the cross edges go from right to left in the tree. Another important property is that of these edges, only the retreating edges have a head lower than its tail in the depth-first order (reverse postorder).

Back Edges: A back edge is one whose head dominates its tail. Every back edge is a retreating edge, regardless of which depth-first spanning tree for its flow graph is chosen.

Reducible Flow Graphs:  If every retreating edge is a back edge, regardless of which depth-first spanning tree is chosen, then the flow graph is said to be reducible. The vast majority of flow graphs are reducible; those whose only control-flow statements are the usual loop=forming and branching statements are certainly reducible.

Natural Loops:¬†A natural loop is a set of nodes with a header node that¬†dominates¬†all the nodes in the set and has at least one back edge entering that node. Given any back edge, we can¬†construct¬†its natural loop by talking the head of the edge plus all nodes that can reach the tail of the edge without going through the head. Two natural loops with different headers are either disjoint or one is completely contained in the other; this fact lets us talk about a hierarchy of the nested loops, as long as “loops” are taken to be natural loops.

Depth-First Order Makes the Iterative Algorithm Efficient: The iterative algorithm requires few passes  as long as propagation of information along acyclic paths is sufficient; ie., cycles add nothing. If we visit nodes in depth-first order, any data-flow framework that propagates information forwards, e.g., reaching definitions, will converge in no more than 2 plus the largest number of retreating edges on any acyclic path. The same holds for backward-propagating frameworks, like live variables, if we visit in the reverse of depth-first order (i.e., in postorder).

Regions: Regions are sets of nodes and edges with a header h that dominates all nodes in the region. The predecessors of any node other than h in the region must also be in the region. The edges of the region are all that go between nodes of the region, with the possible exception of some or all that enter the header.

Regions and Reducible Flow Graphs: Reducible flow graphs can be parsed into a hierarchy of regions. These regions are either loop regions, which include all the edge into the header, or body regions that have no edges into the header.

Region-Based Data-flow analysis: an alternative to the iterative approach to data-flow analysis is to work up and down the region hierarchy, computing transfer functions from the header of each region to each node in that region.

Region-Based Induction Variable Detection: An important application of region-based analysis is in a data-flow framework that tries to compute formulas for each variable in a loop region whose value is an affine (linear) function of the number of times around the loop.

Summary of Chapter 8


Code generation is the final phase of a compiler. The code generator maps the intermediate representation produced by the front end, or if there is a code optimization phase by the code  optimizer, into the target program.

Instruction selection is the process of choosing target-language instructions for each IR statement.

Register allocation is the process of deciding which IR values to keep in registers. Graph coloring is an effective technique for doing register allocation in compilers.

Register assignment is the process of deciding which register should hold a given IR value.

A retargetable compiler is one that can generate code for multiple instruction set.

A virtual machine is an interpreter for bytecode intermediate language produced by languages such as Java and C#.

A CISC machine is typically a two-address machine with relatively few registers, several register classes, and variable-length instructions with complex addressing modes.

A RISC machine is typically a three-address machine with many registers in which operations are done in registers.

A basic block is a maximal sequence of consecutive three-address statements in which flow of control can only enter at the first statement of the block and leave at the last statement without halting or branching except possibly at the last statement in the basic block.

A flow graph is a graphical representation of a program in which the nodes of the graph are basic blocks and the edges of the graph show how control can flow among the blocks.

A loop in a flow graph is strongly connected region with a single entry point called the loop header.

A DAG representation of a basic block is directed acyclic graph in which the node of the DAG represent the statements within the block and each child of a node corresponds to the statement that is the last definition of an operand used in the statement.

Peephole optimizations are local code-improving transformations that can be applied to a program, usually through a sliding window.

Instruction selection can be done by a tree-rewriting process in which tree patterns corresponding to machine instructions are used to tile a syntax tree. We can associate costs with the tree-rewriting rules and apply dynamic programming to obtain an optimal tiling for useful classes of machines and expressions.

An Ershov number tells how many registers are needed to evaluate an expression without storing any temporaries

Spill code is an instruction sequence that stores a value in a register into memory in order to make room to hold another value in that register.