Tutorial by Examples: ces

When an exception object is created (i.e. when you new it), the Throwable constructor captures information about the context in which the exception was created. Later on, this information can be output in the form of a stacktrace, which can be used to help diagnose the problem that caused the excep...
On an ext filesystem, each file has a stored Access, Modification, and (Status) Change time associated with it - to view this information you can use stat myFile.txt; using flags within find, we can search for files that were modified within a certain time range. To find files that have been modifi...
Preferences objects always represent a specific node in a whole Preferences tree, kind of like this: /userRoot ├── com │   └── mycompany │   └── myapp │   ├── darkApplicationMode=true │   ├── showExitConfirmation=false │   └── windowMaximized=true └── org └...
All instances of Preferences are always thread-safe across the threads of a single Java Virtual Machine (JVM). Because Preferences can be shared across multiple JVMs, there are special methods that deal with synchronizing changes across virtual machines. If you have an application which is supposed...
Preferences nodes can be exported into a XML document representing that node. The resulting XML tree can be imported again. The resulting XML document will remember whether it was exported from the user or system Preferences. To export a single node, but not its child nodes: Java SE 7 try (Output...
Preferences nodes can be imported from a XML document. Importing is meant to be used in conjunction with the exporting functionality of Preferences, since it creates the correct corresponding XML documents. The XML documents will remember whether they were exported from the user or system Preferenc...
A value of a Preferences node can be of the type String, boolean, byte[], double, float, int or long. All invocations must provide a default value, in case the specified value is not present in the Preferences node. Preferences preferences = Preferences.userNodeForPackage(getClass()); String som...
To store a value into the Preferences node, one of the putXXX() methods is used. A value of a Preferences node can be of the type String, boolean, byte[], double, float, int or long. Preferences preferences = Preferences.userNodeForPackage(getClass()); preferences.put("someKey", "...
Preferences can be used to store user settings that reflect a user's personal application settings, e.g. their editor font, whether they prefer the application to be started in full-screen mode, whether they checked a "don't show this again" checkbox and things like that. public class Exi...
You can apply any kind of additional processing to the output by passing a callable to ob_start(). <?php function clearAllWhiteSpace($buffer) { return str_replace(array("\n", "\t", ' '), '', $buffer); } ob_start('clearAllWhiteSpace'); ?> <h1>Lorem Ipsum&l...
MATLAB allows for several methods to index (access) elements of matrices and arrays: Subscript indexing - where you specify the position of the elements you want in each dimension of the matrix separately. Linear indexing - where the matrix is treated as a vector, no matter its dimensions. That ...
A a pointer to a piece of memory containing n elements may only be dereferenced if it is in the range memory and memory + (n - 1). Dereferencing a pointer outside of that range results in undefined behavior. As an example, consider the following code: int array[3]; int *beyond_array = array + 3; ...
Since Groups are "numbered" some engines also support matching what a group has previously matched again. Assuming you wanted to match something where two equals strings of length three are divided by a $ you'd use: (.{3})\$\1 This would match any of the following strings: "abc$...
The member access operators (dot . and arrow ->) are used to access a member of a struct. Member of object Evaluates into the lvalue denoting the object that is a member of the accessed object. struct MyStruct { int x; int y; }; struct MyStruct myObject; myObject.x = 42; myObj...
An std::map takes (key, value) pairs as input. Consider the following example of std::map initialization: std::map < std::string, int > ranking { std::make_pair("stackoverflow", 2), std::make_pair("docs-beta", 1) }; In an std::...
Reflection is often used as part of software testing, such as for the runtime creation/instantiation of mock objects. It's also great for inspecting the state of an object at any given point in time. Here's an example of using Reflection in a unit test to verify a protected class member contains the...
5 Treat a property as a combination of two functions, one to get the value from it, and another one to set the value in it. The get property of the property descriptor is a function that will be called to retrieve the value from the property. The set property is also a function, it will be call...
Scollector will monitor Linux processes specified in the configuration file. [[Process]] Command = "/opt/bosun/bosun" Name = "bosun" [[Process]] Command = "ruby" Name = "puppet-agent" Args = "puppet" [[Process]] Command = &qu...
Scollector will monitor any Windows processes or services specified in the configuration file. [[Process]] Name = "^scollector" [[Process]] Name = "^chrome" [[Process]] Name = "^(MSSQLSERVER|SQLSERVERAGENT)$"
Scollector can also monitor any Windows processes using the .NET framework. If no ProcessDotNet settings are specified it will default to just monitoring the w3wp worker processes for IIS. You can specify which applications to monitor in the configuration file. [[ProcessDotNet]] Name = "^w3...

Page 4 of 40