Tutorial by Examples: ect

CSS styles for the credits label. Defaults to: credits: { style: { cursor: 'pointer', color: '#909090', fontSize: '10px' } },
Position configuration for the credits label. Supported properties are align, verticalAlign, x and y. Defaults to: credits: { position: { align: 'right', x: -10, verticalAlign: 'bottom', y: -5 } },
Object oriented style Connect to Server $conn = new mysqli("localhost","my_user","my_password"); Set the default database: $conn->select_db("my_db"); Connect to Database $conn = new mysqli("localhost","my_user","my_password&q...
When we are finished querying the database, it is recommended to close the connection to free up resources. Object oriented style $conn->close(); Procedural style mysqli_close($conn); Note: The connection to the server will be closed as soon as the execution of the script ends, unless it...
let sel = document.getSelection(); sel.removeAllRanges();
let sel = document.getSelection(); let myNode = document.getElementById('element-to-select'); let range = document.createRange(); range.selectNodeContents(myNode); sel.addRange(range); It may be necessary to first remove all the ranges of the previous selection, as most browsers don't s...
let sel = document.getSelection(); let text = sel.toString(); console.log(text); // logs what the user selected Alternatively, since the toString member function is called automatically by some functions when converting the object to a string, you don't always have to call it yourself. console...
If targeting Flash Player 11+, the built-in removeChildren method is the best way to remove all children: removeChildren(); //a start and end index can be passed For legacy applications, the same can be accomplished with a loop: while (numChildren > 0) { removeChildAt(0); }
The C++ approach - new and delete In a language like C++, the application program is responsible for managing the memory used by dynamically allocated memory. When an object is created in the C++ heap using the new operator, there needs to be a corresponding use of the delete operator to dispose o...
Early bound (requires a reference to Microsoft Scripting Runtime): Public Sub EnumerateDirectory() Dim fso As Scripting.FileSystemObject Set fso = New Scripting.FileSystemObject Dim targetFolder As Folder Set targetFolder = fso.GetFolder("C:\") Dim foundFi...
A helper function to create a bitmap copy of an object. This can be used to convert vector objects, text or complex nested Sprite's to a flattened bitmap. function makeBitmapCopy(displayObj:IBitmapDrawable, transparent:Boolean = false, bgColor:uint = 0x00000000, smooth:Boolean = true):Bitmap { ...
It is considered good practice to use a prefix when creating git archives, so that extraction will place all files inside a directory. To create an archive of HEAD with a directory prefix: git archive --output=archive-HEAD.zip --prefix=src-directory-name HEAD When extracted all the files will be...
It is also possible to create archives of other items than HEAD, such as branches, commits, tags, and directories. To create an archive of a local branch dev: git archive --output=archive-dev.zip --prefix=src-directory-name dev To create an archive of a remote branch origin/dev: git archive --...
It's a regular pattern in design these days to vertically align call to actions inside its containing cards like this: This can be achieved using a special trick with flexbox HTML <div class="cards"> <div class="card"> <p>Lorem ipsum Magna proident ...
You can rescue a RecordNotFound exception with a redirect instead of showing an error page: class ApplicationController < ActionController::Base # your other stuff rescue_from ActiveRecord::RecordNotFound do |exception| redirect_to root_path, 404, alert: I18n.t("errors.record...
In the case of a multi-project gradle build, you may sometimes need to depend on another project in your build. To accomplish this, you'd enter the following in your project's dependencies: dependencies { compile project(':OtherProject') } Where ':OtherProject' is the gradle path for the p...
If, instead of always having a content script injected based on the URL, you want to directly control when a content script is injected, you can use Programmatic Injection. Minimal example JavaScript chrome.tabs.executeScript({file: "content.js"}); CSS chrome.tabs.insert...
First action to take is to create a new project File > New > Project. Here Single View Application is selected, but you can choose the one that fits your project the best. The next step in setup of core data is adding the information to your project. The important part in the photo below is...
Instantiating a socket can be done in various ways. by 2 line declaration & instantiation: First we need to define a variable which will hold a Socket class object: Socket socket; then we can create a Socket class object: socket = new Socket(); We can also make a one line defin...
import os, time import pyodbc import pandas.io.sql as pdsql def todf(dsn='yourdsn', uid=None, pwd=None, query=None, params=None): ''' if `query` is not an actual query but rather a path to a text file containing a query, read it in instead ''' if query.endswith('.sql') and o...

Page 27 of 99