I'm not really sure where to begin with this trip report. Salvia is definitely not like any other hallucinogen I've ever encountered, and produces some very bizarre hallucinations.
First let me tell you about my set and setting: It was an uneventful afternoon and I decided that it was as good a time as any to have a go with some salvia. I started by first preparing one bowl of 10X extract, which I suspected would be a perfect starting dose. I was sitting alone in my room staring out of the window, getting myself mentally prepared for the experience to come. After about 15 minutes of quiet meditation I decided I was ready. I lit the bowl and took a nice, deep hit, comprising about 20 seconds of constant intake. I closed my eyes and held it in for 30 seconds, as instructed. After I let it out, I waited for it to take effect. I waited for about a minute until I realized not much was happening. The only really noticeable effects were a general heavy feeling throughout my body and some vague patterning. Naturally, when I opened my eyes, I was rather disappointed to still be in my room.
I continued this same pattern through another 5 bowls of this 10X salvia, and was similarly disappointed. Here is where I made my big mistake: I let myself become irritated and frustrated, thus disturbing my positive mindset.
 I loaded up a large bowl of this stuff and did the same as before. About 5 seconds into holding my breath, the effects began. It took me totally by surprise and I actually didn't realize that I was starting to trip. First, the afterglow of my room on the backs of my eyes spun away from me and a glowing, 3-D text field appeared. The text seemed to spell out whatever I was thinking, which happened to be 'What the hell?'. As I observed the text, each letter came towards me and I saw each one in close detail. The letters were actually comprised of people! As the letters became closer and clearer, I realized that these people were all me! There I was, 10000 times, staring back at myself.
The only difference was that these letter people were not happy. In fact, they looked downright insane with anger. I recall myself frowning back in the 'real world' and then everything in my field of vision totally shattered. Everything fractured and spun out of control everywhere and I was looking down on my body back in the real world, except I was a little different. On my left forearm, there was a zipper. I got closer to the zipper and it began to unzip and inside, where I expected to see my muscles, tendons, veins, etc., but instead, saw something much different.
My extra-body self continued to get closer to my now unzipped arm, and eventually went inside completely. After I was inside my arm, I turned around and looked back to see that my skin and body no longer seemed to really be a part of me. My arm zipped itself back up and my field of vision began to magnify again. I zoomed in, unimaginably close to the zipper track itself and realized that the zipper was not actually comprised of the normal zipper teeth you might expect to find. Nope, instead, the zipper was made out of the same people as the text that I had seen earlier. These people seemed to be even more agitated than the last group, and they were chanting something. A louder voice rang out yelling 'there are too many of them!' in a very dramatic voice at which point the zipper people began to enlarge and get louder. At this point my physical body twitched several times, causing me to spill some bong water on my leg.
This little spill seemed to bring me back to reality because, everything in my field of vision seemed to decompress and expand. With the visuals becoming too incomprehensible, I opened my eyes and looked at my body, thinking that the trip was over, but I was wrong. While the visuals were gone, the accompanying feelings were not. At first I felt primarily confusion, which gave way to fear and then panic. I couldn't figure out what I was freaking out about when I saw a tiny drop of spilled water on my desk, and what I felt afterwards is hard to articulate. I suddenly felt EXTREMELY, unimaginably filthy. I seriously couldn't stand being in my clothes and body, and this feeling of dirtiness only served to amplify my panic.
I sprang up and hit my head on my loft bed. All I could think about was the filthiness. It was unbearable. I tore off my cloths and tried to rub the invisible muck off of my skin, but to no avail. I stumbled my way down the hall to the bathroom, where I turned on the shower, but realized I couldn't get in until the water warmed up, and I felt several waves of nausea flow over me, but I didn't throw up. I paced out in the hall, realizing that I had to get a hold of myself. Walked all over the house doing my best to ride out the remaining effects for another agonizing 10 minutes or so. Finally, I returned to my room and sat back down where I started. I took a deep breath and began to wonder what to make of what had just transpired. I heard the shower running and remembered my original decision to bathe, so I turned it up nice and hot, sat down, and let the steamy water wash over me.
I was totally stunned at the power of this stuff, and I felt somewhat embarrassed about my panic. I've used several hallucinogens, including LSD, Shrooms and DXM, and none of them came anywhere close to producing any similar effects. While most people seem to think of LSD as being 'the most powerful hallucinogen', I'd have to say that LSD is nothing compared to salvia. During my LSD experiences, I always felt as if I were in control and even when things got a little weird, I was able to maintain my cool. Salvia, on the other hand, totally overpowered me.
In retrospect, while this was probably the most difficult trip I've ever had, I would consider using it again. I've still got plenty of the 40X leaf left and I'll have to find something to do with it. I'm lucky no one was home when I did this, considering that I stomped around the house totally naked.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Game of Life
Change to mobile view Change to normal viewThe Game
About
This is an implementation of Conway's Game of Life utilizing HTML5 canvas and Coffeescript. Written by Florian Mayer<EMAIL_ADDRESS>Source available at GitHub.
This is an implementation of Conway's Game of Life utilizing HTML5 canvas and Coffeescript. Written by Florian Mayer<EMAIL_ADDRESS>Source available at GitHub.


--- layout: post authors: ["Ted Hart"] title: Thoughts on an Advanced Bootcamp at Boulder date: 2013-06-07 time: "09:00:00" tags: ["National Center for Atmospheric Research"] ---
Alex Viana and myself recently wrapped up a bootcamp at the National Center for Atmosphere Research (NCAR) in Boulder, CO. It was a lesson in the advantages of being light on your feet when it comes to teaching for Software Carpentry. Our normal audience tends to be scientists with varying degrees of familiarity with the tools that we teach. This time we taught about 20 people all of whom were experience software engineers, some of whom had probably been programming longer than Alex or I had been alive. We had planned on starting the morning with some shell and then moving into Git. A quick survey of the room found that everyone was well versed in the shell so we abandoned that lesson all together and went straight to teaching Git.
Here was where things got interesting. I thought we'd fly through our material because everyone was so experienced. Instead though it almost seemed that we moved more slowly because not only were we teaching Git, but also how git was different than SVN and CVS (other version control systems for the uninitiated). Later in the day we also got into a deep conversation about what types of workflow Git could be used for compared to SVN and CVS.
We had a similar experience the next day teaching Python. Instead of just churning through it we spent a lot of our time talking about how Python was different than other languages the participants programmed in like Java. It turned out that teaching such an advanced crowd meant that we had a group that knew what questions to ask. Topics that we normally gloss over (what is an iterator anyway?) we had to really pick apart because of the knowledge in the room.
As instructors there were two really important lessons for us. The first is never assume that you're the most knowledgeable person in the room. The corollary to that is that just because you aren't doesn't mean you don't have something to teach. We even had a couple of really skilled Python programmers who were happy to be there just to see how they could become better teachers. At first we were a bit intimidated by the depth of knowledge, but really it just forced us to up our game as instructors and I think we're better for it.
The second lesson was that you can never forget that a bootcamp needs to be adaptable. Alex and I were challenged to create curriculum on the spot when we skipped over our 2 hours of the shell. We had to keep in mind that we were there to teach not just stand and deliver a canned lesson even if participants already knew it all. And that's the really great thing about Software Carpentry all around. All the instructors are creative and smart people who are dedicated to being good teachers and don't shy away from these kinds of unexpected challenges. The NCAR bootcamp was definitely my most challenging, but it also offered one of the best opportunities for growth as an instructor.


|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.io.Stream | +--waba.io.Catalog | +--extra.io.ObjectCatalog
An extension to Catalog that allows storage and retrieval of objects that implement the Storable interface. Create an ObjectCatalog and use the addObject() method on the objects you want to store. If you want a particular object you can use loadObjectAt() to load the stored details into an object or to search through all records call resetSearch() and then loop with nextObject() until it returns false. The example below shows an example of it's use with a catalog of identical data:
ObjectCatalog oc=new ObjectCatalog("Test.DATA"); MyObject obj=new MyObject(); oc.resetSearch(); while (oc.nextObject(obj)) { // do something with obj }
Here's an example using unknown data. The two sections of code save a vector containing a number of Lines, Circles, and Squares (all implementing Storable) in no particular order, then loads it back in again.
// save data ObjectCatalog oc=new ObjectCatalog("Test.DATA",ObjectCatalog.CREATE); for(int i=0,size=objs.getCount();i++) oc.addObject((Storable)objs.get(i)); oc.close(); // load data ObjectCatalog oc=new ObjectCatalog("Test.DATA"); oc.registerClass(new Line()); oc.registerClass(new Circle()); oc.registerClass(new Square()); objs=new Vector(); oc.resetSearch(); Storable obj; while ((obj=oc.nextObject())!=null) { objs.add(obj); } oc.close();
| Field Summary | |
protected BufferStream |
bs
|
protected byte[] |
buf
|
protected Vector |
classes
|
protected int |
cnt
|
protected DataStream |
ds
|
| Fields inherited from class waba.io.Catalog |
_dbHash, CREATE, READ_ONLY, READ_WRITE, WRITE_ONLY |
| Constructor Summary | |
ObjectCatalog(String name)
Construct a new ObjectCatalog |
|
ObjectCatalog(String name,
int type)
Constructs a new ObjectCatalog |
| Method Summary | |
boolean |
addObject(Storable s)
Add an object to this catalog. |
boolean |
deleteObjectAt(int i)
Delete an object from the catalog |
Storable |
loadObjectAt(int i)
Loads an object from the catalog. |
boolean |
loadObjectAt(Storable s,
int i)
Load an object from the catalog into the given storable. |
Storable |
nextObject()
Gets the next object in the catalog. |
boolean |
nextObject(Storable s)
Gets the next object in the catalog and places it in the given storable. |
void |
registerClass(Storable s)
Registers this class with the catalog. |
void |
resetSearch()
Resets a counter for iterating through the catalog. |
void |
setSearchIndex(int i)
Sets the search counter at the given index in the catalog. |
int |
size()
Get the size of this catalog |
| Methods inherited from class waba.io.Catalog |
addRecord, close, delete, deleteRecord, getRecordCount, getRecordSize, isOpen, listCatalogs, readBytes, resizeRecord, setRecordPos, skipBytes, writeBytes |
| Methods inherited from class java.lang.Object |
equals, hashCode, toString |
| Field Detail |
protected Vector classes
protected int cnt
protected byte[] buf
protected BufferStream bs
protected DataStream ds
| Constructor Detail |
public ObjectCatalog(String name, int type)
name
- the name of the catalogtype
- the mode to open the catalog withpublic ObjectCatalog(String name)
name
- the name of the catalog| Method Detail |
public void registerClass(Storable s)
s
- an instance of the class to register. The contents are
ignored.public boolean addObject(Storable s)
s
- the storable object to addpublic boolean loadObjectAt(Storable s, int i)
s
- the object to load the data intoi
- the index in the catalog to load frompublic Storable loadObjectAt(int i)
i
- the index in the catalog to load frompublic boolean deleteObjectAt(int i)
i
- the index to delete frompublic int size()
public void resetSearch()
public void setSearchIndex(int i)
i
- the index to startpublic boolean nextObject(Storable s)
public Storable nextObject()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


{% extends "base.template.html" %}
{% set title = "Reviewed-for" %}
{% set description = "Review a PR for specific purposes" %}
{% block content %}
Reviewed-for
{% markdown %}
When submitting your review, PullApprove provides the option to specify *which*
group that review is for. This allows you to review a PR multiple times, for
different purposes. Or, for example, to review a PR for "security" but leave
general "code" review for someone else. By default, a review will apply to all
groups that you are capable of reviewing for.
## Usage
Use the `Reviewed-for: groupname` syntax to specify a group. The `groupname`
should exactly match one of the groups defined in your `.pullapprove.yml`. To
apply the review to multiple groups, just comma-separate them: `Reviewed-for:
security, code`.
[![PullApprove Reviewed-for specific groups](/assets/img/screenshots/reviewed-for-approve.png)](/assets/img/screenshots/reviewed-for-approve.png)
And the same syntax can be used to request changes for specific groups only.
[![PullApprove Reviewed-for specific groups](/assets/img/screenshots/reviewed-for-reject.png)](/assets/img/screenshots/reviewed-for-reject.png)
{% endmarkdown %}
{% endblock %}


A simple widget for establishing virtual connections. After creating connections via drag and drop, users can delete them by clicking on the connection and hitting delete. TODO: how to delete for touch devices?
Example:
a = Mono()
b = Drums('xoxo')
c = Patchbay( a.Cutoff, a.Resonance, b.Pitch, b.Amp, b.Out )
In the above example, connecting the patch point for b.Out to the patch point for a.Cutoff would be the equivalent of executing the following line of code:
a.cutoff = b.Out


|
Utilities
MakeNSISW (compiler interface)
Zip2Exe (convert ZIP to SFX)
NSIS Update (get latest version)
Folders
Example scripts
Contrib (plug-in info etc.)
Language files
Modern UI language files
Source code
|
Documentation
NSIS Users Manual
FAQ (online)
Modern UI Readme
InstallOptions (custom pages)
Websites
NSIS Website
NSIS Archive
Forum
IRC Channel
Bug Tracker
Development changelog
|


Introduction
In this tutorial, you will be shown how to enable collisions and set
up responses using Torque 2D. Whenever you need two or more objects to
collide with each other and react in an appropriate manner, you will
need to use the information in this guide. This can range from stopping a
moving object, bouncing objects off of each other and creating custom
functions based on collision types. The following topics are covered in
this tutorial:
Basic Collision
Torque 2D uses a proprietary physics and collision system. While not
as feature rich as Box2D, it can still support your game's collision
needs. You can get basic box to box collision running with only a couple
mouse clicks.
Enabling Collision
By default, collision is disabled for a new object when you add it to
a scene. This is an optimization, since not every sprite in your scene
needs collision (like a backdrop). To enable collision, start by
clicking on the an object in the scene. Switch to the Edit tab, then
scroll down to the Collision rollout. Click the top two check boxes to
enable Send Collision and Receive Collision:
Collision Properties
With the exception of scripting, you will control the functionality
of your object's collision via the Collision rollout. The full set of
properties are shown below:
(click to enlarge)
- Send Collision: When toggled, this will tell other objects it has collided with them.
- Receive Collision: When toggle, this object will receive notification of collision with other objects.
- Send Physics: Determines whether the object's default physics response will be used when it is sending the collision.
- Receive Physics: Determines whether or not the object's default physics response will be used when it is receiving the collision.
- Callback: When enabled, a script callback named onCollision will be triggered when this object collides with another.
- Detection Mode: Changes the algorithm used for collision detection
- Full: Swept circle combined with polygon detection. The circle is generated dynamically based on the original bounding box size
- Circle: Swept circle only
- Polygon: Polygon detection (can be modified using the Collision Editor)
- Custom: Allows for custom collision calculation.
Currently this does nothing, but you can implement your code in the the
blank function found in t2dSceneObject.cc. This function is named t2dSceneObject::onCustomCollisionDetection
- Circle Scale: Controls the size of the collision circle when using the Full and Circle detection modes.
- Superscribe Ellipse: When enabled, the circle used in
FULL mode collision will automatically scale to a size that covers the
entire polygon at each point.
- Collision Response: Contains a set of default behaviors an object will perform when collision occurs.
- BOUNCE: A simple, pong-style bouncing effect. The
colliding object will reverse its velocity in both the X and Y directions,
essentially reversing its motion.
- CLAMP: The colliding object slides along the surface it hits.
- STICKY: The colliding object will stop completely.
- KILL: The colliding object will be deleted immediately.
- RIGID: The colliding object will react using built-in rigid body physics.
- Collision Layers: Controls which layers this object will
collide with. By default, an object collides with all layers. If layer 0
is turned off, this object will not collide with any objects in that
layer.
- Collision Groups: Similar to Collision Layers, except
this is a manual organization of collision not reliant on any scene
properties (like layers). This can work in conjunction with Collision
Layers. For example, you can disable collision with everything except
objects that exist on layer 3, layer 4 and are only in group 2. This
becomes very important when you have many types of objects on screen
moving at once.
Advanced Collision
In addition to the basic collision properties described previously,
you can extend your object's collision functionality using the Collision
Editor, messages and script callbacks.
Collision Editor
When you have an object selected in the scene, it is outlined by a
box. This is called the bounding box, which is used as the object's
default collision shape. Not every sprite you add to your scene actually
uses that entire space. Many sprites you will be adding likely have
abnormal shapes, such as a walking human, spaceship, flower, etc. A
simple box to box collision is not always ideal.
This is easily fixed by using the Collision Editor. While custom shapes
can consume more processor power, your game play will be more believable
and intuitive. Start by selecting an object in the scene, then click on
the first button on the left end of the Selection Editor Toolbar:
Clicking that button will activate the Collision Editor. At first, the
four points you see are identical to the sprite's bounding box. You can start adding nodes to the box to create a custom shape that more closely resembles the art's shape. The main limitation to this feature is that shapes must be convex, meaning they have no inward facing angles:
BEFORE:
(click to enlarge)
AFTER:
(click to enlarge)
Collision and Physics Messages
The four check boxes at the top of an object's collision properties
define the object's participation in the collision system using these
properties individually. For example, turning Send Collision on but
leaving Receive off will result in some objects never responding to
collision.
Objects that have "Send Collision" active can be thought of as active
colliders, while objects that have "receive collision" active can be
thought of as passive colliders. A collision will only be detected
between objects if one of the objects is an active collider and the
other is a passive collider. Keep in mind that an object can both send
and receive collisions.
Send and receive physics are treated slightly differently. Send physics
dictates whether or not the object's default physics response will be
used when it is sending the collision. Receive physics dictates whether
or not the object's default physics response will be used when it is
receiving the collision.
Callbacks
Perhaps the most powerful feature of the collision system is the
callback implementation. When you enable the Callback checkbox, the
engine will call a specific script function when a collision occurs. If
this script function does not exist, nothing will happen. However, you
can write the script function out and it will automatically execute.
In the following example, assume there is an object in your scene named
"Mine". This object has collision enabled and the callback checkbox
turned on.
// %srcObj - The object receiving the collision
// %dstObj - The object that is being collided with.
// %srcRef - Custom information set by the source object. Only used by t2dTileLayer
// %dstRef - Custom information set by the destination object. Only used by t2dTileLayer
// %time - The time since the previous tick when the collision happened.
// %normal - The normal vector of the collision.
// %contactCount - The number of contact points in the collision.
// %contacts - The list of contact points.
function Mine::onCollision(%srcObj, %dstObj, %srcRef, %dstRef, %time, %normal,
%contactCount, %contacts)
{
// Custom collision code goes here
}
Conclusion
This concludes the introduction to Torque 2D collision. While you
can enable basic collision without ever touching code, you will most
likely make heavy use of the onCollision callback. The tutorials
in the rest of this documentation will provide examples of how to fill
in the function. The instructions you learned in this guide are
essential and will be used throughout your development. |


This Pungsujiri Map of New York ritual is designed to guide you all over the city.
It will activate specific luck areas in your life, bringing you peace and prosperity
not only to oneself, but also to one’s descendants.
Instruction
1. Take a deep breath, listen to your heart. See what lacks/need improvement in your life.
2. Select pungsujiri animal on map.
3. Send the map to your phone and start your ritual by physically (or virtually!) walking along the route.
Enjoy and good luck on your quest!


This email was sent to you by fairymiss.com.
To ensure that our updates get to you(not bulk or junk folders),
please add our e-mail address to your address book or safe list.
If you have any questions regarding your orders or products, please contact us at
service@fairymiss.com.


lean backtest
or lean optimize
, the CLI runs the LEAN engine in a Docker container locally.
If the LEAN engine runs locally your local market data is used, which is the data stored in the data/
directory generated by the lean init
command.
This page explains the structure of your local data directory and ways to source LEAN-compatible data.


Would you like to modify it?


|
PolarScanMatching(PSM)
1
|
Structure describing a laser scan. More...
#include <polar_match.h>
Public Attributes | |
| double | t |
| [s] Time when scan was taken. More... | |
| PM_TYPE | rx |
| [cm] Robot odometry X coordinate. More... | |
| PM_TYPE | ry |
| [cm] Robot odometry Y coordinate. More... | |
| PM_TYPE | th |
| [rad] Robot orientation. More... | |
| PM_TYPE | r [PM_L_POINTS] |
| [cm] Laser range readings. 0 or negative ranges denote invalid readings. More... | |
| PM_TYPE | x [PM_L_POINTS] |
| [cm] Laser reading X coordinates in Cartesian coordinates. More... | |
| PM_TYPE | y [PM_L_POINTS] |
| [cm] Laser reading Y coordinates in Cartesian coordinates. More... | |
| int | bad [PM_L_POINTS] |
| Tag describing the validity of a range measurement. 0 if OK; sources of invalidity - out of range reading; reading belongs to moving object (not implemented); occlusion; mixed pixel. More... | |
| int | seg [PM_L_POINTS] |
| Describes which segment the range reading belongs to. More... | |
Structure describing a laser scan.
The robot pose (rx,ry,th) describes the odometry center if PM_LASER_Y does not equal 0, or the laser center if PM_LASER_Y=0.
In a laser scan, the middle laser bearing coincides with the laser coordinate frame's Y axis.
TODO: Consider using doubles for rx,ry in large environments.
| int PMScan::bad[PM_L_POINTS] |
Tag describing the validity of a range measurement. 0 if OK; sources of invalidity - out of range reading; reading belongs to moving object (not implemented); occlusion; mixed pixel.
| PM_TYPE PMScan::r[PM_L_POINTS] |
[cm] Laser range readings. 0 or negative ranges denote invalid readings.
| PM_TYPE PMScan::rx |
[cm] Robot odometry X coordinate.
| PM_TYPE PMScan::ry |
[cm] Robot odometry Y coordinate.
| int PMScan::seg[PM_L_POINTS] |
Describes which segment the range reading belongs to.
| double PMScan::t |
[s] Time when scan was taken.
| PM_TYPE PMScan::th |
[rad] Robot orientation.
| PM_TYPE PMScan::x[PM_L_POINTS] |
[cm] Laser reading X coordinates in Cartesian coordinates.
| PM_TYPE PMScan::y[PM_L_POINTS] |
[cm] Laser reading Y coordinates in Cartesian coordinates.


ShootQ allows you to import relationships using industry standard formats.
vCard is supported by popular contact management applications, including Apple Address Book and Microsoft Outlook.
CSV or Comma Separated Values is a common export format for most spreadsheet applications such as Microsoft Excel.


Home
My account
(
5 items
) in your cart (
$45.80
)
Home
About
Products
Contact
Our Products
Home /
Products
Hungry ?
All
Ginger
Pizza
Pasta
Drink
Hamburger
Pizza
Vege Pizza
$16.00
Ginger
Ginger Tea
$24.00
Pizza
Vege Green Salad
$12.00
Pasta
Herbal Hot Tea
$8.00
Drink
Fruit Salad
$16.00
Hamburger
Big Hamburger
$8.00
Pizza
Chocolate Cake
$14.00
Pasta
Pizza Taste
$15.00
Hamburger
Hot Meat Grilled
$16.00
Drink
New Ginger Taste
$18.00
Ginger
Hot Coffee
$16.00
Pasta
SUMMER FRUIT SALADE
$16.00
1
2
3
>>


Groups in Pinax are simply container application/models that contain other application/models. For example, if we had something called ‘Project’ it might have ‘Tasks’ within it. The Pinax Groups system is designed to make this scenario easy to implement. It allows you to convert an application and model to become a container, henceforce called respectively a Group App and the model is called a ‘Group Model‘. It also allows you to convert an application and associated models to become ‘Group-Aware‘, which if done properly makes it capable of working inside a group or as a stand-alone application.
To summarize, Pinax gives you the ability to:
- Create a Group App that can hold another application that is Group-Aware.
- Create a Group-Aware application that can either stand-alone or be held inside a Group App.
Pinax comes with a number of built-in applications of both Group Apps and Group-Aware apps detailed in this page’s appendix, but its easy enough to create your own.
First lets make a Task application. Please keep in mind that our example, when complete, can be quicklybrought into any Pinax Group-App, not just projects:
import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
class Task(models.Model):
"""
We don't use anything Pinax specific in this model. In fact, we
make a point with the *get_absolute_url* method of making it able
to handle being in a group or as a stand-alone Django application.
"""
# Some sample fields below to show individual distinction of this model
title = models.CharField(max_length=140)
description = models.TextField(max_length=140)
creator = models.ForeignKey(User,
verbose_name=_("creator"),
related_name="%(class)s_created"
)
created = models.DateTimeField(_("created"), default=datetime.datetime.now)
# The following three fields are required for being group aware.
# We use a nullable generic foreign key to enable it to be optional
# and we don't know what group model it will point to.
object_id = models.IntegerField(null=True)
content_type = models.ForeignKey(ContentType, null=True)
group = generic.GenericForeignKey("content_type", "object_id")
def __unicode__(self):
return self.title
def get_absolute_url(self, group=None):
kwargs = {"id": self.id}
# We check for attachment of a group. This way if the Task object
# is not attached to the group the application continues to function.
if group:
return group.content_bridge.reverse("task_detail", group, kwargs)
return reverse("task_detail", kwargs=kwargs)
We don’t want to display the special object_id, content_type, and group fields to end clients and users. So we use Django forms to control what is displayed:
from django import forms
from django.utils.translation import ugettext as _
from pinax.apps.tasks.models import Task
class TaskForm(forms.ModelForm):
"""
Our Task form is just like the Task model in that it can work with
groups or independantly.
"""
def __init__(self, user, group=None, *args, **kwargs):
self.user = user
self.group = group
super(TaskForm, self).__init__(*args, **kwargs)
def save(self, commit=True):
return super(TaskForm, self).save(commit)
class Meta:
model = Task
fields = ["title", "description"] # only display 2 fields
def clean(self):
self.check_group_membership()
return self.cleaned_data
def check_group_membership(self):
"""
We only let valid group members add new tasks. If the Task is
*not* attached to a group then it ignores this step.
"""
group = self.group
if group and not self.group.user_is_member(self.user):
raise forms.ValidationError(_("You must be a member to create new Tasks"))
Just like the models and forms, we build our Task views in such a way that they can handle being within or without a group:
from django.core.exceptions import ObjectDoesNotExist
from django.http import Http404
from django.template import RequestContext
from django.shortcuts import render_to_response
from pinax.apps.tasks.models import Task
def task_list(request, group_slug=None, bridge=None):
# if a bridge is supplied but does not exist in the database that
# means someone is trying to look at a non-existant object.
if bridge is not None:
try:
group = bridge.get_group(group_slug)
except ObjectDoesNotExist:
raise Http404
else:
group = None
# If we are in a group we fetch the Task list of content via a special
# utility method. Otherwise we just use a standard ORM call.
if group:
tasks = group.content_objects(Task)
else:
tasks = Task.objects.all()
# Is the user a member of the parent group?
if not request.user.is_authenticated():
is_member = False
else:
if group:
is_member = group.user_is_member(request.user)
else:
is_member = True
return render_to_response("tasks/task_list.html", {
"group": group,
"blogs": blogs,
"is_member": is_member,
}, context_instance=RequestContext(request))
In many cases you might want to check if the authenticated user has membership in the group. To do this:
if not request.user.is_authenticated():
is_member = False
else:
is_member = group.user_is_member(request.user)
The urls.py file of your app will not need anything special. Most of that is handled by Pinax. However, URL reversal needs to be group aware. We have some helpers to help you work with this easily.
Let’s say you have the following code in tasks.urls.py:
from django.conf.urls.defaults import *
urlpatterns = patterns("",
url(r"^tasks/$", "pinax.apps.tasks.views.task_list", name="task_list"),
url(r"^tasks/(?P<slug>[-\w]+)/$", "pinax.apps.tasks.views.blog_detail", name="task_detail"),
)
To ensure URLs to task_list are correctly generated you will need to use reverse located on the ContentBridge object:
def some_view_with_redirect(request, bridge=None):
...
return HttpResponseRedirect(bridge.reverse("blog_list", group))
The reverse method work almost identical to Django’s reverse. It is essentially a wrapper. To reverse the taskdetail URL:
task = Task.objects.get(pk=1)
bridge.reverse("task_detail", group, kwargs={"slug": task.slug})
Note
You should be aware that only kwargs work with the bridge reverse. This is significant because URLs with args mapping will fail reversal. The reason behind this is because Django does not allow mixing of args and kwargs when performing URL reversal.
There are some cases when you don’t have easy access to the ContentBridge. You may only have access to a domain object instance. You can get access to the ContentBridge from the instance. For example:
task = Task.objects.get(pk=1)
task.content_bridge.reverse(...)
In Django you may be familiar with the {% url %} templatetag. This is basically a wrapper around reverse. We provide a similar tag, but works with our ContentBridge.reverse. Here is how you might use it:
{% load group_tags %}
{{ task.title }}
The {% groupurl %} templatetag will fall back to normal Django URL reversal if the value of the passed in group is None. This enables the ability to work with no group association.
We will continue with the Project/Task corollary. Our group application will be a Project (which contain tasks, members, and more):
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from groups.base import Group
class Project(Group):
"""
Doesn't inherit the normal *models.Model*. Group comes with a title,
description, created, creator and some glue pieces and utility
methods built in for convenience.
"""
members = models.ManyToManyField(User,
related_name = "projects",
verbose_name=_("members")
)
def get_absolute_url(self):
return reverse("group_detail", kwargs={
"group_slug": self.slug
})
def get_url_kwargs(self):
return {"group_slug": self.slug}
In order for a group-app to be able to display a group-aware application there needs to be a bridge. We take a sample projects.urls.py:
# Standard urlsconf import
from django.conf.urls.defaults import *
# Create your normal project url views
urlpatterns = patterns("",
url(r"^add_project$", "pinax.apps.projects.views.add", name="project_add"),
url(r"^your_projects/$", "pinax.apps.projects.views.your_project", name="your_projects"),
url(r"^(?P<slug>[-\w]+)$", "pinax.apps.projects.views.project_detail", name="project_detail"),
url(r"^$", "pinax.apps.projects.views.projects", name="project_list"),
...
)
So we can render a URL such as /projects/<my-project>.
And then we add in the following code underneath the urlpatterns definition:
# Pinax groups special object
from groups.bridge import ContentBridge
# Fetch the group-aware model
from pinax.apps.tasks.models import Task
# Create the bridge object
bridge = ContentBridge(Task, "tasks")
# Add in the bridged url
urlpatterns += bridge.include_urls("task.urls", r"^projects/(?P<group_slug>[-\w]+)/tasks")
And that lets us render a URL such as /projects/<my-project>/tasks.
Pinax comes bundled with two types of group-apps:
- tribes — used in social_project
- projects — used in code_project
Pinax includes several apps that are group aware:
- photos
- tasks
- topics
- wiki
- pinax-dances (tutorial application)
- pinax-wall (tutorial application)


Sheasy
Please accept the connection in the notification bar or go to settings and select "Accept all connections" on your device and reload the page.


{{reservations.length}} SEATS - {{reservations | totalPrice}} {{currency}}
{{reservations.length}} SEAT - {{reservations | totalPrice}} {{currency}}
CANCEL (HEADER) SELECT MORE SEATS (HEADER) SELECT MORE SEATS (HEADER) CHECKOUT AND REDUCTIONS (HEADER)


Ageless living—at home. Choice. Convenience. Personalized service and assistance. Social events to stay engaged. Support to optimize wellness and the discovery of new ways to enjoy life. And in times of need, the comfort and security of knowing there is one place to call.
Join the village and experience the benefits of membership yourself.
Single-source for trusted resources
Personalized information, referrals and resources via web or telephone
New Member Consultation / Case Management
To make the most of your membership dollar; hospital to home transition
Social Events and Trips
Take full advantage of programs of interest: travel, theater, outings, discussion and interest groups
General Assistance
Whether it's walking the dog, changing smoke detector batteries or air conditioning filters, to moving furniture and help with gardening. Maybe its waiting for a repairman, dropping a package at the Post Office or other errands
Transportation
Rides to the doctor, the grocery store, or the airport, or whatever errands you need to run
Family Caregiver Support
Caregiver resources, arranging or accompanying your family member to medical appointments, support groups
Screened Home Maintenance and Caregiving Providers
Referrals to a vetted network of service providers will enable members to access with confidence a broad array of high-demand services at pre-negotiated or discounted rates.
"REAL Connections allows us to help others and to plan for our future."
Bill and Pat Reed
"When an opportunity to become a member in REAL Connections comes along, you may not think its for you right now because you don't need it. But, as you know, our lives can change suddenly and without warning as mine did. All I can tell you today is that this virtual community has provided me with real friendships, security and savings with vetted vendors, and opportunities to serve others if you choose to pay it forward"
Sandy Hester, AARP Area Advocacy Coordinator
Complete the following form and a representative from Real Connections will be reaching out to you shortly!
Membership Dues
Members have the option to pay dues either annually or monthly:
Individual Membership
$570/yr or $54.50/month; save $84 by paying the full year membership when you join!
Household Membership
$780/yr or $75/month; save $120 by paying the full year membership when you join!
Additional Member (if more than two people)
$180/yr or $15/month extra
Membership dues may be paid by check or credit card
Claremont Community School of Music - Claremont Manor - Claremont Place - Community Connections: Transportation Reimbursement Program - The Enrichment Center Adult Day Program - Foothill Communities RSVP - Oakmont of San Antonio Heights - VNA Hospice and Palliative Care of Southern California - West End Family Counseling Services - Right At Home In-Home Care


An unordered list
- I like puppies
- I like kittens
- My favourite colour is blue
- I like music
An unordered list with circles
- I like puppies
- I like kittens
- My favourite colour is blue
- I like music
An ordered list
- I like puppies
- I like kittens
- My favourite colour is blue
- I like music
A ordered list with capital letters
- I like puppies
- I like kittens
- My favourite colour is blue
- I like music


PostgreSQL is a relational database used by many project . Dinivas can create a PostgreSQL cluster and managed it for you


| DOSE: |
95 mg |
insufflated |
DPT |
(powder / crystals) |
Here are my notes about DPT, starting with the night I recieved the DPT and snorted some of it, and ending with the night that I smoked the last of it out of a light bulb. But first, a word of advice: Weighing out your doses of powdered drugs before ingestion is the responsible thing to do.
Now, DPT really irritates my nostrils. It leaves my nose feeling raw as hell and it hurts the roof of my mouth.  The label on the bottle said DPT hydrochloride.
I had no scale but I estimate my dose based on later use of a scale with DPT to be about 65 mg. It was a medium sized line and a half. It came on and the body vibe felt pretty similar to acid, I had solid (there but not everywhere) visuals, nothing too crazy. I was baseline in about 4 hours.
The chronology of the insufflated DPT experience goes:
1. Insufflate
2. Body vibe starts coming on, start to feel trippy / sometimes giggly.
3. Body vibe in full effect, cue visuals.
4. Body vibe and visuals platue at peak lvls for about an hour.
5. everything slowly goes away till baseline.
What I'm calling the 'body vibe' above, can be a pretty tumultous and sweaty affair (especially on the way up), I come up fast on DPT. I come down fast, too.
On the next night I took considerably more, probably around 90 - 100 mg's, it was a couple big sized lines. Again, the body vibe still felt moderately similar to LSD, this time I saw intricate patterns and occasionally 3 dimensional CEV's.
The night after that (the 3rd night in a row), I took a weighed out dose of 75mg insufflated. This time I got some body vibe and visuals but it was pretty toned down. Tolerance, built up from the previous nights, most definately had it's way this time.
-This is a strong drug not to be taken for granted-
Note: Itís 8/2/2004 now, and the DPT has been gone for a few weeks. I had many cool and interesting trips on it, here are some more experience notes:
Summaries:
The time when I ingested more DPT by far than all the others, was like being in a pocket underwater, with flashes of other places. It was extremely deep and any image I thought of behind my closed eyelids, I would immediately see.
I insufflated 2 really big, un-weighed lines (maybe pinkie sized? it was by far the most DPT Iíve ever done) to get there. I was sitting on a couch in a friends living room.  I began to truly grasp the gravity of my situation when I looked at the Super Nintendo next to the TV and it promptly began to bend around, dent, and warp. I was a little anxious as the DPT experience got progressively deeper and stronger, but I knew I was in for the ride, so I figured I might as well do my best to take it in stride.
Once it had fully sunk in, my entire field of vision (with eyes open) was obscured / blurred / glowing / mixing / etc. It looked alot like an underwater las vegas - thick wavy multicolored neon bars. I shut my eyes and thought deathly thoughts, and promptly saw deathly things. I saw a thousand consecutive deaths in incredibly fast motion. The deaths / mutilations / gore went by at first slow, but then began to increase in speed until they where flashing one after another on my consciousness, each remaining for only a split second. Most of them (if not all of them) were on a white background, with the death and gore occupying the middle of my visual field.
Eventually I decided to think about serenity, the death-imagery subsided then and I saw in 3d the chrome silhouette of a cross-legged human figure floating in outer space. This serenity state was abruptly perforated by brief swaths of time where I looked through what were possibly someone elseís eyes, a different set of mine, or both.
Regardless of whose eyes I was seeing with, I found myself in a train station looking around, and I knew a train was coming soon (possibly a train I was waiting for). This happened a few times (Which is why I say that it 'perforated' my serenity experience) and each time the transition was totally abrupt. Kind of like crossing a line, an instantaneous transition that lasted what seemed like a few minutes, and then went back to the Ďnormalí sensual-pocket DPT state. Eventually I began to come down, and then came down altogether.  Opening them was not as interesting, and was slightly disorienting due to the complete alteration of my visual field.
After that experience I had many others over the period of a few weeks, all of them were very interesting, many were pretty intense, and a few had some (stuffy / runny / irritated) nose problems.
I finished the DPT by smoking what was left of the HCL salt in an emptied out light bulb. The more I toked, the more I tripped, and this was great.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Getting Started with jBPM 4.0 (Part II)
In this blog entry, we are going to use the eclipse GUI to build a helloworld process, and then write a unit test to verify the process.
Firstly, I assumed that you've successfully installed the eclipse GUI, if you haven't done so, please refer to the first Part blog entry.
Create Project and Process Definition
Then, we will create a java project, I used the following project layout(maven way).
we will put the process definition file into the main/resource folder, and the test case and its resources in the src/test folder.
In this helloworld process, we will do the following process scenario, we will have a 'java node', to make a request, and then we add the 'review task node', and then if it is 'approved', it will lead to the 'audit state node'. Of course, we will include the 'start' and the 'end' node in this process, so the finished process image would be like:
In this process definition, we are using a java node to be the 'request' node, its java code as following:
package org.jbpm.helloworld;
public class Println {
public void request() {
System.out.println("--------------------");
System.out.println("Made a request.....");
System.out.println("---------------------");
}
}
The process definition xml is as following:
<process name="helloworld" xmlns="http://jbpm.org/4.0/jpdl">
<start name="start">
<transition name="to request" to="request"/>
</start>
<end name="end"/>
<java class="org.jbpm.helloworld.Println" method="request" name="request">
<transition name="to review" to="review"/>
</java>
<task assignee="alex" name="review">
<transition name="approved" to="audit"/>
</task>
<state name="audit">
<transition name="to end" to="end"/>
</state>
</process>
The xml itself is very easy to understand, you might notice that 'g' attribute in your process definition file, that is only used by the Eclipse GUI.
Verify the process
Once we've finished the process, we want to verify whether it is as same as we expected, with the jBPM 4.0, it is very easy for us to verify it, without deploying it into the container.
With the following 2 steps, we can easily test the process by using API. Because the jbpm.jar doesn't include the jbpm.hibernte.cfg.xml and jbpm.cfg.xml, we need to configure it by ourselves for the test purpose. (However, The deployed jbpm in JBoss container has these two files by default)
Add the jbpm.hibernate.cfg.xml and jbpm.cfg.xml
we put these two files into the src/test/resource folder. the jbpm.hibernate.cfg.xml would be like as following:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
<property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
<property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
<property name="hibernate.connection.username">sa</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property name="hibernate.format_sql">true</property>
<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
<mapping resource="jbpm.task.hbm.xml" />
<mapping resource="jbpm.identity.hbm.xml" />
</session-factory>
</hibernate-configuration>
and here it is the jbpm.cfg.xml:
<jbpm-configuration>
<import resource="jbpm.default.cfg.xml" />
<import resource="jbpm.tx.hibernate.cfg.xml" />
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
</jbpm-configuration>
Write the test case, which extends the JbpmTestCase
Now, we are ready to write the process unit test.
public class ProcessTest extends JbpmTestCase {
String deploymentId;
public void setUp() throws Exception {
super.setUp();
deploymentId = repositoryService.createDeployment()
.addResourceFromClasspath("helloworld.jpdl.xml")
.deploy();
}
public void testProcess() throws Exception {
ProcessInstance instance = executionService.startProcessInstanceByKey("helloworld");
String pid = instance.getId();
assertTrue(instance.isActive("review"));
List tasks = taskService.findPersonalTasks("alex");
Task task = tasks.get(0);
taskService.completeTask(task.getId(), "approved");
instance = executionService.findProcessInstanceById(pid);
String exeId = instance.findActiveExecutionIn("audit").getId();
executionService.signalExecutionById(exeId, "to end");
HistoryProcessInstance historyInstance = historyService.createHistoryProcessInstanceQuery()
.processInstanceId(pid).uniqueResult();
assertEquals("ended", historyInstance.getState());
}
public void tearDown() throws Exception {
repositoryService.deleteDeploymentCascade(deploymentId);
super.tearDown();
}
- we used the repositoryService to deploy our process file.
- we used the executionService to start the process.
- after it starts, it should be at the 'review' task node.
- used the taskService to get the specific task, and complete the task.
- once it completes, it should be at the 'audit' task, as it is a wait state.
- use the executionService.signal method to proceed the process, it goes to the 'end', which means the process should be ended.
- use the historyService to check whether the process is ended or not. Please noted that in the jBPM 4.0, the finished process instance was stored in a separate db table, so you can't use the executionService API to look for the finished process instances. The process unit test should be passed with green in Junit, and the console output is like:
Jul 12, 2009 11:08:17 AM org.hibernate.tool.hbm2ddl.SchemaExport execute
INFO: schema export complete
--------------------
Made a request.....
---------------------
So, that is it, you've already built an process, and verify it. It is simple, isn't it? ;-)
In next entry, I will try to deploy our process into the jBPM server.


| I l@ve RuBoard |
17.2 Implementing StacksStacks are a common and straightforward data structure, used in a variety of applications: language processing, graph searches, etc. In short, stacks are a last-in-first-out collection of objects: the last item added to the collection is always the next one to be removed. Clients use stacks by:
Depending on client requirements, there may also be tools for such tasks as testing if the stack is empty, fetching the top item without popping it, iterating over a stack's items, testing for item membership, etc. In Python, a simple list is often adequate for implementing a stack: because we can change lists in place, we can either add and delete items from the front (left) or end (right). Table 17-1 summarizes various built-in operations available for implementing stack-like behavior with Python lists, depending on whether the stack "top" is the first or last node in the list. In this table, string 'c' is the top item on the stack.
This list arrangement works and will be relatively fast. But it also binds stack-based programs to the stack representation chosen: stack operations will all be hardcoded. If we later want to change how a stack is represented, or extend its basic operations, we're stuck: every stack-based program will have to be updated. For instance, to add logic that monitors the number of stack operations a program performs, we'd have to add code around each hardcoded stack operation. In a large system, this operation may be nontrivial. As we'll see in the next chapter, we may also decide to move stacks to a C-based implementation, if they prove to be a performance bottleneck. As a general rule, hardcoded operations on built-in data structures don't support future migrations as well as we'd sometimes like. 17.2.1 A Stack ModulePerhaps a better approach is to encapsulate stack implementations using Python's code reuse tools. Let's begin by implementing a stack as a module containing a Python list, plus functions to operate on it (see Example 17-1). Example 17-1. PP2E\Dstruct\Basic\stack1.pystack = [] # on first import error = 'stack1.error' # local exceptions def push(obj): global stack # use 'global' to change stack = [obj] + stack # add item to the front def pop( ): global stack if not stack: raise error, 'stack underflow' # raise local error top, stack = stack[0], stack[1:] # remove item at front return top def top( ): if not stack: # raise local error raise error, 'stack underflow' # or let IndexError occur return stack[0] def empty( ): return not stack # is the stack []? def member(obj): return obj in stack # item in stack? def item(offset): return stack[offset] # index the stack def length( ): return len(stack) # number entries def dump( ): print '<Stack:%s>' % stack This module creates a list object (stack) and exports functions to manage access to it. The stack is declared global in functions that change it, but not in those that just reference it. The module also defines an error object (error) that can be used to catch exceptions raised locally in this module. Some stack errors are built-in exceptions: method item triggers IndexError for out-of-bounds indexes. Most of the stack's functions just delegate the operation to the embedded list used to represent the stack. In fact, the module is really just a wrapper around a Python list. But this extra layer of interface logic makes clients independent of the actual implementation of the stack. So, we're able to change the stack later without impacting its clients. As usual, one of the best ways to understand such code is to see it in action. Here's an interactive session that illustrates the module's interfaces: C:\...\PP2E\Dstruct\Basic>python >>> import stack1 >>> stack1.push('spam') >>> stack1.push(123) >>> stack1.top( ) 123 >>> stack1.stack [123, 'spam'] >>> stack1.pop( ) 123 >>> stack1.dump( ) <Stack:['spam']> >>> stack1.pop( ) 'spam' >>> stack1.empty( ) 1 >>> for c in 'spam': stack1.push(c) ... >>> while not stack1.empty( ): ... print stack1.pop( ), ... m a p s Other operations are analogous, but the main thing to notice here is that all stack operations are module functions. For instance, it's possible to iterate over the stack, but we need to use counter-loops and indexing function calls (item ). There's nothing preventing clients from accessing (and changing) stack1.stack directly, but doing so defeats the purpose of interfaces like this one. 17.2.2 A Stack ClassPerhaps the biggest drawback of the module-based stack is that it supports only a single stack object. All clients of the stack module effectively share the same stack. Sometimes we want this feature: a stack can serve as a shared-memory object for multiple modules. But to implement a true stack datatype, we need to use classes. To illustrate, let's define a full-featured stack class. The Stack class shown in Example 17-2 defines a new datatype, with a variety of behavior. Like the module, the class uses a Python list to hold stacked objects. But this time, each instance gets its own list. The class defines both "real" methods, and specially named methods that implement common type operations. Comments in the code describe special methods. Example 17-2. PP2E\Dstruct\Basic\stack2.pyerror = 'stack2.error' # when imported: local exception class Stack: def __init__(self, start=[]): # self is the instance object self.stack = [] # start is any sequence: stack.. for x in start: self.push(x) self.reverse( ) # undo push's order reversal def push(self, obj): # methods: like module + self self.stack = [obj] + self.stack # top is front of list def pop(self): if not self.stack: raise error, 'underflow' top, self.stack = self.stack[0], self.stack[1:] return top def top(self): if not self.stack: raise error, 'underflow' return self.stack[0] def empty(self): return not self.stack # instance.empty( ) # overloads def __repr__(self): return '[Stack:%s]' % self.stack # print, backquotes,.. def __cmp__(self, other): return cmp(self.stack, other.stack) # '==', '>, '<=', '!=',.. def __len__(self): return len(self.stack) # len(instance), not instance def __add__(self, other): return Stack(self.stack + other.stack) # instance1 + instance2 def __mul__(self, reps): return Stack(self.stack * reps) # instance * reps def __getitem__(self, offset): return self.stack[offset] # intance[offset], in, for def __getslice__(self, low, high): return Stack(self.stack[low : high]) # instance[low:high] def __getattr__(self, name): return getattr(self.stack, name) # instance.sort()/reverse( )/.. Now distinct instances are created by calling the Stack class like a function. In most respects, the Stack class implements operations exactly like the stack module in Example 17-1. But here, access to the stack is qualified by self, the subject instance object. Each instance has its own stack attribute, which refers to the instance's own list. Furthermore, instance stacks are created and initialized in the __init__ constructor method, not when the module is imported. Let's make a couple of stacks to see how this all works in practice: >>> from stack2 import Stack >>> x = Stack( ) # make a stack object, push items >>> x.push('spam') >>> x.push(123) >>> x # __repr__ prints a stack [Stack:[123, 'spam']] >>> y = Stack( ) # two distinct stacks objects >>> y.push(3.1415) # they do not share content >>> y.push(x.pop( )) >>> x, y ([Stack:['spam']], [Stack:[123, 3.1415]]) >>> z = Stack( ) # third distinct stack object >>> for c in 'spam': z.push(c) ... >>> while z: print z.pop( ), # __len__ tests stack truth ... m a p s >>> z = x + y # __add__ handles stack + >>> z # holds three different types [Stack:['spam', 123, 3.1415]] >>> for item in z: print item, # __getitem__ does for ... spam 123 3.1415 Like lists and dictionaries, Stack defines both methods and operators for manipulating instances by attribute qualification and expressions. Additionally, it defines the __getattr__ metaclass method to intercept references to attributes not defined in the class and to route them to the wrapped list object (to support list methods: sort, append, reverse, etc.). Many of the module's operations become operators in the class. Table 17-2 shows the equivalence of module and class operations (columns 1 and 2) and gives the class method that comes into play for each (column 3).
In effect, classes let us extend Python's set of built-in types with reusable types implemented in Python modules. Class-based types may be used just like built-in types: depending on which operation methods they define, classes can implement numbers, mappings, and sequences, and may be mutable or not. Class-based types may also fall somewhere in between these categories. 17.2.3 Customization: Performance MonitorsSo far we've seen how classes support multiple instances and integrate better with Python's object model by defining operator methods. One of the other main reasons for using classes is to allow for future extensions and customizations. By implementing stacks with a class, we can later add subclasses that specialize the implementation for new demands. For instance, suppose we've started using the Stack class in Example 17-2, but we start running into performance problems. One way to isolate bottlenecks is to instrument data structures with logic that keeps track of usage statistics, which we can analyze after running client applications. Because Stack is a class, we can add such logic in a new subclass, without affecting the original stack module (or its clients). The subclass in Example 17-3 extends Stack to keep track of overall push/pop usage frequencies and to record the maximum size of each instance. Example 17-3. PP2E\Dstruct\Basic\stacklog.pyfrom stack2 import Stack # extends imported Stack class StackLog(Stack): # count pushes/pops, max-size pushes = pops = 0 # shared/static class members def __init__(self, start=[]): # could also be module vars self.maxlen = 0 Stack.__init__(self, start) def push(self, object): Stack.push(self, object) # do real push StackLog.pushes = StackLog.pushes + 1 # overall stats self.maxlen = max(self.maxlen, len(self)) # per-instance stats def pop(self): StackLog.pops = StackLog.pops + 1 # overall counts return Stack.pop(self) # not 'self.pops': instance def stats(self): return self.maxlen, self.pushes, self.pops # get counts from instance This subclass works the same as the original Stack; it just adds monitoring logic. The new stats method is used to get a statistics tuple through an instance: >>> from stacklog import StackLog >>> x = StackLog( ) >>> y = StackLog( ) # make two stack objects >>> for i in range(3): x.push(i) # and push object on them ... >>> for c in 'spam': y.push(c) ... >>> x, y # run inherited __repr__ ([Stack:[2, 1, 0]], [Stack:['m', 'a', 'p', 's']]) >>> x.stats(), y.stats( ) ((3, 7, 0), (4, 7, 0)) >>> >>> y.pop(), x.pop( ) ('m', 2) >>> x.stats(), y.stats( ) # my maxlen, all pushes, all pops ((3, 7, 2), (4, 7, 2)) Notice the use of class attributes to record overall pushes and pops, and instance attributes for per-instance maximum length. By hanging attributes on different objects, we can expand or narrow their scopes. 17.2.4 Optimization: Tuple Tree StacksOne of the nice things about wrapping objects up in classes is that you are free to change the underlying implementation without breaking the rest of your program. Optimizations can be added in the future, for instance, with minimal impact; the interface is unchanged, even if the internals are. There are a variety of ways to implement stacks, some more efficient than others. So far, our stacks have used slicing and concatenation to implement pushing and popping. This method is relatively inefficient: both operations make copies of the wrapped list object. For large stacks, this practice can add a significant time penalty. One way to speed up such code is to change the underlying data structure completely. For example, we can store the stacked objects in a binary tree of tuples: each item may be recorded as a pair: (object, tree), where object is the stacked item, and tree is either another tuple pair giving the rest of the stack or None to designate an empty stack. A stack of items [1,2,3,4] would be internally stored as a tuple tree (1,(2,(3,(4,None)))). This tuple-based representation is similar to the notion of "cons-cells" in Lisp-family languages: the object on the left is the car, and the rest of the tree on the right is the cdr. Because we add or remove only a top tuple to push and pop items, this structure avoids copying the entire stack. For large stacks, the benefit might be significant. The next class, shown in Example 17-4, implements these ideas. Example 17-4. PP2E\Dstruct\Basic\stack3.pyclass Stack: def __init__(self, start=[]): # init from any sequence self.stack = None # even other (fast)stacks for i in range(-len(start), 0): self.push(start[-i - 1]) # push in reverse order def push(self, node): # grow tree 'up/left' self.stack = node, self.stack # new root tuple: (node, tree) def pop(self): node, self.stack = self.stack # remove root tuple return node # TypeError if empty def empty(self): return not self.stack # is it 'None'? def __len__(self): # on: len, not len, tree = 0, self.stack while tree: len, tree = len+1, tree[1] # visit right subtrees return len def __getitem__(self, index): # on: x[i], in, for len, tree = 0, self.stack while len < index and tree: # visit/count nodes len, tree = len+1, tree[1] if tree: return tree[0] # IndexError if out-of-bounds else: raise IndexError # so 'in' and 'for' stop def __repr__(self): return '[FastStack:' + `self.stack` + ']' This class's __getitem__ method handles indexing, in tests, and for loop iteration as before, but this version has to traverse a tree to find a node by index. Notice that this isn't a subclass of the original Stack class. Since nearly every operation is implemented differently here, inheritance won't really help. But clients that restrict themselves to the operations that are common to both classes can still use them interchangeably -- they just need to import a stack class from a different module to switch implementations. Here's a session with this stack version; as long as we stick to pushing, popping, indexing, and iterating, this version is essentially indistinguishable from the original: >>> from stack3 import Stack >>> x = Stack( ) >>> y = Stack( ) >>> for c in 'spam': x.push(c) ... >>> for i in range(3): y.push(i) ... >>> x [FastStack:('m', ('a', ('p', ('s', None))))] >>> y [FastStack:(2, (1, (0, None)))] >>> len(x), x[2], x[-1] (4, 'p', 'm') >>> x.pop( ) 'm' >>> x [FastStack:('a', ('p', ('s', None)))] >>> >>> while y: print y.pop( ), ... 2 1 0 17.2.5 Optimization: In-place List ModificationsPerhaps a better way to speed up the stack object, though, is to fall back on the mutability of Python's list object. Because lists can be changed in place, they can be modified more quickly than any of the prior examples. In-place change operations like append are prone to complications when a list is referenced from more than one place. But because the list inside the stack object isn't meant to be used directly, we're probably safe here. The module in Example 17-5 shows one way to implement a stack with in-place changes; some operator overloading methods have been dropped to keep this simple. The new Python pop method it uses is equivalent to indexing and deleting the item at offset -1 (top is end-of-list here). Example 17-5. PP2E\Dstruct\Basic\stack4.pyerror = 'stack4.error' # when imported: local exception class Stack: def __init__(self, start=[]): # self is the instance object self.stack = [] # start is any sequence: stack.. for x in start: self.push(x) def push(self, obj): # methods: like module + self self.stack.append(obj) # top is end of list def pop(self): if not self.stack: raise error, 'underflow' return self.stack.pop( ) # like fetch and delete stack[-1] def top(self): if not self.stack: raise error, 'underflow' return self.stack[-1] def empty(self): return not self.stack # instance.empty( ) def __len__(self): return len(self.stack) # len(instance), not intance def __getitem__(self, offset): return self.stack[offset] # instance[offset], in, for def __repr__(self): return '[Stack:%s]' % self.stack This version works like the original in module stack2, too -- just replace stack2 with stack4 in the previous interaction to get a feel for its operation. The only obvious difference is that stack items are in reverse when printed (i.e., the top is the end): >>> from stack4 import Stack >>> x = Stack( ) >>> x.push('spam') >>> x.push(123) >>> x [Stack:['spam', 123]] >>> >>> y = Stack( ) >>> y.push(3.1415) >>> y.push(x.pop( )) >>> x, y ([Stack:['spam']], [Stack:[3.1415, 123]]) >>> y.top( ) 123 17.2.6 Timing the ImprovementsThe in-place changes stack object probably runs faster than both the original and the tuple-tree version, but the only way to really be sure how much faster is to time the alternative implementations. Since this could be something we'll want to do more than once, let's first define a general module for timing functions in Python. In Example 17-6, the built-in time module provides a clock function that we can use to get the current CPU time in floating-point seconds, and the function timer.test simply calls a function reps times and returns the number of elapsed seconds by subtracting stop from start CPU times. Example 17-6. PP2E\Dstruct\Basic\timer.pydef test(reps, func, *args): import time start = time.clock( ) # current CPU tim in float seconds for i in xrange(reps): # call function reps times apply(func, args) # discard any return value return time.clock( ) - start # stop time - start time Next, we define a test driver script (see Example 17-7). It expects three command-line arguments: the number of pushes, pops, and indexing operations to perform (we'll vary these arguments to test different scenarios). When run at the top level, the script creates 200 instances of the original and optimized stack classes, and performs the specified number of operations on each stack.[2] Pushes and pops change the stack; indexing just accesses it.
Example 17-7. PP2E\Dstruct\Basic\stacktime.pyimport stack2 # list-based stacks: [x]+y import stack3 # tuple-tree stacks: (x,y) import stack4 # in-place stacks: y.append(x) import timer # general function timer function rept = 200 from sys import argv pushes, pops, items = eval(argv[1]), eval(argv[2]), eval(argv[3]) def stackops(stackClass): #print stackClass.__module__ x = stackClass('spam') # make a stack object for i in range(pushes): x.push(i) # exercise its methods for i in range(items): t = x[i] for i in range(pops): x.pop( ) print 'stack2:', timer.test(rept, stackops, stack2.Stack) # pass class to test print 'stack3:', timer.test(rept, stackops, stack3.Stack) # rept*(push+pop+ix) print 'stack4:', timer.test(rept, stackops, stack4.Stack) Here are some of the timings reported by the test driver script. The three outputs represent the measured run times in seconds for the original, tuple, and in-place stacks. For each stack type, the first test creates 200 stack objects and performs roughly 120,000 stack operations (200 rept x (200 pushes + 200 indexes + 200 pops)), in the test duration times listed. These results were obtained on a 650 MHz Pentium III Windows machine, and a Python 1.5.2 install: C:\...\PP2E\Dstruct\Basic>python stacktime.py 200 200 200 stack2: 1.67890008213 stack3: 7.70020952413 stack4: 0.694291724635 C:\...\PP2E\Dstruct\Basic>python stacktime.py 200 50 200 stack2: 1.06876246669 stack3: 7.48964866994 stack4: 0.477584270605 C:\...\PP2E\Dstruct\Basic>python stacktime.py 200 200 50 stack2: 1.34536448817 stack3: 0.795615917129 stack4: 0.57297976835 C:\...\PP2E\Dstruct\Basic>python stacktime.py 200 200 0 stack2: 1.33500477715 stack3: 0.300776077373 stack4: 0.533050336077 If you look closely enough, you'll notice that the results show that the tuple-based stack (stack3) performs better when we do more pushing and popping, but worse if we do much indexing. Indexing lists is extremely fast for built-in lists, but very slow for tuple trees -- the Python class must traverse the tree manually. The in-place change stacks (stack4) are almost always fastest, unless no indexing is done at all -- tuples won by a hair in the last test case.  Of course, we're talking about fractions of a second after many tens of thousands of operations; in many applications, your users probably won't care either way. |
| I l@ve RuBoard |


Select Month & Year
Total Worked: {{ minutesToReadable(report.totalWorked) }}
Attendance {{ months[month - 1] }}, {{ year }}
| Date | Status | Hours Worked |
| {{ a.date | date: 'mediumDate' }} | {{ a.status }} | {{ minutesToReadable(a.worked) }} |


- Type Parameters:
T
- the type of entity beans inserted updated or deleted
Generally a named update will be defined on the entity bean. This will take the form of either an actual sql insert update delete statement or a similar statement with bean name and property names in place of database table and column names. The statement will likely include named parameters.
The following is an example of named updates on an entity bean.
...
@NamedUpdates(value = {
@NamedUpdate(
name = "setTitle",
notifyCache = false,
update = "update topic set title = :title, postCount = :count where id = :id"),
@NamedUpdate(
name = "setPostCount",
notifyCache = false,
update = "update f_topic set post_count = :postCount where id = :id"),
@NamedUpdate(
name = "incrementPostCount",
notifyCache = false,
update = "update Topic set postCount = postCount + 1 where id = :id")
//update = "update f_topic set post_count = post_count + 1 where id = :id")
})
@Entity
@Table(name = "f_topic")
public class Topic {
...
}
The following show code that would use a named update on the Topic entity bean.
Update<Topic> update = DB.createUpdate(Topic.class, "incrementPostCount");
update.setParameter("id", 1);
int rows = update.execute();
-
Method Summary
Modifier and TypeMethodDescriptionint
execute()
Execute the statement returning the number of rows modified.Return the sql that is actually executed.getName()
Return the name if it is a named update.Set an ordered bind parameter.Set a named parameter.Set a label meaning performance metrics will be collected for the execution of this update.setNotifyCache
(boolean notifyCache) Set this to false if you do not want the cache to invalidate related objects.setNull
(int position, int jdbcType) Set an ordered parameter that is null.Set a named parameter that is null.setNullParameter
(int position, int jdbcType) Set an ordered parameter that is null (same as bind).setNullParameter
(String name, int jdbcType) Bind a named parameter that is null (same as bind).setParameter
(int position, Object value) Set and ordered bind parameter (same as bind).setParameter
(String name, Object param) Bind a named parameter (same as bind).setTimeout
(int secs) Set a timeout for statement execution.
-
Method Details
-
getName
String getName()Return the name if it is a named update. -
setNotifyCache
Set this to false if you do not want the cache to invalidate related objects.If you don't set this Ebean will automatically invalidate the appropriate parts of the "L2" server cache.
-
setTimeout
Set a timeout for statement execution.This will typically result in a call to setQueryTimeout() on a preparedStatement. If the timeout occurs an exception will be thrown - this will be a SQLException wrapped up in a PersistenceException.
- Parameters:
secs
- the timeout in seconds. Zero implies unlimited.
-
execute
int execute()Execute the statement returning the number of rows modified. -
set
Set an ordered bind parameter.position starts at value 1 (not 0) to be consistent with PreparedStatement.
Set a value for each ? you have in the sql.
- Parameters:
position
- the index position of the parameter starting with 1.value
- the parameter value to bind.
-
setParameter
Set and ordered bind parameter (same as bind).- Parameters:
position
- the index position of the parameter starting with 1.value
- the parameter value to bind.
-
setNull
Set an ordered parameter that is null. The JDBC type of the null must be specified.position starts at value 1 (not 0) to be consistent with PreparedStatement.
-
setNullParameter
Set an ordered parameter that is null (same as bind). -
set
Set a named parameter. Named parameters have a colon to prefix the name.A more succinct version of setParameter() to be consistent with Query.
- Parameters:
name
- the parameter name.value
- the parameter value.
-
setParameter
Bind a named parameter (same as bind). -
setNull
Set a named parameter that is null. The JDBC type of the null must be specified.A more succinct version of setNullParameter().
- Parameters:
name
- the parameter name.jdbcType
- the type of the property being bound.
-
setNullParameter
Bind a named parameter that is null (same as bind). -
setLabel
Set a label meaning performance metrics will be collected for the execution of this update. -
getGeneratedSql
String getGeneratedSql()Return the sql that is actually executed.
-


Server Maintenance Information
Nothing
--- layout: default scrolljs: true ---
A free-to-play multiplayer Cops And Robbers Game, Developed for the Aston University Computing Team Project Module
{% include svg/download.svg %} Download Source CodeNothing
Set in America 2020, a country full of opportunities, people, and wealth. Having an abundance of wealth means more than ever. Nice cars a nice mansion and most importantly FAME!
It is time for The Robbers to come out of their hideouts and acquire some fame for themselves. On the other hand, The Cops’ numbers and their ways of suppressing criminals are now more tremendous than ever.
IN THIS CARDINAL BATTLE BETWEEN THE COPS AND THE ROBBERS, WHOSE SIDE WILL YOU CHOOSE?


Watershed ecosystem science has identified plenty of idiosyncrasy within watersheds,
but hasn't produced many general theories about watersheds at large. A major reason has
been the challenge of data access and integration across all the organizations that house watershed data.
(LTER,
CZO/CZ Net,
NEON,
DOE,
USFS, etc.).
MacroSheds unites stream and watershed data from all these sources on one platform, making it easy for anyone to explore the hydrology, water quality,
and biogeochemistry of rivers across North America and beyond.
Check out the Site Comparison tab to explore patterns across all sites within MacroSheds, or the Time Series page to closely compare time-series data for a few sites.
When you're ready for analysis, head to the Data tab where you can download everything we've put together.
This is
MacroSheds v1.0 beta, so all our major
features are in place, but there might still be some feature bugs or data errors.
Please
let us know if you find any!


To join a list, click "Add Me" or "Send Request". To remove yourself from a list, click "Remove Me".
General Next House lists
next-forum - high traffic mailing list for the house, open to everyone
next - important updates from Next Exec, Housemaster, and administration
next-laundry - information about your own or other people's laundry
Student group lists
next-bake
next-big-thing
next-code
nextgamers
next-make
next-quest
nextservice2013
next-sustain


Recipe Drawer
menu
Home
Recipes
About Us
Logout
Home
Recipes
About Us
Logout
Edit Profile
Username:
USERNAME
Email:
EMAIL
Name:
NAME
DOB:
DOB
Bio:
BIO:
New Recipe
Card Title
description
See Recipe
Edit Recipe


recreational fishing fisheries catches catch number {border-style commercial px;} #ffffff;} des sector Recreational Algerian Fisheries Marine estimated total Algeria Algeria, local reported vessels data fish fishers Sciences artisanal economic estimate pêche CPUE average lack revenue tonnes Fig government higher landing license licenses marine px; small-scale social vessel {font-family University font-size global Pauly annual correspondant cost difference double; impacts income landings les million multiplied practice small value year Catch Ecology Hence, Life Officiel Sumaila Table Zeller border-color border-width case fact fees impact management national paper potential remains sectors sold solid; traditional {font-style {font-weight Algerienne Belhabib Biology British Columbia, Conceptualization Dhou Décembre Economics Government National Republique Science. Social Spearfishing USD Writing [], assessed based bold considered courier; declining defined em; fisheries. high i.e. information landed law monitoring operating previous pt;} reconstructed scale sector. spearfishing stocks subsidies" times trips used vessels.


This website was developed using JavaEE, HTML5, CSS3 &
JavaScript,
runs on WildFly 10.x.
Persistence: JPA/Hibernate and PostgreSQL ORDBMS.
(April, 2017)
(April, 2017)


Survey Form
This survey is out to know the number of women in the Microverse school and their needs
Name
Selma
Martin
Email
Number
Submit