Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandru Stan amstan

View GitHub Profile
View kdevelop_blocking_editor.sh
#!/bin/bash
export KDEV_DBUS_ID=$(qdbus|grep kdevplatform)
absfile=$1
qdbus $KDEV_DBUS_ID /org/kdevelop/DocumentController org.kdevelop.DocumentController.openDocumentSimple $absfile
echo "Waiting for kdevelop to close all tabs with $absfile."
while true ; do
kdevelop_absfiles=$(qdbus $KDEV_DBUS_ID /org/kdevelop/DocumentController org.kdevelop.DocumentController.activeDocumentPaths)
@amstan
amstan / amstan.py
Created Jun 3, 2012
amstan function
View amstan.py
#!/usr/bin/env python2
#-*- coding:utf-8 -*-
def bitlist(x):
return reversed(map(int,bin(x)[2:]))
def amstan(x,k=0):
"""Computes amstan's function. k=0 returns just a bitcount of x, k=1 returns just x, anything in between is magic!"""
bits=bitlist(x)
View too many folders!
amstan@ltfs1110:/home/contest/ai-contest/planet_wars/submissions$ ls -altr|wc
32001 256002 2111994
amstan@ltfs1110:/home/contest/ai-contest/planet_wars/submissions$ mkdir amstan-test-folder
mkdir: cannot create directory `amstan-test-folder': Too many links
You can’t perform that action at this time.