Command-line options for applications are not treated any differently from command-line arguments by the C language. They are just arguments which, in a Linux or Unix environment, traditionally begin with a dash (-).
With glibc in a Linux or Unix environment you can use the getopt tools to easily d...
As the header already says, the following list contains "interoperable signature types" which are more or less strictly defined. The PDF specification specifies a way to also include completely custom signing schemes. But let us assume we are in an interoperable situation. The the collecti...
It is possible to specify a text hint when using EditTexts. Text hints are useful for conveying to the user what they should type in the EditText.
In XML:
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="use...
In case of big data sets, the call of grepl("fox", test_sentences) does not perform well. Big data sets are e.g. crawled websites or million of Tweets, etc.
The first acceleration is the usage of the perl = TRUE option. Even faster is the option fixed = TRUE. A complete example would be:
...
This example shows how to make an interactive presentation transition with "real-world" physics similar to iOS's notifications screen.
To start with, we need a presenting view controller that the shade will appear over. This view controller will also act as our UIViewControllerTransitio...
Processing provides method triangle() to draw a triangle. This code draws a white triangle on black background.
void setup() {
size(500, 500);
background(0);
fill(255);
noStroke();
}
void draw() {
triangle(250, 225, 225, 275, 275, 275);
}
Another convenient solution for cross compilation is the usage of gox: https://github.com/mitchellh/gox
Installation
The installation is done very easily by executing go get github.com/mitchellh/gox. The resulting executable gets placed at Go's binary directory, e.g. /golang/bin or ~/golang/bin. E...
In order to load data from a MongoDB database into an R dataframe, use the library MongoLite:
# Use MongoLite library:
#install.packages("mongolite")
library(jsonlite)
library(mongolite)
# Connect to the database and the desired collection as root:
db <- mongo(collection = &quo...
Methods used:
.DriveExists(strDrive) returns (True/False)
.FileExists(strFile) returns (True/False)
.FolderExists(strFolder) returns (True/False)
The following code checks for the existence of a file using the "FileExists" method of a file system object. For checking the existence of...
Methods used:
.DeleteFolder(FileSpec, Force (True/False))
.CreateFolder(Path)
.DeleteFile(FileSpec, Force (True/False))
The following example illustrates the Deletion and creation of a folder using the methods "DeleteFolder" and "CreateFolder".
Code:
Dim strFolderPath, ob...
Methods Used:
.CopyFile(Source, Dest [,Overwrite (True/False)]
.CopyFolder(Source, Dest [,Overwrite (True/False)]
The following code illustrates the use of CopyFile method to copy a file to a new location. The same thing can be achieved for the folders by using the CopyFolder method.
Code:
Di...
Methods Used:
.MoveFile(Source, Dest)
.MoveFolder(Source, Dest)
The following code illustrates the use of MoveFile method to Move a file to a new location. The same thing can be achieved for the folders by using the MoveFolder method.
Code:
Dim objFso, strSourcePath, strDestPath
strSourcePat...
As java provide two different commands to compile and run Java code. Same as Kotlin also provide you different commands.
javac to compile java files.
java to run java files.
Same as
kotlinc to compile kotlin files
kotlin to run kotlin files.
Redis-py provides the execute_command method to directly invoke Redis operations. This functionality can be used to access any modules that may not have a supported interface in the redis-py client. For example, you can use the execute_command to list all of the modules loaded into a Redis server:...
Common Lisp has 12 type specific operators to compare two characters, 6 of them case sensitives and the others case insensitives. Their names have a simple pattern to make easy to remember their meaning:
Case SensitiveCase InsensitiveCHAR=CHAR-EQUALCHAR/=CHAR-NOT-EQUALCHAR<CHAR-LESSPCHAR<=CHA...
The core idea is to use GameObjects to represent singletons, which has multiple advantages:
Keeps complexity to a minimum but supports concepts like dependency injection
Singletons have a normal Unity lifecycle as part of the Entity-Component system
Singletons can be lazy loaded and cached loca...
We can use the componentchanged event to listen for changes to the entity:
entity.addEventListener('componentchanged', function (evt) {
if (evt.detail.name === 'position') {
console.log('Entity has moved from',
evt.detail.oldData, 'to', evt.detail.newData, '!');
}
});
We can use the child-attached and child-detached events to listen for when the scene attaches or detaches an entity:
entity.addEventListener('child-attached', function (evt) {
if (evt.detail.el.tagName.toLowerCase() === 'a-box') {
console.log('a box element has been attached');
};
});
...
For example, if we wanted to grab an entity’s three.js camera object or material object, we could reach into its components
var camera = document.querySelector('a-entity[camera]').components.camera.camera;
var material = document.querySelector('a-entity[material]').components.material.material;
...