Tutorial by Examples: e

The following method will take a second or two depending on your connection to retrieve a web page and count the text length. Whatever thread calls it will block for that period of time. Also it rethrows an exception which is useful later on. public static long blockingGetWebPageLength(String urlS...
Create a tag: To create a tag on your current branch: git tag < tagname > This will create a local tag with the current state of the branch you are on. To create a tag with some commit: git tag tag-name commit-identifier This will create a local tag with the commit-identifier...
In the example below, the calculateShippingPrice method calculates shipping cost, which takes some processing time. In a real world example, this would e.g. be contacting another server which returns the price based on the weight of the product and the shipping method. By modeling this in an async ...
This example requires importing DateAdapter. import {DateAdapter} from '@angular/material'; datepicker.component.html: <md-input-container> <input mdInput [mdDatepicker]="picker" placeholder="Choose a date"> <button mdSuffix [mdDatepickerToggle]="pi...
mView.afterMeasured { // inside this block the view is completely drawn // you can get view's height/width, it.height / it.width } Under the hood inline fun View.afterMeasured(crossinline f: View.() -> Unit) { viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlob...
(from official doc) fun main(args: Array<String>) { launch(CommonPool) { // create new coroutine in common thread pool delay(1000L) // non-blocking delay for 1 second (default time unit is ms) println("World!") // print after delay } println("He...
Glide .with(context) .load(currentUrl) .into(new BitmapImageViewTarget(profilePicture) { @Override protected void setResource(Bitmap resource) { RoundedBitmapDrawable circularBitmapDrawable = RoundedBitmapDrawableFactory.create(context.g...
git diff-tree --no-commit-id --name-only -r COMMIT_ID
Automatic routing for the DRF, can be achieved for the ViewSet classes. Assume that the ViewSet class goes by the name of MyViewSet for this example. To generate the routing of MyViewSet, the SimpleRouter will be utilized. On myapp/urls.py: from rest_framework import routers router = ...
Please note that some terms like JIT and GC are generic enough to apply to many programming language environments and runtimes. CLR: Common Language Runtime IL: Intermediate Language EE: Execution Engine JIT: Just-in-time compiler GC: Garbage Collector OOM: Out of memory STA: Single-threaded ...
Suppose you’ve got a lot of commit against a project (here ulogd2, official branch is git-svn) and that you wan to send your patchset to the Mailling list [email protected]. To do so, just open a shell at the root of the git directory and use: git format-patch --stat -p --raw --signoff --subject...
git diff-tree [--stdin] [-m] [-c] [--cc] [-s] [-v] [--pretty] [-t] [-r] [--root] [<common-diff-options>] <tree-ish> [<tree-ish>] [<path>...] OptionExplanation-rdiff recursively--rootinclude the initial commit as diff against /dev/null
Creates a scheduled task that executes immediately, then on start up to run C:\myscript.ps1 as SYSTEM $ScheduledTaskPrincipal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -LogonType ServiceAccount $ScheduledTaskTrigger1 = New-ScheduledTaskTrigger -AtStartup $ScheduledTaskTrigger2 = New...
Create an HTML file like below. In the script tag, either you can use CDN link or from your local like <script type="text/javascript" src="dojo/dojo/dojo.js" data-dojo-config="async:true"> <!DOCTYPE html> <html> <head> <met...
Moving Average of last 30 Items sold SELECT value_column1, ( SELECT AVG(value_column1) AS moving_average FROM Table1 T2 WHERE ( SELECT COUNT(*) FROM Table1 T3 WHERE date_column1 BETWEEN T2.date_column1...
REM Truncate table (for testing) SQLCMD -Q "TRUNCATE TABLE TestDatabase.dbo.myNative;" REM Import data bcp TestDatabase.dbo.myNative IN D:\BCP\myNative.bcp -T -n REM Review results SQLCMD -Q "SELECT * FROM TestDatabase.dbo.myNative;"
To make the use of the adapter pattern and the kind of situation when it may be applied more imaginable, a small, simple and very concrete example is given here. There will be no code in here, just UML and a description of the example situation and its problem. Admittedly, the UML content is writte...
Detailed instructions on getting sdl-2 set up or installed.
There are two basic ways that the asset pipeline is used: When running a server in development mode, it automatically pre-processes and prepares your assets on-the-fly. In production mode, you’ll probably use it to pre-process, versionize, and compress and compile your assets. You can do s...
For very first step please make sure your java version is based on Oracle's JDK since the OpenJDP does not support JavaFX yet. So, go to the Oracle Java download page and download JDK suitable for your operating system and computer architecture. If you want to study Oracle's java examples, find th...

Page 1189 of 1191