Tutorial by Examples: ga

Copying a partial array with the static Array.Copy() method, beginning at index 0 in both, source and destination: var sourceArray = new int[] { 11, 12, 3, 5, 2, 9, 28, 17 }; var destinationArray= new int[3]; Array.Copy(sourceArray, destinationArray, 3); // destinationArray will have 11,12 and...
Prerequisite steps: Install Java at your machine Visit neo4j website and click the link "Download Community Edition" or visit directly the download link. Unzip the .tar downloaded file in your home directory Start Neo4j from console (headless, without web server) Visit the sub-d...
Quite often you have a file which was edited within DOS or Windows and you are viewing it under UNIX. This can look like the following when you view the file with vi. First line of file^M Next Line^M And another^M If you wish to remove the ^M, it can be that you delete each ^M by hand. Alter...
Timers are used to perform tasks at specific intervals of time (Do X every Y seconds) Below is an example of creating a new instance of a Timer. NOTE: This applies to Timers using WinForms. If using WPF, you may want to look into DispatcherTimer using System.Windows.Forms; //Timers use the Wi...
public partial class Form1 : Form { Timer myTimer = new Timer(); int timeLeft = 10; public Form1() { InitializeComponent(); //set properties for the Timer myTimer.Interval = 1000; myTimer.Enabled = tru...
This will only install PHP. If you wish to serve a PHP file to the web you will also need to install a web-server such as Apache, Nginx, or use PHP's built in web-server (php version 5.4+). If you are in a Ubuntu version below 16.04 and want to use PHP 7 anyway, you can add Ondrej's PPA repo...
This example shows how to use column data to set a MultiIndex in a pandas.DataFrame. In [1]: df = pd.DataFrame([['one', 'A', 100], ['two', 'A', 101], ['three', 'A', 102], ...: ['one', 'B', 103], ['two', 'B', 104], ['three', 'B', 105]], ...: columns=['c1'...
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <polyline points="10,5 25,15 20,10" /> </svg>
public class ChangeEmailActivity extends BaseAppCompatActivity implements ReAuthenticateDialogFragment.OnReauthenticateSuccessListener { @BindView(R.id.et_change_email) EditText mEditText; private FirebaseUser mFirebaseUser; @OnClick(R.id.btn_change_email) void onChangeE...
This example sorts elements in ascending order of a key using a map. You can use any type, including class, instead of std::string, in the example below. #include <iostream> #include <utility> #include <map> int main() { std::map<double, std::string> sorted_map; ...
1. Setup your formatter and routing in Register of (App_Start/WebApiConfig) public static class WebApiConfig { public static void Register(HttpConfiguration config) { GlobalConfiguration.Configuration.Formatters.Clear(); GlobalConfiguration.Configuration.Formatters.Add...
The NVIDIA installation guide ends with running the sample programs to verify your installation of the CUDA Toolkit, but doesn't explicitly state how. First check all the prerequisites. Check the default CUDA directory for the sample programs. If it is not present, it can be downloaded from the offi...
public class Sheep { private String name; private int weight; public Sheep(String name, int weight) { this.name = name; this.weight = weight; } public static Sheep newInstance(Sheep other); return new Sheep(other.name, other.wei...
To show and hide a FloatingActionButton with the default animation, just call the methods show() and hide(). It's good practice to keep a FloatingActionButton in the Activity layout instead of putting it in a Fragment, this allows the default animations to work when showing and hiding. Here is an ...
CREATE DATABASE LINK dblink_name CONNECT TO remote_username IDENTIFIED BY remote_password USING 'tns_service_name'; The remote DB will then be accessible in the following way: SELECT * FROM MY_TABLE@dblink_name; To test a database link connection without needing to know any of the objec...
If you find that you have multiple servers that need to share session state, storing it in the ASP.NET process memory will not work. For example you may deploy into a web-farm environment with a load balancer that distributes requests in a round-robin fashion. In this environment a single user's req...
If you don't want to use SQL server you can use Amazon's hosted Dynamo DB nosql database as a session store. You'll need the AWS SDK. To install this from the Visual Studio nuget package manager console use the following command Install-Package AWSSDK You can then configure your sessionState p...
Example of calling an extension method as an extension and as a regular method. public Class MyClass Sub Main() 'Extension called directly on the object. Dim Version = Assembly.GetExecutingAssembly.GetVersionFromAssembly() 'Called as a regular method. ...
main.component.ts import {Component} from "@angular/core"; @Component({ selector: "main", template: ` <StackLayout> <TextField hint="some text"></TextField> <Button text="Click me" class="btn">...
A common problem in code that uses multidimensional arrays, arrays of pointers, etc. is the fact that Type** and Type[M][N] are fundamentally different types: #include <stdio.h> void print_strings(char **strings, size_t n) { size_t i; for (i = 0; i < n; i++) puts(str...

Page 61 of 137