Django: custom ModelManager for filtering, overriding default objects  
class MyModelManager(models.Manager):
def get_query_set(self):
return super(MyModelManager, self).get_query_set().filter(published=True)

class MyModel(models.Model):
# fields
# ...

objects = MyModelManager()


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
apache debugging: mod_log_forensic 
The check_forensic script, which can be found in the distribution's support directory, may be helpful in evaluating the forensic log output

Syntax: ForensicLog filename|pipe
Context: server config, virtual host

filename:
A filename, relative to the ServerRoot.
pipe:
The pipe character "|", followed by the path to a program to receive the log information on its standard input. The program name can be specified relative to the ServerRoot directive.


[ add comment ] ( 10 views )   |  [ 0 trackbacks ]   |  permalink
apache debugging: dumpio_module  
LoadModule dumpio_module modules/mod_dumpio.so


DumpIOOutput On
DumpIOINput On
DumpIoLogLevel debug



[ add comment ] ( 11 views )   |  [ 0 trackbacks ]   |  permalink
pzthon: decorators. crazy 
>>> def outer():
... x = 1
... def inner():
... print x
... return inner
...
>>> outer()
<function inner at 0x7f7bd7ac5938>
>>> dis.dis(outer())
4 0 LOAD_DEREF 0 (x)
3 PRINT_ITEM
4 PRINT_NEWLINE
5 LOAD_CONST 0 (None)
8 RETURN_VALUE
>>> dis.dis(outer)
2 0 LOAD_CONST 1 (1)
3 STORE_DEREF 0 (x)

3 6 LOAD_CLOSURE 0 (x)
9 BUILD_TUPLE 1
12 LOAD_CONST 2 (<code object inner at 0x7f7bd7ab5300, file "<stdin>", line 3>)
15 MAKE_CLOSURE 0
18 STORE_FAST 0 (inner)

5 21 LOAD_FAST 0 (inner)
24 RETURN_VALUE





[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
git: get/download repository 
git clone git@github.com:USER/REPO.git


[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink
Visualization: D3js 
D3.js playground: D3.js console for instant d3.js gratification: change your data see the changes: http://bit.ly/1321MEj

Tutorials
http://alignedleft.com/tutorials/d3/chaining-methods/

Anna's wonderfull presentation
http://anna.ps/talks/fel/#/19

reusable charts for D3js
http://nvd3.org/

carto db for maps
http://blog.cartodb.com/post/3968010624 ... s-a-breeze

another perfect tutorial
http://christopheviau.com/d3_tutorial/


[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
visualisation: JavaScript InfoVis Toolkit 
The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.


[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
install pip centos and django extensions 
install pip centos
------------------
http://www.cyberciti.biz/faq/fedora-sl-centos-redhat6-enable-epel-repo/
http://www.cyberciti.biz/faq/debian-ubu ... pipclient/

yum install python-pip

echo 'alias pip="/usr/bin/pip-python"' >> $HOME/.bashrc
. $HOME/.bashr


Django Extensions

Django Extensions is a collection of custom extensions for the Django Framework.

https://github.com/django-extensions/django-extensions

add 'django_extensions' to INSTALLED_APPS

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'django_extensions',
'django_evolution',
'essentials',
'internet',
'system',
)



install pygraphviz
pip install pygraphviz


[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink
Screencast: Django Command Extensions 
This is a screencast on the Django Command Extensions project. It is one of my favorite third party apps, and it gets installed in every Django environment I work in. It provides a plethora of useful manage.py commands, and a couple other little goodies as well.



https://code.djangoproject.com/wiki/DjangoGraphviz
http://ericholscher.com/blog/2008/sep/1 ... xtensions/

[ add comment ] ( 9 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Graphviz - Graph Visualization Software 
Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. It has important applications in networking, bioinformatics, software engineering, database and web design, machine learning, and in visual interfaces for other technical domains.

Graphviz is open source graph visualization software. It has several main layout programs. See the gallery for sample layouts. It also has web and interactive graphical interfaces, and auxiliary tools, libraries, and language bindings. We're not able to put a lot of work into GUI editors but there are quite a few external projects and even commercial tools that incorporate Graphviz. You can find some of these in the Resources section.

The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in useful formats, such as images and SVG for web pages, PDF or Postscript for inclusion in other documents; or display in an interactive graph browser. (Graphviz also supports GXL, an XML dialect.)

Graphviz has many useful features for concrete diagrams, such as options for colors, fonts, tabular node layouts, line styles, hyperlinks, rolland custom shapes.

In practice, graphs are usually generated from an external data sources, but they can also be created and edited manually, either as raw text files or within a graphical editor. (Graphviz was not intended to be a Visio replacement, so it is probably frustrating to try to use it that way.)


http://code.google.com/p/pydot/

http://www.graphviz.org/Download_linux_rhel.php


cd /etc/yum.repos.d
wget http://www.graphviz.org/graphviz-rhel.repo
yum list available 'graphviz*'
yum install 'graphviz*'


[ add comment ] ( 8 views )   |  [ 0 trackbacks ]   |  permalink  |  related link

<<First <Back | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | Next> Last>>