Tutorial by Examples: conte

The standard library module urllib.request can be used to download web content: from urllib.request import urlopen response = urlopen('http://stackoverflow.com/questions?sort=votes') data = response.read() # The received bytes should usually be decoded according the response's characte...
The received bytes have to be decoded with the correct character encoding to be interpreted as text: Python 3.x3.0 import urllib.request response = urllib.request.urlopen("http://stackoverflow.com/") data = response.read() encoding = response.info().get_content_charset() html = d...
Apple introduced ATS with iOS 9 as a new security feature to improve privacy and security between apps and web services. ATS by default fails all non HTTPS requests. While this can be really nice for production environments, it can be a nuisance during testing. ATS is configured in the target's Inf...
Similar to enabling all HTTP content, all configuration happens under the App Transport Security Settings. Add the Exception Domains dictionary (NSExceptionDomains) to the top level ATS settings. For every domain, add a dictionary item to the Exception Domains, where the key is the domain in questi...
The clauses in a SELECT have a specific order: SELECT ... FROM ... WHERE ... GROUP BY ... HAVING ... ORDER BY ... -- goes here LIMIT ... OFFSET ...; ( SELECT ... ) UNION ( SELECT ... ) ORDER BY ... -- for ordering the result of the UNION. SELECT ... GROUP_CONCAT(DISTINCT x ORDER B...
This example is directly derived from John Cooley’s design contest at SNUG’95 (Synopsys Users Group meeting). The contest was intended to oppose VHDL and Verilog designers on the same design problem. What John had in mind was probably to determine what language was the most efficient. The result...
There are a few ways to inspect the contents of a zipfile. You can use the printdir to just get a variety of information sent to stdout with zipfile.ZipFile(filename) as zip: zip.printdir() # Out: # File Name Modified Size ...
Html5 Canvas gives you the ability to fetch and change the color of any pixel on the canvas. You can use Canvas's pixel manipulation to: Create a color-picker for an image or select a color on a color-wheel. Create complex image filters like blurring and edge detection. Recolor any part of an ...
SVG Patterns behave significantly differently than CSS background images when filling equivalent shapes. This can lead to significant surprises for new-comers to SVG. Below are examples of a pattern defined in all possible combinations of patternUnits and patternContentUnits - showing how these sett...
You may need to render some content in view, which is specific to some environment only. To achieve this goal you can use Environment tag helper: <environment names="Development"> <h1>This is heading for development environment</h1> </environment> <envi...
Calling the function string InvoiceHtml = myFunction.RenderPartialViewToString("PartialInvoiceCustomer", ToInvoice); // ToInvoice is a model, you can pass parameters if needed Function to generate HTML public static string RenderPartialViewToString(string viewName, object model) { ...
To print the contents of a file, we can use loadfile to read a file into a local property, and then use echo to print the value of it. <loadfile property="contents" srcFile="example.txt" /> <echo message="${contents}" />
If you have code (a routine) you want to execute under a specific (constraint) context, you can use dependency injection. The following example shows the constraint of executing under an open SSL connection. This first part would be in your library or framework, which you won't expose to the client...
The per-directory context is a part of the static configuration file between <Directory> and </Directory> tags. The entire content of dynamic configuration files is within the per-directory context of the folder in which the .htaccess resides. RewriteRule's in per-directory context matc...
The virtual host context is a part of the static configuration file between <VirtualHost> and </VirtualHost> tags. RewriteRule's in virtual host context match against the part of an url after the protocol, hostname and port, and before the query string. When the following rule is used ...
If you were to hide a link by setting display: none in the CSS then screen readers wouldn’t find it. Instead, we position it absolutely, with clipping. CSS .offscreen { position: absolute; clip: rect(1px 1px 1px 1px); /* for Internet Explorer */ clip: rect(1px, 1px, 1px, 1px); padding: 0; b...
Layout.xml <WebView android:id="@+id/WebViewToDisplay" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_gravity="center" ...
Let's say you have an academic system. The bounded contexts would be like this: Admission of new undergraduate students Distribution of students on classrooms considering a schedule of the courses and occupation, size and type of classrooms Management of courses, hierarchies and predecessors of...
Core Graphics context A Core Graphics context is a canvas which we can draw in it and set some properties like the line thickness. Making a context To make a context, we use the UIGraphicsBeginImageContextWithOptions() C function. Then, when we are done with drawing, we just call UIGraphicsEn...
A layout manager for templated views. Used within a ControlTemplate to mark where the content to be presented appears.

Page 6 of 9