Tutorial by Examples

var providerName = "System.Data.SqlClient"; //Oracle.ManagedDataAccess.Client, IBM.Data.DB2 var connectionString = "{your-connection-string}"; //you will probably get the above two values in the ConnectionStringSettings object from .config file var factory = DbProviderFac...
Assume that I have a file named in.txt: $ cat in.txt a b a c a d I only want to replace the a\nc with deleted, but not a\nb or a\nd. $ sed -e ':loop # create a branch/label named `loop` $!{ N # append the next line of input into the pattern space /\n$/!b...
Setup Steps: Download and install jdk8. Add the following to your project’s main build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath 'me.tatarka:gradle-retrolambda:3.2.3' } } Now add this to your application m...
Encyption happens by replacing each letter of the alfabet with an other letter. The keys can be showed with this circle. Here is a shift of 8 chars used. Here will the A replaced by T, B by U, C by V etc. So will next string encrypted: OriginalEncryptedHELLO WORLDAXEEH PHKEW
Decription happens by the same cicle showed in the encryption example. Example: EncryptedOriginalAXEEH PHKEWHELLO WORLD
Ceasar ciphers are easy to hack. If you know that an encrypted A is equal to H and a P is equal to I, everything with the same encryption key could be encrypted.
class Person { String name; public Person(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Person person = (Person) ...
While coding a script or a function, it can be the case that one or more than one temporary file be needed in order to, for example, store some data. In order to avoid overwriting an existing file or to shadow a MATLAB function the tempname function can be used to generate a unique name for a te...
There can be up to 12 independent variables, there is always 1 dependent variable, and any number of parameters can be fitted. Optionally, error estimates can be input for weighting the data points. (T. Williams, C. Kelley - gnuplot 5.0, An Interactive Plotting Program) If you have a data set a...
If you load your fit parameters from a file, you should declare in it all the parameters you're going to use and, when needed, initialise them. ## Start parameters for the fit of data.dat m = -0.0005 q = -0.0005 d = 1.02 Tc = 45.0 g_d = 1.0 b = 0.0100...
The main queue is the dispatch queue in which all the UI updates take place and the code involving UI changes are placed. You need to get to the main queue in order to update UI on completion of an asynchronous process like NSURLSession There are two types of main queue calls synchronous and async...
class Program { static void Main(string[] args) { string serverName = "INTACT-ETL"; string databaseName = "SOMEDB"; string collectionName = "TestCol"; //Build Connection string ...
Complete the Installation and setup part to connect your app to Firebase. This will create the project in Firebase. Add the dependency for Firebase Cloud Messaging to your module-level build.gradle file: dependencies { compile 'com.google.firebase:firebase-messaging:10.2.1' } ...
The basic use of fit is best explained by a simple example: f(x) = a + b*x + c*x**2 fit [-234:320][0:200] f(x) ’measured.dat’ using 1:2 skip 4 via a,b,c plot ’measured.dat’ u 1:2, f(x) Ranges may be specified to filter the data used in fitting. Out-of-range data points are ignored. (T. W...
SQL has two logical functions – CHOOSE and IIF. The CHOOSE function returns an item from a list of values, based on its position in the list. This position is specified by the index. In the syntax, the index parameter specifies the item and is a whole number, or integer. The val_1 … val_n paramete...
Try catch Errors must always be handled. If you are using synchronous programming you could use a try catch. But this does not work if you work asynchronous! Example: try { setTimeout(function() { throw new Error("I'm an uncaught error and will stop the server!"); }, 1...
Callback hell (also a pyramid of doom or boomerang effect) arises when you nest too many callback functions inside a callback function. Here is an example to read a file (in ES6). const fs = require('fs'); let filename = `${__dirname}/myfile.txt`; fs.exists(filename, exists => { if (exi...
Progress supports one dimensional arrays, but they are called EXTENTS. /* Define a character array with the length 5, and display it's length */ DEFINE VARIABLE a AS CHARACTER EXTENT 5 NO-UNDO. DISPLAY EXTENT(a). Individual positions i the array is accessed using "standard" c-style b...
array_add() This method is used to add new key value pairs to an array. $array = ['username' => 'testuser']; $array = array_add($array, 'age', 18); result ['username' => 'testuser', 'age' => 18]
camel_case() This method changes a string to camel case camel_case('hello_world'); result HelloWorld

Page 1108 of 1336