Tutorial by Examples: sin

The lubridate package provides convenient functions to format date and datetime objects from character strings. The functions are permutations of LetterElement to parseBase R equivalentyyear%y, %Ym (with y and d)month%m, %b, %h, %Bdday%d, %ehhour%H, %I%pm (with h and s)minute%Msseconds%S e.g. ymd(...
You can alternatively use an Object Declaration that contains the main function for a Kotlin program. package my.program object App { @JvmStatic fun main(args: Array<String>) { println("Hello World") } } The class name that you will run is the name of you...
Similar to using an Object Declaration, you can define the main function of a Kotlin program using a Companion Object of a class. package my.program class App { companion object { @JvmStatic fun main(args: Array<String>) { println("Hello World") ...
Haskell supports a notion of class extension. For example, the class Ord inherits all of the operations in Eq, but in addition has a compare function that returns an Ordering between values. Ord may also contain the common order comparison operators, as well as a min method and a max method. The =&...
<PROJECT_ROOT>\app\build.gradle is specific for app module. <PROJECT_ROOT>\build.gradle is a "Top-level build file" where you can add configuration options common to all sub-projects/modules. If you use another module in your project, as a local library you would have another...
You can define the signing configuration to sign the apk in the build.gradle file using these properties: storeFile : the keystore file storePassword: the keystore password keyAlias: a key alias name keyPassword: A key alias password In many case you may need to avoid this kind of info in ...
Looping over an iterable defined inside of your viewmodel or passed through as a bindable (if a Custom Attribute or Custom Element) can be done like so. An array of string values export class MyViewModel { myIterable = ['String 1', 'String 2', 'String 3', 'String 4']; } <template> ...
The return statement can be a useful way to create output for a function. The return statement is especially useful if you do not know in which context the function will be used yet. //An example function that will take a string as input and return //the first character of the string. function...
From your Mac, download and install Xcode from the Mac App Store following this link. After the installation is complete, open Xcode and select Get started with a Playground: On the next panel, you can give your Playground a name or you can leave it MyPlayground and press Next: Select a locat...
import pandas.io.sql import pyodbc import pandas as pd Specify the parameters # Parameters server = 'server_name' db = 'database_name' UID = 'user_id' Create the connection # Create the connection conn = pyodbc.connect('DRIVER={SQL Server};SERVER=' + server + ';DATABASE=' + db + '; UID...
Singletons are used to ensure that only one instance of an object is being created. The singleton allows only a single instance of itself to be created which means it controls its creation. The singleton is one of the Gang of Four design patterns and is a creational pattern. Thread-Safe Singleton ...
The bind attribute can also be applied to derived types: geese.h struct Goose { int flock; float buoyancy; } struct Goose goose_c; geese.f90 use, intrinsic :: iso_c_binding, only : c_int, c_float type, bind(C) :: goose_t integer(c_int) :: flock real(c_float) :: buoyancy e...
Homebrew You can install Node.js using the Homebrew package manager. Start by updating brew: brew update You may need to change permissions or paths. It's best to run this before proceeding: brew doctor Next you can install Node.js by running: brew install node Once Node.js is installe...
Encoding //Create a Base64 Encoded NSString Object NSData *nsdata = [@"iOS Developer Tips encoded in Base64" dataUsingEncoding:NSUTF8StringEncoding]; // Get NSString from NSData object in Base64 NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0]; // Print the B...
You can find the installers on Node.js download page. Normally, Node.js recommends two versions of Node, the LTS version (long term support) and the current version (latest release). If you are new to Node, just go for the LTS and then click the Macintosh Installer button to download the package. I...
Several values of the same type can be returned by passing an output iterator to the function. This is particularly common for generic functions (like the algorithms of the standard library). Example: template<typename Incrementable, typename OutputIterator> void generate_sequence(Increment...
Foreword Git can work with video game development out of the box. However the main caveat is that versioning large (>5 MB) media files can be a problem over the long term as your commit history bloats - Git simply wasn't originally built for versioning binary files. The great news is that since...
Using an incorrect format specifier in the first argument to printf invokes undefined behavior. For example, the code below invokes undefined behavior: long z = 'B'; printf("%c\n", z); Here is another example printf("%f\n",0); Above line of code is undefined behavior. %...
mconcat :: [a] -> a is another method of the Monoid typeclass: ghci> mconcat [Sum 1, Sum 2, Sum 3] Sum {getSum = 6} ghci> mconcat ["concat", "enate"] "concatenate" Its default definition is mconcat = foldr mappend mempty.
In the following examples, we'll be using the following samples: List<Product> Products = new List<Product>() { new Product() { ProductId = 1, Name = "Book nr 1", Price = 25 }, new Product() { ProductId = 2, Name = "Book nr 2&quot...

Page 31 of 161