Tutorial by Examples: c

The predicate function matches can be used to evaluate strings on the fly without use of any object declarations. IF matches( val = 'Not a hex string' regex = '[0-9a-f]*' ). cl_demo_output=>display( 'This will not display' ). ELSEIF matches( val = '6c6f7665' reg...
As already pointed out in other pitfalls, catching all exceptions by using try { // Some code } catch (Exception) { // Some error handling } Comes with a lot of different problems. But one perticular problem is that it can lead to deadlocks as it breaks the interrupt system when writ...
The latest version of the Oracle Java style guide mandates that the "then" and "else" statements in an if statement should always be enclosed in "braces" or "curly brackets". Similar rules apply to the bodies of various loop statements. if (a) { //...
Solr is a standalone enterprise search server with a REST-like API. You put documents in it (called "indexing") via JSON, XML, CSV or binary over HTTP. You query it via HTTP GET and receive JSON, XML, CSV or binary results. Solr uses the Lucene search library and extends it. Here are som...
Create blank Multi-Device (Firemonkey) application. Drop Rectangle on Form. In Object inspector window (F11) find RotationAngle click on drop down button, and select "Create New TFloatAnimation". Object inspector window is automatically switched to a newly added TFloatAnimation, you...
Scaling to fit Means that the whole image will be visible but there may be some empty space on the sides or top and bottom if the image is not the same aspect as the canvas. The example shows the image scaled to fit. The blue on the sides is due to the fact that the image is not the same aspect as ...
Documenting your work Remember what you've done and retain long outputs which can't be kept in WinDbg's buffer. It's always good to have a log available for reproducing debugging steps, e.g. to ask questions on Stack Overflow. CommandPurpose.logopencreate a log file.logcloseclose the log file.dump...
Following are the Prerequisites for installing Cookiecutter: pip virtualenv PostgreSQL Create a virtualenv for your project and activate it: $ mkvirtualenv <virtualenv name> $ workon <virtualenv name> Now install Cookiecutter using: $ pip install cookiecutter Change dire...
This example finds a point on a bezier or cubic curve at position where position is he unit distance on the curve 0 <= position <= 1. The position is clamped to the range thus if values < 0 or > 1 are passed they will be set 0,1 respectively. Pass the function 6 coordinates for quadrati...
Unlike most other JavaScript objects, symbols are not automatically converted into a string when performing concatenation. let apple = Symbol('Apple') + ''; // throws TypeError! Instead, they have to be explicitly converted into a string when necessary, (for example, to get a textual description...
Server-Side JavaScript Native JSON Samplestack Sample Application Temporal Documents REST Management API Improvements More Semantics Features, Including SPARQL 1.1, Inferencing, and SPARQL UPDATE Node.js Client API REST and Java Client API Improvements Enhanced HTTP Server Features Flexi...
The Symbol.for method allows you to register and look up global symbols by name. The first time it is called with a given key, it creates a new symbol and adds it to the registry. let a = Symbol.for('A'); The next time you call Symbol.for('A'), the same symbol will be returned instead of a new o...
For more complex applications, flat execution profiles may be difficult to follow. This is why many profiling tools also generate some form of annotated callgraph information. gperf2dot converts text output from many profilers (Linux perf, callgrind, oprofile etc.) into a callgraph diagram. You can...
Google Perf Tools also provides a CPU profiler, with a slightly friendlier interface. To use it: Install Google Perf Tools Compile your code as usual Add the libprofiler profiler library to your library load path at runtime Use pprof to generate a flat execution profile, or a callgraph diagram...
The | can be used to have a single case statement match against multiple inputs to yield the same result: def f(str: String): String = str match { case "foo" | "bar" => "Matched!" case _ => "No match." } f("foo") // res0: String = M...
Given the following List of tuples: val pastries = List(("Chocolate Cupcake", 2.50), ("Vanilla Cupcake", 2.25), ("Plain Muffin", 3.25)) Pattern matching can be used to handle each element differently: pastries foreach { pa...
Bootstrapping Magento by calling: require_once 'app/Mage.php'; Mage::app(); // Your code This is the simplest way but not really the Magento way because we're not using class that extends Mage_Shell_Abstract - the class which when extended provides us with tools to parse command line arguments...
Magento way File resides in shell/custom.php <?php require_once' abstract.php'; class Stackoverflow_Shell_Custom extends Mage_Shell_Abstract { protected $_argname = array(); public function __construct() { parent::__construct(); // Time limit to infinity ...
.exr -1 gives you details about the last exception thrown. !analyze -v usually does a good job as well. For .NET, the command !pe of the SOS extension shows details about the .NET exception that was thrown.
Print the path to the active developer directory (selected Xcode) xcode-select -p Select a different version of Xcode, e.g. Beta sudo xcode-select -s /Applications/Xcode-beta.app Reset to the default version of Xcode sudo xcode-select -r This is equivalent to running sudo xcode-select -s /Appl...

Page 464 of 826