Skip to content

Instantly share code, notes, and snippets.

(defn update-count
[word counter-atom]
(swap! counter-atom update word #(if %1 (inc %1) 1)))
(defn process-quote
[q counter-atom]
(let [quote-words (clojure.string/split q #"\W+")
lowercased-words (map clojure.string/lower-case quote-words)]
(doseq [word lowercased-words]
(update-count word counter-atom))))
import json
import fileinput
import urllib.request
import sys
key = ""
url = "https://dictionary.yandex.net/api/v1/dicservice.json/lookup?key=" + \
key + \
"&lang=en-ru&text="
count = 0
@posobin
posobin / things.md
Last active January 20, 2016 23:31
Things I am using

Things I am using

Software

  1. Linux
  2. Arch
  3. Google Chrome
  4. urxvt
  5. awesome
  6. vim
  7. tmux
#!/bin/sh
header='\
<html>\
<head>\
<meta charset="utf-8"> \
<meta name="viewport" content="width=device-width, initial-scale=1.0">\
<link rel="stylesheet" href="http://cmcenroe.me/writ/writ.min.css"> \
<style>\
a { background-size: 16px; \
#include <iostream>
#include <vector>
template <size_t N, class ElementType>
class Tensor
{
std::vector<Tensor<N - 1, ElementType>> data_;
public:
Tensor<N - 1, ElementType>& operator[](size_t index)
@posobin
posobin / Wiki articles
Created December 8, 2014 23:09
Probability that you will end up at certain article of simple.wikipedia.org after following many links randomly.
This file has been truncated, but you can view the full file.
"./data3/1417546292 485560280.links" /wiki/Multimedia 0.00670003
"./data3/1417546461 1540232676.links" /wiki/Category:Stubs 0.00475996
"./data3/1417546603 1196556829.links" /wiki/Category:Technology_stubs 0.00411486
"./data3/1417546354 885799631.links" /wiki/Category:Geography_stubs 0.0036936
"./data3/1417546346 1782280524.links" /wiki/United_States 0.00361906
"./data3/1417546358 712633417.links" /wiki/Definition 0.00254944
"./data3/1417546597 1514346896.links" /wiki/Category:Math_stubs 0.00253875
"./data3/1417546612 1536129205.links" /wiki/Category:Science_stubs 0.00237955
"./data3/1417546473 202029501.links" /wiki/International_Standard_Book_Number 0.00232193
"./data3/1417546486 1312712376.links" /wiki/Category:Biology_stubs 0.00220784