Tutorial by Examples: c

Step 1: Locate your download of Node.js, typically it is installed under C:/program files/nodejs Step 2: Open Visual Studios and navigate to "Tools>Options" Step 3: In the options window navigate to "Projects and Solutions>External Web Tools" Step 4: Add new entry with y...
If Sitecore is setup in a CM-CD enviornment there could be a need to fire events on CD server when CM events are fired. The example could be firing publish:end:remote on CD when content editors done publish on CM. In order to make sure that events are firing the following steps are required to be ...
This example shows how to perform basic mathematical operations using BigDecimals. 1.Addition BigDecimal a = new BigDecimal("5"); BigDecimal b = new BigDecimal("7"); //Equivalent to result = a + b BigDecimal result = a.add(b); System.out.println(result); Result : 12 ...
NULL is a special case when it comes to comparisons. Assume the following data. id someVal ---- 0 NULL 1 1 2 2 With a query: SELECT id FROM table WHERE someVal = 1 would return id 1 SELECT id FROM table WHERE someVal <> 1 would return id 2 SELECT id FROM tabl...
Python follows PEMDAS rule. PEMDAS stands for Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction. Example: >>> a, b, c, d = 2, 3, 5, 7 >>> a ** (b + c) # parentheses 256 >>> a * b ** c # exponent: same as `a * (b ** c)` 7776 >>...
When performance is a concern, invoking a method via reflection (i.e. via the MethodInfo.Invoke method) is not ideal. However, it is relatively straightforward to obtain a more performant strongly-typed delegate using the Delegate.CreateDelegate function. The performance penalty for using reflecti...
In order to be able to use a class as the key in a map, all that is required of the key is that it be copiable and assignable. The ordering within the map is defined by the third argument to the template (and the argument to the constructor, if used). This defaults to std::less<KeyType>, w...
What we have is a list of credit cards and we'd like to calculate the premiums for all those cards that the credit card company has to pay out. The premiums themselves depend on the total number of credit cards, so that the company adjust them accordingly. We already have a function that calculate...
The HTTP message body can be compressed (since HTTP/1.1). Either by the server compresses the request and adds a Content-Encoding header, or by a proxy does and adds a Transfer-Encoding header. A client may send an Accept-Encoding request header to indicate which encodings it accepts. The most com...
Sometimes auto may behave not quite as was expected by a programmer. It type deduces the expression, even when type deduction is not the right thing to do. As an example, when proxy objects are used in the code: std::vector<bool> flags{true, true, false}; auto flag = flags[0]; flags.push_...
A _ character in a LIKE clause pattern matches a single character. Query SELECT username FROM users WHERE users LIKE 'admin_'; Result +----------+ | username | +----------+ | admin1 | | admin2 | | admin- | | adminA | +----------+
While using decorator syntax (with the @) is convenient, it also a bit concealing. You can use properties directly, without decorators. The following Python 3.x example shows this: class A: p = 1234 def getX (self): return self._x def setX (self, value): self._x =...
Column Editing enables the user to edit text on several lines as a vertical square zone. This feature is enabled by default. There are 3 ways to select a zone to edit: Maintain Alt+Shift and use Up/Down/Left/Right to select the zone to edit with direction keys Maintain Alt+Shift and click on t...
The fact that the garbage collection will clean up does not mean that you should wait for the garbage collection cycle to clean up. In particular you should not wait for garbage collection to close file handles, database connections and open network connections. for example: In the following code...
The instance_eval method is available on all objects. It evaluates code in the context of the receiver: object = Object.new object.instance_eval do @variable = :value end object.instance_variable_get :@variable # => :value instance_eval sets self to object for the duration of the co...
It is possible to compress an HTTP response message body more than once. The encoding names should then be separated by a comma in the order in which they were applied. For example, if a message has been compressed via deflate and then gzip, the header should look like: Content-Encoding: deflate, g...
The client first sends a request with an Accept-Encoding header that indicates it supports gzip: GET / HTTP/1.1\r\n Host: www.google.com\r\n Accept-Encoding: gzip, deflate\r\n \r\n The server may then send a response with a compressed response body and a Content-Encoding header that specifies...
R has a set of built in higher order functions: Map, Reduce, Filter, Find, Position, Negate. Map applies a given function to a list of values: words <- list("this", "is", "an", "example") Map(toupper, words) Reduce successively applies a binary functi...
If the file already exists, it will be overwritten! String fileName = "file.zip"; // name of the file String urlToGetFrom = "http://www.mywebsite.com/"; // URL to get it from String pathToSaveTo = "C:\\Users\\user\\"; // where to put it ...
The objects created within a Tiled Map (.tmx), can be simply loaded as bodies into a Box2D world using the Libgdx MapObject class as following: public void buildBuildingsBodies(TiledMap tiledMap, World world, String layer){ MapObjects objects = tiledMap.getLayers().get(layer).getObjects(); ...

Page 429 of 826