Tutorial by Examples: co

Docker commands which take the name of a container accept three different forms: TypeExampleFull UUID9cc69f11a0f76073e87f25cb6eaf0e079fbfbd1bc47c063bcd25ed3722a8cc4aShort UUID9cc69f11a0f7Nameberserk_wozniak Use docker ps to view these values for the containers on your system. The UUID is generat...
To stop a running container: docker stop <container> [<container>...] This will send the main process in the container a SIGTERM, followed by a SIGKILL if it doesn't stop within the grace period. The name of each container is printed as it stops. To start a container which is stoppe...
Once you've paused execution on a breakpoint, you may want to follow execution line-by-line to observe what happens. Open your browser's Developer Tools and look for the Execution Control icons. (This example uses the icons in Google Chrome, but they'll be similar in other browsers.) Resume: Unpau...
Razor has its own comment syntax which begins with @* and ends with *@. Inline Comment: <h1>Comments can be @*hi!*@ inline</h1> Multi-line Comment: @* Comments can spread over multiple lines *@ HTML Comment You can also use the normal HTML comment syntax starting with &...
While inside a Razor code block, the browser will only recognize HTML code if the code is escaped. Use @: for a Single line: @foreach(int number in Model.Numbers) { @:<h1>Hello, I am a header!</h1> } Use <text> ... </text> for Multi-line: @{ var number = 1; ...
SQL TermsMongoDB TermsDatabaseDatabaseTableCollectionEntity / RowDocumentColumnKey / FieldTable JoinEmbedded DocumentsPrimary KeyPrimary Key (Default key _id provided by mongodb itself)
jQuery.ajax({ url: 'https://api.dropboxapi.com/2/users/get_current_account', type: 'POST', headers: { "Authorization": "Bearer <ACCESS_TOKEN>" }, success: function (data) { console.log(data); }, error: function (error) { ...
Syntax: SELECT * FROM table_name Using the asterisk operator * serves as a shortcut for selecting all the columns in the table. All rows will also be selected because this SELECT statement does not have a WHERE clause, to specify any filtering criteria. This would also work the same way if you...
This query will return the number of tables in the specified database. USE YourDatabaseName SELECT COUNT(*) from INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' Following is another way this can be done for all user tables with SQL Server 2008+. The reference is here. SELECT COUNT(...
An array can easily be converted into a std::vector by using std::begin and std::end: C++11 int values[5] = { 1, 2, 3, 4, 5 }; // source array std::vector<int> v(std::begin(values), std::end(values)); // copy array to new vector for(auto &x: v) std::cout << x << &q...
What are Array-like Objects? JavaScript has "Array-like Objects", which are Object representations of Arrays with a length property. For example: var realArray = ['a', 'b', 'c']; var arrayLike = { 0: 'a', 1: 'b', 2: 'c', length: 3 }; Common examples of Array-like Objects...
- (void)reachabilityChanged:(NSNotification *)note { Reachability* reachability = [note object]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; if (netStatus == NotReachable) { NSLog(@"Network unavailable"); } }
- (void)reachabilityChanged:(NSNotification *)note { Reachability* reachability = [note object]; NetworkStatus netStatus = [reachability currentReachabilityStatus]; switch (netStatus) { case NotReachable: NSLog(@"Network unavailable"); br...
Many IDEs provide support for generating HTML from Javadocs automatically; some build tools (Maven and Gradle, for example) also have plugins that can handle the HTML creation. However, these tools are not required to generate the Javadoc HTML; this can be done using the command line javadoc tool. ...
django-admin is a command line tool that ships with Django. It comes with several useful commands for getting started with and managing a Django project. The command is the same as ./manage.py , with the difference that you don't need to be in the project directory. The DJANGO_SETTINGS_MODULE envir...
// Java: String joined = things.stream() .map(Object::toString) .collect(Collectors.joining(", ")); // Kotlin: val joined = things.joinToString() // ", " is used as separator, by default
// Java: int total = employees.stream() .collect(Collectors.summingInt(Employee::getSalary))); // Kotlin: val total = employees.sumBy { it.salary }
// Java: Map<Department, Integer> totalByDept = employees.stream() .collect(Collectors.groupingBy(Employee::getDepartment, Collectors.summingInt(Employee::getSalary))); // Kotlin: val totalByDept = employees.groupBy { it.dept }.mapValues { it.v...
// Java: Stream.of("a1", "a2", "a3") .map(s -> s.substring(1)) .mapToInt(Integer::parseInt) .max() .ifPresent(System.out::println); // 3 // Kotlin: sequenceOf("a1", "a2", "a3") .map { it.substring(1) } ...
// Java: long count = items.stream().filter( item -> item.startsWith("t")).count(); // Kotlin: val count = items.filter { it.startsWith('t') }.size // but better to not filter, but count with a predicate val count = items.count { it.startsWith('t') }

Page 16 of 248