Tutorial by Examples: c

Images, static data, sounds, etc. are resources in a Playground. If the Project Navigator is hidden, choose View > Navigators > Show Project Navigator (⌘1) There are several ways to add files Drag your resources to the Resources folder or Select the Resources folder and choose File &gt...
You can display an SVG file within an HTML document, by specifying it as a background image in CSS. For example: .element { background-size: 100px 100px; background: url(my_svg_file.svg); height: 100px; width: 100px; } If the dimensions specified in your SVG file are larger ...
The Null-Coalescing operator ?? will return the left-hand side when not null. If it is null, it will return the right-hand side. object foo = null; object bar = new object(); var c = foo ?? bar; //c will be bar since foo was null The ?? operator can be chained which allows the removal of if...
Often times you will have reason to catch when your program is being told to stop by the OS and take some actions to preserve the state, or clean up your application. To accomplish this you can use the os/signal package from the standard library. Below is a simple example of assigning all signals fr...
Databings are essential for working with XAML. The XAML dialect for UWP apps provides a type of binding: the {x:Bind} markup extension. Working with {Binding XXX} and {x:Bind XXX} is mostly equivalent, with the difference that the x:Bind extension works at compile time, which enables better debuggi...
Most of the time you need to import namespaces in your XAML file. How this is done is different for the different XAML variants. For Windows Phone, Silverlight, WPF use the clr-namespace syntax: <Window ... xmlns:internal="clr-namespace:rootnamespace.namespace" xmlns:exte...
By default, RethinkDB binds all services to 127.0.0.1. So this following example will persist data to the host_data_path on the container's host machine and available to 127.0.0.1 on the standard ports. ServiceFlagDefault PortDriver--driver-port28015Cluster--cluster-port29015HTTP WebUI--http-port80...
When deploying RethinkDB in production, you want to either turn off or lock down the WebUI. This will only respond to localhost to access the WebUI allowing you to SSH Tunnel to the host machine and access it for diagnostics and troubleshooting. docker run -d \ -v host_data_path:/data \ ret...
public class ShakeDetector implements SensorEventListener { private static final float SHAKE_THRESHOLD_GRAVITY = 2.7F; private static final int SHAKE_SLOP_TIME_MS = 500; private static final int SHAKE_COUNT_RESET_TIME_MS = 3000; private OnShakeListener mListener; pri...
First of all you need to setup your project adding Firebase to your Android project following the steps described in this topic. Set up Firebase and the FCM SDK Add the FCM dependency to your app-level build.gradle file dependencies { compile 'com.google.firebase:firebase-messaging:11.0.4' } ...
Open Android Monitor Tab Click on Screen Capture Button
Open Android Device Monitor ( ie C:<ANDROID_SDK_LOCATION>\tools\monitor.bat) Select your device Click on Screen Capture Button
Example below saves a screenshot on Devices's Internal Storage. adb shell screencap /sdcard/screen.png
If you use Linux (or Windows with Cygwin), you can run: adb shell screencap -p | sed 's/\r$//' > screenshot.png
Knitr is an R package that allows us to intermingle R code with LaTeX code. One way to achieve this is inline code chunks. This apporach is demonstrated below. # r-noweb-file.Rnw \documentclass{article} \begin{document} This is an Rnw file (R noweb). It contains a combination of LateX and ...
Knitr is an R package that allows us to intermingle R code with LaTeX code. One way to achieve this is internal code chunks. This apporach is demonstrated below. # r-noweb-file.Rnw \documentclass{article} \begin{document} This is an Rnw file (R noweb). It contains a combination of LateX a...
You can create a form using the form_tag helper <%= form_tag do %> Form contents <% end %> This creates the following HTML <form accept-charset="UTF-8" action="/" method="post"> <input name="utf8" type="hidden" value=...
To create a search form, enter the following code <%= form_tag("/search", method: "get") do %> <%= label_tag(:q, "Search for:") %> <%= text_field_tag(:q) %> <%= submit_tag("Search") %> <% end %> form_tag: This is t...
Assuming an implicit parameter list with more than one implicit parameter: case class Example(p1:String, p2:String)(implicit ctx1:SomeCtx1, ctx2:SomeCtx2) Now, assuming that one of the implicit instances is not available (SomeCtx1) while all other implicit instances needed are in-scope, to creat...
This is an example of a package-info.java file that binds an XML namespace to a serializable Java class. This should be placed in the same package as the Java classes that should be serialized using the namespace. /** * A package containing serializable classes. */ @XmlSchema ( xmlns = ...

Page 378 of 826