expire.avapose.com |
||
ASP.NET Web PDF Document Viewer/Editor Control LibraryAs always, keep on the lookout for ways to visually link frames across the storyboard. For example, if you sketch on your Tablet PC the split-screen photographic approach for the Point A and Point B slides, as shown on the left and middle slides in Figure 7-15, carry over the photographs to the Call to Action slide. Here, sketch an arrow over the two photographs to literally show that you will be taking your audience from Point A to Point B, and sketch the numerals 1 2 3 over the arrow, as shown on the right slide in Figure 7-15. winforms pdf 417 reader, winforms qr code reader, winforms upc-a reader, winforms data matrix reader, winforms ean 128 reader, winforms ean 13 reader, c# remove text from pdf, replace text in pdf using itextsharp in c#, winforms code 39 reader, c# remove text from pdf,goes into more detail about some previously seen aspects of the language. By the end of Part 2, you ll be able to develop Ruby applications complete with complex class and object arrangements of your own; know how to test, document, and deploy them; and use databases and external data sources to feed your applications. Listing 4-2. Dictionary Method Example # A simple database using get() # Insert database (people) from Listing 4-1 here. labels = { 'phone': 'phone number', 'addr': 'address' } name = raw_input('Name: ') # Are we looking for a phone number or an address request = raw_input('Phone number (p) or address (a) ') # Use the correct key: key = request # In case the request is neither 'p' nor 'a' if request == 'p': key = 'phone' if request == 'a': key = 'addr' # Use get to provide default values: person = people.get(name, {}) label = labels.get(key, key) result = person.get(key, 'not available') print "%s's %s is %s." % (name, label, result) n 2 we dove straight into the principles of object orientation, the method of representing concepts in Ruby by using classes and objects. Since then we ve looked at Ruby s standard classes, such as String and Array; worked with them; and then branched off to look at Ruby s logic and other core features. In this chapter the focus is back onto object orientation, but rather than looking at the concepts from afar, we ll be getting into the details. We ll look at why classes and objects behave the way they do, why object orientation is a viable development tool, how you can implement classes to match your own requirements, and how to override and extend the classes Ruby provides by default. Finally, you ll implement a basic dungeon in text adventure form to demonstrate how myriad real-life concepts can combine into an easily maintainable set of interconnected classes. 7 You also need access to Ruby s interactive prompt irb. You access this simply by running irb (if it s in your path) as follows: If neither Ruby nor irb work without complaint, you need to seek assistance for your specific platform. Appendix C provides a list of useful resources. You will develop this 1-2-3 numerical structure in the sketches of the Key Point slides to come. The more you can sketch a singular visual story across the acts and levels of the storyboard like this, the more elegant your presentation will become. In this chapter, you learned about the following: Mappings. A mapping enables you to label its elements with any immutable object, the most usual types being strings and tuples. The only built-in mapping type in Python is the dictionary. String formatting with dictionaries. You can apply the string formatting operation to dictionaries by including names (keys) in the formatting specifiers. When using tuples in string formatting, you need to have one formatting specifier for each element in the tuple. When using dictionaries, you can have fewer specifiers than you have items in the dictionary. Dictionary methods. Dictionaries have quite a few methods, which are called in the same way as list and string methods. Summary
|