Tutorial by Examples

The interface Flyable is a class module with the following code: Public Sub Fly() ' No code. End Sub Public Function GetAltitude() As Long ' No code. End Function A class module, Airplane, uses the Implements keyword to tell the compiler to raise an error unless it has two methods...
First, you need to prepare the environment by creating the SQL Server table and the CSV file. Run the script below in SQL Server to create the SQL table either on a new database or an existing one. For this example, I used my ‘TrainingDB’ database. /* Creates table for Students.csv */ CREATE TABL...
' How To Seek Past VBA's 2GB File Limit ' Source: https://support.microsoft.com/en-us/kb/189981 (Archived) ' This must be in a Class Module Option Explicit Public Enum W32F_Errors W32F_UNKNOWN_ERROR = 45600 W32F_FILE_ALREADY_OPEN W32F_PROBLEM_OPENING_FILE W32F_FILE_ALREAD...
Private Const HashTypeMD5 As String = "MD5" ' https://msdn.microsoft.com/en-us/library/system.security.cryptography.md5cryptoserviceprovider(v=vs.110).aspx Private Const HashTypeSHA1 As String = "SHA1" ' https://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1c...
Another variation from the code above gives you more performance when you want to get hash codes of all files from a root folder including all sub folders. Example of Worksheet: Code Option Explicit Private Const HashTypeMD5 As String = "MD5" ' https://msdn.microsoft.com/en-us/libr...
We can create Singleton class in such a way that developers are forced to used the shared instance (singleton object) instead of creating their own instances. @implementation MySingletonClass + (instancetype)sharedInstance { static MySingletonClass *_sharedInstance = nil; static dispa...
Let's say we have the following 4 by 4 grid: Let's assume that this is a maze. There are no walls/obstacles, though. We only have a starting point (the green square), and an ending point (the red square). Let's also assume that in order to get from green to red, we cannot move diagonally. So, s...
Let's say we have the following 4 by 4 grid: Let's assume that this is a maze. There are no walls/obstacles, though. We only have a starting point (the green square), and an ending point (the red square). Let's also assume that in order to get from green to red, we cannot move diagonally. So, s...
package main import "fmt" func mergeSort(a []int) []int { if len(a) < 2 { return a } m := (len(a)) / 2 f := mergeSort(a[:m]) s := mergeSort(a[m:]) return merge(f, s) } func merge(f []int, s []int) []int { var i, j int size :...
Here we are sharing some minimal workflow to build and publish an Angular 2+ npm package. Configuration files We need some config files to tell git, npm, gulp and typescript how to act. .gitignore First we create a .gitignore file to avoid versioning unwanted files and folders. The content is: ...
Steps: clone the gradle-script-kotlin project copy/paste from the cloned project to your project: build.gradle.kts gradlew gradlew.bat settings.gradle update the content of the build.gradle.kts based on your needs, you can use as inspiration the scripts in the project just clo...
The following example will demonstrate a basic installation and setup of RequireJS. Create a new HTML file called index.html and paste the following content: <!DOCTYPE html> <html lang="en"> <head> <title>Hello RequireJS</title> <script type=&...
A loop will execute as long as its condition remains true, but you can stop it manually using the break keyword. For example: var peopleArray = ["John", "Nicole", "Thomas", "Richard", "Brian", "Novak", "Vick", "Amanda",...
The following example expands upon Hello World by demonstrating multiple dependencies using the define() function. Create a new HTML file called index.html and paste the following content: <!DOCTYPE html> <html lang="en"> <head> <title>Hello RequireJS</t...
In our example we will be creating a customized formatter for email addresses that will allow us to display obfuscated email addresses to fool those nasty spammers. The formatter will have a some configuration options that will allow us to control how the email address is obfuscated: Remove @ an...
A single entry point to your application is possible with RequireJS by using the data-main attributed within the <script> tag. <script type="text/javascript" data-main="scripts/main" src="http://requirejs.org/docs/release/2.3.2/minified/require.js"></scr...
Not all libraries are defined in a way that is compatible with AMD and RequireJS's define() function. The author's have addressed this by including a shim directive for configuring those dependencies. One example is using the jQuery UI Layout Plugin. That plugin depends on jQuery. You can configu...
Import PorterStemmer and initialize from nltk.stem import PorterStemmer from nltk.tokenize import word_tokenize ps = PorterStemmer() Stem a list of words example_words = ["python","pythoner","pythoning","pythoned","pythonly"] f...
Parts of template can be displayed conditionally. If statement is used for this purpose. It's similar to if statement in programing languages. Contents of block are executed/displayed if an expression evaluates to true. {% if enabled == false %} Disabled {% endif %} Disabled will be displ...
As of Ruby 2.4.0, you can start an interactive IRB session inside any Ruby script using these lines: require 'irb' binding.irb This will start an IBR REPL where you will have the expected value for self and you will be able to access all local variables and instance variables that are in scope....

Page 1103 of 1336