Tutorial by Examples

It is possible to instruct the Xamarin.Android Bindings Generator to ignore a Java type and not bind it. This is done by adding a remove-node XML element to the metadata.xml file: <remove-node path="/api/package[@name='{package_name}']/class[@name='{name}']" />
Interactive input To get input from the user, use the input function (note: in Python 2.x, the function is called raw_input instead, although Python 2.x has its own version of input that is completely different): Python 2.x2.3 name = raw_input("What is your name? ") # Out: What is your...
Mark your UIView subclass as an accessible element so that it is visible to VoiceOver. myView.isAccessibilityElement = YES; Ensure that the view speaks a meaningful label, value, and hint. Apple provides more details on how to choose good descriptions in the Accessibility Programming Guide.
The accessibility frame is used by VoiceOver for hit testing touches, drawing the VoiceOver cursor, and calculating where in the focused element to simulate a tap when the user double-taps the screen. Note that the frame is in screen coordinates! myElement.accessibilityFrame = frameInScreenCoordina...
VoiceOver works great most of the time, breezily reading aloud screens full of content and intuitively following the user. Alas, no general solution is perfect. Sometimes only you, the app developer, know where VoiceOver should be focused for an optimal user experience. Fortunately, VoiceOver listen...
In many cases, content within a single screen will update with new or different content. For example, imagine a form that reveals additional options based on the user’s answer to a previous question. In this case, a “layout change” notification lets you either announce the change or focus on a new e...
Announcements are useful for alerting users to events that don’t require any interaction, such as “screen locked” or “finished loading.” Use a more specific announcement to notify users of screen changes or more minor layout changes. UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotifi...
VoiceOver navigates from top-left to bottom-right, irrespective of the view hierarchy. This is usually how content is arranged in left-to-right languages since sighted individuals tend to scan the screen in an “F-shaped pattern”. VoiceOver users will expect to navigate the same way as typical users....
VoiceOver can navigate many apps on iOS because most UIKit classes implement UIAccessibilityProtocol. Features that don’t represent onscreen elements using UIView, including apps that leverage Core Graphics or Metal to perform drawing, must describe these elements for accessibility. As of iOS 8.0, t...
Modal views completely capture the user’s attention until a task is complete. iOS clarifies this to users by dimming and disabling all other content when a modal view, such as an alert or popover, is visible. An app that implements a custom modal interface needs to hint to VoiceOver that this view d...
Most UIKit classes, including UIView, adhere to UIAccessibilityProtocol and return correct values by default. It’s easy to take for granted that a UIView set to hidden is also absent from the accessibility hierarchy and won’t be navigated by VoiceOver. While this default behavior is usually sufficie...
1.8 You can remove a submodule (e.g. the_submodule) by calling: $ git submodule deinit the_submodule $ git rm the_submodule git submodule deinit the_submodule deletes the_submodules' entry from .git/config. This excludes the_submodule from git submodule update, git submodule sync and git ...
IDLE is Python’s Integrated Development and Learning Environment and is an alternative to the command line. As the name may imply, IDLE is very useful for developing new code or learning python. On Windows this comes with the Python interpreter, but in other operating systems you may need to install...
You can use a template in a function based view as follows: from django.shortcuts import render def view(request): return render(request, "template.html") If you want to use template variables, you can do so as follows: from django.shortcuts import render def view(request):...
List Comprehensions can use nested for loops. You can code any number of nested for loops within a list comprehension, and each for loop may have an optional associated if test. When doing so, the order of the for constructs is the same order as when writing a series of nested for statements. The ge...
Swap out AccountSid, AuthToken, ToPhoneNumber and FromPhoneNumber for your credentials/intended recipients. You need to ensure that if the ToPhoneNumber and FromPhoneNumber have + in them, they are urlencoded (ie: as %2B) notification sms { post = https://{AccountSid}:{Authtoken}@api.twilio.co...
Closures are often used for asynchronous tasks, for example when fetching data from a website. 3.0 func getData(urlString: String, callback: (result: NSData?) -> Void) { // Turn the URL string into an NSURLRequest. guard let url = NSURL(string: urlString) else { return } let re...
It is possible to force the type parameters of a generic class to implement a protocol, for example, Equatable class MyGenericClass<Type: Equatable>{ var value: Type init(value: Type){ self.value = value } func getValue() -> Type{ return self....
Scollector has built in support for using cAdvisor to generate container.* metrics in Bosun for each Docker container on a host. To get started you will need to start a new container on each docker host: docker run --name cadvisor --restart=always -d -p 8080:8080 google/cadvisor And then from an...
Example init script for scollector: #!/bin/bash # # scollector Startup script for scollector. # # chkconfig: 2345 90 60 # description: scollector is a replacement for OpenTSDB's TCollector \ # and can be used to send metrics to a Bosun server # Source function library. . /etc/init....

Page 100 of 1336