Tutorial by Examples: co

The working copy (WC) is your local and private workspace that you use to interact with the central Subversion repository. You use the working copy to modify the contents of your project and fetch changes committed by others. The working copy contains your project's data and looks and acts like a r...
This demonstrates a filter on a for-loop, and the use of yield to create a 'sequence comprehension': for ( x <- 1 to 10 if x % 2 == 0) yield x The output for this is: scala.collection.immutable.IndexedSeq[Int] = Vector(2, 4, 6, 8, 10) A for comprehension is useful when you need to crea...
git cherry-pick <commit-hash> will apply the changes made in an existing commit to another branch, while recording a new commit. Essentially, you can copy commits from branch to branch. Given the following tree (Source) dd2e86 - 946992 - 9143a9 - a6fd86 - 5a6057 [master] \ ...
To publish the changes you made in your working copy, run the svn commit command. IMPORTANT: Review your changes before committing them! Use svn status and svn diff to review the changes. Also, make sure you are in the correct path before performing a commit. If you updated many files across vari...
Using the Java-SDK 3.0.1 CountDownLatch lock = new CountDownLatch(1); SpeechToText service = new SpeechToText(); service.setUsernameAndPassword("<username>", "<password>"); FileInputStream audio = new FileInputStream("filename.wav"); RecognizeOpti...
docker run hello-world This will fetch the latest hello-world image from the Docker Hub (if you don't already have it), create a new container, and run it. You should see a message stating that your installation appears to be working correctly.
docker run docker/whalesay cowsay 'Hello, StackExchange!' This command tells Docker to create a container from the docker/whalesay image and run the command cowsay 'Hello, StackExchange!' in it. It should print a picture of a whale saying Hello, StackExchange! to your terminal. If the entrypoin...
Normally, a Docker container persists after it has exited. This allows you to run the container again, inspect its filesystem, and so on. However, sometimes you want to run a container and delete it immediately after it exits. For example to execute a command or show a file from the filesystem. Dock...
You can create multiline code snippets by indenting each line with at least four spaces or one tab: #include <stdio.h> int main() { printf("Hello World!\n"); return 0; }
Some parsers allow code to be designated by adding three backticks before and after a section of code. ``` <p><em>This</em> is an HTML example!</p> ``` Optionally, many parsers allow adding syntax highlighting by specifying the code's language immediately after the firs...
SELECT DisplayName, JoinDate, Reputation FROM Users ORDER BY JoinDate, Reputation DisplayNameJoinDateReputationCommunity2008-09-151Jeff Atwood2008-09-1625784Joel Spolsky2008-09-1637628Jarrod Dixon2008-10-0311739Geoff Dalgas2008-10-0312567
Single-line comments in Lua start with -- and continue until the end of line: -- this is single line comment -- need another line -- huh? Block comments start with --[[ and end with ]]: --[[ This is block comment. So, it can go on... and on... and on.... ]] Block comme...
The "default" for constructors is that they do not have any arguments. In case you do not specify any constructor, the compiler will generate a default constructor for you. This means the following two snippets are semantically equivalent: public class TestClass { private String tes...
Constructors can be created with any kinds of arguments. public class TestClass { private String testData; public TestClass(String testData) { this.testData = testData; } } Called like this: TestClass testClass = new TestClass("Test Data"); A class can ...
Node.js package configurations are contained in a file called package.json that you can find at the root of each project. You can setup a brand new configuration file by calling: npm init That will try to read the current working directory for Git repository information (if it exists) and enviro...
docker run -p "8080:8080" myApp docker run -p "192.168.1.12:80:80" nginx docker run -P myApp In order to use ports on the host have been exposed in an image (via the EXPOSE Dockerfile directive, or --expose command line option for docker run), those ports need to be bound to...
main = do input <- getContents putStr input Input: This is an example sentence. And this one is, too! Output: This is an example sentence. And this one is, too! Note: This program will actually print parts of the output before all of the input has been fully read in. This m...
readFloat :: IO Float readFloat = fmap read getLine main :: IO () main = do putStr "Type the first number: " first <- readFloat putStr "Type the second number: " second <- readFloat putStrLn $ show first ++ " + " ++ show se...
A bit counter-intuitive to the way most other languages' standard I/O libraries do it, Haskell's isEOF does not require you to perform a read operation before checking for an EOF condition; the runtime will do it for you. import System.IO( isEOF ) eofTest :: Int -> IO () eofTest line = do ...
$ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 2bc9b1988080 redis "docker-entrypoint.sh" 2 weeks ago Up 2 hours 0.0.0.0:6379->6379/tcp eleph...

Page 15 of 248