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 java.util.LinkedHashMap; | |
import java.util.Map; | |
class FixedMap<K,V> extends LinkedHashMap<K,V> { | |
private int max_capacity; | |
public FixedMap(int initial_capacity, int max_capacity) { | |
super(initial_capacity, 0.75f, true); | |
this.max_capacity = max_capacity; | |
} |
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 | |
# vim: set fileencoding=utf-8 ts=2 sw=2 expandtab: | |
# PUBLIC DOMAIN | |
# This script trims white margins out of PDF document and packs it to DjVu. | |
# Author Sergei Astanin http://sovety.blogspot.com/ | |
# Modified by Vsevolod K. https://github.com/precious | |
### Settings |
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/env python | |
# adjvold -- dbus service for volume adjusting with an optional GTK progressbar | |
# | |
# Copyright (C) 2009 Adrian C. <anrxc_sysphere_org> | |
# Modified by 2011 Seva K. <vs.kulaga_gmail_com> | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or |
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
REM ***** BASIC ***** | |
Option Explicit | |
Sub Main | |
Dim oDocument | |
Dim oSelectedCells | |
Dim oActiveCells | |
Dim oSheet |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script> | |
function handleFileSelect(input,callback) { | |
// used links: | |
// http://www.w3.org/TR/file-upload/ |
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
(defun natural (a) | |
(and (integerp a) (> a 0)) | |
) | |
(defun fib (x) | |
(if (and (integerp x) (>= x 0)) | |
(if (< x 2) | |
1 | |
(+ (fib (- x 1)) (fib (- x 2))) | |
) |
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 | |
# -*- coding: utf-8 -*- | |
from math import * | |
import sys | |
# generator for values [a,b] with step 'step' | |
def frange(a,b,step): | |
while a <= b: | |
yield a | |
a += step |
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
children(Parent,L) :- findall(Next,parent(Parent,Next),L). | |
ancestors(Child,L) :- findall(Next,parent(Next,Child),L). | |
repr_internal(Elem,L,R) :- (L == [] -> ancestors(Elem,R); children(Elem,R)). | |
repr_retval(Elem,R) :- children(Elem,L), repr_internal(Elem,L,R). | |
repr(Elem):- repr_retval(Elem,R), write(R). | |
read_line_pls(L) :- read_line(X),string_to_atom(X,L). | |
main :- |
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
delim(){ | |
if [ -n "`/home/precious/programming/c/git_branch/git-br`" ]; then | |
echo '|' | |
fi | |
} | |
export PS1='\[\e[0;36m\]$?\[\e[0m\]|\[\e[0;31m\]`/home/precious/programming/c/git_branch/git-br`\[\e[0m\]$(delim)\[\e[0;35m\]\u\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ ' |
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 | |
import sys | |
class BashFileIterator: | |
def __init__(self, src): | |
self.src = src | |
self.reset() | |
def reset(self): |
OlderNewer