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
class ApacheAnt < Formula | |
homepage "http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz" | |
url "http://archive.apache.org/dist/ant/binaries/apache-ant-1.7.1-bin.tar.gz" | |
sha1 "6344bb150f22dc335462bafa87de45085d51a5be" | |
def install | |
rm Dir["bin/*.{bat,cmd,dll,exe}"] | |
libexec.install Dir["*"] | |
bin.install_symlink Dir["#{libexec}/bin/*"] | |
if build.with? "ivy" |
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
package granat.dp.components.image; | |
import java.nio.file.DirectoryStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.util.Iterator; | |
public class TestIterate { | |
public static void main(String[] arg) throws Exception { |
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
<h2>Загрузка картинки</h2> | |
<form method="post" action="/admin/images/upload.json" enctype="multipart/form-data" id="image-upload-form" | |
data-success="/admin/images/"> | |
<div class="row"> | |
<div class="form-group col-md-6"> | |
<label for="image" class="control-label">картинка</label> | |
<input type="file" class="form-control" id="image" name="image" required/> | |
</div> | |
</div> | |
<button type="submit" class="btn btn-default">Сохранить</button> |
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
Mac-Pro:flac mitallast$ ls | |
metallica.flac | |
Mac-Pro:flac mitallast$ ffmpeg -i metallica.flac metallica.wav | |
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers | |
built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) | |
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-vda | |
libavutil 54. 31.100 / 54. 31.100 | |
libavcodec 56. 60.100 / 56. 60.100 | |
libavformat 56. 40.101 / 56. 40.101 | |
libavdevice 56. 4.100 / 56. 4.100 |
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
# retrieve_metric_avg.lua $operation_type | |
local operation_type = ARGV[1]; | |
local count = redis.call("HGET", "operations_count", operation_type) | |
local total = redis.call("HGET", "operations_total", operation_type) | |
if not count or not total then | |
return 0 | |
else | |
local avg = tonumber(total)/tonumber(count) | |
return tostring(avg) | |
end |
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
; -*- mode: clojure; -*- | |
; vim: filetype=clojure | |
(logging/init {:file "/var/log/riemann/riemann.log"}) | |
; Listen on the local interface over TCP (5555), UDP (5555), and websockets | |
; (5556) | |
(let [host "127.0.0.1"] | |
(tcp-server {:host host}) | |
(udp-server {:host host}) |
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
# -*- coding: utf-8 -*- | |
from grab import Grab | |
import logging | |
import pickledb | |
from urlparse import urlparse, parse_qs | |
# logging.basicConfig(level=logging.DEBUG) | |
db = pickledb.load('guitarplayer.db', False) | |
keywords = ['prs', 'paul', 'reed', 'smith', u'прс'] |
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
CREATE LANGUAGE PLPYTHONU; | |
CREATE OR REPLACE | |
FUNCTION merge_json(left JSON, right JSON) | |
RETURNS JSON AS $$ | |
import simplejson as json | |
def merge(source, destination): | |
for key, value in source.items(): | |
if isinstance(value, dict): | |
# get node or create one |
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
from pyspark.mllib.regression import LabeledPoint | |
from pyspark.mllib.classification import NaiveBayes | |
from pyspark.mllib.feature import HashingTF | |
textFile = sc.textFile("sells.csv") | |
htf = HashingTF(100000) | |
data = textFile.map(lambda line: line.split(',', 1)).map(lambda parts: LabeledPoint(parts[0], htf.transform(parts[1].split(" ")))) | |
d_train, d_test = data.randomSplit([0.6, 0.4]) | |
model = NaiveBayes.train(d_train) | |
prediction_and_labels = d_test.map(lambda point: (model.predict(point.features), point.label)) |
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
package org.questions; | |
import com.google.common.collect.Iterators; | |
import com.google.common.primitives.SignedBytes; | |
import com.google.common.primitives.UnsignedBytes; | |
import java.util.*; | |
public class Test { |
OlderNewer