Tutorial by Examples: a

CREATE OR REPLACE TRIGGER CORE_MANUAL_BIUR BEFORE INSERT OR UPDATE ON CORE_MANUAL FOR EACH ROW BEGIN if inserting then -- only set the current date if it is not specified if :new.created is null then :new.created := sysdate; end if; end if; -- always s...
Let's create very simple video player using QtMultimedia module of Qt 5. In .pro file of your application you will need the following lines: QT += multimedia multimediawidgets Note that multimediawidgets is necessary for usage of QVideoWidget. #include <QtMultimedia/QMediaPlayer> #inclu...
ReactiveCocoa supports macOS 10.9+, iOS 8.0+, watchOS 2.0+, and tvOS 9.0+. Carthage If you use Carthage to manage your dependencies, simply add ReactiveCocoa to your Cartfile: github "ReactiveCocoa/ReactiveCocoa" ~> 5.0 If you use Carthage to build your dependencies, make sure you...
public async Task SetProductInactiveAsync(int productId) { using (IDbConnection con = new SqlConnection("myConnectionString")) { await con.ExecuteAsync("SetProductInactive", new { id = productId }, commandType: CommandType.StoredProcedure); ...
This will be a relatively comprehensive tutorial of how to write a command line tool to print the weather from the zip code provided to the command line tool. The first step is to write the program in ruby to do this action. Let's start by writing a method weather(zip_code) (This method requires the...
Some functions in R produce a side effect (i.e. saving, printing, plotting, etc) and do not always return a meaningful or desired value. %T>% (tee operator) allows you to forward a value into a side-effect-producing function while keeping the original lhs value intact. In other words: the tee op...
What is Dagger 2 ? The website describes itself as: Dagger is a fully static, compile-time dependency injection framework The library makes it easy to model dependency graphs as well as to reuse objects. Since reflection is only used at compile time as part of the annotation processing Dagger...
Define a module (the model of dependencies and their graph): @Module public class CoffeeModule{ @Provides public CoffeeMaker provideCoffeeMaker(){ return new CoffeeMaker(); } @Provides public Coffee provideCoffee(CoffeeMaker coffeeMaker){ return new ...
It is often useful to build matrices out of smaller matrices. Horizontal Concatenation Matrices (and vectors, which are treated as column vectors) can be horizontally concatenated using the hcat function. julia> hcat([1 2; 3 4], [5 6 7; 8 9 10], [11, 12]) 2×6 Array{Int64,2}: 1 2 5 6 7 ...
This example is how to turn an image into a Base64 string (i.e. a string you can use directly in a src attribute of an img tag). This example specifically uses the Imagick library (there are others available, such as GD as well). <?php /** * This loads in the file, image.jpg for manipulation....
Create simple CRUD Operation Using Serverless Framework Install Serverless framework globally npm install serverless -g Create simple Lambda Service serverless create --template aws-nodejs --path myService Go to the myService Directory it should contain serverless.yml handler.js even...
NOTES: We are going to install Magento 2 on fresh Ubuntu Server 16.04 LTS with PHP 7.0, MySQL 5.6 and Apache 2.4. 1. Setup Requirements Apache 2.2 or 2.4 with mod_rewrite module (or) Nginx >= 1.8. PHP 5.5 or later version. PHP 7.0 also supported. Required PHP-Modules – PDO/MySQL, mbstring, ...
Generators are fast coded and in many cases a slim alternative to heavy iterator-implementations. With the fast implementation comes a little lack of control when a generator should stop generating or if it should generate something else. However this can be achieved with the usage of the send() fu...
In the following example we will be creating a table called Membership using the AWS Java SDK for DynamoDB. The table will consist of items that represent team assignments. The table will be partitioned by TeamID. Each team will have multiple members, identified by the MemberID (as a sort key). AWS...
There are several considerations when implementing Regular Expressions in Swift. let letters = "abcdefg" let pattern = "[a,b,c]" let regEx = try NSRegularExpression(pattern: pattern, options: []) let nsString = letters as NSString let matches = regEx.matches(in: letters, opt...
Patterns can be used to replace part of an input string. The example below replaces the cent symbol with the dollar symbol. var money = "¢¥€£$¥€£¢" let pattern = "¢" do { let regEx = try NSRegularExpression (pattern: pattern, options: []) let nsString = money as NSS...
To match special characters Double Backslash should be used \. becomes \\. Characters you'll have to escape include (){}[]/\+*$>.|^? The below example get three kinds of opening brackets let specials = "(){}[]" let pattern = "(\\(|\\{|\\[)" do { let regEx = try N...
Regular expressions can be used to validate inputs by counting the number of matches. var validDate = false let numbers = "35/12/2016" let usPattern = "^(0[1-9]|1[012])[-/.](0[1-9]|[12][0-9]|3[01])[-/.](19|20)\\d\\d$" let ukPattern = "^(0[1-9]|[12][0-9]|3[01])[-/](0[1...
Switches can switch on tuples: public typealias mdyTuple = (month: Int, day: Int, year: Int) let fredsBirthday = (month: 4, day: 3, year: 1973) switch theMDY { //You can match on a literal tuple: case (fredsBirthday): message = "\(date) \(prefix) the day Fred was born"...
Underscore is an open source functional programming utility library for JavaScript. Underscore provides many useful functions for working with arrays or collections of JavaScript objects, including filtering, sorting and querying. Node.js Make sure you have node and npm installed then type the fol...

Page 828 of 1099