Tutorial by Examples

Incorrect code Sub DoSomething() Dim row As Integer For row = 1 To 100000 'do stuff Next End Sub Why doesn't this work? The Integer data type is a 16-bit signed integer with a maximum value of 32,767; assigning it to anything larger than that will overflow the type and ...
Incorrect code Sub DoSomething() Dim foo(1 To 10) Dim i As Long For i = 1 To 100 foo(i) = i Next End Sub Why doesn't this work? foo is an array that contains 10 items. When the i loop counter reaches a value of 11, foo(i) is out of range. This error occurs whenever...
Incorrect code Public Sub DoSomething() DoSomethingElse "42?" End Sub Private Sub DoSomethingElse(foo As Date) ' Debug.Print MonthName(Month(foo)) End Sub Why doesn't this work? VBA is trying really hard to convert the "42?" argument into a Date value. When it ...
Incorrect code Sub DoSomething() Dim foo As Collection With foo .Add "ABC" .Add "XYZ" End With End Sub Why doesn't this work? Object variables hold a reference, and references need to be set using the Set keyword. This error occurs whenever ...
you can set a Jekyll environment and value, when build time JEKYLL_ENV=production jekyll b JEKYLL_ENV=production jekyll build JEKYLL_ENV=production bundle exec jekyll build if your code contains the bellow snippet, analytics.html will not be included unless your building with JEKYLL_ENV=...
The following code illustrates how to do simple popup with Kivy. from kivy.app import App from kivy.uix.popup import Popup from kivy.lang import Builder from kivy.uix.button import Button Builder.load_string(''' <SimpleButton>: on_press: self.fire_popup() <SimplePopup>: ...
To deploy Java code to AWS Lambda, you have to create a distribution zip file that contains all dependencies that are needed during the runtime. Example project in Gradle: apply plugin: 'java' repositories { mavenCentral() } dependencies { compile 'com.amazonaws:aws-lambda-java-cor...
A lambda needs a handler, which will serve as the entry point to your application. Every handler needs to implement interface RequestHandler<I, O> where I is the input type and O is the output type. The input type is then passed to the handleRequest() method and the method returns the output t...
A lambda needs a handler, which will serve as the entry point to your application. In the simplest case, you get your input from the context and pass the result using the callback() function: exports.handler = (event, context, callback) => { callback(null, 'You sent ' + event.number); };
To create a Java lambda using the GUI, first make sure you have your distribution zip ready. You will also need an AWS account that can create lambdas. Switch to the AWS Lambda, dismiss the introduction screen (or read the Get Started documentation) and press the button Create a Lambda Function. ...
If you have successfully deployed the Lambda, you can also test it directly in the GUI. When you click the blue Test button for the first time, it presents you with a creation of a new test event. If you are testing the Java code from the Basic Lambda code in Java example, delete the whole body and...
Probably the most common way to invoke a Lambda is to use API Gateway, which maps a REST call to the lambda code. You can add multiple triggers to your Lambda during at any time, including when creating a new lambda. If you are familiar with API Gateway, you can associate any method with a deployed...
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.7' ) import groovyx.net.http.RESTClient try { def restClient = new RESTClient("http://weathers.co") def response = restClient.get(path: '/api.php', query: ['city': 'Prague']) prin...
The known sub-classes for Entity Events are: Sub-ClassesSub-ClassesSub-ClassesCreatureSpawnEventCreeperPowerEventEntityChangeBlockEventEntityCombustEventEntityCreatePortalEventEntityDamageEventEntityDeathEventEntityExplodeEventEntityInteractEventEntityPortalEnterEventEntityRegainHealthEventEntitySh...
UITabBarController building in Swift 3 Change image color and title according to selection with changing selected tab color. import UIKit class TabbarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() self.navigationController?.isNavigat...
There are a number of functions and methods for working with comma (or other character) separated lists in Progress 4GL. NUM-ENTRIES Returns the number of entries in a list. You can optionally specify delimiter, comma is default NUM-ENTRIES(string [, delimiter]) Using comma, the default deli...
Set createScriptingFileSystemObject = CreateObject("Scripting.FileSystemObject") Tools> References> Microsoft Scripting Runtime Associated DLL: ScrRun.dll Source: Windows OS MSDN-Accessing Files with FileSystemObject The File System Object (FSO) model provides an object-base...
Type Casting Type casting is a way to check the type of an instance, or to treat that instance as a different superclass or subclass from somewhere else in its own class hierarchy. Type casting in Swift is implemented with the is and as operators. These two operators provide a simple and express...
Here is a Rules example in Rules export format: { "rules_display_userpoints_after_updating_content" : { "LABEL" : "Display userpoints after updating content", "PLUGIN" : "reaction rule", "OWNER" : "rules", &qu...

Page 1120 of 1336