This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__inputs": [ | |
{ | |
"name": "DS_PROMETHEUS", | |
"label": "Prometheus", | |
"description": "", | |
"type": "datasource", | |
"pluginId": "prometheus", | |
"pluginName": "Prometheus" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bitOne = 0b00000001 | |
var maskingBit = 0b00000000 | |
// Retrieve the state of the bit of the first digit from right side of bitOne | |
print(String(bitOne|maskingBit, radix: 2)) // Print 1, which indicates the first digit from the right of bitOne is 1 | |
// Turn on the first digit of bitOne no matter what the previous bit was | |
bitOne = bitOne|maskingBit | |
// Turn off the first digit of bitOne |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne<<2, radix: 2)) // Print the output 10011100 | |
print(String(bitOne>>2, radix: 2)) // Print the output 1001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne^bitTwo, radix: 2)) // Print the binary XOR output 1111 which is actually 01111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bitOne:UInt8 = 0b01101110 | |
print(String(~bitOne, radix:2)) // Output 10010001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne|bitTwo, radix: 2)) // Print the binary OR output 101111 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let bitOne = 0b100111 | |
let bitTwo = 0b101000 | |
print(String(bitOne&bitTwo, radix: 2)) // Print the binary AND output 100000 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src=”/socket.io/socket.io.js”></script> | |
<script> | |
$(document).ready(() => { | |
var socket = io(); | |
socket.on(‘generated notification’, notificationString => { | |
// show the notification | |
var notification | |
= new Notification(‘Notification,{ | |
title: ‘notificationString’, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /app/sockets/receivers.server.sockets.js | |
var socketIO; | |
exports.receivers = (io) => { | |
socketIO = io; | |
io.emit(‘generated notification’,’hello’); | |
} | |
// handle different type of notification. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var io=null; | |
exports.set = function(socketio) { | |
io=socketio; | |
}; | |
exports.get = function() { | |
return io; | |
}; |
NewerOlder