Skip to content

Instantly share code, notes, and snippets.

@mebubo
mebubo / deposit.py
Last active December 14, 2015 19:29
человек кладет сумму Х на депозит под 10% годовых на 30 лет. и каждый год добавляет туда еще Х. сколько будет через 30 лет? пусть f(n) кол-во денег через n лет f(0) = x f(n) = 1.1*f(n-1) + x (для n>0)
#!/usr/bin/python
def f(n, x, coeff=0.1):
if n == 0:
return x
else:
return (1 + coeff) * f(n - 1, x, coeff) + x
#!/bin/sh
DEVICE=sdf
mkfs.vfat -n multipass01 /dev/$DEVICE1
mount /dev/$DEVICE1 /mnt/
grub-install --no-floppy --root-directory=/mnt /dev/$DEVICE
@mebubo
mebubo / FFN.java
Created July 6, 2013 22:09
f(f(n)) == -n
import org.junit.Assert;
public class FFN {
public static int f(int n) {
if (n > 0) {
if (n % 2 == 0) {
return n - 1;
} else {
return -n - 1;
--- /usr/share/awesome/lib/awful/widget/tasklist.lua.orig 2013-07-13 02:15:19.049306959 +0200
+++ /usr/share/awesome/lib/awful/widget/tasklist.lua 2013-07-13 02:15:38.653306600 +0200
@@ -97,7 +97,7 @@
if not (c.skip_taskbar or c.hidden
or c.type == "splash" or c.type == "dock" or c.type == "desktop")
and filter(c, s) then
- table.insert(clients, c)
+ table.insert(clients, 1, c)
end
end
#!/usr/bin/env python
import random
words = ["jaune", "jeûne", "jeune"]
for c, w in [(i+1, random.choice(words)) for i in range(20)]:
print "%02d" % c, w
/usr/lib/ubiquity/ubiquity/misc.py
min_install_size = 1024 * 1024 * 1024
#!/bin/bash
REPOS=$HOME/txt/
save () {
emacsclient -e "(save-some-buffers t (lambda () (derived-mode-p 'org-mode)))"
}
commit () {
for REPO in $REPOS; do
#!/bin/sh
USERNAME=$1
. /etc/rc.common
dscl . create /Users/$USERNAME
dscl . create /Users/$USERNAME RealName "$USERNAME Account"
dscl . create /Users/$USERNAME hint "Password Hint"
dscl . passwd /Users/$USERNAME thisistheaccountpassword
dscl . create /Users/$USERNAME UniqueID 546
# aptitude install libdbus-1-dev libtiff5-dev libgif-dev libjpeg8-dev libxpm-dev texinfo
./autogen.sh
./configure --prefix=$HOME/opt/emacs24 --with-x-toolkit=gtk3 --without-gsettings
make
make install
| Title | Artist | Album | |
|-------------------------------------------------------+--------------------------------------+------------------------------------------------------+-------|
| Cabaret Blanc | Olivia Ruiz | La Femme Chocolat | 04:10 |
| Ils Ont Changé Ma Chanson | Arno - Stephan Eicher | Le Best Of | 03:58 |
| L'Autre Bout Du Monde | Emily Loizeau | L'Autre Bout Du Monde | 03:18 |
| Louxor J'Adore (Katerine vs Joachim Garraud) | Katerine | Louxor J'Adore | 03:07 |
| Sabali | Amadou