This works as expected:
# export PIP_NO_INDEX=true
# export PIP_FIND_LINKS=http://xsce.activitycentral.com/wheelhouse/pip/
def expand_tree_diagram(a_list, a_branch = []): | |
if a_list == []: | |
return [a_branch] | |
else: | |
result = [] | |
for a_leaf in a_list[0]: | |
result += expand_tree_diagram(a_list[1:], a_branch + [a_leaf]) | |
return result | |
if __name__ == '__main__': |
#!/usr/bin/env python | |
import subprocess | |
import sys | |
# To create the database: | |
# | |
# $ mysqladmin -u root create cvsanaly_android | |
# > CREATE USER 'cvsanaly'@'localhost' IDENTIFIED BY 'cvsanaly'; | |
# > GRANT ALL ON cvsanaly_android.* TO 'cvsanaly'@'localhost'; |
#!/usr/bin/Rscript --vanilla --default-packages=utils | |
# | |
# (c) 2012 Miguel Gonzalez <migonzalvar@gmail.com> | |
# | |
# This work is licensed under a Creative Commons Attribution 3.0 Unported | |
# License. (CC BY 3.0) | |
# | |
# Data source: http://www.vig-bay.com/index.php?option=com_content&view=article&id=518&Itemid=164 | |
str_to_seconds <- function(s){ |
import os | |
import re | |
import time | |
import subprocess | |
import ajenti | |
from ajenti.api import * | |
from ajenti.api.http import * | |
from ajenti.plugins import manager |
%define git_version %(git describe --tags 2> /dev/null || echo 0.0-`git log --oneline | wc -l`-g`git describe --always`) | |
%define git_get_ver %(echo %{git_version} | sed 's/^v\\?\\(.*\\)-\\([0-9]\\+\\)-g.*$/\\1/;s/-//') | |
%define git_get_rel %(echo %{git_version} | sed 's/^v\\?\\(.*\\)-\\([0-9]\\+-g.*\\)$/\\2/;s/-/_/') | |
Name: xsce-virtual | |
Summary: XSCE virtual package to isolate xs-config and xs-tools dependencies | |
Version: %git_get_ver | |
Release: %git_get_rel | |
License: GPLv3 |
#!/usr/bin/env python | |
"""Create a square image. Usage: | |
$ imageholder.py filename size color | |
""" | |
import sys |
#! /usr/bin/env python3 | |
""" grep.py - Search a string in a file. """ | |
import sys | |
# Parse arguments | |
pattern, file_name = sys.argv[1:3] | |
with open(file_name, 'rt') as f: |