Tutorial by Examples: el

A flags-style enum value needs to be tested with bitwise logic because it may not match any single value. [Flags] enum FlagsEnum { Option1 = 1, Option2 = 2, Option3 = 4, Option2And3 = Option2 | Option3; Default = Option1 | Option3, } The Default value is actually a ...
Step 1 If you already have Django installed, you can skip this step. pip install Django Step 2 Create a new project django-admin startproject hello That will create a folder named hello which will contain the following files: hello/ ├── hello/ │ ├── __init__.py │ ├── settings.py │...
An XML document is a text file that conforms to the XML specification's well-formedness rules. Such a conforming document is said to be well-formed (not to be confused with valid). XML is very strict with well-formedness in comparison to other languages such as HTML. A text file that is not well-for...
traverse_ executes an Applicative action for every element in a Foldable structure. It ignores the action's result, keeping only the side-effects. (For a version which doesn't discard results, use Traversable.) -- using the Writer applicative functor (and the Sum monoid) ghci> runWriter $ trave...
In Python you can define a series of conditionals using if for the first one, elif for the rest, up until the final (optional) else for anything not caught by the other conditionals. number = 5 if number > 2: print("Number is bigger than 2.") elif number < 2: # Optional cl...
For the sample XML (without namespaces): This XPath, /r/f/text() will select the text node with this string value: "Text 1" And this XPath, string(/r/f) will return the string value of f, which is also: "Text 1"
For the sample XML (without namespaces): This XPath, /r/e will select this element: <e a="1"/>
The Clojure community puts a large emphasis on interactive development, so quite a lot of interaction with Clojure happens within a REPL (read-eval-print-loop). When you input an expression into it, Clojure reads it, evaluates it, and prints the result of the evaluation, all in a loop. You should b...
For installation instructions on elixir check here, it describes instructions related to different platforms. Elixir is a programming language that is created using erlang, and uses erlang's BEAM runtime (like JVM for java). We can use elixir in two modes: interactive shell iex or directly running...
An example that uses Parallel.ForEach loop to ping a given array of website urls. static void Main() { string [] urls = { "www.stackoverflow.com", "www.google.net", "www.facebook.com", "www.twitter.com" ...
An example that uses Parallel.For loop to ping a given array of website urls. static void Main() { string [] urls = { "www.stackoverflow.com", "www.google.net", "www.facebook.com", "www.twitter.com" }; ...
Invoking methods or actions in parallel (Parallel region) static void Main() { string [] urls = { "www.stackoverflow.com", "www.google.net", "www.facebook.com", "www.twitter.com" }; System.Thr...
Content has been moved back to good 'ol JSP wiki page
A while loop executes statements repeatedly until the given condition evaluates to false. This control statement is used when it is not known, in advance, how many times a block of code is to be executed. For example, to print all the numbers from 0 up to 9, the following code can be used: int i =...
Using the Reflection API, it is possible to change or get the value of a field at runtime. For example, you could use it in an API to retrieve different fields based on a factor, like the OS. You can also remove modifiers like final to allow modifing fields that are final. To do so, you will need t...
When defining discriminated unions you can name elements of tuple types and use these names during pattern matching. type Shape = | Circle of diameter:int | Rectangle of width:int * height:int let shapeIsTenWide = function | Circle(diameter=10) | Rectangle(width=10) -> t...
Clicking the Select an element in the page to inspect it button in the upper left corner of the Elements tab in Chrome or Inspector tab in Firefox, available from Developer Tools, and then clicking on a element of the page highlights the element and assigns it to the $0 variable. Elements inspecto...
SELECT Id, FName, LName, (SELECT COUNT(*) FROM Cars WHERE Cars.CustomerId = Customers.Id) AS NumberOfCars FROM Customers
Responding to Editing Notifications textViewShouldBeginEditing(_:) textViewDidBeginEditing(_:) textViewShouldEndEditing(_:) textViewDidEndEditing(_:) Responding to Text Changes textView(_:shouldChangeTextIn:replacementText:) textViewDidChange(_:) Responding to URL textView(_: UITe...
Lets assume we have some Film model: public class Film { public string Title { get; set; } public string Category { get; set; } public int Year { get; set; } } Group by Category property: foreach (var grp in films.GroupBy(f => f.Category)) { var groupCategory = grp.Key; ...

Page 13 of 145