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
pragma solidity ^0.4.0; | |
pragma experimental ABIEncoderV2; | |
contract MultiSigWallet { | |
uint minApprovers; | |
address beneficiary; | |
address owner; | |
mapping(address => bool) approvedBy; |
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
pragma solidity ^0.4.0; | |
pragma experimental ABIEncoderV2; | |
contract Voter { | |
struct OptionPos { | |
uint pos; | |
bool exists; | |
} | |

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
@echo off | |
setlocal enabledelayedexpansion | |
REM Listen for kubenetes pod status changes, | |
REM change the value of NAME to your pod name or unique | |
REM part of the name, if more than one pod has the unique | |
REM part there will be conflict in the log | |
REM or you can set the pod name from commandline | |
REM | |
REM $ monitorpod podname apodnamespace anotherpodname apodpartname |
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
Param([string]$Title,[string]$Message,[string]$MessageType) | |
Add-Type -AssemblyName System.Windows.Forms | |
$global:balloon = New-Object System.Windows.Forms.NotifyIcon | |
Get-Member -InputObject $Global:balloon 2>&1 | Out-Null | |
[void](Register-ObjectEvent -InputObject $balloon -EventName MouseDoubleClick -SourceIdentifier IconClicked -Action { | |
$global:balloon.dispose() | |
}) | |
$path = (Get-Process -id $pid).Path | |
$balloon.Icon = [System.Drawing.Icon]::ExtractAssociatedIcon($path) | |
[System.Windows.Forms.ToolTipIcon] | Get-Member -Static -Type Property 2>&1 | Out-Null |
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
Commander Lambda uses an automated algorithm to assign minions randomly to tasks, in order to keep her minions on their toes. But you've noticed a flaw in the algorithm - it eventually loops back on itself, so that instead of assigning new minions as it iterates, it gets stuck in a cycle of values so that the same minions end up doing the same tasks over and over again. You think proving this to Commander Lambda will help you make a case for your next promotion. | |
You have worked out that the algorithm has the following process: | |
1) Start with a random minion ID n, which is a nonnegative integer of length k in base b | |
2) Define x and y as integers of length k. x has the digits of n in descending order, and y has the digits of n in ascending order | |
3) Define z = x - y. Add leading zeros to z to maintain length k if necessary | |
4) Assign n = z to get the next minion ID, and go back to step 2 | |
For example, given minion ID n = 1211, k = 4, b = 10, then x = 2111, y = 1112 and z = 2111 - 1112 = 0999. Then the next m |
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
//Example: log 'Hello World' after language-colors.css load completed | |
/** | |
loadScript("https://quickutils.github.io/language-colors/language-colors.css", function() { | |
console.log('Hello World'); | |
}); | |
**/ | |
function loadScript(url, callback) { | |
var head = document.body; | |
var script = document.createElement('script'); |
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
@echo off | |
REM download the microsoft devcon app https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/devcon | |
REM Download x64 if your arch is x64 same for x32 | |
REM change this 'USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0' to your device instace path | |
REM Run as Administrator | |
:exec | |
devcon enable @"USBSTOR\DISK&VEN_WD&PROD_ELEMENTS_25A2&REV_1021\57584131413438324C384543&0" | |
goto:exec |
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
pub fn reverse_string(s: &mut Vec<char>) { | |
if s.len() <= 1 { | |
return; | |
} | |
let mut i = 0; | |
let mut j = s.len() - 1; | |
while i != j && i < j { | |
s.swap(i, j); | |
i += 1; | |
j -= 1; |
NewerOlder