Main Menu

Hellcome To my Blog site , visit my facebook:riyan facebook. بِسْــــــــــــــمِ اللهِ الرَّحْمَنِ الرَّحِيْـــــمِ

Monday, July 4, 2011

Cloud Computing







Cloud computing refers to the use and access of multiple server-based computational resources via a digital network (WAN, Internet connection using the World Wide Web, etc.). Cloud users may access the server resources using a computer, netbook, pad computer, smart phone, or other device. In cloud computing, applications are provided and managed by the cloud server and data is also stored remotely in the cloud configuration. Users do not download and install applications on their own device or computer; all processing and storage is maintained by the cloud server. The on-line services may be offered from a cloud provider or by a private organization.



Introduction


In the past computing tasks such as word processing were not possible without the installation of application software on a user's computer. A user bought a license for each application from a software vendor and obtained the right to install the application on one computer system. With the development of local area networks (LAN) and more networking capabilities, the client-server model of computing was born, where server computers with enhanced capabilities and large storage devices could be used to host application services and data for a large workgroup. Typically, in client-server computing, a network-friendly client version of the application was required on client computers which utilized the client system's memory and CPU for processing, even though resultant application data files (such as word processing documents) were stored centrally on the data servers. Multiple user licenses of an application were purchased for use by many users on a network.


Cloud computing differs from the classic client-server model by providing applications from a server that are executed and managed by a client's web browser, with no installed client version of an application required. Centralization gives cloud service providers complete control over the versions of the browser-based applications provided to clients, which removes the need for version upgrades or license management on individual client computing devices. The term "software as a service" (SaaS) is sometimes used to describe application programs offered through cloud computing. A common shorthand for a provided cloud computing service (or even an aggregation of all existing cloud services) is "The Cloud".


Any computer or web-friendly device connected to the Internet may access the same pool of computing power, applications, and files in a cloud-computing environment. Users may remotely store and access personal files such as music, pictures, videos, and bookmarks; play games; or do word processing on a remote server. Data is centrally stored, so the user does not need to carry a storage medium such as a DVD or thumb drive. Desktop applications that connect to internet-host email providers may be considered cloud applications, including web-based Gmail, Hotmail, or Yahoo! email services. Private companies may also make use of their own customized cloud email servers for their employees.


Cloud computing technologies are regarded by some analysts as a technological evolution,[1] or may be seen as a marketing trap by others such as Richard Stallman.[2][3]


Consumers now routinely use data-intensive applications driven by cloud technology that may have been previously unavailable due to cost and deployment complexity.[citation needed] In many companies, employees and company departments are bringing a flood of consumer technology into the workplace, which raises legal compliance and security concerns for the corporation which may be relieved by cloud computing.



How it works


A cloud user needs a client device such as a laptop or desktop computer, pad computer, smart phone, or other computing resource with a web browser (or other approved access route) to access a cloud system via the World Wide Web. Typically the user will log into the cloud at a service provider or private company, such as their employer. Cloud computing works on a client-server basis, using web browser protocols. The cloud provides server-based applications and all data services to the user, with output displayed on the client device. If the user wishes to create a document using a word processor, for example, the cloud provides a suitable application running on the server which displays work done by the user on the client web browser display. Memory allocated to the client system's web browser is used to make the application data appear on the client system display, but all computations and changes are recorded by the server, and final results including files created or altered are permanently stored on the cloud servers. Performance of the cloud application is dependent upon the network access, speed and reliability as well as the processing speed of the client device.


Since cloud services are web-based, they work on multiple platforms, including Linux, Macintosh, and Windows computers. Smart phones, pads and tablet devices with Internet and World Wide Web access also provide cloud services to telecommuting and mobile users.


A service provider may pool the processing power of multiple remote computers in a cloud to achieve routine tasks such as backing up of large amounts of data, word processing, or computationally intensive work. These tasks might normally be difficult, time consuming, or expensive for an individual user or a small company to accomplish, especially with limited computing resources and funds. With cloud computing, clients require only a simple computer, such as netbooks, designed with cloud computing in mind, or even a smartphone, with a connection to the Internet, or a company network, in order to make requests to and receive data from the cloud, hence the term "software as a service" (SaaS). Computation and storage is divided among the remote computers in order to handle large volumes of both, thus the client need not purchase expensive hardware or software to handle the task. The outcome of the processing task is returned to the client over the network, dependent on the speed of the Internet connection.



Technical description


The National Institute of Standards and Technology (NIST) provides a concise and specific definition:


Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services) that can be rapidly provisioned and released with minimal management effort or service provider interaction.[4]


Cloud computing provides computation, software, data access, and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services. Parallels to this concept can be drawn with the electricity grid, wherein end-users consume power without needing to understand the component devices or infrastructure required to provide the service.


Cloud computing describes a new supplement, consumption, and delivery model for IT services based on Internet protocols, and it typically involves provisioning of dynamically scalable and oftenvirtualized resources[5][6] It is a byproduct and consequence of the ease-of-access to remote computing sites provided by the Internet.[7] This may take the form of web-based tools or applications that users can access and use through a web browser as if they were programs installed locally on their own computers.[8]


Cloud computing providers deliver applications via the internet, which are accessed from a Web browser, while the business software and data are stored on servers at a remote location. In some cases, legacy applications (line of business applications that until now have been prevalent in thin client Windows computing) are delivered via a screen-sharing technology such as Citrix XenApp, while the computing resources are consolidated at a remote data center location; in other cases, entire business applications have been coded using web-based technologies such as AJAX.


Most cloud computing infrastructures consist of services delivered through shared data-centers. The Cloud may appear as a single point of access for consumers' computing needs; notable examples include the iTunes Store and the iOS App Store. Commercial offerings may be required to meet service level agreements (SLAs), but specific terms are less often negotiated by smaller companies.


Risks


Cloud computing's users are exposed to risks mainly associated with:


1) Information security and users' privacy
Using a service of cloud computing to store data may expose the user to potential violation of privacy. Possession of a user's personal information is entrusted to a provider that can reside in a country other than the user's. In the case of a malicious behavior of the cloud provider, it could access the data in order to perform market research and user profiling.[10]
In the case of wireless cloud computing, the safety risk increases as a function of reduced security offered by wireless networks. In the presence of illegal acts like misappropriation or illegal appropriation of personal data, the damage could be very serious for the user, with difficulty to reach legal solutions and/or refunds if the provider resides in a state other than the user's country.
In the case of industries or corporations, all the data stored in external memories are seriously exposed to possible cases of international or cyber espionage.


2) International, political and economic problems
May arise when public data are freely collected and privately stored from cloud's archives located in a country other than those of the cloud's users. Crucial and intellectual productions and large amounts of personal informations are increasingly stored in private, centralized and partially accessible archives in the form of digital data. No guarantee is given to the users for a free future access.
Issues are related with the location of the cloud's archives in a few rich countries. If not governed by specific international rules:
it could increase the digital divide between rich and poor nations (if the access to the stored knowledge will be not freely ensured to all).[says who?]
being the intangible property considered as a strategic factor for the modern knowledge-based economies it could favor big corporations with "polycentric bodies" and "monocentric minds" only located in the "cloud's countries".


3) Continuity of service
Delegating their data-managing and processing to an external service, users are severely limited when these services are not operating. A malfunction also affects a large number of users at once because these services are often shared on a large network. As the service provided is supported by a high-speed Internet connection (both in download and upload), even in the event of an interruption of the line connection due to the user's Internet Service Provider (ISP) he or she will face a complete paralysis of the work.


4) Data migration problems when changing the cloud provider
Another issue is related with the data migration or porting when a user wants to change his cloud provider. There is no defined standard between the operators and such a change is extremely complex. The case of bankruptcy of the company of the cloud provider could be extremely dangerous for the users.


Comparisons


Cloud computing shares characteristics with:
Autonomic computing — computer systems capable of self-management."[13]
Client–server model – client–server computing refers broadly to any distributed application that distinguishes between service providers (servers) and service requesters (clients).[14]
Grid computing — "a form of distributed computing and parallel computing, whereby a 'super and virtual computer' is composed of a cluster of networked, loosely coupled computers acting in concert to perform very large tasks."
Mainframe computer — powerful computers used mainly by large organizations for critical applications, typically bulk data processing such as census, industry and consumer statistics,enterprise resource planning, and financial transaction processing.[15]
Utility computing — the "packaging of computing resources, such as computation and storage, as a metered service similar to a traditional public utility, such as electricity."[16]
Peer-to-peer – distributed architecture without the need for central coordination, with participants being at the same time both suppliers and consumers of resources (in contrast to the traditional client–server model).
Service-oriented computing – Cloud computing provides services related to computing while, in a reciprocal manner, service-oriented computing consists of the computing techniques that operate on software-as-a-service
Characteristics


The key characteristic of cloud computing is that the computing is "in the cloud"; that is, the processing (and the related data) is not in a specified, known or static place(s). This is in contrast to a model in which the processing takes place in one or more specific servers that are known. All the other concepts mentioned are supplementary or complementary to this concept.
Architecture








Cloud computing sample architecture


Cloud architecture,[18] the systems architecture of the software systems involved in the delivery of cloud computing, typically involves multiple cloud components communicating with each other over loose coupling mechanism such as messaging queue.


The two most significant components of cloud computing architecture are known as the front end and the back end. The front end is the part seen by the client, i.e., the computer user. This includes the client’s network (or computer) and the applications used to access the cloud via a user interface such as a web browser. The back end of the cloud computing architecture is the cloud itself, comprising various computers, servers and data storage devices.
History


The term "cloud" is used as a metaphor for the Internet, based on the cloud drawing used in the past to represent the telephone network,[19]and later to depict the Internet in computer network diagrams as an abstraction of the underlying infrastructure it represents.[20]


Cloud computing is a natural evolution of the widespread adoption of virtualization, service-oriented architecture, autonomic, and utility computing. Details are abstracted from end-users, who no longer have need for expertise in, or control over, the technology infrastructure "in the cloud" that supports them.[21]


The underlying concept of cloud computing dates back to the 1960s, when John McCarthy opined that "computation may someday be organized as a public utility." Almost all the modern-day characteristics of cloud computing (elastic provision, provided as a utility, online, illusion of infinite supply), the comparison to the electricity industry and the use of public, private, government, and community forms, were thoroughly explored in Douglas Parkhill's 1966 book, The Challenge of the Computer Utility.


The actual term "cloud" borrows from telephony in that telecommunications companies, who until the 1990s offered primarily dedicated point-to-point data circuits, began offering Virtual Private Network(VPN) services with comparable quality of service but at a much lower cost. By switching traffic to balance utilization as they saw fit, they were able to utilize their overall network bandwidth more effectively. The cloud symbol was used to denote the demarcation point between that which was the responsibility of the provider and that which was the responsibility of the user. Cloud computing extends this boundary to cover servers as well as the network infrastructure.[22] The first scholarly use of the term “cloud computing” was in a 1997 lecture by Ramnath Chellappa.[23]


After the dot-com bubble, Amazon played a key role in the development of cloud computing by modernizing their data centers, which, like most computer networks, were using as little as 10% of their capacity at any one time, just to leave room for occasional spikes. Having found that the new cloud architecture resulted in significant internal efficiency improvements whereby small, fast-moving "two-pizza teams" could add new features faster and more easily, Amazon initiated a new product development effort to provide cloud computing to external customers, and launched Amazon Web Service (AWS) on a utility computing basis in 2006.[24][25] The first exposure of the term Cloud Computing to public media is by GoogleEx CEO Eric Schmidt at SES San Jose 2006.[26] It was reported in 2011 that Amazon has thousands of corporate customers, from large ones like Pfizer and Netflix to start-ups. Among them also include many corporations that live on Amazon's web services, includingFoursquare, a location-based social networking site; Quora, a question-and-answer service; Reddit, a site for news-sharing and BigDoor, a maker of game tools for Web publishers.[27]


In 2007, Google, IBM and a number of universities embarked on a large-scale cloud computing research project.[28] In early 2008, Eucalyptus became the first open-source, AWS API-compatible platform for deploying private clouds. In early 2008, OpenNebula, enhanced in the RESERVOIR European Commission-funded project, became the first open-source software for deploying private and hybrid clouds, and for the federation of clouds.[29] In the same year, efforts were focused on providing QoS guarantees (as required by real-time interactive applications) to cloud-based infrastructures, in the framework of the IRMOS European Commission-funded project.[30] By mid-2008, Gartner saw an opportunity for cloud computing "to shape the relationship among consumers of IT services, those who use IT services and those who sell them"[31] and observed that "[o]rganisations are switching from company-owned hardware and software assets to per-use service-based models" so that the "projected shift to cloud computing ... will result in dramatic growth in IT products in some areas and significant reductions in other areas.
0 comments Continue Reading

Tutorial - Learn Python in 10 minutes


NOTE: If you would like some Python development done, my company, Stochastic Technologies, is available for consulting.
Also, this tutorial is available as a short ebook.

Preliminary fluff

So, you want to learn the Python programming language but can't find a concise and yet full-featured tutorial. This tutorial will attempt to teach you Python in 10 minutes. It's probably not so much a tutorial as it is a cross between a tutorial and a cheatsheet, so it will just show you some basic concepts to start you off. Obviously, if you want to really learn a language you need to program in it for a while. I will assume that you are already familiar with programming and will, therefore, skip most of the non-language-specific stuff. The important keywords will be highlighted so you can easily spot them. Also,pay attention because, due to the terseness of this tutorial, some things will be introduced directly in code and only briefly commented on.

Properties

Python is strongly typed (i.e. types are enforced), dynamically, implicitly typed (i.e. you don't have to declare variables),case sensitive (i.e. var and VAR are two different variables) and object-oriented (i.e. everything is an object).

Getting help

Help in Python is always available right in the interpreter. If you want to know how an object works, all you have to do is call help(<object>)! Also useful are dir(), which shows you all the object's methods, and <object>.__doc__, which shows you its documentation string:
>>> help(5) Help on int object: (etc etc) >>> dir(5) ['__abs__', '__add__', ...] >>> abs.__doc__ 'abs(number) -> number Return the absolute value of the argument.'

Syntax

Python has no mandatory statement termination characters and blocks are specified by indentation. Indent to begin a block, dedent to end one. Statements that expect an indentation level end in a colon (:). Comments start with the pound (#) sign and are single-line, multi-line strings are used for multi-line commentsValues are assigned (in fact, objects are bound to names) with the _equals_ sign ("="), and equality testing is done using two _equals_ signs ("=="). You can increment/decrement values using the += and -= operators respectively by the right-hand amount. This works on many datatypes, strings included. You can also use multiple variables on one line. For example:
>>> myvar = 3 >>> myvar += 2 >>> myvar 5 >>> myvar -= 1 >>> myvar 4 """This is a multiline comment. The following lines concatenate the two strings.""" >>> mystring = "Hello" >>> mystring += " world." >>> print mystring Hello world. # This swaps the variables in one line(!). # It doesn't violate strong typing because values aren't # actually being assigned, but new objects are bound to # the old names. >>> myvar, mystring = mystring, myvar

Data types

The data structures available in python are lists, tuples and dictionaries. Sets are available in the sets library (but are built-in in Python 2.5 and later). Lists are like one-dimensional arrays (but you can also have lists of other lists), dictionaries are associative arrays (a.k.a. hash tables) and tuples are immutable one-dimensional arrays (Python "arrays" can be of any type, so you can mix e.g. integers, strings, etc in lists/dictionaries/tuples). The index of the first item in all array types is 0. Negative numbers count from the end towards the beginning, -1 is the last item. Variables can point to functions. The usage is as follows:
>>> sample = [1, ["another", "list"], ("a", "tuple")] >>> mylist = ["List item 1", 2, 3.14] >>> mylist[0] = "List item 1 again" >>> mylist[-1] = 3.14 >>> mydict = {"Key 1": "Value 1", 2: 3, "pi": 3.14} >>> mydict["pi"] = 3.15 >>> mytuple = (1, 2, 3) >>> myfunction = len >>> print myfunction(mylist) 3
You can access array ranges using a colon (:). Leaving the start index empty assumes the first item, leaving the end index assumes the last item. Negative indexes count from the last item backwards (thus -1 is the last item) like so:
>>> mylist = ["List item 1", 2, 3.14] >>> print mylist[:] ['List item 1', 2, 3.1400000000000001] >>> print mylist[0:2] ['List item 1', 2] >>> print mylist[-3:-1] ['List item 1', 2] >>> print mylist[1:] [2, 3.14]

Strings

Its strings can use either single or double quotation marks, and you can have quotation marks of one kind inside a string that uses the other kind (i.e. "He said 'hello'." is valid). Multiline strings are enclosed in _triple double (or single) quotes_ ("""). Python supports Unicode out of the box, using the syntax u"This is a unicode string". To fill a string with values, you use the % (modulo) operator and a tuple. Each %s gets replaced with an item from the tuple, left to right, and you can also use dictionary substitutions, like so:
>>>print "Name: %s\ Number: %s\ String: %s" % (myclass.name, 3, 3 * "-") Name: Poromenos Number: 3 String: --- strString = """This is a multiline string.""" # WARNING: Watch out for the trailing s in "%(key)s". >>> print "This %(verb)s a %(noun)s." % {"noun": "test", "verb": "is"} This is a test.

Flow control statements

Flow control statements are iffor, and while. There is no select; instead, use if. Use for to enumerate through members of a list. To obtain a list of numbers, use range(<number>). These statements' syntax is thus:
rangelist = range(10) >>> print rangelist [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] for number in rangelist: # Check if number is one of # the numbers in the tuple. if number in (3, 4, 7, 9): # "Break" terminates a for without # executing the "else" clause. break else: # "Continue" starts the next iteration # of the loop. It's rather useless here, # as it's the last statement of the loop. continue else: # The "else" clause is optional and is # executed only if the loop didn't "break". pass # Do nothing if rangelist[1] == 2: print "The second item (lists are 0-based) is 2" elif rangelist[1] == 3: print "The second item (lists are 0-based) is 3" else: print "Dunno" while rangelist[1] == 1: pass

Functions

Functions are declared with the "def" keyword. Optional arguments are set in the function declaration after the mandatory arguments by being assigned a default value. For named arguments, the name of the argument is assigned a value. Functions can return a tuple (and using tuple unpacking you can effectively return multiple values). Lambda functions are ad hoc functions that are comprised of a single statement. Parameters are passed by reference, but immutable types (tuples, ints, strings, etc) *cannot be changed*. This is because only the memory location of the item is passed, and binding another object to a variable discards the old one, so immutable types are replaced. For example:
# Same as def f(x): return x + 1 functionvar = lambda x: x + 1 >>> print functionvar(1) 2 # an_int and a_string are optional, they have default values # if one is not passed (2 and "A default string", respectively). def passing_example(a_list, an_int=2, a_string="A default string"): a_list.append("A new item") an_int = 4 return a_list, an_int, a_string >>> my_list = [1, 2, 3] >>> my_int = 10 >>> print passing_example(my_list, my_int) ([1, 2, 3, 'A new item'], 4, "A default string") >>> my_list [1, 2, 3, 'A new item'] >>> my_int 10

Classes

Python supports a limited form of multiple inheritance in classes. Private variables and methods can be declared (by convention, this is not enforced by the language) by adding at least two leading underscores and at most one trailing one (e.g. "__spam"). We can also bind arbitrary names to class instances. An example follows:
class MyClass(object): common = 10 def __init__(self): self.myvariable = 3 def myfunction(self, arg1, arg2): return self.myvariable # This is the class instantiation >>> classinstance = MyClass() >>> classinstance.myfunction(1, 2) 3 # This variable is shared by all classes. >>> classinstance2 = MyClass() >>> classinstance.common 10 >>> classinstance2.common 10 # Note how we use the class name # instead of the instance. >>> MyClass.common = 30 >>> classinstance.common 30 >>> classinstance2.common 30 # This will not update the variable on the class, # instead it will bind a new object to the old # variable name. >>> classinstance.common = 10 >>> classinstance.common 10 >>> classinstance2.common 30 >>> MyClass.common = 50 # This has not changed, because "common" is # now an instance variable. >>> classinstance.common 10 >>> classinstance2.common 50 # This class inherits from MyClass. The example # class above inherits from "object", which makes # it what's called a "new-style class". # Multiple inheritance is declared as: # class OtherClass(MyClass1, MyClass2, MyClassN) class OtherClass(MyClass): # The "self" argument is passed automatically # and refers to the class instance, so you can set # instance variables as above, but from inside the class. def __init__(self, arg1): self.myvariable = 3 print arg1 >>> classinstance = OtherClass("hello") hello >>> classinstance.myfunction(1, 2) 3 # This class doesn't have a .test member, but # we can add one to the instance anyway. Note # that this will only be a member of classinstance. >>> classinstance.test = 10 >>> classinstance.test 10

Exceptions

Exceptions in Python are handled with try-except [exceptionname] blocks:
def some_function(): try: # Division by zero raises an exception 10 / 0 except ZeroDivisionError: print "Oops, invalid." else: # Exception didn't occur, we're good. pass finally: # This is executed after the code block is run # and all exceptions have been handled, even # if a new exception is raised while handling. print "We're done with that." >>> some_function() Oops, invalid. We're done with that.

Importing

External libraries are used with the import [libname] keyword. You can also use from [libname] import [funcname] for individual functions. Here is an example:
import random from time import clock randomint = random.randint(1, 100) >>> print randomint 64

File I/O

Python has a wide array of libraries built in. As an example, here is how serializing (converting data structures to strings using the pickle library) with file I/O is used:
import pickle mylist = ["This", "is", 4, 13327] # Open the file C:\\binary.dat for writing. The letter r before the # filename string is used to prevent backslash escaping. myfile = open(r"C:\\binary.dat", "w") pickle.dump(mylist, myfile) myfile.close() myfile = open(r"C:\\text.txt", "w") myfile.write("This is a sample string") myfile.close() myfile = open(r"C:\\text.txt") >>> print myfile.read() 'This is a sample string' myfile.close() # Open the file for reading. myfile = open(r"C:\\binary.dat") loadedlist = pickle.load(myfile) myfile.close() >>> print loadedlist ['This', 'is', 4, 13327]

Miscellaneous

  • Conditions can be chained1 < a < 3 checks that a is both less than 3 and greater than 1.
  • You can use del to delete variables or items in arrays.
  • List comprehensions provide a powerful way to create and manipulate lists. They consist of an expression followed by afor clause followed by zero or more if or for clauses, like so:
>>> lst1 = [1, 2, 3] >>> lst2 = [3, 4, 5] >>> print [x * y for x in lst1 for y in lst2] [3, 4, 5, 6, 8, 10, 9, 12, 15] >>> print [x for x in lst1 if 4 > x > 1] [2, 3] # Check if an item has a specific property. # "any" returns true if any item in the list is true. >>> any([i % 3 for i in [3, 3, 4, 4, 3]]) True # This is because 4 % 3 = 1, and 1 is true, so any() # returns True. # Check how many items have this property. >>> sum(1 for i in [3, 3, 4, 4, 3] if i == 4) 2 >>> del lst1[0] >>> print lst1 [2, 3] >>> del lst1
  • Global variables are declared outside of functions and can be read without any special declarations, but if you want to write to them you must declare them at the beginning of the function with the "global" keyword, otherwise Python will bind that object to a new local variable (be careful of that, it's a small catch that can get you if you don't know it). For example:
number = 5 def myfunc(): # This will print 5. print number def anotherfunc(): # This raises an exception because the variable has not # been bound before printing. Python knows that it an # object will be bound to it later and creates a new, local # object instead of accessing the global one. print number number = 3 def yetanotherfunc(): global number # This will correctly change the global. number = 3

Epilogue

This tutorial is not meant to be an exhaustive list of all (or even a subset) of Python. Python has a vast array of libraries and much much more functionality which you will have to discover through other means, such as the excellent book Dive into Python. I hope I have made your transition in Python easier. Please leave comments if you believe there is something that could be improved or added or if there is anything else you would like to see (classes, error handling, anything).
0 comments Continue Reading