Skip to content

Instantly share code, notes, and snippets.

View OliverUv's full-sized avatar

Oliver Uvman OliverUv

View GitHub Profile
..............................................................................................................................................................EFEE.EFFFE.FFFFFFFFFEF.........................................................
======================================================================
ERROR: test_stack_insertion (vncbrowser.tests.InsertionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/oliver/CATMAID/django/applications/vncbrowser/tests.py", line 87, in test_stack_insertion
s = self.insert_stack()
File "/home/oliver/CATMAID/django/applications/vncbrowser/tests.py", line 66, in insert_stack
s.save()
File "/home/oliver/CATMAID/django/env/local/lib/python2.7/site-packages/django/db/models/base.py", line 460, in save
Version Cluster Port Status Owner Data directory Log file
9.1 main 5432 online postgres /var/lib/postgresql/9.1/main /var/log/postgresql/postgresql-9.1-main.log
from django.db import transaction
from django.http import HttpResponse
class RollbackAndReport(Exception):
def __init__(self, error_json_report):
self.error_json_report = error_json_report
def __str__(self):
return self.error_json_report
$query = "
SELECT
tn.id AS id,
tn.skeleton_id AS skeleton_id,
(tn.location).x as x,
(tn.location).y as y,
(tn.location).z AS z,
greatest(tn.creation_time, tn.edition_time) AS most_recent,
'treenode' as type
FROM
>>> vncbrowser.models.TextlabelLocation.objects.all()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/home/oliver/CATMAID/django/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 69, in __repr__
data = list(self[:REPR_OUTPUT_SIZE + 1])
File "/home/oliver/CATMAID/django/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 84, in __len__
self._result_cache.extend(self._iter)
File "/home/oliver/CATMAID/django/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 273, in iterator
for row in compiler.results_iter():
File "/home/oliver/CATMAID/django/env/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 680, in results_iter
$skeleton_rows = $db->getResult(
"SELECT class_instance_a as skeleton_id
FROM class_instance_class_instance cici,
class_instance ca,
class_instance cb
WHERE relation_id = {$relations['model_of']}
AND class_instance_b = $neuronID
AND cici.class_instance_a = ca.id
AND cici.class_instance_b = cb.id
AND ca.class_id = {$classes['skeleton']}
$canEdit = $db->getResult(
'SELECT "textlabel"."id" AS "tid"
FROM "textlabel" INNER JOIN "project"
ON "project"."id" = "textlabel"."project_id" INNER JOIN "project_user"
ON "project"."id" = "project_user"."project_id"
WHERE "textlabel"."id" = '.$tid.' AND
"project_user"."user_id" = '.$uid.' AND
"project_user"."project_id" = '.$pid );
# assumes:
# X >= Y >= Z (will work otherwise, but suboptimally)
turn_switch = False
def switch():
if turn_switch:
turn_switch = False
else:
turn_switch = True
<?php
/*
I've included below some example JSON output from this script. First,
a couple of normal treenodes, then a connector with no pre- or post-
synaptic relationships, finally a connector with some of both:
[
{
exception_message_on_failure = ''
try:
exception_message_on_failure = 'Could not access database.'
neurons = database.query(Neurons, state='Firing')
exception_message_on_failure = 'Failed doing some thing.'
some.thing()
exception_message_on_failure = 'Could not format data.'
output = format(neurons)