Tutorial by Examples: def

Given a codec context and encoded packets from a media stream, you can start decoding media into raw frames. To decode a single frame, you can use the following code: // A codec context, and some encoded data packet from a stream/file, given. AVCodecContext *codecContext; // See Open a codec cont...
To discovery the default print service, we can use the PrintServiceLookup class. Let's see how:: import javax.print.PrintService; import javax.print.PrintServiceLookup; public class DiscoveringDefaultPrintService { public static void main(String[] args) { discoverDefaultPrintSer...
Sometimes we need to determine some aspects of the print request. We will call them attribute. Are examples of print request attributes: amount of copies (1, 2 etc), orientation (portrait or landscape) chromacity (monochrome, color) quality (draft, normal, high) sides (one-sided, two-sided e...
For example, we can create a ring-shaped cursor fixed to the center of the screen. To fix the cursor to the screen so the cursor is always present no matter where we look, we place it as a child of the active camera entity. We pull it in front of the camera by placing it on the negative Z axis. When...
A camera situated at the average height of human eye level (1.6 meters or 1.75 yard or 5.25 feet). <a-entity camera="userHeight: 1.6" look-controls></a-entity>
You can add custom post type posts on default wordpress search, Add below code in theme functions.php function my_search_filter($query) { if ( !is_admin() && $query->is_main_query() ) { if ($query->is_search) { $query->set('post_type', array( 'news','post','article' ...
BottomSheet DialogFragment opens up in STATE_COLLAPSED by default. Which can be forced to open to STATE_EXPANDEDand take up the full device screen with help of the following code template. @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { BottomSheetDialog dialog = ...
The following rules define a simple strategy for creating immutable objects. Don't provide "setter" methods - methods that modify fields or objects referred to by fields. Make all fields final and private. Don't allow subclasses to override methods. The simplest way to do this is to d...
We can use typedef to simplify the usage of function pointers. Imagine we have some functions, all having the same signature, that use their argument to print out something in different ways: #include<stdio.h> void print_to_n(int n) { for (int i = 1; i <= n; ++i) printf(...
Request:"http://example.com" GET / HTTP/1.1 Host: example.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:53.0) Gecko/20100101 Firefox/53.0 Accept: text/html,application/xml;q=0.9,*/*;q=0.8 Accept-Encoding: compress, gzip Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzi...
To shelve an object, first import the module and then assign the object value as follows: import shelve database = shelve.open(filename.suffix) object = Object() database['key'] = object
animated_android_dialog_box.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="16dp"> &...
function REReplaceCallback(re,str,callback) { /* Thanks to Ben Nadel "Learning ColdFusion 8: REMatch() For Regular Expression Matching" from 2007-06-13 https://www.bennadel.com/blog/769-learning-coldfusion-8-rematch-for-regular-expression-matching.h...
PROGRAM zprogram MESSAGE-ID sabapdemos. System-defined message may be stored in a message class. The MESSAGE-ID token defines the message class sabapdemos for the entire program. If this is not used, the message class must be specified on each MESSAGE call.
PROGRAM zprogram MESSAGE-ID za. ... MESSAGE i000 WITH TEXT-i00. A message will display the text stored in the text symbol i00 to the user. Since the message type is i (as seen in i000), after the user exits the dialog box, program flow will continue from the point of the MESSAGE call. Although...
PROGRAM zprogram. ... MESSAGE i050(sabapdemos). It may be inconvenient to define a message class for the entire program, so it is possible to define the message class that the message comes from in the MESSAGE statement itself. This example will display message 050 from the message class sabapd...
/*Wrapping inside a method avoids auto incrementing on every gradle task run. Now it runs only when we build apk*/ ext.autoIncrementBuildNumber = { if (versionPropsFile.canRead()) { def Properties versionProps = new Properties() versionProps.load(new FileInputStream(versio...
Docs: 1.x -> 2.x upgrade guide, registering an element, shared style modules. <link rel="import" href="bower_components/polymer/polymer-element.html"> <dom-module id="element-name"> <template> <!-- Use one of these style declaration...
NSString *appDomain = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:appDomain];

Page 26 of 27