Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
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 | |
| asyncdispatch, asyncnet, htmlparser, xmltree, httpclient, strutils, | |
| strtabs, streams, uri, sets | |
| var visited = initSet[string]() | |
| proc crawl(url: string, client: PAsyncHttpClient = newAsyncHttpClient()) {.async.} = | |
| if url in visited: return # Already visited this URL. | |
| echo("Crawling ", url) | |
| visited.incl(url) |
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
| You can create a new empty branch like this: | |
| $ git checkout --orphan NEWBRANCH | |
| --orphan creates a new branch, but it starts without any commit. After running the above command you are on a new branch "NEWBRANCH", and the first commit you create from this state will start a new history without any ancestry. | |
| The --orphan command keeps the index and the working tree files intact in order to make it convenient for creating a new history whose trees resemble the ones from the original branch. | |
| Since you want to create a new empty branch that has nothing to do with the original branch, you can delete all files in the new working directory: |
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 sys import argv | |
| import re | |
| # open the file and get read to read data | |
| file = open(argv[1], "r"); | |
| p = re.compile("\d+"); | |
| # initialize the graph | |
| vertices, edges = map(int, p.findall(file.readline())) | |
| graph = [[0]*vertices for _ in range(vertices)] |
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
| #!/usr/bin/env python | |
| import sqlite3 | |
| class dbopen(object): | |
| """ | |
| Simple CM for sqlite3 databases. Commits everything at exit. | |
| """ | |
| def __init__(self, path): | |
| self.path = path |
- https://dancres.github.io/Pages/
- https://ferd.ca/a-distributed-systems-reading-list.html
- http://the-paper-trail.org/blog/distributed-systems-theory-for-the-distributed-systems-engineer/
- https://github.com/palvaro/CMPS290S-Winter16/blob/master/readings.md
- http://muratbuffalo.blogspot.com/2015/12/my-distributed-systems-seminars-reading.html
- http://christophermeiklejohn.com/distributed/systems/2013/07/12/readings-in-distributed-systems.html
- http://michaelrbernste.in/2013/11/06/distributed-systems-archaeology-works-cited.html
- http://rxin.github.io/db-readings/
- http://research.microsoft.com/en-us/um/people/lamport/pubs/pubs.html
- http://pdos.csail.mit.edu/dsrg/papers/
A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.
##Creating the DMG file #Disk Utility
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
| (in-package :cl-user) | |
| (eval-when (:compile-toplevel :load-toplevel :execute) | |
| (ql:quickload :alexandria) | |
| (ql:quickload :fiveam)) | |
| (defpackage :sort | |
| (:use :cl) | |
| (:import-from :alexandria :iota) | |
| (:export :bubble-sort/naive :bubble-sort/not-enough :bubble-sort/knuth |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"