Первоначально задача возникла в https://t.me/haskellru и формулировалась примерно так: почему следующий код на Haskell
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
--- SDL-1.2.14/src/video/x11/SDL_x11modes.c 2009-10-13 01:07:15.000000000 +0200 | |
+++ SDL-1.2.14/src/video/x11/SDL_x11modes.c 2011-12-04 12:34:55.000000000 +0100 | |
@@ -33,7 +33,7 @@ | |
#include "SDL_x11modes_c.h" | |
#include "SDL_x11image_c.h" | |
-/*#define X11MODES_DEBUG*/ | |
+#define X11MODES_DEBUG | |
#define MAX(a, b) (a > b ? a : b) |
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
#!/bin/bash | |
# | |
# Due to a bug in Go, you can't `go get` a private Bitbucket repository | |
# (issue #5375, linked below). This means you can't `go get ./...` ANY project | |
# that might depend on a private Bitbucket repository. | |
# | |
# This script works around it by detecting Bitbucket imports and using | |
# `git` directly to clone into it. This will not work if you use private | |
# Mercurial repositories on Bitbucket. | |
# |
| ns/op | op/s | MdAPE | benchmark
|--------------------:|--------------------:|--------:|:----------------------------------------------
| 3.03 | 329,748,861.72 | 3.2% | `(a + b) / 2`
| 3.01 | 332,744,047.95 | 4.1% | `a + ((b - a) / 2)`
| 3.01 | 331,690,526.09 | 2.3% | `A/2 + B/2 + (A & B & 1)`
| 3.13 | 318,986,706.11 | 2.3% | `std::midpoint()`
Pick a scylla version: https://hub.docker.com/r/scylladb/scylla/tags
This tuturial was created with 3.1.0.rc9
on Linux
docker run --name scylla-si -d scylladb/scylla:3.1.0 --smp 2 --memory 4G
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 ycm_core | |
from clang_helpers import PrepareClangFlags | |
# Set this to the absolute path to the folder (NOT the file!) containing the | |
# compile_commands.json file to use that instead of 'flags'. See here for | |
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html | |
# Most projects will NOT need to set this to anything; you can just change the | |
# 'flags' list of compilation flags. Notice that YCM itself uses that approach. | |
compilation_database_folder = '' |
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
#!/bin/bash | |
source /etc/environment | |
name=$(cat /etc/machine-id) | |
if [ ! -f /opt/consul ]; then | |
mkdir /opt | |
mkdir /var/lib/consul | |
curl http://storage.googleapis.com/ifup-org-tilde/consul-0.2.0-linux-x86-64.lzma | lzcat > /opt/consul | |
chmod +x /opt/consul |
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: Group by Distribution | |
hosts: all | |
tasks: | |
- group_by: key=${ansible_distribution} | |
- name: Set Time Zone | |
hosts: Ubuntu | |
gather_facts: False | |
tasks: | |
- name: Set timezone variables |
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
// FileSaver.min.js | |
(function(a,b){if("function"==typeof define&&define.amd)define([],b);else if("undefined"!=typeof exports)b();else{b(),a.FileSaver={exports:{}}.exports}})(this,function(){"use strict";function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Depricated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;return b.open("HEAD",a,!1),b.send(),200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"==typeof |
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/python | |
# to try this you'll need to edit in the name of your ruby binary and install bcc-tools | |
# bcc installation instructions are at https://github.com/iovisor/bcc/blob/master/INSTALL.md | |
from __future__ import print_function | |
from bcc import BPF | |
from time import sleep | |
import os | |
# load BPF program |
OlderNewer