Tutorial by Examples: c

Creates a Global Default Instance of a class. The default instance is accessed via the name of the class. Declaration VERSION 1.0 CLASS BEGIN MultiUse = -1 'True END Attribute VB_Name = "Class1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_Pr...
Adds a text description to a class or module member that becomes visible in the Object Explorer. Ideally, all public members of a public interface / API should have a description. Public Function GiveMeATwo() As Integer Attribute GiveMeATwo.VB_Description = "Returns a two!" ...
Transcrypt is a tool to precompile a fairly extensive subset of Python into compact, readable Javascript. It has the following characteristics: Allows for classical OO programming with multiple inheritance using pure Python syntax, parsed by CPython’s native parser Seamless integration with the ...
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...
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...
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
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...
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...
Depending on the structure of your data, you can create variables that update dynamically. DECLARE @CurrentID int = (SELECT TOP 1 ID FROM Table ORDER BY CreateDate desc) DECLARE @Year int = 2014 DECLARE @CurrentID int = (SELECT ID FROM Table WHERE Year = @Year) In most cases, you will want...
First, let's setup the example table. -- Create a table as an example CREATE TABLE SortOrder ( ID INT IDENTITY PRIMARY KEY, [Text] VARCHAR(256) ) GO -- Insert rows into the table INSERT INTO SortOrder ([Text]) SELECT ('Lorem ipsum dolor sit amet, consectetur adipiscing elit') U...
First, in addition to the normal Fresco Gradle dependency, you have to add the OkHttp 3 dependency to your build.gradle: compile "com.facebook.fresco:imagepipeline-okhttp3:1.2.0" // Or a newer version. When you initialize Fresco (usually in your custom Application implementation), you ...
Adding dependencies into the build.gradle file. dependencies { .... compile 'com.squareup.retrofit2:retrofit:2.1.0' compile ('com.thoughtworks.xstream:xstream:1.4.7') { exclude group: 'xmlpull', module: 'xmlpull' } .... } Then create Converter Factory public c...

Page 458 of 826