Tutorial by Examples: c

If you want to parse more complex command-line arguments, e.g. with optional parameters, than the best is to use google's GWT approach. All classes are public available at: https://gwt.googlesource.com/gwt/+/2.8.0-beta1/dev/core/src/com/google/gwt/util/tools/ToolBase.java An example for handling ...
The power of AppleScript lies in being able to automate many Mac applications. To find out what you can automate, you need to read an app's scripting dictionary. To do so, launch Script Editor, and select File > Open Dictionary… Once you choose an app, its dictionary will open up in a new win...
C++14 It is often useful to define classes or structures that have a variable number and type of data members which are defined at compile time. The canonical example is std::tuple, but sometimes is it is necessary to define your own custom structures. Here is an example that defines the structure ...
The methods object.wait(), object.notify() and object.notifyAll() are meant to be used in a very specific way. (see http://stackoverflow.com/documentation/java/5409/wait-notify#t=20160811161648303307 ) The "Lost Notification" problem One common beginner mistake is to unconditionally cal...
// 1. Base example not using language support for covariance, dynamic type checking. class Top { public: virtual Top* clone() const = 0; virtual ~Top() = default; // Necessary for `delete` via Top*. }; class D : public Top { public: Top* clone() const override ...
// 2. Covariant result version of the base example, static type checking. class Top { public: virtual Top* clone() const = 0; virtual ~Top() = default; // Necessary for `delete` via Top*. }; class D : public Top { public: D* /* ← Covariant return */ clone() const over...
// 3. Covariant smart pointer result (automated cleanup). #include <memory> using std::unique_ptr; template< class Type > auto up( Type* p ) { return unique_ptr<Type>( p ); } class Top { private: virtual Top* virtual_clone() const = 0; public: unique_ptr&l...
Worse ViewController: // ... myMethod: function () { this.getView().lookup('myhappyfield').setValue(100); } //... View: //... items: [ { xtype: 'textfield', reference: 'myhappyfield' } ] //... Better ViewController: // ... myMethod: function () { ...
Converts the specified string representation of a date and time to its DateTime equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. The method returns a value that indicates whether th...
Return the number of characters in the string Syntax: CHAR_LENGTH(str) CHAR_LENGTH('foobar') -- 6 CHAR_LENGTH('fööbar') -- 6 -- contrast with LENGTH(...) = 8
Resource with same path and name may exist in more than one JAR file on the classpath. Common cases are resources following a convention or that are part of a packaging specification. Examples for such resources are META-INF/MANIFEST.MF META-INF/beans.xml (CDI Spec) ServiceLoader properties con...
const source = Rx.Observable.range(1, 3) .map(x => x * x); const subscription = source.subscribe( x => console.log(`Next: ${x}`), err => console.log(`Error: ${err}`), () => console.log(`Completed`) ); // => Next: 1 // => Next: 4 // => Next: 9 // => Compl...
const source = Rx.Observable.range(1, 3) .map((x, idx, obs) => `Element ${x} was at position ${idx}`); const subscription = source.subscribe( x => console.log(`Next: ${x}`), err => console.log(`Error: ${err}`), () => console.log(`Completed`) ); // => Next: Element 1...
The standard library module urllib.request can be used to download web content: from urllib.request import urlopen response = urlopen('http://stackoverflow.com/questions?sort=votes') data = response.read() # The received bytes should usually be decoded according the response's characte...
The received bytes have to be decoded with the correct character encoding to be interpreted as text: Python 3.x3.0 import urllib.request response = urllib.request.urlopen("http://stackoverflow.com/") data = response.read() encoding = response.info().get_content_charset() html = d...
The simplest way is to use brew: brew install zsh After installation, you may want to set it as your default shell by doing: sudo echo '/usr/local/bin/zsh' >> /etc/shells chsh -s /usr/local/bin/zsh If you have git, and required command line tools installed you can compile and install ...
brew install zsh sudo echo '/usr/local/bin/zsh' >> /etc/shells chsh -s /usr/local/bin/zsh
textOnCurve(text,offset,x1,y1,x2,y2,x3,y3,x4,y4) Renders text on quadratic and cubic curves. text is the text to render offset distance from start of curve to text >= 0 x1,y1 - x3,y3 points of quadratic curve or x1,y1 - x4,y4 points of cubic curve or Example usage: textOnCurve("...
Puppet is a configuration management solution. Users describe the desired state of a server or software and configuration management achieves this state. This brings following advantages: Configurations can be reproduced exactly the same every time, as many times as necessary Configurations for ...
Coments "Comments are enclosed in double quotes. BEWARE: This is NOT a string!" "They can span multiple lines." Strings 'Strings are enclosed in sigle quotes.' 'Single quotes are escaped with a single quote, like this: ''.' '''' "<--This string contains one sin...

Page 467 of 826