Tutorial by Examples: contain

public static class ArrayHelpers { public static bool Contains<T>(this T[] array, T[] candidate) { if (IsEmptyLocate(array, candidate)) return false; if (candidate.Length > array.Length) return false; for (int a = 0; a <...
In cases such as restoring a database dump, or otherwise wishing to push some information through a pipe from the host, you can use the -i flag as an argument to docker run or docker exec. E.g., assuming you want to put to a containerized mariadb client a database dump that you have on the host, in...
This code makes sure that all nested containers are always the same height. This is done by assuring that all nested elements are the same height as the containing parrent div. See working example: https://jsfiddle.net/3wwh7ewp/ This effect is achieved due to the property align-items being set to...
A common problem is having a collection of items that all need to meet a certain criteria. In the example below we have collected two items for a diet plan and we want to check that the diet doesn't contain any unhealthy food. // First we create a collection $diet = collect([ ['name' => ...
XML <Data> <BioLight> <name>Firefly</name> <model>Insect</model> </BioLight> <ArtificialLight> <name>Fire</name> <model>Natural element</model> <source>flint<...
Custom events usually need custom event arguments containing information about the event. For example MouseEventArgs which is used by mouse events like MouseDown or MouseUp events, contains information about Location or Buttons which used to generate the event. When creating new events, to create a...
It is possible to save a Docker container's filesystem contents to a tarball archive file. This is useful in a pinch for moving container filesystems to different hosts, for example if a database container has important changes and it isn't otherwise possible to replicate those changes elsewhere. Pl...
This script, from here and here, will return all Tables and Columns where a specified value exists. This is powerful in finding out where a certain value is in a database. It can be taxing, so it is suggested that it be executed in a backup / test enviroment first. DECLARE @SearchStr nvarchar(100) ...
docker network connect app-backend myAwesomeApp-1 This command attaches the myAwesomeApp-1 container to the app-backend network. When you add a container to a user-defined network, the embedded DNS resolver (which is not a full-featured DNS server, and is not exportable) allows each container on ...
docker network disconnect app-backend myAwesomeApp-1 This command detaches the myAwesomeApp-1 container from the app-backend network. The container will no longer be able to communicate with other containers on the network it has been disconnected from, nor use the embedded DNS resolver to look u...
Data-only containers are obsolete and are now considered an anti-pattern! In the days of yore, before Docker's volume subcommand, and before it was possible to create named volumes, Docker deleted volumes when there were no more references to them in any containers. Data-only containers are obsolet...
While attached to a running container with a pty assigned (docker run -it ...), you can press ControlP - ControlQ to detach.
Docker is just a fancy way to run a process, not a virtual machine. Therefore, debugging a process "in a container" is also possible "on the host" by simply examining the running container process as a user with the appropriate permissions to inspect those processes on the host (...
In the example below we use std::string and operator>> to read items from the file. std::ifstream file("file3.txt"); std::vector<std::string> v; std::string s; while(file >> s) // keep reading until we run out { v.push_back(s); ...
The :global command already has its own topic: The global command
When the view controller is presented within a tab bar controller, you can access the tab bar controller like this: Swift let tabBarController = viewController.tabBarController Objective-C UITabBarController *tabBarController = self.tabBarController; When the view controller is part on an n...
Use appearanceWhenContainedInInstancesOfClasses: to customize the appearance for instance of a class when contained within an instance of container class. For example customization of UILabel's textColor and backgroundColor within ViewController class will look like this: Set UILabel text color Sw...
Const baseString As String = "Foo Bar" Dim containsBar As Boolean 'Check if baseString contains "bar" (case insensitive) containsBar = InStr(1, baseString, "bar", vbTextCompare) > 0 'containsBar = True 'Check if baseString contains bar (case insensitive) co...
Let's say there's a collection called Todos and the autopublish package is added. Here is the basic component. import { createContainer } from 'meteor/react-meteor-data'; import React, { Component, PropTypes } from 'react'; import Todos from '/imports/collections/Todos'; export class List exte...
With the power of regex comes great responsibility.... db.posts.find({'text': /.*foo.*|.*bar.*/i})

Page 4 of 8