Tutorial by Examples: n

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...
This is an example of an implementation of the identity monad in JavaScript, and could serve as a starting point to create other monads. Based on the conference by Douglas Crockford on monads and gonads Using this approach reusing your functions will be easier because of the flexibility this monad...
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 ...
The std::nth_element algorithm takes three iterators: an iterator to the beginning, nth position, and end. Once the function returns, the nth element (by order) will be the nth smallest element. (The function has more elaborate overloads, e.g., some taking comparison functors; see the above link for...
.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.
Hosted XSLT 2.0 Setup To run XSLT 2.0 in the browser, use one of the following XSLT 2.0 as a service hosts: XSLT Fiddle W3C XSLT Servlet Online XSLT Test Tool
NetExt is an extension for .NET which provides LINQ-like queries for objects on the heap (!wselect, !wfrom) display capabilities for special objects like dictionaries and hash tables (!wdict, !whash) ASP.NET / HTTP related commands (!wcookie, !wruntime, !whttp) several other network related co...
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...
An incomplete list of WinDbg extensions that are not installed with WinDbg itself: ExtensionPurposeSOS.NET (official Microsoft extension)SOSex.NET (extension for SOS)CoSOS.NET (extension for SOS)NetExt.NET (with focus on networking)PyKDPython scriptingPDEWindows native and store applications (stowe...

Page 610 of 1088