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
import {Project, CompileStream} from 'gulp-typescript'; | |
import {Duplex, PassThrough, Readable} from 'stream'; | |
import {Reporter} from 'gulp-typescript/release/reporter'; | |
type Callback = () => void; | |
/** | |
* This is used to ensure that each project object is not busy when it is to be used | |
* This prevents the annoying: | |
* "Error: gulp-typescript: A project cannot be used in two compilations |
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
interface ChainedCallback { | |
(): void; | |
} | |
class ChainedCallback { | |
private chain: Callback[]; | |
public static fromCallbacks(...cbs: Callback[]): ChainedCallback { | |
let chained = new ChainedCallback(); | |
cbs.forEach(chained.attach); |
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
#include <algorithm> | |
#include <iterator> | |
#include <unordered_set> | |
#include <vector> | |
class disjoint_set { | |
struct ranked { int root, rank, size; }; | |
public: | |
explicit disjoint_set(int n): cc(n + 1) { |
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
#include <iostream> | |
#include <type_traits> | |
#include <limits> | |
#include <stdexcept> | |
template <typename I> | |
class range_t { | |
static_assert(std::is_integral<I>::value, "Integer type required"); | |
class offset { |
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
// Immutable Stack Type using List | |
case class Stack[A] (elems: Seq[A] = List.empty[A]) { | |
def push(v: A) : Stack[A] = Stack(v +: elems) | |
def pushAll(xs: Iterable[A]) : Stack[A] = | |
xs.foldLeft (this) ((accStack, e) => accStack.push(e)) | |
def pop(): Either[String, (A, Stack[A])] = { | |
if (isEmpty) Left("Cannot pop from empty stack") |
- To kill a service
-
Get-Service -Name <servicename> | Stop-Service [-Force]
- Reset windows update: Script
- Run a windows powershell script or command
-
powershell.exe -ExecutionPolicy ByPass -File <script.ps1>
-
- Unplug your device from the computer and type
lsusb
in the terminal. You should get an output similar to this:
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 005: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
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
# coding=utf8 | |
# the above tag defines encoding for this document and is for Python 2.x compatibility | |
# See it in action https://regex101.com/r/ObowxD/5 | |
import re | |
regex = r""" | |
(?xm) | |
(?:\s|^) | |
([-+]*(?:\d+\.\d*|\.?\d+)(?:[eE][-+]?\d+)?) |