This file contains hidden or 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
https://github.global.ssl.fastly.net/images/modules/contact/goldstar.gif |
This file contains hidden or 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
http://askubuntu.com/questions/410302/how-good-does-ubuntu-run-on-lenovo-y510p?rq=1 | |
this helped me http://askubuntu.com/a/290358 |
This file contains hidden or 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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(cua-mode t nil (cua-base)) | |
'(inhibit-startup-screen t) | |
'(make-backup-files nil)) | |
(custom-set-faces | |
;; custom-set-faces was added by Custom. |
This file contains hidden or 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 functools) | |
(defn parse [formatted] | |
(setv time_regex (.compile re "(\d+):?(\d{2}):(\d{2})")) | |
(setv s&m&h (map (fn [x] (if (empty? x) 0 (int x))) | |
(.group (.match time_regex formatted) | |
3 2 1))) | |
; (print (list (enumerate s&m&h))) | |
(functools.reduce sum |
This file contains hidden or 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
Before we take a closer look at consistent hashing in Swift, let’s | |
examine a simpler way in which one might determine where to store | |
objects. This will illustrate some of the fundamental problems that | |
need to be solved in order to efficiently add or remove capacity to a | |
cluster. | |
A _hash function_ takes in some data and outputs a number that | |
seemingly has nothing to do with the input but is actually completely | |
determined by it. This is useful for our purposes, because we want a | |
predictable way to assign objects to devices, but we don't want our |
This file contains hidden or 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
def underscores_to_hyphens(string) | |
string.gsub!('_', '-') | |
end |
This file contains hidden or 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
I'm having trouble verifying the container creation with cURL; as before, I can auth, but I can't do anything else. Not sure what I'm doing wrong ... | |
curl -v -H 'X-Auth-User: test:tester' -H 'X-Auth-Key: testing' http://localhost:8080/auth/v1.0/ | |
* About to connect() to localhost port 8080 (#0) | |
* Trying 127.0.0.1... connected | |
> GET /auth/v1.0/ HTTP/1.1 | |
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3 | |
> Host: localhost:8080 | |
> Accept: */* | |
> X-Auth-User: test:tester |
This file contains hidden or 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
{ | |
"id": "2036184099", | |
"type": "DeleteEvent", | |
"actor": { | |
"id": 903479, | |
"login": "openstack-gerrit", | |
"gravatar_id": "319605a7b6f36f2cd80214b2fc4d0e92", | |
"url": "https://api.github.com/users/openstack-gerrit", | |
"avatar_url": "https://avatars.githubusercontent.com/u/903479?" | |
}, |
This file contains hidden or 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
from string import ascii_uppercase | |
ALPHABET = " "+ascii_uppercase | |
CHAR_TO_INT = dict(zip(ALPHABET, range(27))) | |
INT_TO_CHAR = dict(zip(range(27), ALPHABET)) | |
def pad(text, chunk_size): | |
return text + ' '*(chunk_size - len(text) % chunk_size) | |
def chunkify(text, chunk_size): |