Tutorial by Examples: e

VB_VarUserMemId (for module-scope variables) and VB_UserMemId (for procedures) attributes are used in VBA mostly for two things. Specifying the default member of a class A List class that would encapsulate a Collection would want to have an Item property, so the client code can do this: For i = 1...
This code adds outwardly increasing shadows to an image to create a "sticker" version of the image. Notes: In addition to being an ImageObject, the "img" argument can also be a Canvas element. This allows you to stickerize your own custom drawings. If you draw text on the Can...
Once shadowing is turned on, every new drawing to the canvas will be shadowed. Turn off further shadowing by setting context.shadowColor to a transparent color. // start shadowing context.shadowColor='black'; ... render some shadowed drawings ... // turn off shadowing. context.shadowColor=...
Warning! Apply shadows sparingly! Applying shadowing is expensive and is multiplicatively expensive if you apply shadowing inside an animation loop. Instead, cache a shadowed version of your image (or other drawing): At the start of your app, create a shadowed version of your image in a secon...
The traditional use of shadowing is to give 2-dimensional drawings the illusion of 3D depth. This example shows the same "button" with and without shadowing var canvas=document.createElement("canvas"); var ctx=canvas.getContext("2d"); document.body.appendChild(can...
Canvas does not have CSS's inner-shadow. Canvas will shadow the outside of a filled shape. Canvas will shadow both inside and outside a stroked shape. But it's easy to create inner-shadows using compositing. Strokes with an inner-shadow To create strokes with an inner-shadow, use destinat...
let's generate a DataFrame first: df = pd.DataFrame(np.arange(10).reshape(5,2), columns=list('ab')) print(df) # Output: # a b # 0 0 1 # 1 2 3 # 2 4 5 # 3 6 7 # 4 8 9 drop rows with indexes: 0 and 4 using drop([...], inplace=True) method: df.drop([0,4], inplace=True) ...
INSERT INTO Invoices [ /* column names may go here */ ] VALUES (123, '1234abc', '2016-08-05 20:18:25.770', 321, 5, '2016-08-04'); Column names are required if the table you are inserting into contains a column with the IDENTITY attribute. INSERT INTO Invoices ([ID], [Num], [DateTime], [Tota...
To get the list of all backup operations performed on the current database instance: SELECT sdb.Name AS DatabaseName, COALESCE(CONVERT(VARCHAR(50), bus.backup_finish_date, 120),'-') AS LastBackUpDateTime FROM sys.sysdatabases sdb LEFT OUTER JOIN msdb.dbo.backupset bus ON bus.database_nam...
CREATE SEQUENCE [dbo].[CustomersSeq] AS INT START WITH 10001 INCREMENT BY 1 MINVALUE -1;
CREATE TABLE [dbo].[Customers] ( CustomerID INT DEFAULT (NEXT VALUE FOR [dbo].[CustomersSeq]) NOT NULL, CustomerName VARCHAR(100), );
INSERT INTO [dbo].[Customers] ([CustomerName]) VALUES ('Jerry'), ('Gorge') SELECT * FROM [dbo].[Customers] Results CustomerIDCustomerName10001Jerry10002Gorge
DELETE FROM [dbo].[Customers] WHERE CustomerName = 'Gorge'; INSERT INTO [dbo].[Customers] ([CustomerName]) VALUES ('George') SELECT * FROM [dbo].[Customers] Results CustomerIDCustomerName10001Jerry10003George
SCOPE_IDENTITY() returns the last identity value inserted into an identity column in the same scope. A scope is a module: a stored procedure, trigger, function, or batch. Therefore, two statements are in the same scope if they are in the same stored procedure, function, or batch. INSERT INTO ([col...
This function will take 2 datetime parameters, the DOB, and a date to check the age at CREATE FUNCTION [dbo].[Calc_Age] ( @DOB datetime , @calcDate datetime ) RETURNS int AS BEGIN declare @age int IF (@calcDate < @DOB ) RETURN -1 -- If a DOB is supplied a...
CREATE VIEW dbo.PersonsView AS SELECT name, address FROM persons;
This query will drop the view - if it already exists - and create a new one. IF OBJECT_ID('dbo.PersonsView', 'V') IS NOT NULL DROP VIEW dbo.PersonsView GO CREATE VIEW dbo.PersonsView AS SELECT name, address FROM persons;
Will be available till the current connection persists for the user. Automatically deleted when the user disconnects. The name should start with # (#temp) CREATE TABLE #LocalTempTable( StudentID int, StudentName varchar(50), Student...
Will start with ## (##temp). Will be deleted only if user disconnects all connections. It behaves like a permanent table. CREATE TABLE ##NewGlobalTempTable( StudentID int, StudentName varchar(50), StudentAddress varchar(150)) Insert ...
Create a Job To add a job first we have to use a stored procedure named sp_add_job USE msdb ; GO EXEC dbo.sp_add_job @job_name = N'Weekly Job' ; -- the job name Then we have to add a job step using a stored procedure named sp_add_jobStep EXEC sp_add_jobstep @job_name = N'W...

Page 654 of 1191