venable dot devin at gmail dot com
view source
sudo apt-get install exuberant-ctags
| Value | Description |
|---|---|
| _blank | Open the linked document in a new window or tab |
| _self | Open the linked document in the same frame as it was clicked (this is default) |
| _parent | Open the linked document in the parent frameset |
| _top | Open the linked document in the full body of the window |
| framename | Open the linked document in a named
frame |
<!--[if IE]> You are using IE (IE5+ and above), so include include script that is specific for IE here. <![endif]--> <![if !IE]> You are NOT using IE, so feel free to use HTML 5 features. <![endif]>
ls -ltr total 32 -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 9.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 8.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 6.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 5.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 4.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 3.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 2.bmp -rw-r--r-- 1 dvenable dvenable 1654 2010-07-20 14:06 1.bmp
from pyglet.gl import * import pyglet from pyglet.window import * from pyglet import image import os from PIL import Image import glob from math import sin, cos window = pyglet.window.Window(width=640, height=480, resizable=True) y=0.0 x=-10.0 z=10.0 xspeed = 0.5 yspeed = 0.0 lx=ly=0 lz=-2 angle=ratio=0.0 boxcol = [ [1.0, 0.0, 0.0], # bright: red [1.0, 0.5, 0.0], # orange [1.0, 1.0, 0.0], # yellow [0.0, 1.0, 0.0], # green [0.0, 1.0, 1.0], # blue ] # Dark: red, orange, yellow, green ,blue topcol =[ [0.6, 0.0, 0.0], [0.6, 0.25, 0.0], [0.6, 0.6, 0.0], [0.0, 0.6 ,0.0], [0.0, 0.6, 0.6]] box = None # display list storage top = None #display list storage yloop = None # loop for y axis xloop = None # loop for x axies bmpdata = None nextimg = 0 files = None def load_image_data(): global bmpdata, bmpdatalen, files files = glob.glob('data/*.bmp') files.sort() bmpdata = map(lambda x: Image.open(x).getdata(), files.__iter__()) bmpdatalen = len(bmpdata) def build_lists(): global box, top box = glGenLists(2) glNewList(box, GL_COMPILE) # new compiled box display list # draw the box without the top (it will be store in display list # and will not appear on the screen) glBegin(GL_QUADS) # front face glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 1.0) glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 1.0) glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 1.0) glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 1.0) # back face glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, 1.0, -1.0) glTexCoord2f(0.0, 1.0); glVertex3f(1.0, 1.0, -1.0) glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, -1.0) # right face glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, -1.0) glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, -1.0) glTexCoord2f(0.0, 1.0); glVertex3f(1.0, 1.0, 1.0) glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 1.0) # left face glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, 1.0) glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0) glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, -1.0) glEnd() glEndList() # Done building the list top=box+1 glNewList(top, GL_COMPILE) # new compiled top display list # Top face glBegin(GL_QUADS) glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, -1.0) glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, 1.0, 1.0) glTexCoord2f(1.0, 0.0); glVertex3f(1.0, 1.0, 1.0) glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, -1.0) glTexCoord2f(1.0, 1.0); glVertex3f(-1.0, -1.0, -1.0) glTexCoord2f(0.0, 1.0); glVertex3f(1.0, -1.0, -1.0) glTexCoord2f(0.0, 0.0); glVertex3f(1.0, -1.0, 1.0) glTexCoord2f(1.0, 0.0); glVertex3f(-1.0, -1.0, 1.0) glEnd() glEndList() def load_gl_textures(): # load bitmaps and convert to textures global texture, texture_file, texture_surf #texture_file = os.path.join('data', 'cube.bmp') texture_file = files[nextimg] texture_surf = image.load(texture_file) texture = texture_surf.get_texture() glBindTexture(GL_TEXTURE_2D, texture.id) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) def init(): """ Pyglet oftentimes calls this setup() """ glEnable(GL_TEXTURE_2D) load_image_data() load_gl_textures() build_lists() glShadeModel(GL_SMOOTH) # Enables smooth shading glClearColor(0.0, 0.0, 0.0, 0.0) #Black background glClearDepth(1.0) # Depth buffer setup glEnable(GL_DEPTH_TEST) # Enables depth testing glDepthFunc(GL_LEQUAL) # The type of depth test to do glEnable(GL_LIGHT0) # quick and dirty lighting #glEnable(GL_LIGHTING) # enable lighting glEnable(GL_COLOR_MATERIAL) # enable coloring glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) # Really nice perspective calculations @window.event def on_draw(): global nextimg, bmpdata, x, y, z, lx, ly, lz # Here we do all the drawing glClear(GL_COLOR_BUFFER_BIT |GL_DEPTH_BUFFER_BIT) # Select the texture load_gl_textures() #glBindTexture(GL_TEXTURE_2D, texture.id) xloop = 1 yloop = 1 mandata = bmpdata[nextimg] for idx in range (0, len(mandata)): if (idx+1) % 24 == 0: yloop += 1 xloop = 1 else: xloop += 1 if mandata[idx] < 100: glLoadIdentity() # reset our view gluLookAt(x,y,z, x+lx , y+ly, z+lz, 0.0, 1.0, 0.0) glTranslatef( xloop*1.8 - 30 , 28 - yloop*2.4 , -60.0) glColor3f(*boxcol[xloop % 4]) # select a box color glCallList(box) # draw the box glColor3f(*topcol[1]) glCallList(top) # draw the top return pyglet.event.EVENT_HANDLED def moveMeFlat(direction): global x, z, y, lx, lz, ly x = x - direction*(lx)*0.75; y = y + direction*(ly)*0.5; z = z + direction*(lz)*0.5; def orientMe(ang): global lx, lz lx = sin(ang) lz = -cos(ang) def update(dt): global z, angle angle +=0.005 orientMe(angle) moveMeFlat(0.5) def update2(dt): global nextimg if nextimg < bmpdatalen-1: nextimg += 1 else: nextimg = 0 pyglet.clock.schedule_interval(update2, .1) pyglet.clock.schedule(update) @window.event def on_resize(width, height): if height==0: height = 1 glViewport(0, 0, width, height) glMatrixMode(GL_PROJECTION) glLoadIdentity() # Calculate the aspect ratio of the window gluPerspective(45.0, 1.0*width/height, 0.1, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() return pyglet.event.EVENT_HANDLED init() pyglet.app.run()
try: """ This is where you build your view. Do whatever you need to do. In my case I was inserting a row into the database here. """ except Exception as inst: """ inst.args is a tuple of arguments that were passed when the exception was raised. Django will turn this variable into the main error message you see atop the default error page. It's a tuple, so you can't append to it, but you can replace it with another tuple and add any information that would serve you well. """ inst.args = ("%s sql:%s" % (inst.args[0], " ".join(connections[db].queries.pop()['sql'].split())),) """ Sure that's ugly, but it served my debugging purpose. Use pop to get the most recent query from the queries list. I wanted to get rid of the while space and newline characters, which is the reason for the split and join. Now you just raise the exception. """ raise
import pdb pdb.set_trace
.js .flv .mp3 .ico
youtube.com/videoplayback
ytimg.com

:help colorcolumn
'colorcolumn' 'cc' string (default "") local to window {not in Vi} {not available when compiled without the |+syntax| feature} 'colorcolumn' is a comma separated list of screen columns that are highlighted with ColorColumn |hl-ColorColumn|. Useful to align text. Will make screen redrawing slower. The screen column can be an absolute number, or a number preceded with '+' or '-', which is added to or subtracted from 'textwidth'. :set cc=+1 " highlight column after 'textwidth' :set cc=+1,+2,+3 " highlight three columns after 'textwidth' :hi ColorColumn ctermbg=lightgrey guibg=lightgrey When 'textwidth' is zero then the items with '-' and '+' are not used. A maximum of 256 columns are highlighted.
# Add auto-completion and a stored history file of commands to your Python # interactive interpreter. Requires Python 2.0+, readline. Autocomplete is # bound to the Esc key by default (you can change it - see readline docs). # # Store the file in ~/.pystartup, and set an environment variable to point # to it: "export PYTHONSTARTUP=/home/user/.pystartup" in bash. # # Note that PYTHONSTARTUP does *not* expand "~", so you have to put in the # full path to your home directory. import atexit import os import readline import rlcompleter readline.parse_and_bind('tab: complete') historyPath = os.path.expanduser("~/.pyhistory") def save_history(historyPath=historyPath): import readline readline.write_history_file(historyPath) if os.path.exists(historyPath): readline.read_history_file(historyPath) atexit.register(save_history) del os, atexit, readline, rlcompleter, save_history, historyPath
Tripper McCarthy Tue Jun 24 2003 19:19:31 GMT-0500 (CDT) There have been several posts asking how to change the body of a message (not the header) from within a handler. Here is a way to pull it off. It's a little strange, but it works. public void invoke(MessageContext msgContext) throws AxisFault { try { javax.xml.soap.SOAPMessage soapMessage = msgContext.getRequestMessage(); String oldRequest = soapMessage.getSOAPPart().getEnvelope().toString(); int index = oldRequest.indexOf(" index = oldRequest.indexOf(">",index); String newRequest = oldRequest.substring(0,index+1) + "5" + oldRequest.substring(index+1,oldRequest.length()); ByteArrayInputStream istream = new ByteArrayInputStream(newRequest.getBytes()); Message msg = new Message(istream, false); msgContext.setRequestMessage(msg); } catch(Exception e) { e.printStackTrace(); throw new AxisFault(e.getMessage()); } }
update-alternatives --config python
devin@studio:~/Music/samples$ sndinfo funky.wav virtual_keyboard real time MIDI plugin for Csound PortMIDI real time MIDI plugin for Csound PortAudio real-time audio module for Csound util sndinfo: funky.wav: srate 44100, stereo, 32 bit WAV, 9.835 seconds (433737 sample frames)
connection = cx_Oracle.connect(connstr) cursor = connection.cursor() out = cursor.var(cx_Oracle.CURSOR) items = cursor.callproc('EXAMPLE_PKG.get_some_data', ['02-SEP-2010', '03-SEP-2010', 332123.0, 896798.0, 68567.0, 'xyz', out ] print items[6].fetchall()
yum install expat-devel zlib-devel uuid-c++-devel openssl-devel
wget http://www.carfab.com/apachesoftware/activemq/activemq-cpp/source/activemq-cpp-library-3.2.1-src.tar.gz wget http://mirror.candidhosting.com/pub/apache/apr/apr-1.4.2.tar.gz
[root@myserver] cd apr-1.4.2 [root@myserver] ./configure --prefix=/usr --libdir=/usr/lib CXXFLAGS="-m32" LDFLAGS="-m32" CFLAGS="-m32" --build=i686-redhat-linux-gnu PKG_CONFIG_PATH=/usr/lib/pkgconfig [root@myserver] ./make [root@myserver] ./make install
[root@myserver] cd ../activemq-cpp-library-3.2.1 [root@myserver] ./configure --prefix=/usr --libdir=/usr/lib CXXFLAGS="-m32" LDFLAGS="-m32" CFLAGS="-m32" --build=i686-redhat-linux-gnu PKG_CONFIG_PATH=/usr/lib/pkgconfig --with-apr=../apr-1.4.2/apr-1-config [root@myserver] ./make [root@myserver] ./make install
qemu-img convert windowsxp.img -O vdi windowsxp.vdi
dd if=/dev/zero of=vm8.img bs=2048k count=12000 kvm -m 512 -cdrom winxp.iso -boot d v8.img
from PIL import Image import sys, os def bw(pt): if pt>126: return 255 else: return 0 for infile in sys.argv[1:]: f, e = os.path.splitext(infile) outfile = f + "_mod" + e im = Image.open(infile) im = im.convert('L') out = im.point(bw) out.save(outfile) print outfile
from PIL import Image import sys, os for infile in sys.argv[1:]: im = Image.open(infile) data = im.getdata() for idx in range (0, len(data)): i = data[idx] if i == 255: print 'X', else: print ' ', if (idx+1) % 24 == 0: print ''
devin@studio:~/src/py$ python showdata.py /home/devin/Video/bitmaps/foo_00041_mod.bmp X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X










