Tutorial by Examples: c

Scale a rectangle horizontally by factor 2 and vertically by factor 0.5: <svg xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="40" height="40" transform="scale(2, 0.5)" /> </svg> The result is equiv...
<svg width="400" height="400"> <defs> <pattern id="pattern1" width="0.2" height="0.2" patternUnits="objectBoundingBox"> <circle cx="10" cy="10" r="10" fill="#0000ff" /&...
Let’s try some basic expression in the REPL: CL-USER> (+ 1 2 3) 6 CL-USER> (- 3 1 1) 1 CL-USER> (- 3) -3 CL-USER> (+ 5.3 (- 3 2) (* 2 2)) 10.3 CL-USER> (concatenate 'string "Hello, " "World!") "Hello, World!" CL-USER> The basic building ...
Two popular options are to use: ipython notation: In [11]: df = pd.DataFrame([[1, 2], [3, 4]]) In [12]: df Out[12]: 0 1 0 1 2 1 3 4 Alternatively (this is popular over in the python documentation) and more concisely: df.columns # Out: RangeIndex(start=0, stop=2, step=1) df[0...
emacs-live is another popular emacs starter kit, with an additional focus on live music coding using overtone. You can install it in 2 ways: On *nix (e.g. linux, OSX, etc.) systems, run the following command on the command-line: bash <(curl -fksSL https://raw.github.com/overtone/emacs-l...
Cask is a project management tool which can be also used to easily manage your local emacs configuration. Installing cask is easy. You can either run the following command on the command-line: curl -fsSL https://raw.githubusercontent.com/cask/cask/master/go | python Or if you are on a mac, you...
In the example below we use std::string and operator>> to read items from the file. std::ifstream file("file3.txt"); std::vector<std::string> v; std::string s; while(file >> s) // keep reading until we run out { v.push_back(s); ...
C++11 struct info_type { std::string name; int age; float height; // we define an overload of operator>> as a friend function which // gives in privileged access to private data members friend std::istream& operator>>(std::istream& is, info_...
Comparison operators compare two values and return to you a boolean (True or False) as the result. Equality The equal sign = is used both for equality comparison and assignment. If leftValue = rightValue Then ... Inequality The left angle bracket nest to the right angle bracket <> p...
cdecl is a Windows 32-bit function calling convention which is very similar to the calling convention used on many POSIX operating systems (documented in the i386 System V ABI). One of the differences is in returning small structs. Parameters Parameters are passed on the stack, with the first arg...
stdcall is used for 32-bit Windows API calls. Parameters Parameters are passed on the stack, with the first parameter closest to the top of the stack. The callee will pop these values off of the stack before returning. Return Value Scalar return values are placed in EAX. Saved and Clobbered Re...
<svg width="900px" height="400px" viewBox="0 0 900 400"> <defs> <filter id="basicGaussian"> <feGaussianBlur stdDeviation="5"/> </filter> </defs> <image xlink:href=&q...
// Get the battery API navigator.getBattery().then(function(battery) { // Battery level is between 0 and 1, so we multiply it by 100 to get in percents console.log("Battery level: " + battery.level * 100 + "%"); });
// Get the battery API navigator.getBattery().then(function(battery) { if (battery.charging) { console.log("Battery is charging"); } else { console.log("Battery is discharging"); } });
// Get the battery API navigator.getBattery().then(function(battery) { console.log( "Battery will get fully charged in ", battery.chargingTime, " seconds" ); });
The method PrintWriter.format (called through System.out.format) can be used to print aligned strings in console. The method receives a String with the format information and a series of objects to format: String rowsStrings[] = new String[] {"1", &q...
DELIMITER $$ DROP PROCEDURE IF EXISTS sp_nested_loop$$ CREATE PROCEDURE sp_nested_loop(IN i INT, IN j INT, OUT x INT, OUT y INT, INOUT z INT) BEGIN DECLARE a INTEGER DEFAULT 0; DECLARE b INTEGER DEFAULT 0; DECLARE c INTEGER DEFAULT 0; WHILE a < i DO WHILE b <...
Clickjacking is a malicious technique of tricking a Web user into clicking on something different from what the user perceives they are clicking on. Learn more To enable clickjacking protection, add the XFrameOptionsMiddleware to your middleware classes. This should already be there if you didn...
Controller code: angular.module('myModule', []) .controller('myController', function($scope) { $scope.num = 2; $scope.doSomething = function() { $scope.num += 2; } }); The test: describe('myController', function() { var $scope; beforeEach(function() { modu...
Service Code angular.module('myModule', []) .service('myService', function() { this.doSomething = function(someNumber) { return someNumber + 2; } }); The test describe('myService', function() { var myService; beforeEach(function() { module('myModule'); inj...

Page 265 of 826