Tutorial by Examples: def

1067 This is probably related to TIMESTAMP defaults, which have changed over time. See TIMESTAMP defaults in the Dates & Times page. (which does not exist yet) 1292/1366 DOUBLE/Integer Check for letters or other syntax errors. Check that the columns align; perhaps you think you are putting i...
You can allow role to access some action on resource by: $acl->allow('Administrator', 'products', 'create'); You can deny role to access some action on resource by: $acl->deny('Customer', 'categories', 'create'); You can check if role is allowed to some action on resource by using: $a...
In a switch statement, introduces a label that will be jumped to if the condition's value is not equal to any of the case labels' values. char c = getchar(); bool confirmed; switch (c) { case 'y': confirmed = true; break; case 'n': confirmed = false; break; default: ...
A named style requires the x:Key property to be set and applies only to elements that explicitly reference it by name: <StackPanel> <StackPanel.Resources> <Style x:Key="MyTextBlockStyle" TargetType="TextBlock"> <Setter Property=&qu...
An implicit style applies to all elements of a given type within scope. An implicit style can omit x:Key since it is implicitly the same as the style's TargetType property. <StackPanel> <StackPanel.Resources> <Style TargetType="TextBlock"> <...
If we have a file called Business.hs, we can define a Business module that can be import-ed, like so: module Business ( Person (..), -- ^ Export the Person type and all its constructors and field names employees -- ^ Export the employees function ) where -- begin types, function defin...
Starting with the Support Library version 22.2.1, it's possible to show and hide a FloatingActionButton from scrolling behavior using a FloatingActionButton.Behavior sublclass that takes advantage of the show() and hide() methods. Note that this only works with a CoordinatorLayout in conjunction wi...
You can define the signing configuration in an external file as a signing.properties in the root directory of your project. For example you can define these keys (you can use your favorite names): STORE_FILE=myStoreFileLocation STORE_PASSWORD=myStorePassword KEY_ALIAS=myKeyAlias KEY_PASSWOR...
You can store the signing information setting environment variables. These values can be accessed with System.getenv("<VAR-NAME>") In your build.gradle you can define: signingConfigs { release { storeFile file(System.getenv("KEYSTORE")) storePasswo...
Official documentation: http://erlang.org/doc/tutorial/nif.html NIFs were introduced in Erlang/OTP R13B03 as an experimental feature. The purpose is to allow calling C-code from inside Erlang code. NIFs are implemented in C instead of Erlang, but they appear as any other functions in the scope of ...
CREATE TYPE MyUniqueNamesType as TABLE ( FirstName varchar(10), LastName varchar(10), CreateDate datetime default GETDATE() PRIMARY KEY (FirstName,LastName) )
Modules are defined in a file named module-info.java, named a module descriptor. It should be placed in the source-code root: |-- module-info.java |-- com |-- example |-- foo |-- Foo.java |-- bar |-- Bar.java Here is a simple module descri...
A common use of macros is to create templates for data structures which obey common rules but may contain different fields. By writing a macro, you can allow the detailed configuration of the data structure to be specified without needing to repeat boilerplate code, nor to use a less efficient struc...
Care must be taken when initializing variables of type float to literal values or comparing them with literal values, because regular floating point literals like 0.1 are of type double. This may lead to surprises: #include <stdio.h> int main() { float n; n = 0.1; if (n > ...
Swift let bundleIdentifier = NSBundle.mainBundle().bundleIdentifier() NSUserDefaults.standardUserDefaults().removePersistentDomainForName(bundleIdentifier) Objective-C NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier]; [[NSUserDefaults standardUserDefaults] removePersi...
A default valued command line argument can be specified easily: // declare options desc.add_options() ("name", po::value<std::string>()->required(), "Type your name to be greeted!") ("rank", po::value<std::string>()->default_value("Dark Kn...
The simplest way is to use brew: brew install zsh After installation, you may want to set it as your default shell by doing: sudo echo '/usr/local/bin/zsh' >> /etc/shells chsh -s /usr/local/bin/zsh If you have git, and required command line tools installed you can compile and install ...
$ a='I am a string with spaces' $ [ $a = $a ] || echo "didn't match" bash: [: too many arguments didn't match [ $a = $a ] was interpreted as [ I am a string with spaces = I am a string with spaces ]. [ is the test command for which I am a string with spaces is not a single argument...
getfunc() { declare -f "$@" } function func(){ echo "I am a sample function" } funcd="$(getfunc func)" getfunc func # or echo "$funcd" Output: func () { echo "I am a sample function" }
A complex type allows you to map selected fields of a database table into a single type that is a child of the main type. [ComplexType] public class Address { public string Street { get; set; } public string Street_2 { get; set; } public string City { get; set; } public string...

Page 16 of 27