Tutorial by Examples: code

package main import ( "encoding/gob" "fmt" "os" ) type User struct { Username string Password string } func main() { user := User{} file, _ := os.Open("user.gob") defer file.Close() decoder := gob...
package main import ( "encoding/gob" "fmt" "os" ) type User struct { Username string Password string } type Admin struct { Username string Password string IsAdmin bool } type Deleter interface { Delete() } ...
package main import ( "encoding/gob" "fmt" "log" "os" ) type User struct { Username string Password string } type Admin struct { Username string Password string IsAdmin bool } type Deleter interface ...
In Pharo everything is an object, and every object responds to messages. So if you evaluate the following code Object subclass: #MyClass the object Object will create for you its subclass called MyClass. If you don't have any particular superclass in your mind it's advised to subclass from Objec...
Glass.Mapper.Sc allows you to move your data from Sitecore and into your code seamlessly using strongly typed objects. The framework allows you to map data on to c# classes and interfaces without any additional mark-up. As the data is mapped to your target objects it is converted to the target type...
# Print the working directory import os print os.getcwd() # C:\Python27\Scripts # Set the working directory os.chdir('C:/Users/general1/Documents/simple Python files') print os.getcwd() # C:\Users\general1\Documents\simple Python files # load pandas import pandas as pd # read a csv d...
/* In all versions of Progress ABL you can write multi line comments */ /* They can also span a single line */ //Starting with version 11.6 you can also write single line comments //Can you nest single line comments? //Yes you can string = "HELLO". //A single line comme...
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); };
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...
Open Function.cs and replace the class code with the following: public class Function { /// <summary> /// A simple function that takes a birth date and returns Age in years /// </summary> /// <param name="input"></param> /// <returns>Age is years&...
Paste this snippet somewhere in the http {} Block; or place it in it's own file in the /etc/nginx/conf.d/ folder. Also see the official docs for logging to syslog. # # Access Log # log_format fmt_syslog '[$time_local] $status $remote_addr $http_host "$request" $body_bytes_sent $reque...
Download visual studio code from here Visual studio code. Select your target installer[mac|windows|linux]. Go to downloaded file in your local. Below steps in volved for installing Installation finished successfully.
Create an F# console application. Change the Output type of the application to Windows Application. Add the FsXaml NuGet package. Add these four source files, in the order listed here. MainWindow.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ...
This is my FirebaseMessagingService public class MyFirebaseMessagingService extends FirebaseMessagingService { Bitmap bitmap; @Override public void onMessageReceived(RemoteMessage remoteMessage) { String message = remoteMessage.getData().get("message"); //imageUri will ...
use Time::HiRes qw( time ); my $start = time(); #Code for which execution time is calculated sleep(1.2); my $end = time(); printf("Execution Time: %0.02f s\n", $end - $start); This will print execution time of Code in seconds
// create the dictionary that will be sent to the blocks var myDictionary:Dictionary<String, Any> = Dictionary<String, Any>() myDictionary["InitialKey"] = "InitialValue" // create block queue let myBlockQueue:MKBlockQueue = MKBlockQueue() // block 1 let b1...
In the tsconfig.json set "sourceMap": true, to generate mappings alongside with js-files from the TypeScript sources using the tsc command. The launch.json file: { "version": "0.2.0", "configurations": [ { "type"...
Add ts-node to your TypeScript project: npm i ts-node Add a script to your package.json: "start:debug": "ts-node --inspect=5858 --debug-brk --ignore false index.ts" The launch.json needs to be configured to use the node2 type and start npm running the start:debug script: ...
See Ellie for a working example. This example uses the NoRedInk/elm-decode-pipeline module. Given a list of JSON objects, which themselves contain lists of JSON objects: [ { "id": 0, "name": "Item 1", "transactions": [ { "id&quo...

Page 17 of 21