Wednesday, April 4, 2012

Cloud Computing Paper Reading Summary 10

In the paper Cloud Computing Architecture for Social Computing - A Comparison Study of Facebook and Google, which is published by Bo Wen Yang, authors compares the architecture between Google and Facebook Cloud Computing Architecture.


According to resource scarcity, there is a tradeoff between the application functionality versus future scalability.


The typical distributed architecture consists of a number of layers:


Application logic ( Ruby on Rails, Scala )


Caching ( Memcache, SQL query caching )


Database backend  ( RDBMS clusters, CouchDB, Google's BigTable or Amazon's Dynamo )




Business model, server hardware, data center and distributed architecture.



Wednesday, March 28, 2012

Stupid faults in ASST2 of OS161

1. Only call vfs_chdir() in sys_chdir() implementation.

2. Unclear about using vnode in sys___getcwd() implementation such as extract vnode->vn_data as cwd.

Sunday, March 18, 2012

Cloud Computing Paper Reading Summary 9

In the paper Google Cloud Computing Platform Technology Architecture and the Impact of Its Cost, which is published by Jia Xiaojing, the author compares the architecture between Google Cloud Computing platform and traditional IT system.

Data Storage Technology

Core technical indicators: storage reliability, I / O throughput and scalability.

Google developed a distributed file system based on several assumptions:
Hardware failures are the norm.
Supporting large data sets.
Processing mode of write once and read many.
High concurrency.

To ensure reliability of data, Google File System uses a redundant storage means.

GFS's writing operation separates control signal from data flow.

Data Management Technology


Google developed a large-scale database system Big Table with the weak consistency requirements.

Big Table system depends on the underlying structure of the cluster system, which includes a distributed cluster task scheduler, the GFS which has been addressed above, and a distributed lock service Chubby.

Big Table's main server not only manage the metadata but also is responsible to manage remotely and allocate for the Tablet Server.

Programming Model

Map Reduce is not only the programming model that processes and brings about a large data set but also an efficient task scheduling model. (The programmer can finish the distributed parallel program development that specifies the data processing to each block data in the Map function and how to regress the intermediate results of the block data processing in the Reduce function)

Five steps to implement Map Reduce program:
1. input file
2. assign one file to many parallel workers
3. write intermediate file (local writing)
4. reduce workers running
5. output the final result

In Map Reduce model, because data is managed dispersively by each node, there is no separate, centralized database system, and each node can only operate the data managed by it. Consequently it needs the intervention of upper application software to ensure consistency and integrity of across-node data.

The system in the Map Reduce mode increases the map that decomposes the task, the Reduce other processing link about the protocol of results, and parallel processing to support multiple worker node, while need to complete the failure handling about worker node, as well as coordination and communication between the worker nodes and so on.

Cost Analysis of Google Cloud Computing Platform

Due to the distributed data storage and data management, Google reduces the capacity requirements on a single node.

It is easy to achieve standardization of equipment because all nodes are isomorphic.

Google Cloud Computing platform takes hardware failure as the norm and turns to switch automatically between nodes to achieve high availability by means of software fault-tolerant, significantly reducing equipment redundancy.

Based on the unique advantages of parallel computing, Google has developed excellent load balancing technology that enable to ensure business continuity in the means of dynamic load switching in different data centers worldwide.

Conclusion

3 Basic Characteristics of Google Cloud Computing Platform Architecture

1. system built on large-scale clusters of cheap servers
2. build synergies between infrastructure and the upper application (to achieve maximum efficiency in utilization of hardware resources)
3. achieve fault-tolerant nodes through software

Google applies Top-Down design method, namely, from the upper application, the infrastructure is reconstructed based on the operational characteristics about the specific application (rather than the optimization of a general sense)




Cloud Computing Paper Reading Summary 8

In the paper Mobile Cloud Computing as Future For Mobile Applications - Implementation Methods and Challenging Issues published by Shahryar S. Qureshi, etc. Authors pointed out that Cloud Computing is expected to bring an innovation in mobile computing, where the mobile devices can use clouds for data processing, storage and other intensive operations. In the paper, authors introduce state-of-the-art Mobile Cloud Computing and its implementation methods.

Nowadays we use desktop computer and servers tied together to create a so called Cloud Computing System.

Mobile Cloud Computing is defined as extension of Cloud Computing with a new ad-hoc infrastructure based on a mobile device.

Simple viewpoint refers that both data storage and data processing is carried outside the mobile devices. Cloud resources are utilized for processing and storage purpose.

1. The advantage of this concept is that Mobile Cloud Computing applications are not constrained to a certain kind of mobile devices or operation systems.

2. No need to worry for the storage capacity and computation speed limitation.

Mobile device view point refers that both data storage and data processing is that nowadays mobile devices (smart phones, tablets etc) are more intelligent and highly developed.

The advantage of such viewpoint is to provide user an ownership (to store and maintain data on personal mobile device).

Mobile Cloud Computing


The Cloud Computing services in a mobile ecosystems incorporating consumer,  enterprise, femtocells, transcoding, end-to-end security, home gateway and mobile broadband-enabled services.

Mobile Cloud Computing is made up of a complex network and relationships of and in between Infrastructure Providers, Application / Services Providers (ASP), End users and developers and are connected through Internet.

Mobile Cloud Computing exploits user's information such as location, context, accessed services and network intelligence. Also Mobile Cloud Computing can be a solution to the limitations in Cloud Computing such as limited bandwidth capacity and poor network connectivity.

General purpose Mobile Cloud Computing (GPMCC)

Augmented execution for smart phones using clone clouds

Application specific Mobile Cloud Computing (ASMCC)

Mobile service clouds model enables dynamic instantiation, composition, configuration and reconfiguration of services to be used by the mobile user.

Weblets can be exchanged between mobile devices and clouds. Using elastic computing resources provides solution for authentication, secure session management, secure migration between weblets running mobile devices and those on clouds.

RESTful web services are to offload computational capacity, storage and security (of mobile device) to cloud by utilizing the RESTful web services.

Some Potential Barriers and Issues

Barriers

1. Only SaaS has been implemented in Mobile Cloud Computing because of mobile devices ' insufficient storage capacity, battery, poor display and computing power. (Opportunities for PaaS and IaaS)

2. Absence of standards.
Limited scalability, unreliable availability of service and service provider lock-in.

Potential Issues

1. Resource poverty of mobile devices
2. Network bandwidth and latency
3. Network availability and intermittency
4. Security concerns

Future Search 

1. Security issues
2. The mobile cloud architecture for heterogeneous wireless network should be investigated
3. A single access platform is required to establish for MCC on the various operating systems platform (e.g. Android, Symbian, Apple iOS, Chrome, MeeGo, Windows Phone)

Cracking The Coding Interview reading notes 2

At the Interview | Five Algorithm Approaches


Approach 1: Examplify
Approach 2: Pattern Matching
Approach 3: Simplify & Generalize
Approach 4: Base Case and Build
Approach 5: Data Structure Brainstorm


At the Interview | The Offer and Beyond



What about your career option?


Career Path
Promotion Opportunity 
Money and Benefits
Happiness
Brand Name


At the Interview | Top Ten Mistakes Candidates Make



#1 Practicing on a Computer
#2 Not Rehearsing Behavioral Questions
#3 Not Doing a Mock Interview
#4 Trying to Memorize Solutions
#5 Talking Too Much
#6 Talking Too Little
#7 Rushing
#8 Not Debugging 
#9 Sloppy Coding
#10 Giving Up

Thursday, March 15, 2012

Cloud Computing Paper Reading Summary 7

In the paper A QoS-AWARE System for Mobile Cloud Computing published by Peng Zhang and Zheng Yan, authors put forward a QoS framework for Mobile Cloud Computing and an adaptive QoS management process to manage QoS assurance in Mobile Cloud Computing environment, thus their QoS management model is based on Fuzzy Cognitive Map (FCM).

QoS refers to a set of properties including objective ones such as transmission rate, delay variance, packet loss, cost and reputation, and also subjective ones like user experience, trust, privacy concern and satisfaction degree.

Mobile Cloud Computing are often affected by many specific factors like hardware and software limitations of mobile devices, signal strength of mobile networks, mobility of mobile users and so on.

The research work on Cloud Computing falls in various aspects such as Cloud Computing architecture, middle-ware design, cloud services, cloud security and resource management.

In a mobile device, a QoS agent monitors QoS status at run time, for example, percentage of memory and CPU consumption, connection speed, remaining battery percentage and packet loss rate, etc.

The QoS management center aggregates and analyzes the huge set of QoS data, and dynamically adjusts resources to meet QoS requirements of each mobile cloud service.

The QoS management supports context awareness by adaptively selecting a proper set of service modes that can always ensure the quality of cloud services.

FCM specifies the interconnections and influences between nodes. It also permits updating the construction of the graph, such as adding or deleting an interconnection or a node. Thus we can utilize it to predict the performance of cloud service modes in order to select the best one.

The adaptive QoS management system for Mobile Cloud Computing facilities QoS prediction, establishment, assessment and assurance.

Two directions to go ahead:
1. generating a good model with suitable configurations.
2. implementing the solution

Cloud Computing Paper Reading Summary 6

In the paper Review of Mobile Cloud Computing published by Weiguang Song and Xiaolong Su, they summarized both general Cloud Computing and Mobile Cloud Computing.

They pointed out that Cloud Computing is a kind of distributed computing whose main idea is to disperse data process.

They put forward that Mobile Cloud Computing is the combination of mobile computing, mobile internet and Cloud Computing.

Mobile Cloud Computing is to share resources and transport data of computers or other intelligent terminal equipments like cell phones.

Character of Mobile Cloud Computing

1. Hardware of handheld equipment and independence of the system.

2. Effectiveness of task processing.

3. Convenience of sharing data.

4. Elimination of regional limitation.

Mobile Cloud Computing System Architecture: access layer (access control layer), basic managing layer, virtual layer and physical layer.

Problems of Mobile Cloud Computing

1. cell phone platform
2. cloud end system
3. stability of bandwidth
4. input and output interface
5. service provider
6. individualization of handheld equipment
7. loss of battery and network flow

Mobile Cloud Computing Application
1. Android platform
2. MOTOBLUR (proposed by Motorola in Oct 2009 )
3. UCWEB

Cloud Computing Paper Reading Summary 5

In the paper Overview and Analysis of Cloud Computing Research and Application published by Yizeng Chen etc. , authors summarize definition, characteristics, classification and challenges.

They pointed out a definition which has been generally accepted is that Cloud Computing is the developing result of Grid Computing, Distributed Computing, Parallel Computing, Utility Computing, Network Storage technologies, Virtualization, Load Balance etc. traditional computer technology.

There is not too much fresh ideas in this paper, but it reminds me reconsider about the development trend of IaaS, PaaS and SaaS. Move computation processing and storage to the cloud and transfer user client to I/O port in order to reduce users' burden? Or maintain computing and storage in the local? It is a question.

Tuesday, March 13, 2012

PHP Study



What is it?

Scripting Language
Server Side Language
EasyPHP Software

What can it do?

Take information from forms and store it in a database
Run threaded discussions
Serve XML pages
Build Web Applications

Value Data Types

PHP is a loosely-typed language. A variable does not need to be a specific type and can freely move between types.

Naming Rules

The first character must  be the dollar sign ($).

Variables are case sensitive.

HTML, CSS and JavaScript study



HTML -> structure 

HTML is HyperText Markup Language.

HTML is a formatting language rather than programming language.

Data informs markup.

Recommended (HTML5) DOCTYPE


CSS -> presentation

CSS is Cascading Style Sheets

Inline, Embedded and External CSS.

CSS Semantic:Selector, Declaration, Cascade.


JavaScript -> behavior

JavaScript makes pages interactive.

Embedded JavaScript is easy for maintaining.

External JavaScript is great.

JavaScript is a programming language.

Variables, Operators, Strings, Arrays and Functions, Conditionals, Loops, Objects (Properties and Methods). 

The DOM (Document Object Model).

Events occur whenever actions happen on the page.

You can attach listener functions to an event on an element.

Object detection

You can change the style.

You can change the class(es).

You can alter default events. (Browsers have default events like having default CSS)

Monday, March 12, 2012

The Google Resume reading notes 3

Chapter 3 Getting in the Door

The Black Hole: Online Job Submission


Making the Best of the Black Hole


To increase your chances of getting a call, make sure you follow every instruction

Second, if the job opening is fresh, apply quickly.

Third, put yourself in the shoes of the hiring manager.

Fourth, remember that just because you discover the opening through a job web site doesn't mean you have to apply through it. (Send a personalized note to the recruiters or hiring mangers)

Getting a Personal Referral 


Tell Your Friends


Make Yourself Known 


Blog, LinkedIn, Facebook and Twitter communication

The Informational Interview


Reach Out to Recruiters

A quick Internet search with a query like will turn up recruiters from virtually every major company.

Alumni Network and Beyond


Career Fairs

Do your homework
Prepare questions
Prepare answers
Practice your elevator pitch
Tailor your resume
Dress appropriately
Follow up

a portfolio of projects
How did you build it? What did you enjoy? What did you learn? What was the hardest part?

Contract Roles

A contract role can be a wonderful way to have flexibility in life (nine months on, three months of vacation!) or to experience a company sans commitment.

To transfer to full-time employee (FTE) , you need to perform well, build connections, discover open positions, and, yes, interview just like anyone else off the street.

Get Creative 

Example, import  resume to Google Docs

Quality, Not Quantity: How to Build a Network that Works

Networking is about what you do when you don't need a network.

Be giving/ Be open / Be the connector

Immerse Yourself in Start-ups

Contributing Online

Create a web site
Start a blog
Write guest blog posts
Answer questions
Get involved with GitHub

The Google Resume reading notes 2

Chapter 2 Advanced Preparation

What Can You Do: An Overview
Develop a track record of achievement
Learn to write and speak
Emphasize depth over breadth
Become a leader
Find a mentor (or become a mentor)
Develop a tangible skill
Learn about technology

Academics

Get Project Experience

Grade Point Average: Does It Matter and What Can You Do?
Companies care about what you can actually do, and your interview performance is generally considered a better indication of that than some silly number.

Doctor Who? Getting to Know Professors
Get involved in their research
Ask them for help
Become a teaching assistant
Lunch, coffee, or office hours

Work Experience

Make an Impact
Think broadly
Be really, really good at what you do
Solicit feedback proactively
Learn about other teams

Become a Generalist

The best program managers, the best markets, and the best developers have something in common: they each understand the others' roles.

Understanding the roles around you will enable you to perform better at your own job by offering greater context, while also offering you transferable skills.

Size Matters: Quantify Your Impact

Can you quantify its impact in terms of dollars, hours, or reduced sales calls? Seek out this information when it happens to ensure that you can get the most precise, accurate data.

Part-Time Jobs and Internships
Help a professor out with research
Contact a start-up
Volunteer for a nonprofit

Remember that experience builds on itself. (Web Development->Microsoft->Apple->Google)

The Google Resume reading notes 1

The Google Resume is written by Gayle Laakmann McDowell and it worth reading for the ones who want to join in the field of technology.

Chapter 1 Introduction

Work/Life Balance

Moving Up: Individual Contributors

The Differences

Amazon, many would argue, is more of a retail company than a software company. It is leading in multiple industries (retail, cloud computing,  etc.) largely because of its technical innovation.

Apple is just as secretive inside as it is outside.

Microsoft has dabbled (and reasonably successfully) with search and the web, but a large chunk of its earnings come from Windows and Office.

Google is the nerdiest of nerdy.


Big vs. Little: Is a Start-up Right for You?

The Good
Diversity of skills
Leadership opportunities
Control and influence
Rapid results
High reward

The Bad
Long hours
Unclear job description 
Low pay
Limited credibility
Less mentorship

The Job Title: What Do You Want to Be When You Grow Up?

What Do You Need?
Money
Recognition and respect
Work/Life balance

How Do You Enjoy Working?
Teamwork vs. independent work
Creating vs. maintaining
Leading vs. joining

What Are You Good At?
Numbers
Writing and communication
Creativity
People skills


Sunday, March 11, 2012

Cloud Computing Paper Reading Summary 4

In the tech report Above the Clouds: A Berkeley View of Cloud Computing, which is published by Reliable Adaptive Distributed Systems Laboratory Professors in UC Berkeley, these authors summarized about almost every aspects of Cloud Computing and predict the future of Cloud Computing.

2. Cloud Computing: An Old Idea Whose Time Has (Finally) Come

What is Cloud Computing, and how is it different from previous paradigm shifts such as Software as a Service(SaaS)?

Why is Cloud Computing poised to take off now, whereas previous attempts have foundered?

What does it take to become a Cloud Computing provider, and why would a company consider becoming one?

What new opportunities are either enabled by or potential drivers of Cloud Computing?

How might we classify current Cloud Computing offerings across a spectrum, and how do the technical  and business challenges differ depending on where in the spectrum a particular offering lies?


What, if any, are the new economic models enabled by Cloud Computing, and can a service operator decide whether to move to the cloud or stay in a private datacenter?


What are the top 10 obstacles to the success of Cloud Computing---and the corresponding top 10 opportunities available for overcoming the obstacles?


What changes should be made to the design of future applications software, infrastructure software, and hardware to match the needs and opportunities of Cloud Computing?


3. What is Cloud Computing?


Cloud Computing refers to both the applications delivered as services over the Internet and the hardware and systems software in the datacenters that provide those services. The services themselves have long been referred to as Software as a Service (SaaS). The datacenter hardware and software is what we will call a Cloud.


Factors might influence these companies to become Cloud Computing providers:
1. Make a lot of money.
2. Leverage existing investment.
3. Defend a franchise.
4. Attack an incumbent.
5. Leverage customer relationship.
6. Becomes a platform.


4. Cloud in a Perfect Storm: Why now, Not Then?

4.1 New Technology Trends and Business Models.
4.2 New Application Opportunities
Mobile interactive applications.
Parallel batch processing.
The rise of analytics.
Extension of compute-intensive desktop applications
"Earthbound" applications

5. Classes of Utility Computing

Azure is intermediate between complete application frameworks like Google AppEngine on the one hand, and hardware virtual machines like EC2 on the other.

Different tasks will result in demand for different classes of utility computing.

6. Cloud Computing Economics

6.1 Elasticity: Shifting the  Risk 
"pay as  you go"
usage-based pricing
Few users deliberately provision for less than the expected peak.


6.2 Comparing Costs: Should I Move to the Cloud?
Pay separately per resource.
Power, cooling and physical plant costs.
Operation costs.
Tasks are shifted to the cloud provider.
Costs will be lower for managed environment than for hardware-level utility computing.

7. Top 10 obstacles and Opportunities for Cloud Computing

Each obstacle is paired with an opportunity.

#1 Obstacle: Availability of a Service


Simple Storage Service (S3)


The only plausible solution to very high availability is multiple Cloud Computing providers. (The best chance for independent software stacks is for them to be provided by different companies.)


Another availability obstacle is Distributed Denial of Service (DDoS) attacks.


The longer an attack lasts the easier it is to uncover and defend against.


#2 Obstacle: Data Lock-In



Concern about the difficult of extracting data from the cloud is preventing some organizations from adopting Cloud Computing.


1. The quality of a service matters as well as the price, so customers will not necessarily jump to the lowest cost service.


2. In addition to mitigating data lock-in concerns, standardization of APIs enables a new usage model in which the same software infrastructure can be used in a Private Cloud and in a Public Cloud. Such an option could enable "Surge Computing" in which the public Cloud is used to capture the extra tasks that cannot be easily run in the datacenter (or private cloud) due to temporarily heavy workloads.

#3 Obstacle: Data Confidentiality and Auditability

#4 Obstacle: Data Transfer Bottlenecks 



Applications continue to become more data-intensive.

One opportunity to overcome the high cost of Internet transfer is to ship disks.

A second opportunity is to find other reasons to make it attractive to keep data in the cloud.

A third, more radical opportunity is to try to reduce the cost of WAN bandwidth more quickly.

#5 Obstacle: Performance Unpredictability  


I/O sharing is more problematic.


One opportunity is to improve architecture and operating systems to efficiently virtualize interrupts and I/O channels.


Another possibility is that flash memory will decrease I/O interference.


Another unpredictability obstacle concerns the scheduling of virtual machines for some classes of batch processing programs, especially for high performance computing.


Many HPC applications need to ensure that all the threads of a program are running simultaneously.
Thus, the opportunity of overcome this obstacle is to offer something like "gang scheduling" for Cloud Computing.


#6 Obstacle: Scalable Storage


The opportunity, which is still an open research problem, is to create a storage system would not only meet these needs but combine them with the cloud advantage of scaling arbitrarily  up and down on-demand, as well as meeting programmer expectations in regard to resource management for scalability, data durability, and high availability.


#7 Obstacle: Bugs in Large-Scale Distributed Systems


A common occurrence is that these bugs cannot be reproduced in smaller configurations, so the debugging must at scale in the production datacenters.


One opportunity may be the reliance on virtual machine in Cloud Computing.


Since VM are de rigueur in Utility Computing, that level of virtualization may make it possible to capture valuable information in ways that are implausible without VMs. (de rigueur: prescribed or required by fashion, etiquette or customer)


#8 Obstacle: Scaling Quickly


Google AppEngine automatically scales in response to load increases and decreases, and users are charged by the cycles used. AWS charges by the hour for the number of instance you occupy, even if your machine is idle.


One RAD Lab focus is the pervasive and aggressive use of statistical machine learning as a diagnostic and predictive tool that would allow dynamic scaling, automatic reaction to performance and correctness problems, and generally automatic management of many aspects of these systems.


Another reason for scaling is to conserve resources as well as money.

#9 Obstacle: Reputation Fate Sharing

#10 Obstacle: Software Licensing 

The primary opportunity is either for open source to remain popular or simply for commercial software companies to change their licensing structure to better fit Cloud Computing.

8. Conclusion and Questions about the Clouds of Tomorrow

Application Software

The client piece needs to be useful when disconnected from the Cloud, which is not the case for many Web 2.0 applications today.  (Evernote?)

Infrastructure Software
Hardware System


Change In Technology and Prices Over Time


Will technology or business innovations accelerate network bandwidth pricing, which is currently the most slowly-improving technology?


Virtualization Level:


Dominated by low-level hardware virtual machines like Amazon EC2, intermediate language offerings like Microsoft Azure or high-level frameworks like Google AppEngine?

Friday, March 9, 2012

Cracking The Coding Interview reading notes 1

At the Interview | Handling Behavioral Questions

Structure Answers Using Situation (Scenario) - Action - Result

Ex: in operating system project a guy struggled and discuss few in emails, then the actor communicated with him and that guy performed better.

General Advice for Technical Questions

Interviews are supposed to be difficult. If you don't get every -or any-answer immediately, that's ok! According to author's experience, 10 of 120 people finished right instantly.

So when you get a hard question, don't panic. Just start talking aloud about how you would solve it.

You're not done until the interviewer says that you're done!

Five Steps to a Technical Question


1. Ask your interviewer questions to resolve ambiguity.
2. Design an algorithm.
3. Write pseudo-code first, but make sure to tell your interviewer that you're writing pseudo-code!
4. Write your code, not too slow and not too fast.
5. Test your code and carefully fix any mistakes.

Step 1: Ask Questions

Good questions might be like: What are the data types? How much data is there? What assumptions do you need to solve the problem? Who is the user?

Step 2: Design an Algorithm

1. What are the space and time complexities?
2. What happens if there is a lot of data?
3. Does your design cause other issue? (i.e., if you are creating a modified version of a binary search tree, did you design impact the time for insert/ find/ delete?)
4. If there are other issues, did you make the right trade-offs?
5. If they gave you specific data(e.g., mentioned that the data is ages, or in sorted order), have you leveraged that information? There's probably a reason that you're given it.

Step 3: Pseudo-Code

Writing pseudo-code first can help you outline your thoughts clearly and reduce the number of mistakes you commit.

Step 4: Code

You don't need to rush through your code; in fact, it will most likely hurt you. Just go at a nice, slow methodical pace.

1. Use Data Structures Generously: Where relevant, use a good data structure or define your own.

(i.e., what structure used to represent a person, which shows caring about object oriented design)

2. Don't Crowd Your Coding.

Step 5: Test

1. Extreme case: 0, negative, null, maximum, etc.
2. User error: What happens if the user passes in null or a negative value?
3. General cases: Test the normal case.

If the algorithm is complicated or highly numerical(bit shifting, arithmetic, etc.), consider testing while you're writing the code rather than at the end.

Also, when you find mistakes(which you will), carefully think through why the bug is occurring. Don't try to make "random" changes to fix the error.

When you notice problems in your code, really think deeply about why your code failed before fixing the mistake.

Before the Interview | Technical Preparation

Data Structures

Linked Lists
Binary Trees
Tries
Stacks
Queues
Vectors / ArrayLists
Hash Tables

Algorithms

Breadth First Search
Depth First Search
Binary Search
Merge Sort
Quick Sort
Tree Insert / Find /etc

Concepts

Big Manipulation
Singleton Design Pattern
Factory Design Pattern
Memory (Stack vs Heap)
Recursion
Big-O Time

Monday, March 5, 2012

Cloud Computing Paper Reading Summary 3

In the tech report, Above the Clouds: A Berkeley View of Cloud Computing, published by Professors in UC Berkeley Reliable Adaptive Distributed Systems Laboratory, these authors talked about almost every aspects of Cloud Computing and predict the future of Cloud Computing.


1. Executive Summary


The services themselves have long been referred to as Software as a Service(SaaS). The datacenter hardware and software are what we call a Cloud.


When a Cloud is made available i a pay-as-you-go manner to the general public, we call it a Public Cloud. The service being sold is Utility Computing.


Private Cloud is used to refer to internal datacenters of a business or other organization, not made available to the general public.


Cloud Computing is the sum of SaaS and Utility Computing, but does not include Private Clouds, according to the Berkeley professors.


From a hardware point of view, three aspects are new in Cloud Computing:
(1). The illusion of infinite computing resources available on demand.
(2). The elimination of an up-front commitment by Cloud users.
(3). The ability to pay for use of computing resources on a short-term basis as needed.


Any application needs a model of computation, a model of storage, and a model of communication.


Google AppEngine is targeted exclusively at traditional web applications, enforcing an application structure of clean separation between a stateless computation tier and a stateful storage tier.

Saturday, March 3, 2012

Programming Interviews Exposed reading notes 1

Approaches to Programming Problems
 (Secrets to Landing Your Next Job)

Take the time to make your code solid and pretty.

Lesson1: These problems are hard! Some of the questions are designed to see how you handle a problem when you don't immediately see the solution.

Lesson2: Brush up on the languages you expect to use, and write your best code.

Lesson3: Keep talking! Always explain what you are doing.

Lesson4: Many questions involve ridiculous restrictions, use obscure feature of languages, and seem silly and contrived. Play within the rules.

Lesson5: Make sure you understand the problem before you start solving it, then start with an example to solidify your understanding.

Lesson6: Explain what you are doing to your interviewer before and while coding the solution. Keep talking!

Lesson7: Try an example, and check all error and special cases.

Lesson8: When all else fails, return to a specific example. Try to move from the specific example to the general case and from there to the solution.

Lesson9: Sometimes a different data structure or advanced language feature is key to the solution. (advanced feature: bit operators, union types, complex pointer casting and advanced keywords )

p.s.
1. One of the shared traits of almost all interview coding questions is that the correct solutions are short. You rarely need to write more than 15 lines of code and almost never more than 30. If you start writing lots of code, it should be a warning that you may be heading in the wrong direction.
2. You often need to compare a value to NULL or 0.
    if ( elem != NULL ) { or if ( elem ) {


Friday, March 2, 2012

Cloud Computing Paper Reading Summary 2

In paper The Characteristics of Cloud Computing published by Chunye Gong etc. , these authors summarized the characteristics about cloud computing and compared Cloud Computing with High Performance Computing(HPC) and Grid Computing.

There are more than 20 definitions of cloud computing which seem to concentrate on certain aspects of this technology.
According to the provided capability type, cloud computing are divided into 3 classes:
a. Infrastructure as a Service(IaaS): delivery of huge computing resources such as the capacity of processing, storage and network. Also called Hardware as a Service(HaaS).
b. Platform as a Service(PaaS): abstracting the infrastructures and supporting a set of application program interface to cloud applications.
c. Software as a Service(SaaS): aiming at replacing the applications running on PC. A problem about SaaS is that the delay of network is fatal to real time or half real time applications such as 3D online game.

Cloud Computing is divided into 5 layers including clients, applications, platform, infrastructure and servers. 

The Cloud Computing has main characteristics like service oriented, loose coupling, strong fault tolerant, business model and ease use. As the paper authors said, the bird's eye about cloud computing or other research areas is the free encyclopedia Wikipedia.

The key characteristics of cloud computing are agility, low cost, device and location independence, multi-tenancy, high reliability, high scalability, security and sustainability. L.M. Vaquero etc. list up to 22 definitions and analyse characteristics of Cloud Computing. They pointed out that the clouds are a large pool of virtualized resources which are ease to use and access. Ten in their summary: user-friendliness, virtualization, Internet centric, variety of resources, automatic adaptation, scalability, resource optimization, pay-per-use, service SLAs(Service-Level-Agreements) and infrastructure SLAs.

Compared with HPC, Cloud Computing balanced powerful processing performance and low delay very well. Moreover, HPC is tight coupling, has too much data dependence or global among computing nodes. 

Since abstraction and accessibility are two keys to achieve the service oriented conception. Abstraction reduces both the need for cloud user to learn the detail of cloud architecture and threshold of application development.

With virtualization or other technologies, the infrastructures are separated in logic or physic, they will not affect each other. Whole Cloud Computing runs in a client-server model.

There are mainly four places where faults maybe occur in Cloud Computing: provider-inner, provider-across, provider-user and user-across.

When it comes to User Experience, it belongs to the subject of human computer interaction, which is an important criterion when evaluating whether an application is successful or not.
Cloud Computing performs better than Grid Computing in User Experience for 3 reasons:
a. Most cloud providers offer Internet-based interfaces which are simpler than other application program interfaces(API).
b. User Experience of web application is full studied so that the User Experience are independent from content.
c. The Web 2.0 increases the interactions between web users and providers.

Furthermore, Cloud Computing has characteristics such as TCP/IP based, virtualization and high security. They are all significant because TCP/IP provides reliable delivery, a connection-oriented service between remote applications. Cloud resources are often virtualized as a service over the Internet. High security relies on 3 factors: loose coupling; abstraction, virtualization, privation of cloud provider; technology cooperating with law.

In sum, the conceptional service oriented characteristic abstracts the details of Cloud Computing implementation. The loose coupling and strong fault tolerant stand for the main technical characteristics. Owing business model is the key differentiation compared with other academic researches and helps Cloud Computing flourishing. The ease use user experience helps Cloud Computing being accepted widely by non computer experts.


Project Euler 3

First time I thought about generating successive prime numbers to divide the aim number, whose reminder is zero. If the reminder is not zero, then the previous prime number is the largest prime factor of the aim number. But it doesn’t work, Floating Point Exception always displays. Code is following:

long int primegen(long int i)
{
long int temp_num;
temp_num = i;
if( temp_num % 2 == 0)
temp_num = 0;
else
{
int j;
long long int sqrt_result = (long long int)sqrt(temp_num);
for( j = 3; j < sqrt_result; j += 2)
{
if( ( temp_num % j ) == 0 ) temp_num = 0;
}
}
return temp_num;
}

int main()
{
long long int prime, prime_factor;
long long int aim;
aim = 600851475143;
int flag = 0;
long int count = 3;

while( flag == 0 )
{
if ( primegen( count ) > 0 );
{
prime = primegen( count );
if( ( aim % prime == 0 ) && ( prime <= aim ) )
prime_factor = prime;
else if ( prime > aim )
{
flag = 1;
}
}
count+=2;
}

printf(“The largest prime factor of the number 600851475143 is %lld\n”, prime_factor);

return 0;
}

After considering for some time, I cannot help checking solutions with Google. Then I found one solution in http://thetaoishere.blogspot.com/2008/05/largest-prime-factor-of-number.html

FindLargestPrimeFactor(n):

divide the number by successive integers (each denoted by i) upto sqrt(n),
when the remainder is 0, return the maximum among i and FindLargestPrimeFactor(n/i).
But in my eyes, it should be added the termination condition into the function FindLargestPrimeFactor(n):

If the reminder is 0, then return MAX( i , FindLargestPrimeFactor(n/i) ), but if the reminder is not zero until finish the whole loop and obviously, n is a prime number, so the recursion ends when it just returns n. My complete code is like this:

#include
#include
#include

// Find Largest Prime Factor
long long int FLPF(long long int i)
{
long long int aim;
long long int solution;
aim = i;
int counter_sol;

for( counter_sol=3; counter_sol{
if( aim % counter_sol == 0)
{

//printf(“The counter_sol is %d\n”, counter_sol);
solution = aim/counter_sol;
//printf(“The solution is %lld\n”, solution);
if( counter_sol < solution )
return FLPF(solution);
else return counter_sol;
}
}

return aim;
}

int main()
{
long long int aim;
long long int solution;
aim = 600851475143;
solution = 0;

printf(“The aim is %lld\n”, aim);
solution = FLPF(aim);
printf(“The solution is %lld\n”, solution);
return 0;
}

I feel I’m cheating because I borrowed the main idea from the website even though I add termination condition by myself.

I was trapped in the math procedure and the more efficient way is to find the smallest factor first and then find the solution which combine the main two steps into one, wonderful!

Two things learned from problem 3 in Project Euler:

1.C is not very suitable to figure out this kind of math problem. Some other language might be better like Python and Perl. Python is the unique required language in Pattern Recognition so that I will finish learning the syntax within 2 or 3 hours tonight.

2.Sometimes I cannot figure out the problem in Project Euler due to insufficient math knowledge. I will fix it from now on. Now I’m Baby Step now, I will figure out more problems since I enjoy this process.

Cloud Computing Paper Reading Summary 1

In paper Cloud computing and its key techniques, published by Xu Wang, Beizhan Wang, Jing Huang, these authors summaries several characteristics about cloud computing and cites Google File System as an example.

In the first place, cloud computing has advantages like reducing costs, increasing business flexibility and providing business continuity.

What is cloud? The definition given by a paper is that a cloud is a type of parallel and distributed system consisting of a collection of inter connected and virtualized computers that are dynamically provisioned and presented as one or more unified computing resources based on service-level agreements established through negotiation between the service provider and consumers. In the paper I read, cloud computing refers to both the applications delivered as services over the Internet and the hardware and systems software in the datacenter that provides those services.

From a hardware point of view, three aspects are new in cloud computing:
a. The illusion of infinite computing resources available on demand .
b. The elimination of an up-front commitment by cloud users.
c. The ability to pay for use of computing resources on a short-term basis as needed.

Cloud computing has several styles:
a. SAAS(Software as a service)
b. Utility Computing
c. Network service
d. PAAS(Platform as a service)
e. MSP(management service provider)
f. Commercial service platform
g. Integrating internet

Could computing has characteristics:
a. Ultra large-scale
b. Virtualization
c. High reliability
d. Versatility
e. High extendibility
f. On demand service
g. Extremely inexpensive

Google's cloud computing techniques:
a. Google File System(GFS) as data storage technology
b. Big Table as data management technology
c. Map Reduce as programming model and task scheduling model

Finally, authors point out lot of unsolved issues:
a. Continuously high availability
b. Dealt mechanism of cluster failure in cloud environment
c. Consistency guaranty
d. Synchronization in different clusters in cloud platform
e. Security of cloud platform

My later research will focus on the above issues.

Monday, February 20, 2012

Understanding

In this assignment 1, I keep low efficiency as usual until I asked help for Ben. Thanks, Ben, first.

He pointed out freeing lock in lock_acquire() section, kfree(lock->lk_name) and kfree(lock), which were ignored by myself all the time. In the responding email to him, I said that the only reason I do that is having not understood codes completely. Yes, I have no courage to advise codes written by the professor, I’m afraid of the authority.

Understanding is quite significant. Computer Science and coding are good ways to train my understanding capability. Maybe I have to maintain pursuit for PhD in CS.

Work hard. Think hard. Understand hard. Last long!

Inspired by Programmer Heroes

Actually I wanna implement quick sort in c, then I accessed to the author’s weibo (Chinese Twitter), who wrote the article about how to understand and implement quick sort in CSDN. What a surprise! I walked into an amazing world.

First I read about the article Travelling, Writing, Programming, which describes the author traveled around the world, wrote technical articles and programmed at the same time. It’s extremely cool, isn’t it? It is quite easy for a programmer work and relax at the same time, what’s more, programmers might prefer to work while taking vacation. What a cool thing! I wanna learn swimming and driving first, then make that dream come true, travel all over the world, write and code at the same time.

Then I read about a girl graduated with a Business Administration degree, but could not find a job which enables her satisfied. She had two friends working in Google and they are happy with their job, after some talk, she decide to learn computer techniques, like HTML/ CSS/ Javascript. Finally she found a QA job successfully. A story is that a East Europe miner who worked in a coal in Germany, since he could not touch the future, he quit and learned computer skills at home. During that two years, he had not left his home, no new clothes and shoes, no party, no girlfriend, but parents and brothers and sisters to feed. Potatoes are what he ate most time because they’re cheap. He learned HTML and Photoshop skills, created his first static website without connecting to database, then he was offered a full time job after beating six guys with bachelor degree, obvious, he mastered more than other six guys. Now he works in Phoenix, US, he was into filmmaking some time before, maybe he would start up a company or be a director? Who knows.

But which impressed me most is Jamie Zawinski’s story. He dropped out in high school and participated in developing Netscape and XEmacs. His argument against Michael Arrington, who said that if you work at a startup and you think you’re working too hard and sacrificing too much, find a job somewhere else that will cater to your needs. Jamie said, he’s using my words to try and back up that thesis. I hate this, because it’s not true, and it’s disingenuous. What is true is that for a VC’s business model to work, it’s necessary for you to give up your life in order for him to become richer. He’s telling you the story of, “If you bust your ass and don’t sleep, you’ll get rich” because the only way that people in his line of work get richer is if young, poorly-socialized, naive geniuses believe that story! Without those coat-tails to ride, VCs might have to work for a living. Once that kid burns out, they’ll just slot a new one in. I recommend that you do what you love because you love doing it. If that means long hours, fantastic. If that means leaving the office by 6pm every day for your underwater basket-weaving class, also fantastic. Yes, I really appreciate this sentence because I thought to work for nights in order to be successful, but just like some words in a book, you do need to work smart rather than hard. Jamie’s words in his dairy is filled with intelligence as well, this is the time period that is traditionally referred to as “the good old days,” but time always softens the pain and makes things look like more fun than they really were. But who said everything has to be fun? Pain builds character. (Sometimes it builds products, too.).