A script to fix EDID problems on external monitors in macOS.
-
Connect only the problem display.
-
Create this directory structure (if it doesn't already exist):
RANGE QUERY | |
Given a (big) array r[0..n-1], and a lot of queries of certain type. We may want to pre-process the data so that each | |
query can be performed fast. In this section, we use T (f, g) to denote the running time for an algorithm is O(f(n)) | |
for pre-processing, and O(g(n)) for each query. | |
If the queries are of type getsum(a, b), which asks the sum of all the elements between a and b, inclusive, | |
we have a T (n, 1) algorithm: Compute s[i] to be the sum from r[0] to r[i-1], inclusive, then getsum(a,b) simply | |
returns s[b+1]-s[a]. |
var socket = io.connect('http://localhost'); | |
var startTime; | |
setInterval(function() { | |
startTime = Date.now(); | |
socket.emit('ping'); | |
}, 2000); | |
socket.on('pong', function() { | |
latency = Date.now() - startTime; |
import ( | |
"crypto/md5" | |
"encoding/hex" | |
) | |
func GetMD5Hash(text string) string { | |
hasher := md5.New() | |
hasher.Write([]byte(text)) | |
return hex.EncodeToString(hasher.Sum(nil)) | |
} |
let g:ctrlp_buffer_func = { 'enter': 'CtrlPMappings' } | |
function! CtrlPMappings() | |
nnoremap <buffer> <silent> <C-@> :call <sid>DeleteBuffer()<cr> | |
endfunction | |
function! s:DeleteBuffer() | |
let path = fnamemodify(getline('.')[2:], ':p') | |
let bufn = matchstr(path, '\v\d+\ze\*No Name') | |
exec "bd" bufn ==# "" ? path : bufn |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
void computeLPSarray(char *pat, int M, int *lps) | |
{ | |
int len = 0; //lenght of previous longest prefix suffix | |
int i ; | |
lps[0] = 0 ; //lps[0] is always 0 |
#include "game.h" | |
#define MAXR 1000000000 | |
#define MAXC 1000000000 | |
#include <assert.h> | |
#include <stddef.h> | |
long long gcd2(long long X, long long Y) { | |
if(X == 0 || Y == 0) { |
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger ([email protected]) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
# Inspired from http://blog.hio.fr/2011/09/17/doctrine2-yaml-mapping-example.html | |
MyEntity: | |
type: entity | |
repositoryClass: MyRepositoryClass | |
table: my_entity | |
namedQueries: | |
all: "SELECT u FROM __CLASS__ u" | |
# Class-Table-Inheritance |