Tutorial by Examples: dc

Starting a new comment (single line or delimited) inside a comment (single line or delimited) has no effect and is ignored. Examples: -- This is a single-line comment. This second -- has no special meaning. -- This is a single-line comment. This /* has no special meaning. /* This is not a si...
If you add controls from third party libraries in a C# WPF project, the XAML file will normally have lines like this one. xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" This will perhaps not work with FsXaml. The designer and the compiler accepts that line, but there will prob...
public abstract class BaseActivity extends AppCompatActivity { private Map<Integer, PermissionCallback> permissionCallbackMap = new HashMap<>(); @Override protected void onStart() { super.onStart(); ... } @Override public void setConten...
on your elements.html file, run the following commands: cd PATH/TO/IMPORTFILE/ vulcanize elements.html -o elements.vulc.html --strip-comments --inline-css --inline-js crisper --source elements.vulc.html --html build.html --js build.js Vulcanize retrieved source code of all the imports, then re...
Copying files copy copies the source file in the first argument to the destination in the second argument. The resolved destination needs to be in a directory that is already created. if (copy('test.txt', 'dest.txt')) { echo 'File has been copied successfully'; } else { echo 'Failed to ...
(From this answer) The example below adds an enumerated type to a postgres database. First, edit the migration file (created with mix ecto.gen.migration): def up do # creating the enumerated type execute("CREATE TYPE post_status AS ENUM ('published', 'editing')") # creating a...
Creates a graph topology in a distributed manner so that each node defines its neighbors. Each node communicates its rank among neighbors with MPI_Neighbor_allgather. #include <mpi.h> #include <stdio.h> #define nnode 4 int main() { MPI_Init(NULL, NULL); int rank; ...
In Sprite-Kit, there is the concept of collisions which refers to the SK physics engine handling how physics objects interact when they collide i.e. which ones bounce off which other ones. It also has the concept of contacts, which is the mechanism by which your program gets informed when 2 physics...
Before 1.2, the only way to persist state/retain a checkpoint after a job termination/cancellation/persistant failure was through a savepoint, which is triggered manually. Version 1.2 introduced persistent checkpoints. Persistent checkpoints behave very much like regular periodic checkpoints except...
To enable Pull to Refresh in a ListView in Xamarin, you first need to specify that it is PullToRefresh enabled and then specify the name of the command you want to invoke upon the ListView being pulled: <ListView x:Name="itemListView" IsPullToRefreshEnabled="True" RefreshComm...
Assuming we have a working laravel application running in, say, "mylaravel.com",we want our application to show a "Hello World" message when we hit the URL http://mylaravel.com/helloworld . It involves the creation of two files (the view and the controller) and the modification o...
You can define methods and classes within JShell: jshell> void speak() { ...> System.out.println("hello"); ...> } jshell> class MyClass { ...> void doNothing() {} ...> } No access modifiers are necessary. As with other blocks, semicolons are require...
For this example, we will used 4 bodies and will show only the last 8 bits of the bit masks for simplicity. The 4 bodies are 3 SKSpriteNodes, each with a physics body and a boundary: let edge = frame.insetBy(dx: 0, dy: 0) physicsBody = SKPhysicsBody(edgeLoopFrom: edge) Note that the 'ed...
In the JNDI declaration you may want to encrypt the username and password. You have to implement a custom datasource factory in order to be able to decrypt the credentials. In server.xml replace factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" by factory="cypher.MyCustomDataS...
public function addCard($cust_id, $token) { $retriveResult=Customer::retrieve($cust_id); $tokendata = Token::retrieve($token); $newcard = $tokendata['card']; $flag = 1; foreach ($retriveResult['sources']['data'] as $card) { if($card['fingerprint'] === $newcard['f...
Processing Field collection items with Rules is fun, really! Have a look at this Rule (in Rules export format): { "rules_calculate_sum_of_prices_in_all_field_collection_items" : { "LABEL" : "Calculate sum of prices in all field collection items", "PLUGIN...
If you need to execute a repeating sequence of the same action with different parameters, use the ‘Parameterized Controller’ 3rd party plugin from JMeter-Plugins project. You need to install this plugin first by following installation procedure. Let’s assume that we want to parameterize the login ...
Imagine many users all running a web application that is trying to increment a counter in the database. Each user must read the current count, add one and write out the updated value. To make sure no one reads the counter while someone else is is adding one we use a transaction: ref.transaction(fun...
SET v_column_definition := CONCAT( v_column_name ,' ',v_column_type ,' ',v_column_options ); SET @stmt := CONCAT('ALTER TABLE ADD COLUMN ', v_column_definition); PREPARE stmt FROM @stmt; EXECUTE stmt; DEALLOCATE PREPARE stmt;
Once you have installed Visual Studio from https://www.visualstudio.com/downloads/, start a new project. Select 'Windows Forms Application' from Visual Basic Tab. You can rename it here if you need to. Once you click 'OK', you will see this window: Click on the 'Toolbo...

Page 25 of 28