Tutorial by Examples: el

TSDBRelay can be used to forward metrics to an OpenTSDB instance, send to Bosun for indexing, and relay to another opentsdb compatible instance for backup/DR/HA. It also has options to denormalize metrics with high tag cardinality or create redis/ledis backed external counters. #Create tsdbrelay un...
This example assumes Ruby is installed. Place the following in a file named hello.rb: puts 'Hello World' From the command line, type the following command to execute the Ruby code from the source file: $ ruby hello.rb This should output: Hello World The output will be immediately di...
var httpClient = new HttpClient(); // Create a block the accepts a uri and returns its contents as a string var downloaderBlock = new TransformBlock<string, string>( async uri => await httpClient.GetStringAsync(uri)); // Create a block that accepts the content and prints it to t...
The typical way to begin writing webservers in golang is to use the standard library net/http module. There is also a tutorial for it here. The following code also uses it. Here is the simplest possible HTTP server implementation. It responds "Hello World" to any HTTP request. Save the...
Method 1: Below query will be applicable for SQL Server 2000+ version (Contains 12 columns) SELECT * FROM dbo.sysdatabases Method 2: Below query extract information about databases with more informations (ex: State, Isolation, recovery model etc.) Note: This is a catalog view and will be availa...
Adding elements: [1, 2, 3] << 4 # => [1, 2, 3, 4] [1, 2, 3].push(4) # => [1, 2, 3, 4] [1, 2, 3].unshift(4) # => [4, 1, 2, 3] [1, 2, 3] << [4, 5] # => [1, 2, 3, [4, 5]] Removing elements: array = [1, 2, 3, 4] array.pop # => 4 array # => [1, 2, 3] ...
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, ...
Note: Before deciding which Stream to use please have a look at ParallelStream vs Sequential Stream behavior. When you want to perform Stream operations concurrently, you could use either of these ways. List<String> data = Arrays.asList("One", "Two", "Three", &q...
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 ...

Tel

<input type="tel" value="+8400000000"> The input element with a type attribute whose value is tel represents a one-line plain-text edit control for entering a telephone number.
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 #...
To access tuple elements use Item1-Item8 properties. Only the properties with index number less or equal to tuple size are going to be available (i.e. one cannot access Item3 property in Tuple<T1,T2>). var tuple = new Tuple<string, int, bool, MyClass>("foo", 123, true, new MyC...
String json = "{\"name\": \"John\", \"age\":21}"; JsonObject jsonObject = new JsonParser().parse(json).getAsJsonObject(); System.out.println(jsonObject.get("name").getAsString()); //John System.out.println(jsonObject.get("age").getAs...
With any variadic function, the function must know how to interpret the variable arguments list. With the printf() or scanf() functions, the format string tells the function what to expect. The simplest technique is to pass an explicit count of the other arguments (which are normally all the same ...
using namespace System; int main(array<String^>^ args) { Console::WriteLine("Hello World"); }
As long as the element is a block, and it has an explicitly set width value, margins can be used to center block elements on a page horizontally. We add a width value that is lower than the width of the window and the auto property of margin then distributes the remaining space to the left and the ...
To let rails automatically and correctly link assets (css/js/images) in most cases you want to use built in helpers. (Official documentation) Image helpers image_path This returns the path to an image asset in app/assets/images. image_path("edit.png") # => /assets/edit.png image_...
interface IFoo { } class Foo : IFoo { } class Bar : IFoo { } var item0 = new Foo(); var item1 = new Foo(); var item2 = new Bar(); var item3 = new Bar(); var collection = new IFoo[] { item0, item1, item2, item3 }; Using OfType var foos = collection.OfType<Foo>(); // result: IEnum...
public class DatabaseHelper extends SQLiteOpenHelper { private static final String DATABASE_NAME = "Example.db"; private static final int DATABASE_VERSION = 3; // For all Primary Keys _id should be used as column name public static final String COLUMN_ID = "_id&q...

Page 11 of 145