This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
from bigchaindb_driver import BigchainDB | |
from bigchaindb_driver.crypto import generate_keypair | |
keyfile = 'keys.json' | |
bdb = BigchainDB( 'http://localhost:9984') | |
msg = '*'*100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== Building 'vboxdrv' module === | |
make[1]: Entering directory '/usr/src/kernel-modules/virtualbox/src/vboxdrv' | |
Makefile:190: Warning: using /usr/src/linux as the source directory of your Linux kernel. If this is not correct, specify KERN_DIR=<directory> and run Make again. | |
make KBUILD_VERBOSE= SUBDIRS=/usr/src/kernel-modules/virtualbox/src/vboxdrv SRCROOT=/usr/src/kernel-modules/virtualbox/src/vboxdrv CONFIG_MODULE_SIG= -C /usr/src/linux -j4 modules | |
make[2]: Entering directory '/usr/src/linux-4.13.1-1' | |
ERROR: Kernel configuration is invalid. | |
include/generated/autoconf.h or include/config/auto.conf are missing. | |
Run 'make oldconfig && make prepare' on kernel src to fix it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ajung@blackmoon ~ $ sudo /sbin/vboxconfig | |
Building kernel modules... | |
Build of VirtualBox host kernel modules failed. | |
Look at /var/log/virtualbox.log to find reasons. | |
ajung@blackmoon ~ $ sudo cat /var/log/virtualbox.log | |
=== Building 'vboxdrv' module === | |
make[1]: Entering directory '/usr/src/kernel-modules/virtualbox/src/vboxdrv' | |
Makefile:187: *** Error: unable to find the sources of your current Linux kernel. Specify KERN_DIR=<directory> and run Make again. Stop. | |
make[1]: Leaving directory '/usr/src/kernel-modules/virtualbox/src/vboxdrv' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def memoize(function): | |
def wrapper(*args, **kwargs): | |
key = (args, frozenset(kwargs.items())) | |
instance = args[0] | |
if not hasattr(instance, '__cache'): | |
instance.__cache = {} | |
if key not in instance.__cache: | |
instance.__cache[key] = function(*args, **kwargs) | |
return instance.__cache[key] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import random | |
import psycopg2 | |
import pdb; pdb.set_trace() | |
conn = psycopg2.connect(database='foo', user='root', host='localhost', port=26257) | |
cursor = conn.cursor() | |
cursor.execute('create table series(created timestamp, unit text, unit2 text, measurement text, ym text, value int)') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
order = DT_ORDER_BY; | |
} catch(e) { | |
order = [0, "asc"]; | |
} | |
var editor = new $.fn.dataTable.Editor( { | |
ajax: '/api/staff', | |
table: '#listing', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
order = DT_ORDER_BY; | |
} catch(e) { | |
order = [0, "asc"]; | |
} | |
var editor = new $.fn.dataTable.Editor( { | |
ajax: '/api/staff', | |
table: '#listing', | |
fields: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(document).ready( function () { | |
try { | |
order = DT_ORDER_BY; | |
} catch(e) { | |
order = [0, "asc"]; | |
} | |
var editor = new $.fn.dataTable.Editor( { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from plone.autoform import directives | |
from plone.dexterity.content import Item | |
from plone.formwidget.autocomplete.widget import AutocompleteSelectionWidget # noqa | |
from Products.CMFPlone.utils import safe_unicode | |
from unimr.staff.i18n import MessageFactory as _ | |
from unimr.staff.interfaces import IStaffService | |
from z3c.formwidget.query.interfaces import IQuerySource | |
from zope import schema |