... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| #! /bin/sh | |
| # | |
| # virtuoso OpenLink Virtuoso Open-Source Edition | |
| # | |
| # Written by OpenLink Virtuoso Maintainer | |
| # <vos.admin@openlinksw.com> | |
| # | |
| # Adapted for CentOS 6.0 | |
| # | |
| # sources |
... or Why Pipelining Is Not That Easy
Golang Concurrency Patterns for brave and smart.
By @kachayev
| var benchmarkQueries = []struct { | |
| message string | |
| query string | |
| tag string | |
| expect []string | |
| }{ | |
| // Easy one to get us started. How quick is the most straightforward retrieval? | |
| { | |
| message: "name predicate", |
(by @andrestaltz)
So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).
Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:
Rx.Observable.prototype.flatMapLatest(selector, [thisArg])
Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.
| class Graph: | |
| def __init__(self): | |
| self.nodes = set() | |
| self.edges = defaultdict(list) | |
| self.distances = {} | |
| def add_node(self, value): | |
| self.nodes.add(value) | |
| def add_edge(self, from_node, to_node, distance): |
| def adj(g): | |
| """ | |
| Convert a directed graph to an adjacency matrix. | |
| Note: The distance from a node to itself is 0 and distance from a node to | |
| an unconnected node is defined to be infinite. | |
| >>> g = {1: {2: 3, 3: 8, 5: -4}, |
| #!/usr/bin/env python2 | |
| # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org) | |
| # The author disclaims copyright to this source code. | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
| M[16],X=16,W,k;main(){T(system("stty cbreak") | |
| );puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i | |
| ,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M | |
| [w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<< | |
| (l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k) | |
| ]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d | |
| -1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X] | |
| *i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4; | |
| )s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4|| | |
| puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2 |
| /** @jsx React.DOM */ | |
| /** | |
| * Our component structure will look like the following: | |
| * - WikiBox | |
| * -- AutoCompleteBox | |
| * --- AutoComplete | |
| */ | |
| // this component renders a single entity coming from wikipedia |
| #!/bin/sh | |
| # This is for Redhat 64 bit versions of Linux with `createrepo` installed. If you | |
| # do not have createrepo, you can install it with: | |
| # yum install -y createrepo | |
| # Change DESTDIR path to RPMS directory of your repo | |
| DESTDIR="/var/www/repo/rhel/6" | |
| for ARCH in x86_64 |