Skip to content

Instantly share code, notes, and snippets.

View aerosol's full-sized avatar
🌞
Praise the sun

hq1 aerosol

🌞
Praise the sun
View GitHub Profile
\documentclass[11pt,a4paper]{article}
\usepackage{polski}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\begin{document}
\fancyhf{}
\lhead{jTendo}
************* Module dilla
C: 1: Missing docstring
C: 10: Invalid name "log" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$)
C: 28:AbstractRecord.is_app: Missing docstring
C: 31:AbstractRecord.is_model: Missing docstring
C: 34:AbstractRecord.is_field: Missing docstring
C: 37:AbstractRecord.create_object: Missing docstring
C: 39:AbstractRecord.create_object: Invalid name "Klass" (should match [a-z_][a-z0-9_]{2,30}$)
C: 43:AbstractRecord.set_object_property: Missing docstring
W: 47:AbstractRecord.set_object_property: Used * or ** magic
#!/usr/bin/env python
# -*- coding: utf-8 *-*
import datetime
import itertools
class WeeklySchedule(object):
def __init__(self, timeline=None):
if timeline is None:
timeline = dict([(w,0) for w in range(7*24)])
#!/usr/bin/env python
naur = lambda a: [(ind,i) for ind,i in enumerate(a) if sum(a[:ind+1]) == sum(a[ind:])] or -1
print naur([1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 0, -1, 1, 2, 1])
@aerosol
aerosol / audit
Created February 7, 2011 17:44
A simple shell script for environment testing
#!/bin/bash
echo -e "\033[1mStarting environment audit\033[0m"
echo "----------------------------------------------------------------------------"
ERRORS=0
function h {
echo -e " > $1 ... \c"
}
function warn {
require 'rake/clean'
INCLUDE = "include"
ERLC_FLAGS = "-I#{INCLUDE} +warn_unused_vars +warn_unused_import"
SRC = FileList['src/*.erl']
OBJ = SRC.pathmap("%{src,ebin}X.beam")
CLEAN.include("ebin/*.beam")
directory 'ebin'
@aerosol
aerosol / gist:845683
Created February 26, 2011 22:23
exc#1 concurrency
-module(processes).
-compile(export_all).
% Interaction between processes, Concurrency
%
% 1. Write a function which starts 2 processes, and sends a message M
% times forewards and backwards between them. After the messages have been
% sent the processes should terminate gracefully.
init(PingPongCount) ->
@aerosol
aerosol / pr_ring.erl
Created March 12, 2011 18:52
Process ring struggle
-module(pr_ring).
-compile(export_all).
start(M, N, Message) ->
io:format("Starting ~p processes and sending ~p ~p~n", [N,M,Message]),
ProcessList = spawn_ring(M, N, []),
io:format("Spawned ~p~n", [ProcessList]),
hd(ProcessList) ! { Message, ProcessList }.
{sys, [
{lib_dirs, ["../.."]},
{rel, "mynode", "1",
[
mmsprofile,
appmon,
kernel,
stdlib,
sasl
]},
6> eventmon_db:show().
[{smsc_socket_closed},
{smsc_socket_closed},
{smsc_socket_closed},
{smsc_socket_closed}]
7> rr("sysevents.hrl").
[sysevent,sysevent_counter]
8> Event = #sysevent{}. %%% <--- DUMMY
#sysevent{eid = undefined,node = nonode@nohost,
request = undefined,status = undefined,