Skip to content

Instantly share code, notes, and snippets.

Elias Dorneles eliasdorneles

Block or report user

Report or block eliasdorneles

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eliasdorneles
eliasdorneles / plot_event_times.py
Last active May 27, 2019
Script to plot event times from a log quickly
View plot_event_times.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Plot events over a time axis
"""
# Relies on matplotlib and dateutil
from __future__ import print_function, absolute_import, division
import sys
import dateutil.parser
import datetime
@eliasdorneles
eliasdorneles / urwid_master_detail.py
Last active Sep 4, 2018
Sample implementation of Master-Detail UI problem for the console using urwid, written to answer an SO question: https://stackoverflow.com/a/52174629/149872
View urwid_master_detail.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Sample program demonstrating how to implement widgets for a master-detail UI
for a list of records using the urwid library (http://urwid.org)
"""
from __future__ import print_function, absolute_import, division
from functools import partial
import urwid
View voc-stdlib-support-status.html
<html>
<head>
<title>VOC stdlib modules status</title>
<style>
body {
font: 1.2em "Open Sans", sans-serif;
}
.td {
padding: 2px 0;
border: 1px solid #444;
@eliasdorneles
eliasdorneles / runspider.sh
Last active Apr 20, 2018
Script to run spider, saving log output and stuff
View runspider.sh
#!/bin/bash
set -e
abort() {
echo "$*"; exit 1;
}
usage() {
echo $*
View diff-after-compile-and-run.sh
#!/bin/bash
# This script assumes you're using the directory layout described in the
# documentation at: https://voc.readthedocs.io/en/latest/tutorials/tutorial-0.html
set -e
#set -x
abort() {
echo "$*"; exit 1;
}
@eliasdorneles
eliasdorneles / bytecode.java
Created Oct 15, 2017
Running python -m voc.java over test class
View bytecode.java
Magic: cafebabe
Version: 50.0
Constant pool: (160 constants)
1: <Class python/buglong/SomeClass>
2: b'python/buglong/SomeClass'
3: <Class org/python/types/Object>
4: b'org/python/types/Object'
5: b'__VOC__'
6: b'Lorg/python/Object;'
7: b'class$init'
View error_with_toga_android_from_master.txt
```
09-20 00:56:18.909 4981 4981 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testhello/android.PythonActivity}: NameError: name '__all__' is not defined
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.app.ActivityThread.-wrap12(ActivityThread.java)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
09-20 00:56:18.909 4981 4981 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6077)
09-20 00:56:18.909
@eliasdorneles
eliasdorneles / log-analysis-result.txt
Last active May 21, 2017
Log of Ouroboros compilation attempt using VOC
View log-analysis-result.txt
$ egrep '^[a-zA-Z]+Error' log-compilation-full.txt | sed 's/object at 0x[^>]\+/object at 0x.../' | sort | uniq -c | sort -nr
260 AttributeError: 'Attribute' object has no attribute 'id'
82 NotImplementedError: Unknown context <_ast.Del object at 0x...>
76 NotImplementedError: Don't know how to resolve multiple comparators
40 AttributeError: 'NoneType' object has no attribute '_fields'
29 AttributeError: 'Class' object has no attribute 'add_class'
26 NotImplementedError: No handler for YieldFrom
26 NameError: <generator>
22 AttributeError: 'TRY' object has no attribute 'next_op'
20 TypeError: expected AST, got 'NoneType'
@eliasdorneles
eliasdorneles / rc_logo.py
Created May 9, 2017
RC Logo -- Code Dojo for NGW
View rc_logo.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urwid
LOGO = '''
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMM MMM
MMM MMMMMMMMMMMMMMMMMMMMMMMMMMM MMM
@eliasdorneles
eliasdorneles / square.py
Created Apr 25, 2017
Draw a square in the screen, move it with arrow keys -- experimenting with urwid
View square.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Draw a square in the screen, move it with arrow keys
"""
from __future__ import print_function, absolute_import, division
import urwid
BLOCK = u"""
You can’t perform that action at this time.