Tutorial by Examples: c

Let's consider the below snippet, Get-ChildItem -Path C:\MyFolder | Select-Object Name, CreationTime, Length It simply output the folder content with the selected properties. Something like, What if I want to display the file size in KB ? This is where calcualted properties comes handy. Get-...
Unlike functions, there's no need to forward declare a procedure. It can be placed anywhere in your code, before or after you call it using RUN. RUN proc. //Procedure starts here PROCEDURE proc: //Procedure ends here END PROCEDURE. The procedure name is folowed by a colon sign telling u...
Recursion is easy - RUN the procedure itself from inside the procedure. However if you recurse too far the stack will run out of space. A procedure calculation the factorial. PROCEDURE factorial: DEFINE INPUT PARAMETER piNum AS INTEGER NO-UNDO. DEFINE OUTPUT PARAMETER piFac AS INTEG...
The procedure has it's own scope. The outside scope will "bleed" into the procedure but not the other way arround. DEFINE VARIABLE i AS INTEGER NO-UNDO INIT 1. DEFINE VARIABLE j AS INTEGER NO-UNDO. PROCEDURE p: MESSAGE i VIEW-AS ALERT-BOX. // 1 MESSAGE j VIEW-AS AL...
Set createVBScriptRegExObject = CreateObject("vbscript.RegExp") Tools> References> Microsoft VBScript Regular Expressions #.# Associated DLL: VBScript.dll Source: Internet Explorer 1.0 and 5.5 MSDN-Microsoft Beefs Up VBScript with Regular Expressions MSDN-Regular Expression ...
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=...
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...
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...
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 696 of 826