Tutorial by Examples: dse

Starting from a new Settings class and custom configuration section: Add an application setting named ExampleTimeout, using the time System.Timespan, and set the value to 1 minute: Save the Project Properties, which saves the Settings tab entries, as well as re-generates the custom Settings cl...
SpeechRecognitionEngine recognitionEngine = new SpeechRecognitionEngine(); GrammarBuilder builder = new GrammarBuilder(); builder.Append(new Choices("I am", "You are", "He is", "She is", "We are", "They are")); builder.Append(new Choices...
The ArrayIndexOutOfBoundsException is thrown when a non-existing index of an array is being accessed. Arrays are zero-based indexed, so the index of the first element is 0 and the index of the last element is the array capacity minus 1 (i.e. array.length - 1). Therefore, any request for an array e...
Server: Start, and wait for incoming connections //Open a listening "ServerSocket" on port 1234. ServerSocket serverSocket = new ServerSocket(1234); while (true) { // Wait for a client connection. // Once a client connected, we get a "Socket" object // that c...
import random shuffle() You can use random.shuffle() to mix up/randomize the items in a mutable and indexable sequence. For example a list: laughs = ["Hi", "Ho", "He"] random.shuffle(laughs) # Shuffles in-place! Don't do: laughs = random.shuffle(laughs) p...
Using one sequence: sorted((7, 2, 1, 5)) # tuple # Output: [1, 2, 5, 7] sorted(['c', 'A', 'b']) # list # Output: ['A', 'b', 'c'] sorted({11, 8, 1}) # set # Output: [1, 8, 11] sorted({'11': 5, '3': 2, '10': 15}) # dict # Output: ['10', '11...
We have three methods: attr_reader: used to allow reading the variable outside the class. attr_writer: used to allow modifying the variable outside the class. attr_accessor: combines both methods. class Cat attr_reader :age # you can read the age but you can never change it attr_writer...
The following variables set up the below example: var COOKIE_NAME = "Example Cookie"; /* The cookie's name. */ var COOKIE_VALUE = "Hello, world!"; /* The cookie's value. */ var COOKIE_PATH = "/foo/bar"; /* The cookie's path. */ var COOKIE_EXPIRES; ...
It is possible to emulate container types, which support accessing values by key or index. Consider this naive implementation of a sparse list, which stores only its non-zero elements to conserve memory. class sparselist(object): def __init__(self, size): self.size = size se...
Sorted sequences allow the use of faster searching algorithms: bisect.bisect_left()1: import bisect def index_sorted(sorted_seq, value): """Locate the leftmost value exactly equal to x or raise a ValueError""" i = bisect.bisect_left(sorted_seq, value) ...
Searching in nested sequences like a list of tuple requires an approach like searching the keys for values in dict but needs customized functions. The index of the outermost sequence if the value was found in the sequence: def outer_index(nested_sequence, value): return next(index for index, ...
Getters and setters allow you to define custom behaviour for reading and writing a given property on your class. To the user, they appear the same as any typical property. However, internally a custom function you provide is used to determine the value when the property is accessed (the getter), and...
ID selectors select DOM elements with the targeted ID. To select an element by a specific ID in CSS, the # prefix is used. For example, the following HTML div element… <div id="exampleID"> <p>Example</p> </div> …can be selected by #exampleID in CSS as sho...
5 Treat a property as a combination of two functions, one to get the value from it, and another one to set the value in it. The get property of the property descriptor is a function that will be called to retrieve the value from the property. The set property is also a function, it will be call...
Scollector will monitor Linux processes specified in the configuration file. [[Process]] Command = "/opt/bosun/bosun" Name = "bosun" [[Process]] Command = "ruby" Name = "puppet-agent" Args = "puppet" [[Process]] Command = &qu...
Scollector will monitor any Windows processes or services specified in the configuration file. [[Process]] Name = "^scollector" [[Process]] Name = "^chrome" [[Process]] Name = "^(MSSQLSERVER|SQLSERVERAGENT)$"
Background TypeScript is a typed superset of JavaScript that compiles directly to JavaScript code. TypeScript files commonly use the .ts extension. Many IDEs support TypeScript without any other setup required, but TypeScript can also be compiled with the TypeScript Node.JS package from the command...
Installing Visual Studio If you do not have Visual Studio installed, you can download the free Visual Studio Community Edition here. If you already have it installed, you can proceed to the next step. Creating an ASP.NET Core MVC Application. Open Visual Studio. Select File > New Project. ...
Prerequisites and Requirements for Magento Community Edition 1.9 Hosting Apache 2.x ( with mod_rewrite ) or Nginx 1.7.x Due to the demands of processing Magento operations, it is recommended that you install Magento on a server with at least 2 GB of RAM. This will ensure that all of the s...
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...

Page 1 of 10