Tutorial by Examples: er

Generate a random letter between a and z by using the Next() overload for a given range of numbers, then converting the resulting int to a char Random rnd = new Random(); char randomChar = (char)rnd.Next('a','z'); //'a' and 'z' are interpreted as ints for parameters for Next()
#include <string.h> #include <gst/gst.h> #include <gst/app/gstappsrc.h> /* * an example application of using appsrc in push mode to create a file. * from buffers we push into the pipeline. */ /* S16LE 10ms frame audio */ #define BUFFER_SIZE 160 /* 300 frames =...
/** * NetSuite will loop through each record in your search * and pass the record type and id for deletion * Try / Catch is useful if you wish to handle potential errors */ function MassDelete(record_type, record_id) { try { nlapiDeleteRecord(record_type, record_id...
The modules used in this example are part of pywin32 (Python for Windows extensions). Depending on how you installed Python, you might need to install this separately. import win32serviceutil import win32service import win32event import servicemanager import socket class AppServerSvc (win3...
A version control system allows a developer or development team access to essentially I time machine. If the source code, settings, etc., that were used to build a program or system are under version control then the developers can step back in time to recover lost functionality, trace how errors we...
This example has been taken from here package com.reborne.SmartHibernateConnector.utils; import org.hibernate.HibernateException; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; public class LiveHibernateConnector implements IHiber...
This is a variation on the generic example. You just need to import your app script and invoke it's run() method in the service's main() function. In this case we're also using the multiprocessing module due to an issue accessing WSGIRequestHandler. import win32serviceutil import win32service imp...
Inside the script, use the first line to store the very first variable (in this example, %1%) with a name to deal with. Example: OpenWithFile = %1% Once you open a file with this script through Windows (Right click on any file on MS Windows and choose 'Open with...' then select the compiled version...
Cassandra uses two kinds of keys: the Partition Keys is responsible for data distribution across nodes the Clustering Key is responsible for data sorting within a partition A primary key is a combination of those to types. The vocabulary depends on the combination: simple primary key: only...
The partition key is the minimum specifier needed to perform a query using a where clause. If you declare a composite clustering key, the order matters. Say you have the following primary key: PRIMARY KEY((part_key1, part_key_2), (clust_key_1, clust_key_2, clust_key_3)) Then, the only valid qu...
Perhaps the most important performance metric is the hitrate. Varnish routes it's incoming requests like this: Hash, a cacheable request. This might be either hit or miss depending on the state of the cache. Hitpass, a not cacheable request. A hash with a miss and a hitpass will be fetched f...
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Aeson main :: IO () main = do let example = Data.Aeson.object [ "key" .= (5 :: Integer), "somethingElse" .= (2 :: Integer) ] :: Value print . encode $ example
var foo = new uint8[12]; var bar = (owned) foo; assert (foo == null); The bar variable will own the value previously owned by foo.
As edgeapi suggests, it provides an interface for protecting attributes from end-user assignment. This makes Action Controller parameters forbidden to be used in Active Model mass assignment until they have been whitelisted. In addition, parameters can be marked as required and flow through a prede...
Now that you have every connection ready, you have to obtain an instance of this interface and invoke its methods to obtain the object you need: VehicleComponent component = Dagger_VehicleComponent.builder().vehicleModule(new VehicleModule()).build(); vehicle = component.provideVehicle(); Toast.m...
Given a normalized phone number like +178612345678 we will get a formatted number with the provided pattern. private String getFormattedNumber(String phoneNumber) { PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); Phonemetadata.NumberFormat numberFormat = new P...
Token authentication functionality assigns a token to a user, so each time you use that token, the request object will have a user attribute that holds the user model information. Easy, isn’t it? We’ll create a new POST method to return the token for this user, as long as the request holds a correc...
Access modifiers are used to control the access to an object or to a function/method. This is a main part of the concept of Abstraction. Different programming languages use different access modifiers. Here are some examples: Java Java has 4 access modifiers. private - These attributes can ...
If you installed Laravel via Composer or the Laravel installer, below configuration you will need. Configuration for Apache Laravel includes a public/.htaccess file that is used to provide URLs without the index.php front controller in the path. Before serving Laravel with Apache, be sure to enabl...
In twitter-bootstrap 4 the support for IE8, IE9, and iOS 6 has been dropped. v4 is now only IE10+ and iOS 7+. For sites needing either of those, use v3. In twitter-bootstrap 4 the official support for Android v5.0 Lollipop’s Browser and WebView has been Added. Earlier versions of the Android Brows...

Page 358 of 417