Tutorial by Examples: c

spec can describe and be used with arbitrary sequences. It supports this via a number of regex spec operations. (clojure.spec/valid? (clojure.spec/cat :text string? :int int?) ["test" 1]) ;;=> true cat requires labels for each spec used to describe the sequence. cat describes a seq...
9 Patches are stretchable images in which the areas which can be stretched are defined by black markers on a transparent border. There is a great tutorial here. Despite being so old, it's still so valuable and it helped many of us to deeply understand the 9 patch gear. Unfortunately, recently tha...
This example demonstrates creating a basic application in ExtJS using Sencha Cmd to bootstrap the process - this method will automatically generate some code and a skeleton structure for the project. Open a console window and change the working directory to an appropriate space in which to work. ...
A While loop starts by evaluating a condition. If it is true, the body of the loop is executed. After the body of the loop is executed, the While condition is evaluated again to determine whether to re-execute the body. Dim iteration As Integer = 1 While iteration <= 10 Console.Writeline(ite...
A package.json file, usually present in the project root, contains metadata about your app or module as well as the list of dependencies to install from npm when running npm install. To initialize a package.json type npm init in your command prompt. To create a package.json with default values use...
2.3-2.3.2 An enclosing CoordinatorLayout can be used to achieve Material Design Scrolling Effects when using inner layouts that support Nested Scrolling, such as NestedScrollView or RecyclerView. For this example: app:layout_scrollFlags="scroll|enterAlways" is used in the Toolbar pro...
Any time you instantiate a class that Implements IDisposable, you should call .Dispose1 on that class when you have finished using it. This allows the class to clean up any managed or unmanaged dependencies that it may be using. Not doing this could cause a memory leak. The Using keyword ensures th...
Sometimes, you have to create two Disposable objects in a row. There is an easy way to avoid nesting Using blocks. This code Using File As New FileStream("MyFile", FileMode.Append) Using Writer As New BinaryWriter(File) 'You code here Writer.Writer("Hello&quot...
Place your test classes here: /src/test/<pkg_name>/ Example test class public class ExampleUnitTest { @Test public void addition_isCorrect() throws Exception { int a=4, b=5, c; c = a + b; assertEquals(9, c); // This test passes assertEquals(10, c...
The slider provides an event called change that will trigger after the mouse completes a slider handle drag or if the value(s) have been changed programmatically. This function holds a reference to the slide event and a reference to the slider ui object. The ui object holds a jQuery object for the ...
The @Header and @Body annotations can be placed into the method signatures and Retrofit will automatically create them based on your models. public interface MyService { @POST("authentication/user") Call<AuthenticationResponse> authenticateUser(@Body AuthenticationReques...
The background-origin property specifies where the background image is positioned. Note: If the background-attachment property is set to fixed, this property has no effect. Default value: padding-box Possible values: padding-box - The position is relative to the padding box border-box - The p...
Definition and Usage: The background-clip property specifies the painting area of the background. Default value: border-box Values border-box is the default value. This allows the background to extend all the way to the outside edge of the element's border. padding-box clips the background at ...
When you need to set a pixel value for something like Paint.setTextSize but still want it be scaled based on the device, you can convert dp and sp values. DisplayMetrics metrics = Resources.getSystem().getDisplayMetrics(); float pixels = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, 12f, m...
USER daemon The USER instruction sets the user name or UID to use when running the image and for any RUN, CMD and ENTRYPOINT instructions that follow it in the Dockerfile.
WORKDIR /path/to/workdir The WORKDIR instruction sets the working directory for any RUN, CMD, ENTRYPOINT, COPY and ADD instructions that follow it in the Dockerfile. If the WORKDIR doesn’t exist, it will be created even if it’s not used in any subsequent Dockerfile instruction. It can be used mu...
VOLUME ["/data"] The VOLUME instruction creates a mount point with the specified name and marks it as holding externally mounted volumes from native host or other containers. The value can be a JSON array, VOLUME ["/var/log/"], or a plain string with multiple arguments, such a...
COPY has two forms: COPY <src>... <dest> COPY ["<src>",... "<dest>"] (this form is required for paths containing whitespace) The COPY instruction copies new files or directories from <src> and adds them to the filesystem of the container at the ...
ENV ENV <key> <value> ENV <key>=<value> ... The ENV instruction sets the environment variable <key> to the value . This value will be in the environment of all “descendant” Dockerfile commands and can be replaced inline in many as well. The ENV instruction has two...
EXPOSE <port> [<port>...] The EXPOSE instruction informs Docker that the container listens on the specified network ports at runtime. EXPOSE does NOT make the ports of the container accessible to the host. To do that, you must use either the -p flag to publish a range of ports or the ...

Page 259 of 826