Tutorial by Examples: ti

If a selection on multiple arguments for a type generic expression is wanted, and all types in question are arithmetic types, an easy way to avoid nested _Generic expressions is to use addition of the parameters in the controlling expression: int max_int(int, int); unsigned max_unsigned(unsigned, ...
Windows PowerShell is included with the Windows Management Framework. Installation and Setup are not required on modern versions of Windows. Updates to PowerShell can be accomplished by installing a newer version of the Windows Management Framework. Other Platforms "Beta" version of P...
The easiest way to set up NumPy on Mac is with pip pip install numpy Installation using Conda. Conda available for Windows, Mac, and Linux Install Conda. There are two ways to install Conda, either with Anaconda (Full package, include numpy) or Miniconda (only Conda,Python, and the package...
Option 1: Leiningen Requires JDK 6 or newer. The easiest way to get started with Clojure is to download and install Leiningen, the de facto standard tool to manage Clojure projects, then run lein repl to open a REPL. Linux curl https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/l...
While using scaffolding is a fast and easy if you are new to Rails or you are creating a new application, later it can be useful just to do it on your own ato avoid the need to go through the scaffold-generated code to slim it down (remove unused parts, etc.). Creating a model can be as simple as c...
Ruby on Rails provides a model generator you can use to create ActiveRecord models. Simply use rails generate model and provide the model name. $ rails g model user In addition to the model file in app/models, the generator will also create: the Test in test/models/user_test.rb the Fixtures ...
Getting setup with Spring Boot for the first time is quite fast thanks to the hard work of the Spring Community. Prerequisites: Java installed Java IDE Recommended not required (Intellij, Eclipse, Netbeans, etc.) You don't need to have Maven and/or Gradle installed. The projects generate...
Windows Verify that you have the correct JDK. You can check it by opening command prompt (press windows key and write cmd). In the command prompt type javac -version, this will show the current version of JDK installed on your matching or an error* if Java is missing. If the JDK is not availabl...
Following is an implementation that demonstrates how an object can be serialized into its corresponding JSON string. class Test { private int idx; private String name; public int getIdx() { return idx; } public void setIdx(int idx) { this.idx = idx; ...
A custom component that takes the type of a component as input and creates an instance of that component type inside itself. When the input is updated, the previously added dynamic component is removed and the new one added instead. @Component({ selector: 'dcl-wrapper', template: `<div #...
Simple: NSString *newString = @"My String"; From multiple strings: NSString *stringOne = @"Hello"; NSString *stringTwo = @"world"; NSString *newString = [NSString stringWithFormat:@"My message: %@ %@", stringOne, stringTwo]; Usi...
Ruby provides several ways to create a String object. The most common way is using single or double quotes to create a "string literal": s1 = 'Hello' s2 = "Hello" The main difference is that double-quoted string literals are a little bit more flexible as they support interpo...
Concatenate strings with the + operator: s1 = "Hello" s2 = " " s3 = "World" puts s1 + s2 + s3 # => Hello World s = s1 + s2 + s3 puts s # => Hello World Or with the << operator: s = 'Hello' s << ' ' s << 'World' puts s # => ...
The double-quoted delimiter " and %Q sequence supports string interpolation using #{ruby_expression}: puts "Now is #{Time.now}" # Now is Now is 2016-07-21 12:47:45 +0200 puts %Q(Now is #{Time.now}) # Now is Now is 2016-07-21 12:47:45 +0200
By default, all the required libraries for build ASP.NET applications are included during the installation of Visual Studio. If a newer version of ASP.NET is released that was not included with Visual Studio, you can download the appropriate SDK library from Microsoft, which will include all the nec...
You can iterate over arrays either by using enhanced for loop (aka foreach) or by using array indices: int[] array = new int[10]; // using indices: read and write for (int i = 0; i < array.length; i++) { array[i] = i; } Java SE 5 // extended for: read only for (int e : array) { ...
Tuples are created using generic types Tuple<T1>-Tuple<T1,T2,T3,T4,T5,T6,T7,T8>. Each of the types represents a tuple containing 1 to 8 elements. Elements can be of different types. // tuple with 4 elements var tuple = new Tuple<string, int, bool, MyClass>("foo", 123, t...
Some people have issues regarding error messages not being displayed if an existing value is being entered. For example I'm not allowing a user signup with an existing email. View <?php ...................... <?= $form->field($modelUser, 'email')->textInput(['class'=&gt...
In Python 2, range function returns a list while xrange creates a special xrange object, which is an immutable sequence, which unlike other built-in sequence types, doesn't support slicing and has neither index nor count methods: Python 2.x2.3 print(range(1, 10)) # Out: [1, 2, 3, 4, 5, 6, 7, 8, 9...
Use the following steps to create a topic: Click Create New Topic on the tag's dashboard. Name the topic. Provide detailed examples in the "Examples" section. If you have more to share, use the "Syntax," "Parameters," and "Remarks" sections. You have ...

Page 41 of 505