Tutorial by Examples: st

Overview Create a new file named my_first_method.rb Place the following code inside the file: def hello_world puts "Hello world!" end hello_world() # or just 'hello_world' (without parenthesis) Now, from a command line, execute the following: ruby my_first_method.rb The ou...
If you want to provide Custom Error Messages you would do it like this: public class LoginViewModel { [Required(ErrorMessage = "Please specify an Email Address")] [EmailAddress(ErrorMessage = "Please specify a valid Email Address")] public string Email { get; set...
@Path("/hello") public class HelloResource { /** * A request to /hello would get the response "Hello World" */ @GET public String exampleGet() { return "Hello World"; } /** * A request to /hello/bob would get ...
import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.HashMap; import java.util.Map; import java.util.Objects; @Path("/alphabet/{letter}") public class AlphabetResource { private final Map<String, String> alphabet; public AlphabetResource(...
First step : PCL part using Xamarin.Forms; namespace ProjectNamespace { public class ExtendedFrame : Frame { /// <summary> /// The corner radius property. /// </summary> public static readonly BindableProperty CornerRadiusProperty = ...
v8 uses the Google depot_tools for getting the source and building the library. To install depot_tools, follow the instructions here: https://www.chromium.org/developers/how-tos/install-depot-tools Get the v8 source by running /path/to/depot_tools/fetch v8 After running this command, to pull ...
Detailed instructions on getting CentOS 7 installation and basic set up for starting on. Download latest CentOS .ISO - https://www.centos.org/download/ After downloading the last version of CentOS using above links or using official CentOS download page. Burn it to a DVD or create a bootable USB...
Detailed instructions on getting twitter set up or installed.
1)Took backup of Machine.config from locations C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config and C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config 2)Copy them to different location and edit them as a)locate and add under <system.data> <DbProviderFactories> ...
GraphQL.js GraphQL.js is a JavaScript reference implementation for GraphQL. You can install it via npm: Initialize npm in your project if you have not done so already: npm init Install GraphQL.js from npm: npm install --save graphql Example Server var { graphql, buildSchema } = require('gra...
USE [MyDatabase] CREATE MESSAGE TYPE [//initiator] VALIDATION = WELL_FORMED_XML; GO CREATE CONTRACT [//call/contract] ( [//initiator] SENT BY INITIATOR ) GO CREATE QUEUE InitiatorQueue; GO CREATE QUEUE TargetQueue; GO CREATE SERVICE InitiatorService ON QUEUE...
Detailed instructions on getting file set up or installed.
npm install --global yarn If you didn't have npm installed before, check there website documentation for more details. https://yarnpkg.com/en/docs/install
To illustrate how to use regr_slope(Y,X), I applied it to a real world problem. In Java, if you don't clean up memory properly, the garbage can get stuck and fill up the memory. You dump statistics every hour about memory utilization of different classes and load it into a postgres database for anal...
When a Component is resolved from the Windsor container it must have a definition of the scope it is in. By scope meaning if and how it is reused and when to release the object for the Garbage Collector to destroy. This is the LifeStlye of the Component. The way to specify a LifeStyle is by registe...
By implementing your custom IScopeAccessor you can create different types of scopes. For the following example I have the two classes Foo and Bar in which Bar will be registered with a custom LifeStyle. Each have an Id to assist with testing public class Foo { public Guid FooId { get; } = G...
The idea is to have one or more control machines from where you can issue ad-hoc commands to remote machines (via ansible tool) or run a sequenced instruction set via playbooks (via ansible-playbook tool). Basically, we use Ansible control machine, this will typically be your desktop, laptop or s...
Basic printing std::ostream_iterator allows to print contents of an STL container to any output stream without explicit loops. The second argument of std::ostream_iterator constructor sets the delimiter. For example, the following code: std::vector<int> v = {1,2,3,4}; std::copy(v.begin(), v...
The try...catch...finally statement combines exception handling with clean-up code. The finally block contains code that will be executed in all circumstances. This makes them suitable for resource management, and other kinds of cleanup. Try-finally Here is an example of the simpler (try...finally...
Example from www.phptherightway.com <?php interface OutputInterface { public function load(); } class SerializedArrayOutput implements OutputInterface { public function load() { return serialize($arrayOfData); } } class JsonStringOutput implements Output...

Page 276 of 369