Tutorial by Examples: dp

Split vector of texts using one pattern: stri_split_fixed(c("To be or not to be.", "This is very short sentence.")," ") # [[1]] # [1] "To" "be" "or" "not" "to" "be." # # [[2]] # [1] "This" ...
To call a stored procedure on the server: $query = "{call [dbo].[myStoredProcedure](?,?,?)}"; //Parameters '?' includes OUT parameters $params = array( array($name, SQLSRV_PARAM_IN), array($age, SQLSRV_PARAM_IN), array($count, SQLSRV_PARAM_OUT, SQLSRV_PHPTYPE_INT) //$cou...
C++11 threading primitives are still relatively low level. They can be used to write a higher level construct, like a thread pool: C++14 struct tasks { // the mutex, condition variable and deque form a single // thread-safe triggered queue of tasks: std::mutex m; std::condition_variab...
MySQL's DECIMAL and NUMERIC types store exact numeric data values. It is recommended to use these types to preserve exact precision, such as for money. Decimal These values are stored in binary format. In a column declaration, the precision and scale should be specified Precision represents the n...
By using the .IsRequired() method, properties can be specified as mandatory, which means that the column will have a NOT NULL constraint. using System.Data.Entity; // .. public class PersonContext : DbContext { // .. protected override void OnModelCreating(DbModelBuilder modelB...
"The :nth-child(an+b) CSS pseudo-class matches an element that has an+b-1 siblings before it in the document tree, for a given positive or zero value for n" - MDN :nth-child pseudo-selector12345678910:first-child✔:nth-child(3)✔:nth-child(n+3)✔✔✔✔✔✔✔✔:nth-child(3n)✔✔✔:nth-child(3n+1)...
This program demonstrates how to run another process using fork() and wait its termination using waitpid(): fork() creates an identical copy of the current process. The original process is the parent process, while the newly created one is the child process. Both processes continue exactly afte...
Stored procedures can return values using the OUTPUT keyword in its parameter list. Creating a stored procedure with a single out parameter CREATE PROCEDURE SprocWithOutParams ( @InParam VARCHAR(30), @OutParam VARCHAR(30) OUTPUT ) AS BEGIN SELECT @OutParam = @InParam + ' must co...
-- GUID primary key - arbitrary unique value for table create table person ( id uniqueIdentifier default (newId()) primary key, firstName varchar(100) not null, lastName varchar(100) not null, dob DateTime not null, ssn varchar(9) not null )
ALTER TABLE person ADD CONSTRAINT pk_PersonSSN PRIMARY KEY (ssn) Note, if the primary key column (in this case ssn) has more than one row with the same candidate key, the above statement will fail, as primary key values must be unique.
page.html - source code <html> <head> <script src="loadData.js"></script> </head> <body onLoad="loadData()"> <div class="container"> <table id="data" border="1"> <...
template <div id="demo">{{fullName}}</div> watch example var vm = new Vue({ el: '#demo', data: { firstName: 'Foo', lastName: 'Bar', fullName: 'Foo Bar' } }) vm.$watch('firstName', function (val) { this.fullName = val + ' ' + this.lastName })...
public class SoundActivity extends Activity { private MediaPlayer mediaPlayer; ProgressBar progress_bar; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_tool_sound); ...
Notice, this is only for angular-cli up to 1.0.0-beta.10 version ! Some libraries or plugins may not have typings. Without these, TypeScript can't type check them and therefore causes compilation errors. These libraries can still be used but differently than imported modules. Include a scr...
When matching the path of a route, you can do it explicitly, matching only one path, like so: get "/hello" do return "Hello!" end You can also use a regular expression to match complex routes. Any route which matches the regular expression will run that code block. If m...
/*add this code to your function.php file now your api will include transaction_id */ add_action( 'woocommerce_api_order_response', 'my_woocommerce_api_order', 10, 2); function my_woocommerce_api_order( $data ) { //you can do anything with the $data here lets add the transaction id ...
public class PlaySound extends Activity implements OnTouchListener { private SoundPool soundPool; private int soundID; boolean loaded = false; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { su...
If you either have apps generated with pre-android support or just did that on purpose, you can always add android project to your app. $ react-native android This will generate android folder and index.android.js inside your app.
To load a private key directly from disk, use the PEM_read_PrivateKey function: FILE *f; EVP_PKEY *pkey; f = fopen("key.pem", "rb"); PEM_read_PrivateKey( f, /* use the FILE* that was opened */ &pkey, /* pointer to EVP_PKEY structure */ NULL, /* passwor...
OLDPWD (OLDPrintWorkingDirectory) contains directory before the last cd command: ~> $ cd directory directory> $ echo $OLDPWD /home/user

Page 9 of 21