Tutorial by Examples: amp

Prepare helloworld.go (find below) package main import "fmt" func main(){ fmt.Println("hello world") } Run GOOS=linux GOARCH=arm go build helloworld.go Copy generated helloworld (arm executable) file to your target machine.
{{#bs-form model=this onSubmit=(action "submit") as |form|}} {{#form.element label="Email" placeholder="Email" property="email" as |el|}} <div class="input-group"> <input value={{el.value}} class="form-control" place...
Let's assume we have a search results page that displays a user's search query back to them. The code below is an example of how this could be done in PHP: Results for "<?php echo $_GET['query'] ?>" For this to work, you would access the page with a URL like: https://yoursite.te...
#include <threads.h> #include <stdio.h> int run(void *arg) { printf("Hello world of C11 threads."); return 0; } int main(int argc, const char *argv[]) { thrd_t thread; int result; thrd_create(&thread, run, NULL); thrd_join(&...
{$DEFINE MyRuntimeCheck} // Comment out this directive when the check is no-longer required! // You can also put MyRuntimeCheck in the project defines instead. function MyRuntimeCheck: Boolean; {$IFNDEF MyRuntimeCheck} inline; {$ENDIF} begin result := TRU...
This example is a sample page that shows how to use Dojo to display a "Hello world" text inside <h1> tag. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Dojo sample</title> <script src="//ajax.go...
public final class Color { final private int red; final private int green; final private int blue; private void check(int red, int green, int blue) { if (red < 0 || red > 255 || green < 0 || green > 255 || blue < 0 || blue > 255) { throw ...
In this case class Point is mutable and some user can modify state of object of this class. class Point { private int x, y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return x; } public void setX(int ...
Since BackAndroid is deprecated. Use BackHandler instead of BackAndroid. import { BackHandler } from 'react-native'; {...} ComponentWillMount(){ BackHandler.addEventListener('hardwareBackPress',()=>{ if (!this.onMainScreen()) { this.goBack(); return true; ...
<?php include "vendor/autoload.php"; $app = new \Slim\App(); $app->get('/hello', function () { echo "Hello, world"; }); $app->run();
Parent element html <child-component [isSelected]="inputPropValue"></child-component> Parent element ts export class AppComponent { inputPropValue: true } Child component ts: export class ChildComponent { @Input() inputPropValue = false; } Child compone...
Installation pip install Flask-SQLAlchemy Simple Model class User(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(80)) email = db.Column(db.String(120), unique=True) The code example above shows a simple Flask-SQLAlchemy model, we can add an ...
ChromeDriverManager.getInstance().setup(); FirefoxDriverManager.getInstance().setup(); OperaDriverManager.getInstance().setup(); PhantomJsDriverManager.getInstance().setup(); EdgeDriverManager.getInstance().setup(); InternetExplorerDriverManager.getInstance().setup();
Java StringWriter class is a character stream that collects output from string buffer, which can be used to construct a string. The StringWriter class extends the Writer class. In StringWriter class, system resources like network sockets and files are not used, therefore closing the StringWriter i...
package com.streams; import java.io.*; public class DataStreamDemo { public static void main(String[] args) throws IOException { InputStream input = new FileInputStream("D:\\datastreamdemo.txt"); DataInputStream inst = new DataInputStream(input); int count...
Locate and open your TIBCO BW bwengine.tra file typlically under TIBCO_HOME/bw/5.12/bin/bwengine.tra (Linux environment) Look for the line that states: *** Common variables. Modify these only. *** Add the following line right after that section tibco.deployment=%tibco.deployment% ...
<nav aria-label="Page navigation example"> <ul class="pagination"> <li class="page-item"><a class="page-link" href="#">Previous</a></li> <li class="page-item"><a class="page-lin...
This widget is used to display items with hierarchy. For instance, windows explorer can be reproduced in this way. Some nice tables can be also done using treeview widget. Create the widget tree=ttk.Treeview(master) Definition of the columns You can define how many columns, their width and min...
import asyncio async def hello_world(): print('Hello World') loop = asyncio.get_event_loop() loop.run_until_complete(hello_world()) loop.close()
To shelve an object, first import the module and then assign the object value as follows: import shelve database = shelve.open(filename.suffix) object = Object() database['key'] = object

Page 43 of 46