Tutorial by Examples: st

You do not need to use double negation in if-else statements. if 'hello' puts 'hey!' else puts 'bye!' end The above code prints 'hey!' on the screen.
Your app can't access your reminders and your calendar without permission. Instead, it must show an alert to user, requesting him/her to grant access to events for the app. To get started, import the EventKit framework: Swift import EventKit Objective-C #import <EventKit/EventKit.h> ...
Setup variables JUSERID=$[ ( $RANDOM % 100 ) + 1 ] JUSERNAME="admin" JUSEREMAIL="[email protected]" JUSERPASS="qweasd" DB="joomla_3" DBUSER="jdbuser" DBPASS="dbupass" DBPREFIX="prfx_" JOOMLAVERSION="3.6.2" ...
$basic_post_args = array( 'post_title' => 'My Basic Post', 'post_content' => 'This is a basic content', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array(8, 59) ); wp_insert_post( $basic_post_args );
The first thing we need is to tell karma to use Webpack to read our tests, under a configuration we set for the webpack engine. Here, I am using babel because I write my code in ES6, you can change that for other flavors, such as Typescript. Or I use Pug (formerly Jade) templates, you don't have to....
sudo docker stats $(sudo docker inspect -f "{{ .Name }}" $(sudo docker ps -q)) Shows live CPU usage of all running containers.
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property. * Note class names are not stored in the element's property in any particular order W3C DOM4 Testing if an element cont...
In InnoDB, having a long PRIMARY KEY (either a single column with a lengthy value, or several columns that form a long composite value) wastes a lot of disk space. The primary key value for a row is duplicated in all the secondary index records that point to the same row. Create an AUTO_INCREME...
The Ruby Version Manager is a command line tool to simply install and manage different versions of Ruby. rvm istall 2.3.1 for example installs Ruby version 2.3.1 on your machine. With rvm list you can see which versions are installed and which is actually set for use. user@dev:~$ rvm li...
Method 1: proc sql; create table foo like sashelp.class; quit; Method 2: proc sql; create table bar as select * from sashelp.class (obs=0); quit; Method 1 should be the preferred option
The registration step registers the app with the device's system and returns a registration id import { Push, RegistrationEventResponse} from "ionic-native"; //the push element is created in the initialization example push.on("registration", async (response:...
just execute uname -a. On Arch: $ uname -a Linux nokia 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 GNU/Linuxenter code here
The Maven Surefire plugin runs during the test phase of the Maven build process or when test is specified as a Maven goal. The following directory structure and minimum pom.xml file will configure Maven to run a test. Directory structure inside the project's root directory: ─ project_root ├─ p...
The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file that ends with the extension "mov" and will play in just about any modern media player. Note that the download...
This example will explore how to see the layout of a video track and how to extract the individual pictures within it. The sample content used here is Tears of Steel, by Blender Foundation. Specifically, we will use the download titled "HD 720p (~365MB, mov, 2.0)". This is a single file t...
DASH is the most widely deployed adaptive streaming technology in modern solutions, used to deliver video in a wide variety of scenarios. The best way to understand DASH presentations is to observe the network activity that takes place during playback. This example uses Fiddler to capture and analy...
There exist cases in which it is necessary to put data of different types together. In Azure ML for example, it is necessary to pass informations from a R script module to another one exclusively throught dataframes. Suppose we have a dataframe and a number: > df name height team...
In order to send messages to the queue, we will write a C# console application using Visual Studio. Create a console application Launch Visual Studio and create a new Console application. Add the Service Bus NuGet package Right click on the newly created project and select Manage NuGet P...
If you have predefined ranges and want to use specific colors for those ranges you can declare custom colormap. For example: import matplotlib.pyplot as plt import numpy as np import matplotlib.colors x = np.linspace(-2,2,500) y = np.linspace(-2,2,500) XX, YY = np.meshgrid(x, y) Z = np.sin(...
To create a new project use the following command (HelloWorld is the name of the project and play-java is the template) $ ~/activator-1.3.10-minimal/bin/activator new HelloWorld play-java You should get an output similar to this one Fetching the latest list of templates... OK, application &...

Page 225 of 369