Tutorial by Examples: arc

// Usage: var arc={ cx:150, cy:150, innerRadius:75, outerRadius:100, startAngle:-Math.PI/4, endAngle:Math.PI } drawArc(arc,'skyblue','gray',4); function drawArc(a,fill,stroke,strokewidth){ ctx.beginPath(); ctx.arc(a.cx,a.cy,a.innerRadius,a.startAngle,a.endAngle); ...
Searching git log using some string in log: git log [options] --grep "search_string" Example: git log --all --grep "removed file" Will search for removed file string in all logs in all branches. Starting from git 2.4+, the search can be inverted using the --invert-grep...
If you know you need a packet <packet>, but you don't know the exact name <packet-exact-name>, instead of searching with Google try with the following: sudo apt-get update apt-cache search <packet> This will return you a list of packets name with a description. Once you have i...
You can use the archivesBaseName to set the name of apk. For example: defaultConfig { .... project.ext.set("archivesBaseName", "MyName-" + defaultConfig.versionName); } You will obtain this output. MyName-X.X.X-release.apk
This example shows how to render text along an arc. It includes how you can add functionality to the CanvasRenderingContext2D by extending its prototype. This examples is derived from the stackoverflow answer Circular Text. Example rendering Example code The example adds 3 new text renderi...
Rather than use clearRect which makes all pixels transparent you may want a background. To clear with a gradient // create the background gradient once var bgGrad = ctx.createLinearGradient(0,0,0,canvas.height); bgGrad.addColorStop(0,"#0FF"); bgGrad.addColorStop(1,"#08F"); ...
FIND command can scan large files line-by-line to find a certain string. It doesn't support wildcards in the search string. find /i "Completed" "%userprofile%\Downloads\*.log" >> %targetdir%\tested.log TYPE scan2.txt | FIND "Failed" /c && echo Scan fai...
The following script shows more advanced split file technique, where FOR function loops through a list of files in a directory, and each file content is piped to FINDSTR that looks for a string containing substring var preceded by undefined number of spaces and superseded by any extra text. Once fou...
MarkLogic is first and foremost a search engine, so let's use two different methods to search for this document. Using search:search() This gives a peek into using search:search() to develop search applications. This library provides Google-like search results and will likely speed up your develop...
0.5.0 (Although this example is written using syntax introduced in version v0.5, it can work with few modifications on older versions also.) This implementation of breadth-first search (BFS) on a graph represented with adjacency lists uses while loops and the return statement. The task we will sol...
menu.xml - (res -> menu) <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" tools:context=".HomeActivity"> <item...
The purpose of the classpath is to tell a JVM where to find classes and other resources. The meaning of the classpath and the search process are intertwined. The classpath is a form of search path which specifies a sequence of locations to look for resources. In a standard classpath, these places...
For those of us using Maven as a build system, we can use the Maven Archetype to create a new application. First consult the maven archetype catalog mvn archetype:generate -DarchetypeCatalog=http://struts.apache.org/ you can use one of the following achetypes: The Blank Convention Archetype (s...
Clear the canvas using compositing operation. This will clear the canvas independent of transforms but is not as fast as clearRect(). ctx.globalCompositeOperation = 'copy'; anything drawn next will clear previous content.
The Deque is the only Python data structure with fast Queue operations. (Note queue.Queue isn't normally suitable, since it's meant for communication between threads.) A basic use case of a Queue is the breadth first search. from collections import deque def bfs(graph, root): distances = {}...
Search for a lemma when you know what its conclusion ought to be: Coq < SearchPattern (S _ <= _). le_n_S: forall n m : nat, n <= m -> S n <= S m You can also search on a partial conclusion (the conclusion and one or several last hypotheses). Coq < Require Import Arith. Coq &...
This is a simple implementation of Binary Search Tree Insertion using Python. An example is shown below: Following the code snippet each image shows the execution visualization which makes it easier to visualize how this code works. class Node: def __init__(self, val): self.l_chil...
Install the required dependencies: 'org.apache.solr:solr-solrj:5.5.1' 'org.apache.httpcomponents:httpclient:4.3.6' 'com.ibm.watson.developer_cloud:java-sdk:3.2.0' The code below assumes you have a Solr collection with documents and you have trained a ranker, otherwise follow this tutorial pub...
require(['N/search'], function(SEARCHMODULE){ var type = 'transaction'; var columns = []; columns.push(SEARCHMODULE.createColumn({ name: 'internalid' })); columns.push(SEARCHMODULE.createColumn({ name: 'formulanumeric', formula: '{quantity}-{...
require(['N/search'], function(SEARCHMODULE){ var savedSearchId = 'customsearch_mySavedSearch'; var mySearch = SEARCHMODULE.load(savedSearchId); var resultset = mySearch.run(); var results = resultset.getRange(0, 1000); for(var i in results){ var result = results[i]...

Page 7 of 13