Tutorial by Examples: def

Sometimes a element needs to be created outside of the usual object structure in the fxml. This is where Define Blocks come into play: Contents inside a <fx:define> element are not added to the object created for the parent element. Every child element of the <fx:define> needs a fx:id...
In order to work with bindings in WPF, you need to define a DataContext. The DataContext tells bindings where to get their data from by default. <Window x:Class="StackOverflowDataBindingExample.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation&q...
Introduced in Java 8, default methods are a way of specifying an implementation inside an interface. This could be used to avoid the typical "Base" or "Abstract" class by providing a partial implementation of an interface, and restricting the subclasses hierarchy. Observer patte...
A category C consists of: A collection of objects called Obj(C) ; A collection (called Hom(C)) of morphisms between those objects. If a and b are in Obj(C), then a morphism f in Hom(C) is typically denoted f : a -> b, and the collection of all morphism between a and b is denoted hom(a,b) ; A...
In Scala operators (such as +, -, *, ++, etc.) are just methods. For instance, 1 + 2 can be written as 1.+(2). These sorts of methods are called 'infix operators'. This means custom methods can be defined on your own types, reusing these operators: class Matrix(rows: Int, cols: Int, val data: Seq[...
Sometimes you want to destructure key under a map which might not be present in the map, but you want a default value for the destructured value. You can do that this way: (def my-map {:a 3 :b 4}) (let [{a :a b :b :keys [c d] :or {a 1 c 2}} my-map] (println ...
XML pre-defines five general entities that can be used without declaring them: & " ' < > They are associated with the names amp, quot, apos, lt and gt. <?xml version="1.0"?> <entities> & is an ampersand. " is a quote. ' is...
It is possible to define one's own general entities. The declaration occurs in the DTD subset, with a name and the associated replacement text. It can then be used in the document using the entity reference syntax &...;, either in text, or in attribute values. <?xml version="1.0"?...
${parameter:-word} If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted. $ unset var $ echo "${var:-XX}" # Parameter is unset -> expansion XX occurs XX $ var="" # Parameter is null ...
DefaultIfEmpty is used to return a Default Element if the Sequence contains no elements. This Element can be the Default of the Type or a user defined instance of that Type. Example: var chars = new List<string>() { "a", "b", "c", "d" }; chars.Defaul...
Let's say we have the following function: (defn nat-num-count [nums] (count (remove neg? nums))) We can write a spec for this function by defining a function spec of the same name: (clojure.spec/fdef nat-num-count :args (s/cat :nums (s/coll-of number?)) :ret integer? ...
The default event for the Page object is Load event. Similarly, every control has a default event. For example, default event for the button control is the Click event. The default event handler could be created in Visual Studio, just by double clicking the control in design view. The following tab...
Mage::log('My log entry'); Mage::log('My log message: '.$myVariable); Mage::log($myArray); Mage::log($myObject); This will log to /var/log/system.log Objects and Arrays are automatically written via a print_r() directive. Watch out when using objects since these can get substantial in size. ...
Fortran 2003 introduced support for object oriented programming. This feature allows to take advantage of modern programming techniques. Derived types are defined with the following form: TYPE [[, attr-list] :: ] name [(name-list)] [def-stmts] [PRIVATE statement or SEQUENCE statement]. . . ...
Information Inheritance allows you to derive a new class from an existing class. You do this using the INHERITING FROM addition in the CLASS subclass DEFINITION INHERITING FROM superclass. statement. The new class subclass inherits all of the components of the existing class superclass. The n...
The following example adds a column admin to the users table, and gives that column the default value false. class AddDetailsToUsers < ActiveRecord::Migration[5.0] def change add_column :users, :admin, :boolean, default: false end end Migrations with defaults might take a long tim...
A list of recognised color keyword names can be found in the W3C Recommendation for SVG. <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <circle r="30" cx="100" cy="100" fill="red" stroke=&qu...
Predefined operators according to ISO/IEC 13211-1 and 13211-2: PriorityTypeOperator(s)Use1200xfx:- -->1200fx:- ?-Directive, query1100xfy;1050xfy->1000xfy','900fy\+700xfx= \\=Term unification700xfx== \\== @< @=< @> @>=Term comparison700xfx=..700xfxis =:= =\= < > =<...
Introduce environment variable VAGRANT_DEFAULT_PROVIDER export VAGRANT_DEFAULT_PROVIDER=vmware_fusion
Vagrant.configure("2") do |config| # ... other config up here config.vm.provider "vmware_fusion" end

Page 7 of 27