Tutorial by Examples: co

Most browsers support using color keywords to specify a color. For example, to set the color of an element to blue, use the blue keyword: .some-class { color: blue; } CSS keywords are not case sensitive—blue, Blue and BLUE will all result in #0000FF. Color Keywords Color nameHex valueRGB...
currentColor returns the computed color value of the current element. Use in same element Here currentColor evaluates to red since the color property is set to red: div { color: red; border: 5px solid currentColor; box-shadow: 0 0 5px currentColor; } In this case, specifyin...
The Problem The abstract equality and inequality operators (== and !=) convert their operands if the operand types do not match. This type coercion is a common source of confusion about the results of these operators, in particular, these operators aren't always transitive as one would expect. &...
The @property decorator can be used to define methods in a class which act like attributes. One example where this can be useful is when exposing information which may require an initial (expensive) lookup and simple retrieval thereafter. Given some module foobar.py: class Foo(object): def __...
If you want to use @property to implement custom behavior for setting and getting, use this pattern: class Cash(object): def __init__(self, value): self.value = value @property def formatted(self): return '${:.2f}'.format(self.value) @formatted.setter def ...
The following example shows common AngularJS constructs in one file: <!DOCTYPE html> <html ng-app="myDemoApp"> <head> <style>.started { background: gold; }</style> <script src="https://code.angularjs.org/1.5.8/angular.min.js">&lt...
Let's say I have this data: Table items idnametag1exampleunique_tag2foosimple42barsimple3bazhello51quuxworld I'd like to get all those lines and know if a tag is used by other lines SELECT id, name, tag, COUNT(*) OVER (PARTITION BY tag) > 1 AS flag FROM items The result will be: idnametag...
Use putAll to put every member of one map into another. Keys already present in the map will have their corresponding values overwritten. Map<String, Integer> numbers = new HashMap<>(); numbers.put("One", 1) numbers.put("Three", 3) Map<String, Integer> othe...
To begin making modifications to the project's data, you have to obtain a local copy of the versioned project. Use the command line svn client or your favorite SVN client (TortoiseSVN, for example). Your local copy of the project is called a working copy in Subversion and you get it by issuing the c...
You are not the only person working on the project, right? This means that your colleagues are also making modifications to the project's data. To stay up to date and to fetch the modifications committed by others, you should run svn update command in your working copy. As a result, your working cop...
If a remote branch has been deleted, your local repository has to be told to prune the reference to it. To prune deleted branches from a specific remote: git fetch [remote-name] --prune To prune deleted branches from all remotes: git fetch --all --prune
A wide variety of standard library functions have among their effects copying byte sequences from one memory region to another. Most of these functions have undefined behavior when the source and destination regions overlap. For example, this ... #include <string.h> /* for memcpy() */ ch...
Requirements: OS X 10.8 “Mountain Lion” or newer required to run Docker. While the docker binary can run natively on Mac OS X, to build and host containers you need to run a Linux virtual machine on the box. 1.12.0 Since version 1.12 you don't need to have a separate VM to be installed, as Docker...
Evaluates its first operand, and, if the resulting value is not equal to zero, evaluates its second operand. Otherwise, it evaluates its third operand, as shown in the following example: a = b ? c : d; is equivalent to: if (b) a = c; else a = d; This pseudo-code represents it : c...
Evaluates its left operand, discards the resulting value, and then evaluates its rights operand and result yields the value of its rightmost operand. int x = 42, y = 42; printf("%i\n", (x *= 2, y)); /* Outputs "42". */ The comma operator introduces a sequence point between i...
This example uses the Car Table from the Example Databases. SELECT * FROM Cars WHERE TotalCost IN (100, 200, 300) This query will return Car #2 which costs 200 and Car #3 which costs 100. Note that this is equivalent to using multiple clauses with OR, e.g.: SELECT * FROM Cars WHERE TotalCos...
In order to get const char* access to the data of a std::string you can use the string's c_str() member function. Keep in mind that the pointer is only valid as long as the std::string object is within scope and remains unchanged, that means that only const methods may be called on the object. C++1...
This example shows the usage of the ILGenerator by generating code that makes use of already existing and new created members as well as basic Exception handling. The following code emits a DynamicAssembly that contains an equivalent to this c# code: public static class UnixTimeHelper { priva...
Branching in Subversion is very simple. In the simplest form, creating a new branch requires you to run the command against the remote repository's URLs. For example, let's create a new branch out of the mainline trunk: svn copy https://svn.example.com/svn/MyRepo/MyProject/trunk https://svn.example...
When you interact with the remote central repository using your private local workspace -- the working copy -- you can use repository-relative URL instead of direct URL to URL copy to create a new branch: svn copy "^/MyProject/trunk" "^/MyProject/branches/MyNewBranch" -m "C...

Page 14 of 248