Tutorial by Examples: ad

ALTER TABLE table_name ADD PARTITION new_partition VALUES LESS THAN(400);
When working with existing model that is quite big and is being regenerated quite often in cases where abstraction needed it might be costly to manually go around redecorating model with interfaces. In such cases one might want to add some dynamic behavior to model generation. Following example wil...
#include <Windows.h> DWORD WINAPI DoStuff(LPVOID lpParameter) { // The new thread will start here return 0; } int main() { // Create a new thread which will start at the DoStuff function HANDLE hThread = CreateThread( NULL, // Thread attributes ...
We can read from a text file: dt <- fread("my_file.csv") Unlike read.csv, fread will read strings as strings, not as factors by default. See the [topic on fread][need_a_link] for more examples.
For efficiency, data.table offers a way of altering a data.frame or list to make a data.table in-place: # example data.frame DF = data.frame(x = letters[1:5], y = 1:5, z = (1:5) > 3) # modification setDT(DF) Note that we do not <- assign the result, since the object DF has been modifi...
Adding a footer is not natively possible. Luckily, we can make use of jQuery and CSS to add a footer to the slides of an ioslides presentation rendered with knitr. First of all we have to include the jQuery plugin. This is done by the line <script src="https://ajax.googleapis.com/ajax/libs...
Sometimes one has to work with pages that are not using jQuery while most developers are used to have jQuery handy. In such situations one can use Chrome Developer Tools console (F12) to manually add jQuery on a loaded page by running following: var j = document.createElement('script'); j.onload ...
ArrayList is one of the inbuilt data structures in Java. It is a dynamic array (where the size of the data structure not needed to be declared first) for storing elements (Objects). It extends AbstractList class and implements List interface. An ArrayList can contain duplicate elements where it mai...
This example assumes that your lookup column is named MultiLookupColumnName and that you want to set your multi-lookup field to lookup to the items with IDs 1 and 2. Using jQuery AJAX 2010 var listName = "YourListName"; var lookupList = "LookupListName"; var idOfItemToUpdate...
Enable and configure the experimental Gradle plugin to improve AndroidStudio's NDK support. Check that you fulfill the following requirements: Gradle 2.10 (for this example) Android NDK r10 or later Android SDK with build tools v19.0.0 or later Configure MyApp/build.gradle file Edit the dep...
HTML: <div id="title"> <h1 data-content="HOVER">HOVER</h1> </div> CSS: *{margin:0;padding:0;} html,body{height:100%;width:100%;overflow:hidden;background:#0099CC;} #title{ position:absolute; top:50%; left:50%; transform:translate(-50%,-...
Session Types are a way to tell the compiler about the protocol you want to use to communicate between threads - not protocol as in HTTP or FTP, but the pattern of information flow between threads. This is useful since the compiler will now stop you from accidentally breaking your protocol and causi...
If your team is following a rebase-based workflow, it may be a advantageous to setup git so that each newly created branch will perform a rebase operation, instead of a merge operation, during a git pull. To setup every new branch to automatically rebase, add the following to your .gitconfig or .gi...
If you have loaded a file into GHCi (e.g. using :l filename.hs) and you have changed the file in an editor outside of GHCi you must reload the file with :r or :reload in order to make use of the changes, hence you don't need to type again the filename. ghci> :r OK, modules loaded: Main. ghci...
let configuration = WKWebViewConfiguration() if let path = NSBundle.mainBundle().pathForResource("customUserScript", ofType: "js"), source = try? NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) as String { let userScript = WKUserScript(source...
function DriveAppAddFolder(child) {//Adds file to the root drive in Google Drive var body,returnedFolder;//Declare variable names if (!child) { body = "There is no folder"; MailApp.sendEmail(Session.getEffectiveUser().getEmail(), "", "Error Adding Folder!&q...
function DriveAppAddFile(child) {//Adds file to the root drive in Google Drive var body,returnedFolder;//Declare variable names if (!child) { body = "There is no file"; MailApp.sendEmail(Session.getEffectiveUser().getEmail(), "", "Error Adding File!",...
uses System.Generics.Collections, { TArray } System.Generics.Defaults; { TComparer<T> } var StringArray: TArray<string>; { Also works with "array of string" } ... { Sorts the array case insensitive } TArray.Sort<string>(StringArray, TComparer<string>...
Value constructors are functions that return a value of a data type. Because of this, just like any other function, they can take one or more parameters: data Foo = Bar String Int | Biz String Let's check the type of the Bar value constructor. :t Bar prints Bar :: String -> Int -> Foo...
Type constructors can take one or more type parameters: data Foo a b = Bar a b | Biz a b Type parameters in Haskell must begin with a lowercase letter. Our custom data type is not a real type yet. In order to create values of our type, we must substitute all type parameters with actual types. Be...

Page 46 of 114