Tutorial by Examples: and

The padding property sets the padding space on all sides of an element. The padding area is the space between the content of the element and its border. Negative values are not allowed. To save adding padding to each side individually (using padding-top, padding-left etc) can you write it as a shor...
Implementations in classes, including abstract declarations, take precedence over all interface defaults. Abstract class method takes precedence over Interface Default Method. public interface Swim { default void backStroke() { System.out.println("Swim.backStroke"); ...
Macro expansion is the process of turning macros into actual code. This usually happens as part of the compilation process. The compiler will expand all macro forms before actually compiling code. Macro expansion also happens during interpretation of Lisp code. One can call MACROEXPAND manually to ...
__construct() is the most common magic method in PHP, because it is used to set up a class when it is initialized. The opposite of the __construct() method is the __destruct() method. This method is called when there are no more references to an object that you created or when you force its deletion...
If a function contains just one expression, we can omit the brace brackets and use an equals instead, like a variable assignment. The result of the expression is returned automatically. fun sayMyName(name: String): String = "Your name is $name"
iex(1)> 1 + 1 2 iex(2)> v 2 iex(3)> 1 + v 3 See also: Get the value of a row with `v`
Dim array = New Integer() {1, 2, 3, 4} or Dim array As Int32() = {1, 2, 3, 4}
You can also combine several operators together to create more complex WHERE conditions. The following examples use the Employees table: Id FName LName PhoneNumber ManagerId DepartmentId Salary Hire_date CreatedDate ModifiedDate 1 James Smith 1234567890 NULL ...
ViewData is the mechanism for a controller to provide data to the view it presents, without using a ViewModel. Specifically, ViewData is a dictionary which is available both in MVC action methods and views. You may use ViewData to transfer some data from your action method to the view returned by th...
For instance, a computation involving commands to read and write from the prompt: First we describe the "commands" of our computation as a Functor data type {-# LANGUAGE DeriveFunctor #-} data TeletypeF next = PrintLine String next | ReadLine (String -> next) derivin...
The basics After making changes to your source code, you should stage those changes with Git before you can commit them. For example, if you change README.md and program.py: git add README.md program.py This tells git that you want to add the files to the next commit you do. Then, commit your...
docker exec -it <container id> /bin/bash It is common to log in an already running container to make some quick tests or see what the application is doing. Often it denotes bad container use practices due to logs and changed files should be placed in volumes. This example allows us log in the...
Before Python 3.5+ was released, the asyncio module used generators to mimic asynchronous calls and thus had a different syntax than the current Python 3.5 release. Python 3.x3.5 Python 3.5 introduced the async and await keywords. Note the lack of parentheses around the await func() call. import ...
First, remove autopublish. autopublish automatically publishes the entire database to the client-side, and so the effects of publications and subscriptions cannot be seen. To remove autopublish: $ meteor remove autopublish Then you can create publications. Below is a full example. import { Mon...
Example Application-extending class for handling the reporting: @ReportsCrashes( formUri = "https://backend-of-your-choice.com/",//Non-password protected. customReportContent = { /* */ReportField.APP_VERSION_NAME, ReportField.PACKAGE_NAME,ReportField.ANDROID_VERSION, R...
This will show the user location on the map Objective-C [self.map setShowsUserLocation:YES]; Swift self.map?.showsUserLocation = true This will track the user location on the map, updating regions according Objective-C [self.map setUserTrackingMode:MKUserTrackingModeFollow]; Swift s...
Define a menu in res/menu <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/first_...
Suppose you have a Dockerfile ending with ENTRYPOINT [ "nethogs"] CMD ["wlan0"] if you build this image with a docker built -t inspector . launch the image built with such a Dockerfile with a command such as docker run -it --net=host --rm inspector ,nethogs will monitor the...
Sometimes it's necessary to convert a Discriminated Union to and from a string: module UnionConversion open Microsoft.FSharp.Reflection let toString (x: 'a) = match FSharpValue.GetUnionFields(x, typeof<'a>) with | case, _ -> case.Name let fromStri...
Given the text: foo: bar I would like to replace anything following "foo: " with "baz", but I want to keep "foo: ". This could be done with a capturing group like this: s/(foo: ).*/$1baz/ Which results in the text: foo: baz Example 1 or we could use \K,...

Page 19 of 153