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
$Devs = (Get-NetAdapter | Where-Object -Property Name -Like vEthernet* | Where-Object -Property Status -Like "Not Present" ) | |
ForEach ($Dev in $Devs) { | |
$RemoveKey = "HKLM:\SYSTEM\Setup\Upgrade\NetworkDriverBackup\Control\Network\{4d36e972-e325-11ce-bfc1-08002be10318}\$($Dev.InstanceId)" | |
Remove-Item -Path $RemoveKey | |
} |
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
package main | |
import ( | |
"bytes" | |
"encoding/binary" | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"sync" |
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
#!/usr/bin/env python3 | |
import socket | |
import time | |
import threading | |
import signal | |
import sys | |
import os | |
sending = None | |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"strings" | |
"github.com/google/netstack/tcpip" | |
"github.com/google/netstack/tcpip/adapters/gonet" |
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 <cstdio> | |
#include <cstring> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
void zigzag(int m, int n) { | |
vector<vector<int> > ground(m); | |
for (size_t i = 0; i < m; i++) { | |
ground[i].resize(n); | |
} |
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 <random> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
vector<int> random_k_in_n(size_t k, int n) { // generate k distinct number in [0..n-1] | |
vector<int> ans; | |
ans.reserve(k); | |
std::random_device rd; |
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 <random> | |
#include <iostream> | |
using namespace std; | |
template< class RandomIt> | |
void partial_random_shuffle( RandomIt first, RandomIt last, RandomIt part) { | |
typename std::iterator_traits<RandomIt>::difference_type i, n, p; | |
p = part - first; | |
n = last - first; |
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 re | |
import sys | |
def main(): | |
for line in sys.stdin.readlines(): | |
line = re.sub(r'\\textbf\{(?P<value>(\d+)?\.\d+)\}', lambda g: g.group('value'), line) | |
maxval = 0.0 | |
for v in re.finditer(r'(?P<value>(\d+)?\.\d+)', line): | |
maxval = max(maxval, float(v.group('value'))) | |
def rep_func(group): | |
# print(float(group.group('value')) == maxval) |
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
{ | |
"name": "Ubuntu", | |
"comment": "Ubuntu default/theme terminal colors for tilix", | |
"use-theme-colors": false, | |
"foreground-color": "#ffffff", | |
"background-color": "#300a24", | |
"palette": [ | |
"#2e3436", | |
"#cc0000", | |
"#4e9a06", |
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 os | |
import os.path | |
import sys | |
import codecs | |
def main(): | |
print(sys.argv[1]) | |
for root, dirs, files in os.walk(sys.argv[1]): | |
for file in files: | |
if file.endswith('.h'): |
NewerOlder