Tutorial by Examples

Public Interface IPerson Sub DoSomething() End Interface Public Class Customer Implements IPerson Public Sub DoSomething() Implements IPerson.DoSomething Console.WriteLine("Customer") End Sub End Class
Chart.js can be included in several different ways: NPM Run the following command on your NPM project directory npm install chart.js --save CDN Include a script tag in your HTML linking to the chart.js CDN <html> <body> <script type="text/javascript" s...
In C, character constants and string literals are different things. A character surrounded by single quotes like 'a' is a character constant. A character constant is an integer whose value is the character code that stands for the character. How to interpret character constants with multiple charac...
To know the path of the directory your file is in you can use: Esc to enter command mode :pwd This will print the path to the directory at the bottom of the editor, like this I'm a ninja ~ ~ ~ ~ ~ /home/ubuntu/myfolder 1,5 All Now...
SQLite is a lightweight, disk-based database. Since it does not require a separate database server, it is often used for prototyping or for small applications that are often used by a single user or by one user at a given time. import sqlite3 conn = sqlite3.connect("users.db") c = con...
Interface declaration for downloading a file public interface ApiInterface { @GET("movie/now_playing") Call<MovieResponse> getNowPlayingMovies(@Query("api_key") String apiKey, @Query("page") int page); // option 1: a resource relative to your bas...
Returns a string (varchar or nvarchar) where all occurrences of a specified sub string is replaced with another sub string. Parameters: string expression. This is the string that would be searched. It can be a character or binary data type. pattern. This is the sub string that would be replaced...
# will retrieve my home path ENV['HOME'] # => "/Users/username" # will try retrieve the 'FOO' environment variable. If failed, will get 'bar' ENV.fetch('FOO', 'bar')
Ruby has three types of objects: Classes and modules which are instances of class Class or class Module. Instances of classes. Singleton Classes. Each object has a class which contains its methods: class Example end object = Example.new object.class # => Example Example.class # ...
There are two ways to get singleton class of an object singleton_class method. Reopening singleton class of an object and returning self. object.singleton_class singleton_class = class << object self end
Singleton classes share their instance/class variables with their object. class Example @@foo = :example end def Example.foo class_variable_get :@@foo end Example.foo #=> :example class Example def initialize @foo = 1 end def foo @foo end end e = Ex...
In Normal, type the following to delete a range of lines into a named register :10,20d a This will delete lines 10,20 in register "a. We can verify this by typing :reg This will show the text that was delete in register "a. To paste the contents in "a, just type "ap ...
When you need to pass some data from the parent task to its children tasks, so it logically flows with the execution, use AsyncLocal class: void Main() { AsyncLocal<string> user = new AsyncLocal<string>(); user.Value = "initial user"; // this does not aff...
Many of the console's print methods can also handle C-like string formatting, using % tokens: console.log('%s has %d points', 'Sam', 100); Displays Sam has 100 points. The full list of format specifiers in Javascript is: SpecifierOutput%sFormats the value as a string%i or %dFormats the value a...
0.18.0 Model is passed to subscriptions which means that every state change can modify subscriptions. import Html exposing ( Html, div, text, button ) import Html.Events exposing ( onClick ) import Time main : Program Never Model Msg main = Html.program { init = init ,...
The canvas can be used to display video from a variety of sources. This example shows how to load a video as a file resource, display it and add a simple click on screen play/pause toggle. This stackoverflow self answered question How do I display a video using HTML5 canvas tag shows the following ...

C#

Clearing the Content of element(Generally Text Box) interactionWebElement.Clear(); Entering data to element (Generally Text Box) interactionWebElement.SendKeys("Text"); Storing the value of the element. string valueinTextBox = interactionWebElement.GetAttribute("value"...
If a recursive call goes "too deep", this results in a StackOverflowError. Java allocates a new frame for every method call on its thread's stack. However, the space of each thread's stack is limited. Too many frames on the stack leads to the Stack Overflow (SO). Example public static vo...
Components define their own Messages, sent after emitted DOM Events, eg. CounterMsg from Parent-child communication type CounterMsg = Increment | Decrement | Reset The view of this component will send messages of CounterMsg type, therefore the view type signature is Html CounterMs...
A common mistake seen in JavaScript when run in a browser environment is updating the DOM more often than necessary. The issue here is that every update in the DOM interface causes the browser to re-render the screen. If an update changes the layout of an element in the page, the entire page layout...

Page 578 of 1336