Skip to content

Instantly share code, notes, and snippets.

def quick(a)
return a if a.min == a.max
m = a[rand(a.size)]
quick( a.select { |i| i <= m } ) + quick( a.select { |i| i > m } )
end
describe "Quicksort" do
it "should sort an empty array" do
quick([]).should == []
end
eruption извержение
astound изумлять, поражать
summit вершина
destroy разрушать,уничтожать
tear разрывать
disintegrate раздроблять, разделять(ся) на составные части
devastate разорять
event событие, происшествие
edge кромка, край
stir шевелить(ся)
@cypok
cypok / shim.asm
Created May 12, 2010 10:20 — forked from NIA/timer5.asm
.warmst equ $ff7c
tcnt equ $100e
tctl1 equ $1020
tctl2 equ $1021
tic1 equ $1010
toc2 equ $1018
tflg1 equ $1023
cforc equ $100b
incident/accident/case случай
distinguished выдающийся, знаменитый
faith вера
conduct поведение
ascent восхождение, подъём
bright яркий, блестящий, умный
daring дерзкий
be concerned with/deal with заниматься, интересоваться
sustain поддерживать (горение, реакцию)
explosive взрывчатка
@cypok
cypok / main.c
Created March 30, 2012 11:35 — forked from anonymous/main.c
Феерическое прухло
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include "stack.h"
int check(char* expression){
int i;
for(i=0; i<= strlen(expression); i++){
if(expression[i]=='(')
@cypok
cypok / Tree.scala
Last active December 22, 2015 03:18 — forked from vkostyukov/Tree.scala
import scala.annotation.tailrec
object TestRun extends App {
val tree = Leaf.add(10).add(5).add(7)
println(tree.valuesByBreadth mkString ", ")
}
abstract sealed class Tree[+A] {
import Ordered._
@cypok
cypok / truecolor.rb
Last active December 25, 2015 10:39 — forked from NIA/truecolor.rb
#!/usr/bin/env ruby
# Usage example: sml hw1test.sml | truecolor.rb
require 'colorize'
true_pat = /\btrue\b/
false_pat = /\bfalse\b/
true_count = 0