Tutorial by Examples

This shows how to create the demo database used in big parts of Progress documentation: sports2000. This assumes you have installed the Progress products with at least one type of database license. Run proenv script/bat-file that will give you a prompt with all environment variables set. Create ...
/* These variables are declared with `NO-UNDO`. That state...
Global aliases In bash, aliases can only be placed at the beginning of of a command, but zsh supports aliases anywhere. If you place the following line in your $ZDOTDIR/.zshrc alias -g G=' | grep -i' You can then run cat haystack.txt G "needle" Suffix aliases (Added in zsh 4.2.x) ...
List the contents of an archive file without extracting it: tar -tf archive.tar.gz Folder-In-Archive/ Folder-In-Archive/file1 Folder-In-Archive/Another-Folder/ Folder-In-Archive/Another-Folder/file2
imports: from subprocess import Popen, PIPE from lxml import etree from io import StringIO Downloading: user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36' url = 'http://stackoverflow.com' get = Popen(['curl...
A minimal example of using SWIG. HelloWorld.i, the SWIG interface file %module helloworld //the name of the module SWIG will create %{ //code inside %{...%} gets inserted into the wrapper file #include "myheader.h" //helloworld_wrap.cxx includes this header %} ...
Returns a new deque object initialized left-to-right (using append()) with data from iterable. If iterable is not specified, the new deque is empty. Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”). Deques support thread-safe, me...
installing pytest: pip install pytest getting the tests ready: mkdir tests touch tests/test_docker.py Functions to test in docker_something/helpers.py: from subprocess import Popen, PIPE # this Popen is monkeypatched with the fixture `all_popens` def copy_file_to_docker(src, dest): ...
Go supports user defined types in the form of structs and type aliases. structs are composite types, the component pieces of data that constitute the struct type are called fields. a field has a type and a name which must be unqiue. package main type User struct { ID uint64 FullName st...
because a struct is also a data type, it can be used as an anonymous field, the outer struct can directly access the fields of the embedded struct even if the struct came from a diffrent package. this behaviour provides a way to derive some or all of your implementation from another type or a set of...
In Go a method is a function that acts on a variable of a certain type, called the receiver the receiver can be anything, not only structs but even a function, alias types for built in types such as int, string, bool can have a method, an exception to this rule is that interfaces(discussed lat...
the receiver of a method is usually a pointer for performance reason because we wouldn't make a copy of the instance, as it would be the case in value receiver, this is especially true if the receiver type is a struct. anoter reason to make the receiver type a pointer would be so we could modify the...
Interfaces provide a way to specify the behaviour of an object, if something can do this then it can be used here. an interface defines a set of methods, but these methods do not contain code as they are abstract or the implemntation is left to the user of the interface. unlike most Object Oriented ...
In the following example we will create a service with the name visualizer. We will specify a custom label and remap the internal port of the service from 8080 to 9090. In addition we will bind mount an external directory of the host into the service. docker service create \ --name=visual...
This simple exampe will create a hello world web service that will listen on the port 80. docker service create \ --publish 80:80 \ tutum/hello-world
You can install mocha either globally or in your project folder. The latter is the preferred way. In all the example let's assume that all the test files are in a test folder within the project folder. Install Mocha locally To install mocha in your project folder, you can use the following npm co...
import spock.lang.* class HelloWorldSpec extends Specification { @Shared message = 'Hello world!' def "The world can say hello using when and then"() { when: def newMessage = message then: newMessage == 'Hello world!' } ...
Contrary to Drupal 7 you cannot call regular PHP functions in your templates. In Drupal 8 the way to go is by creating filters and functions. You should use a filter when: you want to transform the data you want to display. Imagine you have a title that you want to always be uppercase. For example,...
This example will show you how to use Dependency Inject to use other services registered in the Drupal environment. Imagine you have an SVG image file that changes colors depending on some random CSS/Javascript thing in your project. To be able to target the SVG with CSS you have to actually have t...
A Seaside component (subclass of WAComponent) needs to override #renderContentOn:. It is a smalltalk class that can use all the normal ways of structuring an application. Here it delegates to three different methods. JQDroppableFunctionalTest>>renderContentOn: html self renderInstructions...

Page 1105 of 1336