<link rel="stylesheet" href="path/to.css" type="text/css">
The standard practice is to place CSS <link> tags inside the <head> tag at the top of your HTML. This way the CSS will be loaded first and will apply to your page as it is loading, rather th...
Have you ever forgotten to add a trap to clean up a temporary file or do other work at exit?
Have you ever set one trap which canceled another?
This code makes it easy to add things to be done on exit one item at a time, rather than having one large trap statement somewhere in your code, which may...
You can embed another template body into your template via {{template "mysharedtemplate" .}} to reuse shared components. Here is an example that creates a header template that can be reused at the top of all other template bodies. It also uses CSS to stylize the output so that it is easier...
This lists all of the custom classifiers you have trained.
'use strict';
let watson = require('watson-developer-cloud');
var visualRecognition = watson.visual_recognition({
version: 'v3',
api_key: process.env['API_KEY'],
version_date:'2016-05-19'
});
let url = "https://upl...
This returns information about a specific classifier ID you have trained. This includes information about its current status (i.e., if it is ready or not).
'use strict';
let watson = require('watson-developer-cloud');
var visualRecognition = watson.visual_recognition({
version: 'v3',
ap...
Training a custom classifier requires a corpus of images organized into groups. In this example, I have a bunch of images of apples in one ZIP file, a bunch of images of bananas in another ZIP file, and a third group of images of things that are not fruits for a negative set. Once a custom classif...
The following Go file can be compiled into a continuous external collector that will query a MSSQL server database that uses the StackExchange.Exceptional schema. It will query multiple servers/databases for all exceptions since UTC 00:00 to convert the raw entries into a counter. It also uses the b...
In case you have reverted back to a past commit and lost a newer commit you can recover the lost commit by running
git reflog
Then find your lost commit, and reset back to it by doing
git reset HEAD --hard <sha1-of-commit>
In case you have accidentally commited a delete on a file and later realized that you need it back.
First find the commit id of the commit that deleted your file.
git log --diff-filter=D --summary
Will give you a sorted summary of commits which deleted files.
Then proceed to restore the file b...
To restore a file to a previous version you can use reset.
git reset <sha1-of-commit> <file-name>
If you have already made local changes to the file (that you do not require!) you can also use the --hard option
CardView is a member of the Android Support Library, and provides a layout for cards.
To add CardView to your project, add the following line to your build.gradle dependencies.
compile 'com.android.support:cardview-v7:25.1.1'
A number of the latest version may be found here
In your layout you ...
var parts = new[] { "Foo", "Bar", "Fizz", "Buzz"};
var joined = string.Join(", ", parts);
//joined = "Foo, Bar, Fizz, Buzz"
SELECT
'XPath example' AS 'head/title',
'This example demonstrates ' AS 'body/p',
'https://www.w3.org/TR/xpath/' AS 'body/p/a/@href',
'XPath expressions' AS 'body/p/a'
FOR XML PATH('html')
<html>
<head>
<title>XPath example</title>
&...
var wsHost = "ws://my-sites-url.com/path/to/echo-web-socket-handler";
var ws = new WebSocket(wsHost);
var value = "an example message";
//onmessage : Event Listener - Triggered when we receive message form server
ws.onmessage = function(message) {
if (message === value...
Variable substitutions should only be used inside double quotes.
calculation='2 * 3'
echo "$calculation" # prints 2 * 3
echo $calculation # prints 2, the list of files in the current directory, and 3
echo "$(($calculation))" # prints 6
Outside of doubl...
The above type handler can be installed into SqlMapper using the AddTypeHandler method.
SqlMapper.AddTypeHandler<IHtmlString>(new IHtmlStringTypeHandler());
Type inference allows you to omit the generic type parameter:
SqlMapper.AddTypeHandler(new IHtmlStringTypeHandler());
There's als...