Tutorial by Examples: c

Overridable Allows a property or method in a class to be overridden in a derived class. Public Class Person Public Overridable Sub DoSomething() Console.WriteLine("Person") End Sub End Class Overrides Overrides an Overridable property or method defined in the base...
Me uses the current object instance. MyClass uses the memberdefinition in the class where the member is called Class Person Public Overridable Sub DoSomething() Console.WriteLine("Person") End Sub Public Sub useMe() Me.DoSomething() End Sub ...
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
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...
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...
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...
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...
Default date format: "mm/dd/yy" The following example shows how you can set the date format in initialization with the dateFormat option. <input type="text" id="datepicker"> <script> $("#datepicker").datepicker({ dateFormat: "...
In assignments, you can split an Iterable into values using the "unpacking" syntax: Destructuring as values a, b = (1, 2) print(a) # Prints: 1 print(b) # Prints: 2 If you try to unpack more than the length of the iterable, you'll get an error: a, b, c = [1] # Raises: ValueError:...
In functions, you can define a number of mandatory arguments: def fun1(arg1, arg2, arg3): return (arg1,arg2,arg3) which will make the function callable only when the three arguments are given: fun1(1, 2, 3) and you can define the arguments as optional, by using default values: def fun...
When you want to create a function that can accept any number of arguments, and not enforce the position or the name of the argument at "compile" time, it's possible and here's how: def fun1(*args, **kwargs): print(args, kwargs) The *args and **kwargs parameters are special parame...
let fetchRequest = NSFetchRequest(entityName: "Foo") var thePredicate: NSPredicate? thePredicate = NSPredicate(format: "message == 'example'") The entity Foo has a message string attribute

Page 359 of 826