Tutorial by Examples

A very basic docker-compose.yml looks like this: version: '2' services: hello_world: image: ubuntu command: [/bin/echo, 'Hello world'] This file is making it so that there's a hello_world service, that's initialized from the ubuntu:latest image and that, when it's run, it just runs...
Below code is simple java program using selenium. The journey of the below code is Open Firefox browser Open google page Print title of Google page Find the search box location Pass the value as Selenium in the search box Submit the form Shutdown the browser package org.openqa.selenium....
fizzbuzz = fn (0, 0, _) -> "FizzBuzz" (0, _, _) -> "Fizz" (_, 0, _) -> "Buzz" (_, _, x) -> x end my_function = fn(n) -> fizzbuzz.(rem(n, 3), rem(n, 5), n) end
Go to https://www.arduino.cc/en/Main/Software Click the Mac OS X link. Unzip the .zipfile. Move the Arduino application to Applications.
Sometimes one has to work with pages that are not using jQuery while most developers are used to have jQuery handy. In such situations one can use Chrome Developer Tools console (F12) to manually add jQuery on a loaded page by running following: var j = document.createElement('script'); j.onload ...
The first interesting thing to know is how to write comments. In VB .NET, you write a comment by writing an apostrophe ' or writing REM. This means the rest of the line will not be taken into account by the compiler. 'This entire line is a comment Dim x As Integer = 0 'This comment is here to say...
One interesting thing is the ability to add you own comments into Visual Studio Intellisense. So you can make your own written functions and classes self-explanatory. To do so, you must type the comment symbol three times the line above your function. Once done, Visual Studio will automatically add...
In VB.NET, every variable must be declared before it is used (If Option Explicit is set to On). There are two ways of declaring variables: Inside a Function or a Sub: Dim w 'Declares a variable named w of type Object (invalid if Option Strict is On) Dim x As String 'Declares a variable named ...
Modifiers are a way to indicate how external objects can access an object's data. Public Means any object can access this without restriction Private Means only the declaring object can access and view this Protected Means only the declaring object and any object that inherits from...
Dim flags = BindingFlags.Static Or BindingFlags.Public Or BindingFlags.Instance Dim members = GetType(String).GetMembers(flags) For Each member In members Console.WriteLine($"{member.Name}, ({member.MemberType})") Next
Static method: Dim parseMethod = GetType(Integer).GetMethod("Parse",{GetType(String)}) Dim result = DirectCast(parseMethod.Invoke(Nothing,{"123"}), Integer) Instance method: Dim instance = "hello".ToUpper Dim method = Gettype(String).GetMethod("ToUpper&quo...
ArrayList is one of the inbuilt data structures in Java. It is a dynamic array (where the size of the data structure not needed to be declared first) for storing elements (Objects). It extends AbstractList class and implements List interface. An ArrayList can contain duplicate elements where it mai...
Test classes are created as local classes in a special unit test include. This is the basic structure of a test class: CLASS lcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_...
To get more information about any git command – i.e. details about what the command does, available options and other documentation – use the --help option or the help command. For example, to get all available information about the git diff command, use: git diff --help git help diff Similarl...
This example assumes that your lookup column is named MultiLookupColumnName and that you want to set your multi-lookup field to lookup to the items with IDs 1 and 2. Using jQuery AJAX 2010 var listName = "YourListName"; var lookupList = "LookupListName"; var idOfItemToUpdate...
If you want to change the order of a character strings you can use parentheses in the pattern to group parts of the string together. These groups can in the replacement argument be addresed using consecutive numbers. The following example shows how you can reorder a vector of names of the form &quo...
Repeat something n times: >>> import itertools >>> for i in itertools.repeat('over-and-over', 3): ... print(i) over-and-over over-and-over over-and-over
Python 3.x3.2 accumulate yields a cumulative sum (or product) of numbers. >>> import itertools as it >>> import operator >>> list(it.accumulate([1,2,3,4,5])) [1, 3, 6, 10, 15] >>> list(it.accumulate([1,2,3,4,5], func=operator.mul)) [1, 2, 6, 24, 120] ...
Ionic 1.2 officially supports deployment as a website If you're not using any Cordova plugins then there is no problem (if you really wish to) to upload the contents of the www folder to your server, and woila - you'll have the same app. However, it is important to note that Ionic 1 never intended...
Creating a separate instance of the WP_Query object is easy: $query_args = array( 'post_type' => 'post', 'post_per_page' => 10 ); $my_query = new WP_Query($query_args); if( $my_query->have_posts() ): while( $my_query->have_posts...

Page 537 of 1336