Tutorial by Examples: c

String macros are syntactic sugar for certain macro invocations. The parser expands syntax like mymacro"my string" into @mymacro_str "my string" which then, like any other macro call, gets substituted with whatever expression the @mymacro_str macro returns. Base Julia com...
This is a continuation of the "main class" and "executable JAR" examples. Typical Java applications consist of an application-specific code, and various reusable library code that you have implemented or that has been implemented by third parties. The latter are commonly referr...
Search for a lemma when you know what its conclusion ought to be: Coq < SearchPattern (S _ <= _). le_n_S: forall n m : nat, n <= m -> S n <= S m You can also search on a partial conclusion (the conclusion and one or several last hypotheses). Coq < Require Import Arith. Coq &...
Consider this CSV data: #id,title,text 1,hello world,"This is a ""blog""." 2,second time,"My second entry." This data can be read with the following code: // r can be any io.Reader, including a file. csvReader := csv.NewReader(r) // Set comment char...
The Comprehensive TeX Archive Network (CTAN) is indeed that, the comprehensive repository of LaTeX packages. Most if not all quality packages (and more) are on there, and all the good ones include documentation. Enter the package name into the search bar. Select the package from the list...
If you use the TeX Live distribution you can use the command-line program texdoc. For instance, texdoc biblatex will open the documentation of package biblatex. Or if you are not command-line-savvy, the same can be found online at http://www.texdoc.net/
Depending on the service, you will either need to use Basic Authentication with a username and password or pass an apikey as a parameter in each request. Some services also support token authentication. GET using Tone Analyzer: curl -X GET \ -u "username":"password" \ -d &qu...
The quickest way to get started with Watson services is to use the Watson Developer Cloud SDKs. The following GitHub repositories contain installation instructions and basic usage examples: Android iOS Java Node.js Python Unity For example, here's how to make an AlchemyLanguage API call w...
Groups can be configured under Suite and/or Test element of testng.xml. All groups which are marked as included in tesng.xml will be considered for execution, excluded one will be ignored. If a @Test method has multiple groups and from those groups if any single groups is excluded in testng.xml that...
HTML: <div class="container"> <span>vertically centered</span> </div> CSS: .container{ height: 50px; /* set height */ line-height: 50px; /* set line-height equal to the height */ vertical-align: middle; /* works without this ...
Swift Add this extension to UIImage : extension UIImage { func maskWithColor(color: UIColor) -> UIImage? { let maskImage = self.CGImage let width = self.size.width let height = self.size.height let bounds = CGRectMake(0, 0, width, height) ...
with q command we could simplify a lot of tedious work in vim. example 1. generate array sequence (1 to 20). STEP 1. press i to enter insert mode, input 1 1 STEP 2. Record following action: "append the last number to the next line, and increment the number" type esc to exit input...
import scala.reflect.runtime.universe._ val mirror = runtimeMirror(getClass.getClassLoader) val module = mirror.staticModule("org.data.TempClass")
The following command backs up the 'Users' database to 'D:\DB_Backup' file. Its better to not give an extension. BACKUP DATABASE Users TO DISK = 'D:\DB_Backup'
The following command restores the 'Users' database from 'D:\DB_Backup' file. RESTORE DATABASE Users FROM DISK = 'D:\DB_Backup'
Following example also have explanation required for understanding example within it. import java.time.Clock; import java.time.Duration; import java.time.Instant; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.time.ZoneId; import java.time...
The find function First let's take a look at the string.find function in general: The function string.find (s, substr [, init [, plain]]) returns the start and end index of a substring if found, and nil otherwise, starting at the index init if it is provided (defaults to 1). ("Hello, I am a ...
How it works The string.gmatch function will take an input string and a pattern. This pattern describes on what to actually get back. This function will return a function which is actually an iterator. The result of this iterator will match to the pattern. type(("abc"):gmatch ".&quo...
do not confuse with the string.sub function, which returns a substring! How it works string argument ("hello world"):gsub("o", "0") --> returns "hell0 w0rld", 2 -- the 2 means that 2 substrings have been replaced (the 2 Os) ("hello worl...
The Compat.jl package enables using some new Julia features and syntax with older versions of Julia. Its features are documented on its README, but a summary of useful applications is given below. 0.5.0 Unified String type In Julia v0.4, there were many different types of strings. This system was...

Page 500 of 826