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 -*- | |
import string | |
vowels, consonants = 'aąeęioóuy', 'bcćdfghjklłmnńpqrsśtvwxzźż' | |
trans = string.maketrans(vowels + consonants, 'V' * len(vowels) + 'C' * len(consonants)) | |
patterns = [w.lower().translate(trans, string.punctuation + string.digits) for w in open('in.txt', 'r').read().split()] | |
for p, count in sorted(dict((p, patterns.count(p)) for p in set(patterns)).iteritems(), key=lambda (k,v): (v,k), reverse=True): | |
print '%24s: %d' % (p, count) |
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
/** | |
* Playing the Imperial March from Star Wars. | |
* | |
* Notes and timings found at: | |
* http://processors.wiki.ti.com/index.php/Playing_The_Imperial_March | |
*/ | |
#include "aquila/source/generator/SineGenerator.h" | |
#include "aquila/wrappers/SoundBufferAdapter.h" | |
#include <SFML/Audio.hpp> |
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
Aquila::SineGenerator generator(44100); | |
generator.setAmplitude(2000).setFrequency(500).generate(10 * 44100); | |
Aquila::WaveFile::save(generator, "L:\\sin.wav"); |
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 django.contrib import comments | |
from django.contrib.contenttypes.models import ContentType | |
from django.db import connection | |
from django.db import models | |
from django.utils.datastructures import SortedDict | |
class RecentManagerMixin(object): | |
pub_date_field_name = 'pub_date' |
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
--- D:/Python26/Lib/site-packages/django_notification-0.1.4-py2.6.egg/notification/views.py Tue Jun 08 14:21:04 2010 | |
+++ D:/Python26/Lib/site-packages/django_notification-0.1.4-py2.6.egg/notification/views2.py Tue Jun 08 14:21:12 2010 | |
@@ -19,7 +19,7 @@ | |
@login_required | |
def notices(request): | |
notice_types = NoticeType.objects.all() | |
- notices = Notice.objects.notices_for(request.user, on_site=True) | |
+ notices = Notice.objects.notices_for(request.user, on_site=True).select_related(depth=1) | |
settings_table = [] | |
for notice_type in NoticeType.objects.all(): |
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
#include "aquila/tools/TextPlot.h" | |
#include <cstddef> | |
int main(int argc, char *argv[]) | |
{ | |
const std::size_t SIZE = 64; | |
int arr[SIZE]; | |
for (std::size_t i = 0; i < SIZE; ++i) | |
{ | |
arr[i] = i % 10; |
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
defmodule Functools do | |
def reduce(func, [head|tail], acc) do | |
reduce(func, tail, func.(head, acc)) | |
end | |
def reduce(_func, [], acc) do | |
acc | |
end | |
def map(func, [head|tail]) do |
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
./configure --enable-perlinterp \ | |
--enable-pythoninterp \ | |
--enable-rubyinterp \ | |
--enable-cscope \ | |
--enable-gui=auto \ | |
--enable-gtk2-check \ | |
--enable-gnome-check \ | |
--with-features=huge \ | |
--enable-multibyte \ | |
--with-x \ |
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 functools | |
import types | |
@functools.singledispatch | |
def fmap(value, fun): | |
return value | |
@fmap.register(list) |
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 sh | |
set -eu | |
IFS=$'\n\t' | |
PREFIX="workon siciarz.net" | |
gnome-terminal \ | |
--maximize \ | |
--working-directory=Development/siciarz.net \ | |
--tab \ | |
--title="editor" \ |