Tutorial by Examples

The routing configuration is included in your app/config/config.yml file, by default the app/config/routing.yml file. From there you can link to your own routing configuration in a bundle # app/config/routing.yml app: resource: "@AppBundle/Resources/config/routing.yml" It migh...
The routing configuration is included in your app/config/config.yml file, by default the app/config/routing.yml file. From there you can link to the controllers that have annotated routing configuration: # app/config/routing.yml app: resource: "@AppBundle/Controller" type: ...
File: test.cfm Tag Implementation <cfoutput>Hello World!</cfoutput> CFScript Implementation <cfscript> writeOutput("Hello World!"); </cfscript>
A browser's debugging console can be used in order to print simple messages. This debugging or web console can be directly opened in the browser (F12 key in most browsers – see Remarks below for further information) and the log method of the console Javascript object can be invoked by typing the fol...
Begin by including highcharts.js in your index.html <html> <head> <script src="http://code.highcharts.com/highcharts.js"></script> </head> Add a <div> to contain your chart <body> <div id="chart"> <!...
Sometimes, we may open a file which we do not have permission to write in Vim without using sudo. Use this command to save a read-only file edited in Vim. :w !sudo tee > /dev/null % Which you could map to :w!! in your .vimrc: cmap w!! w !sudo tee > /dev/null % You will be presented a ...
The size of a canvas is the area it occupies on the page and is defined by the CSS width and height properties. canvas { width : 1000px; height : 1000px; } The canvas resolution defines the number of pixels it contains. The resolution is set by setting the canvas element width and heigh...
Starter code to create and remove a full page canvas that responds to resize events via javascript. var canvas; // Global canvas reference var ctx; // Global 2D context reference // Creates a canvas function createCanvas () { const canvas = document.createElement(&q...
Many times when working with the canvas you will need to have a canvas to hold some intrum pixel data. It is easy to create an offscreen canvas, obtain a 2D context. An offscreen canvas will also use the available graphics hardware to render. The following code simply creates a canvas and fills it ...
This example will show you how to create a simple animation using the canvas and the 2D context. It is assumed you know how to create and add a canvas to the DOM and obtain the context // this example assumes ctx and canvas have been created const textToDisplay = "This is an example that uses...
There are many situation where you want to draw an image that is rotated, scaled, and translated. The rotation should occur around the center of the image. This is the quickest way to do so on the 2D canvas. These functions a well suited to 2D games where the expectation is to render a few hundred e...
Pyinstaller is a normal python package. It can be installed using pip: pip install pyinstaller Installation in Windows For Windows, pywin32 or pypiwin32 is a prerequisite. The latter is installed automatically when pyinstaller is installed using pip. Installation in Mac OS X PyInstaller works...
In the simplest use-case, just navigate to the directory your file is in, and type: pyinstaller myfile.py Pyinstaller analyzes the file and creates: A myfile.spec file in the same directory as myfile.py A build folder in the same directory as myfile.py A dist folder in the same directory as m...
pg_dump -Fc -f DATABASE.pgsql DATABASE The -Fc selects the "custom backup format" which gives you more power than raw SQL; see pg_restore for more details. If you want a vanilla SQL file, you can do this instead: pg_dump -f DATABASE.sql DATABASE or even pg_dump DATABASE > DATABA...
psql < backup.sql A safer alternative uses -1 to wrap the restore in a transaction. The -f specifies the filename rather than using shell redirection. psql -1f backup.sql Custom format files must be restored using pg_restore with the -d option to specify the database: pg_restore -d DATABA...
$ pg_dumpall -f backup.sql This works behind the scenes by making multiple connections to the server once for each database and executing pg_dump on it. Sometimes, you might be tempted to set this up as a cron job, so you want to see the date the backup was taken as part of the filename: $ post...
The datetime module can convert a POSIX timestamp to a ITC datetime object. The Epoch is January 1st, 1970 midnight. import time from datetime import datetime seconds_since_epoch=time.time() #1469182681.709 utc_date=datetime.utcfromtimestamp(seconds_since_epoch) #datetime.datetime(2016, 7, 2...
Angular 2.0.0-rc.4 In this example we'll create a "Hello World!" app with only one root component (AppComponent) for the sake of simplicity. Prerequisites: Node.js v5 or later npm v3 or later Note: You can check versions by running node -v and npm -v in the console/terminal. ...
There are 4 methods for comparing NSDates in Objective-C: - (BOOL)isEqualToDate:(NSDate *)anotherDate - (NSDate *)earlierDate:(NSDate *)anotherDate - (NSDate *)laterDate:(NSDate *)anotherDate - (NSComparisonResult)compare:(NSDate *)anotherDate Consider the following example using 2 dates, N...
For each environment you need to create a separate appsettings.{EnvironmentName}.json files: appsettings.Development.json appsettings.Staging.json appsettings.Production.json Then open project.json file and include them into "include" in "publishOptions" section. This lis...

Page 283 of 1336