Tutorial by Examples: action

BEGIN TRY -- start error handling BEGIN TRANSACTION; -- from here on transactions (modifictions) are not final -- start your statement(s) select 42/0 as ANSWER -- simple SQL Query with an error -- end your statement(s) COMMIT TRANSACTION; -- finalize all transa...
@IBAction func axisChange(sender: UISwitch) { UIView.animateWithDuration(1.0) { self.updateConstraintsForAxis() } } The updateConstraintForAxis function just sets the axis of the stack view containing the two image views: private func updateConstraintsForAxis() { if (axi...
Possible values are Continue | Ignore | Inquire | SilentlyContinue | Stop | Suspend. Value of this parameter will determine how the cmdlet will handle non-terminating errors (those generated from Write-Error for example; to learn more about error handling see [topic not yet created]). Default valu...
This type of Hook can be used to override core portal (e.g c/portal/login) and portlet struts actions (e.g /login/forgot_password), this actions for Liferay Portal are specified in a struts-config.xml file in its WEB-INF folder.To override an action: in liferay-hook.xml file of your hook plugin u...
Transaction using JDBC driver is used to control how and when a transaction should commit and rollback. Connection to MySQL server is created using JDBC driver JDBC driver for MySQL can be downloaded here Lets start with getting a connection to database using JDBC driver Class.forName("com.m...
The following procedure is a generic one which will be used to log all errors in an application to a common error log table. CREATE OR REPLACE PROCEDURE log_errors ( p_calling_program IN VARCHAR2, p_error_code IN INTEGER, p_error_description IN VARCHAR2 ) IS PRAGMA AUTONOMOUS_TRANSAC...
add_action('wp_head','hook_javascript'); function hook_javascript() { $output="<script> alert('Page is loading...'); </script>"; echo $output; }
const options = require("commander"); options .option("-v, --verbose", "Be verbose"); options .command("convert") .alias("c") .description("Converts input file to output file") .option("-i, --in-file <file_name&...
A very simple example would be to fade out an SKSpriteNode. In Swift: let node = SKSpriteNode(imageNamed: "image") let action = SKAction.fadeOutWithDuration(1.0) node.runAction(action)
Sometimes it is necessary to do an action on repeat or in a sequence. This example will make the node fade in and out a total of 3 times. In Swift: let node = SKSpriteNode(imageNamed: "image") let actionFadeOut = SKAction.fadeOutWithDuration(1.0) let actionFadeIn = SKAction.fadeInWithD...
One helpful case is to have the action run a block of code. In Swift: let node = SKSpriteNode(imageNamed: "image") let actionBlock = SKAction.runBlock({ //Do what you want here if let gameScene = node.scene as? GameScene { gameScene.score += 5 } }) node.runActi...
You can place action filters at three possible levels: Global Controller Action Placing a filter globally means it will execute on requests to any route. Placing one on a controller makes it execute on requests to any action in that controller. Placing one on an action means it runs with the...
Another approach to handling asynchrony in Redux is to use action creators. In Flux, action creators are special functions that construct action objects and dispatch them. myActionCreator(dispatch) { dispatch({ type: "ASYNC_ACTION_START" }); setTimeout(() => { dispatch({ typ...
Adding a product to a shopping cart (Label item.name references the name property of the product added): ga('send', 'event', 'Cart', 'Add', product.name); This lets you see what people are adding to the shopping cart, even if they never complete the order, allowing more insight into where users ...
set mouse=a This will enable mouse interaction in the vim editor. The mouse can change the current cursor's position select text
The most basic application of add_action() is to add custom code to be executed at a certain location in a WordPress installation's source-code - either using actions supplied by the Core of WordPress, or ones created by third-party code such as plugins and themes. To add content to the <head&g...
Any number of functions may be "hooked" to any given action. In some instances it is important for a hooked function to execute before or after others, which is where the third parameter to add_action(), $priority comes into play. If the $priority argument is omitted, the function will be...
PHP Classes are powerful tool for improving code organization and minimizing naming collisions. At some point or another, the question of how to create an action hook for a class method inevitably arises. The $function_to_add argument is often shown as a string containing the function's name, howev...
If you want your card to include buttons, use the md-card-actions directive. Buttons can also be formatted differently for icon-only buttons. Search for icons at here if you're using Google's Material Icons. <md-card> <!--header--> <md-card-content> <p> ...
This example uses SqlConnection, but any IDbConnection is supported. Also any IDbTransaction is supported from the related IDbConnection. public void UpdateWidgetQuantity(int widgetId, int quantity) { using(var conn = new SqlConnection("{connection string}")) { conn.Open()...

Page 5 of 8