You can neatly group your options within a selection menu in order to provide a more structured layout in a long list of options by using the <optgroup> element.
The syntax is very basic, by simply using the element with a label attribute to identify the title for the group, and containing ze...
The options inside a selection menu are what the user will be selection. The normal syntax for an option is as follows:
<option>Some Option</option>
However, it's important to note that the text inside the <option> element itself is not always used, and essentially becomes the ...
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...
Scollector can also monitor any Windows processes using the .NET framework. If no ProcessDotNet settings are specified it will default to just monitoring the w3wp worker processes for IIS. You can specify which applications to monitor in the configuration file.
[[ProcessDotNet]]
Name = "^w3...
The following demo features an <output> element's use of the [for] and [form] attributes. Keep in mind, <output> needs JavaScript in order to function. Inline JavaScript is commonly used in forms as this example demonstrates. Although the <input> elements are type="number"...
NSLog(@"Log Message!");
NSLog(@"NSString value: %@", stringValue);
NSLog(@"Integer value: %d", intValue);
The first argument of NSLog is an NSString containing the log message format. The rest of the parameters are used as values to substitute in place of the forma...
NSLog(@"NSLog message");
printf("printf message\n");
Output:
2016-07-16 08:58:04.681 test[46259:1244773] NSLog message
printf message
NSLog outputs the date, time, process name, process ID, and thread ID in addition to the log message. printf just outputs the message.
N...
NSLog(@"NSLog message");
The message that gets printed by calling NSLog has the following format when viewed in Console.app:
DateTimeProgram nameProcess IDThread IDMessage2016-07-1608:58:04.681test[46259:1244773]NSLog message
In classes, super.foo() will look in superclasses only. If you want to call a default implementation from a superinterface, you need to qualify super with the interface name: Fooable.super.foo().
public interface Fooable {
default int foo() {return 3;}
}
public class A extends Object impl...
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
To recover a deleted branch you need to find the commit which was the head of your deleted branch by running
git reflog
You can then recreate the branch by running
git checkout -b <branch-name> <sha1-of-commit>
You will not be able to recover deleted branches if git's garbage col...
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...