Tutorial by Examples: dur

Simple usage Dapper fully supports stored procs: var user = conn.Query<User>("spGetUser", new { Id = 1 }, commandType: CommandType.StoredProcedure) .SingleOrDefault(); Input, Output and Return parameters If you want something more fancy...
Commits can be squashed during a git rebase. It is recommended that you understand rebasing before attempting to squash commits in this fashion. Determine which commit you would like to rebase from, and note its commit hash. Run git rebase -i [commit hash]. Alternatively, you can type HE...
The following queries will return a list of all Stored Procedures in the database, with basic information about each Stored Procedure: SQL Server 2005 SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' The ROUTINE_NAME, ROUTINE_SCHEMA and ROUTINE_DEFINITION columns are...
Procedures do something. Name them after what they're doing, using a verb. If accurately naming a procedure is not possible, likely the procedure is doing too many things and needs to be broken down into smaller, more specialized procedures. Some common VBA naming conventions go thus: For all Pr...
Given the following history, imagine you make a change that you want to squash into the commit bbb2222 A second commit: $ git log --oneline --decorate ccc3333 (HEAD -> master) A third commit bbb2222 A second commit aaa1111 A first commit 9999999 Initial commit Once you've made your change...
public async Task<Product> GetProductAsync(string productId) { using (_db) { return await _db.QueryFirstOrDefaultAsync<Product>("usp_GetProduct", new { id = productId }, commandType: CommandType.StoredProcedure); } }
You can use git merge --squash to squash changes introduced by a branch into a single commit. No actual commit will be created. git merge --squash <branch> git commit This is more or less equivalent to using git reset, but is more convenient when changes being incorporated have a symbolic...
A Sub is a procedure that performs a specific task but does not return a specific value. Sub ProcedureName ([argument_list]) [statements] End Sub If no access modifier is specified, a procedure is Public by default. A Function is a procedure that is given data and returns a value, ideally...
Stored procedures can be created through a database management GUI (SQL Server example), or through a SQL statement as follows: -- Define a name and parameters CREATE PROCEDURE Northwind.getEmployee @LastName nvarchar(50), @FirstName nvarchar(50) AS -- Define the query to be...
In Fortran functions and subroutines need to be explicitly declared as recursive, if they are to call themselves again, directly or indirectly. Thus, a recursive implementation of the Fibonacci series could look like this: recursive function fibonacci(term) result(fibo) integer, intent(in) :: te...
It is best practice in any programming language to avoid premature optimization. However, if testing reveals that your code is running too slowly, you may gain some speed by switching off some of the application’s properties while it runs. Add this code to a standard module: Public Sub SpeedUp( _ ...
$this->helper('customer/data')->getForgotPasswordUrl(); OR Mage::helper('customer/data')->getForgotPasswordUrl();
An external procedure is one which is defined outside another program unit, or by a means other than Fortran. The function contained in a file like integer function f() implicit none end function f is an external function. For external procedures, their existence may be declared by using a...
In order to obtain class-like behavior, type and related procedures (subroutine and functions) shall be placed in a module: Example: module MShape implicit none private type, public :: Shape private integer :: radius contains procedure :: set => sh...
Intervals are simplest way of recording timespans in lubridate. An interval is a span of time that occurs between two specific instants. # create interval by substracting two instants today_start <- ymd_hms("2016-07-22 12-00-00", tz="IST") today_start ## [1] "2016-07-...
Unlike durations, periods can be used to accurately model clock times without knowing when events such as leap seconds, leap days, and DST changes occur. start_2012 <- ymd_hms("2012-01-01 12:00:00") ## [1] "2012-01-01 12:00:00 UTC" # period() considers leap year calculati...
Variables don't necessarily have to expand to their values - substrings can be extracted during expansion, which can be useful for extracting file extensions or parts of paths. Globbing characters keep their usual meanings, so .* refers to a literal dot, followed by any sequence of characters; it's ...
Properties can be set when an object is instantiated. var redCar = new Car { Wheels = 2, Year = 2016, Color = Color.Red };
DROP PROCEDURE if exists displayNext100WithName; DELIMITER $$ CREATE PROCEDURE displayNext100WithName ( nStart int, tblName varchar(100) ) BEGIN DECLARE thesql varchar(500); -- holds the constructed sql string to execute -- expands the sizing of the output buffer to accomoda...
Using the Authors table in the Library Database CREATE PROCEDURE GetName ( @input_id INT = NULL, --Input parameter, id of the person, NULL default @name VARCHAR(128) = NULL --Input parameter, name of the person, NULL default ) AS BEGIN SELECT Name + ' is from ' + Country...

Page 1 of 3