Tutorial by Examples: du

The Replace function in SQL is used to update the content of a string. The function call is REPLACE( ) for MySQL, Oracle, and SQL Server. The syntax of the Replace function is: REPLACE (str, find, repl) The following example replaces occurrences of South with Southern in Employees table: FirstN...
When expecting someone to reproduce an R code that has random elements in it, the set.seed() function becomes very handy. For example, these two lines will always produce different output (because that is the whole point of random number generators): > sample(1:10,5) [1] 6 9 2 7 10 >...
When your command is made available to your application, you can use Laravel to schedule it to run at pre-defined intervals, just like you would a CRON. In The app/Console/Kernel.php file you will find a schedule method that you can use to schedule your task. <?php namespace App\Console; ...
The scheduler can be run using the command: php artisan schedule:run The scheduler needs to be run every minute in order to work correctly. You can set this up by creating a cron job with the following line, which runs the scheduler every minute in the background. * * * * * php /path/to/artisan...
Modules can contain other modules and classes: module Namespace module Child class Foo; end end # module Child # Foo can now be accessed as: # Child::Foo end # module Namespace # Foo must now be accessed as: # Namespace::Child::Foo
Redux is very functional, so unit testing is very straightforward. Action creator: export function showSidebar () { return { type: 'SHOW_SIDEBAR' } } Action creators unit test: import expect from 'expect' import actions from './actions' import * as type from './constants' desc...
Strict mode does not allow you to use duplicate function parameter names. function foo(bar, bar) {} // No error. bar is set to the final argument when called "use strict"; function foo(bar, bar) {}; // SyntaxError: duplicate formal argument bar
This is an example of something that would have been straight up impossible with labels. If you execute the same label multiple times at the same time and they rely on variables that are being defined within them, they very likely interfere and cause unexpected behavior. Here is how to do it with f...
When you are programming in OpenGL or any other graphics api you will hit a brick wall when you are not that good in math. Here I will explain with example code how you can achieve movement/scaling and many other cool stuff with your 3d object. Let's take a real life case... You've made a awesome (...
dump prints the contents of an object via reflection (mirroring). Detailed view of an array: let names = ["Joe", "Jane", "Jim", "Joyce"] dump(names) Prints: ▿ 4 elements - [0]: Joe - [1]: Jane - [2]: Jim - [3]: Joyce For a dictionary: let attr...
With Resources class it's possible to dynamically load assets that are not part of the scene. It's very usefull when you have to use on demand assets, for example localize multi language audios, texts, etc.. Assets must be placed in a folder named Resources. It's possible to have multiple Resource...
Verilog is a hardware description language (HDL) used to model electronic systems. It most commonly describes an electronic system at the register-transfer level (RTL) of abstraction. It is also used in the verification of analog circuits and mixed-signal circuits. Its structure and main principles ...
Remember to create folder for upload (uploads in example). install multer npm i -S multer server.js: var express = require("express"); var multer = require('multer'); var app = express(); var fs = require('fs'); app.get('/',function(req,res){ res.sendFil...
This module defines functions and classes which implement a flexible event logging system for applications and libraries. The key benefit of having the logging API provided by a standard library module is that all Python modules can participate in logging, so your application log can include your o...
dput() and dget() The easiest way to share a (preferable small) data frame is to use a basic function dput(). It will export an R object in a plain text form. Note: Before making the example data below, make sure you're in an empty folder you can write to. Run getwd() and read ?setwd if you need t...
Package reproducibility is a very common issue in reproducing some R code. When various packages get updated, some interconnections between them may break. The ideal solution for the problem is to reproduce the image of the R code writer's machine on your computer at the date when the code was writt...
Install module and read docs npm i formidable@latest Example of server on 8080 port var formidable = require('formidable'), http = require('http'), util = require('util'); http.createServer(function(req, res) { if (req.url == '/upload' && req.method.toLowerCase() == 'pos...
Examples ES6/ES2015 to ES5 (via Babel): This ES2015 syntax // ES2015 arrow function syntax [1,2,3].map(n => n + 1); is interpreted and translated to this ES5 syntax: // Conventional ES5 anonymous function syntax [1,2,3].map(function(n) { return n + 1; }); CoffeeScript to ...
You should already have your backend REST resource available. On the client side (GWT) your need to Add RestyGwt dependency to your project with maven <dependency> <groupId>org.fusesource.restygwt</groupId> <artifactId>restygwt</artifactId> <vers...
To use the library, you must include it as a dependency with the following line: compile project(':[library root directory]')

Page 18 of 47