Stories from Around the World
by FCIT
Ananzi and the Lion
by Traditional
Additional Information
- Year Published: 2012
- Language: English
- Country of Origin: United States of America
- Source: Dasent, G.W. (Ed.). Popular Tales from the Norse
-
Readability:
- Flesch–Kincaid Level: 5.8
- Word Count: 1,366
- Genre: Fairy Tale/Folk Tale
- Keywords: fantasy, perseverance
- ✎ Cite This
Downloads
Once on a time Ananzi planned a scheme. He went to town and bought ever so many firkins of fat, and ever so many sacks, and ever so many balls of string, and a very big frying pan, then he went to the bay and blew a shell, and called the Head-fish in the sea, “Green Eel,” to him. Then he said to the fish, “The King sends me to tell you that you must bring all the fish on shore, for he wants to give them new life.”
So “Green Eel” said he would, and went to call them. Meanwhile Ananzi lighted a fire, and took out some of the fat, and got his frying pan ready, and as fast as the fish came out of the water he caught them and put them into the frying pan, and so he did with all of them until he got to the Head-fish, who was so slippery that he couldn’t hold him, and he got back again into the water.
When Ananzi had fried all the fish, he put them into the sacks, and took the sacks on his back, and set off to the mountains. He had not gone very far when he met Lion, and Lion said to him:
“Well, brother Ananzi, where have you been? I have not seen you a long time.”
Ananzi said, “I have been traveling about.”
“Oh! But what have you got there?” said the Lion.
“Oh! I have got my mother’s bones—she has been dead these forty-eleven years, and they say I must not keep her here, so I am taking her up into the middle of the mountains to bury her.”
Then they parted. After he had gone a little way, the Lion said: “I know that Ananzi is a great rogue; I dare say he has got something there that he doesn’t want me to see, and I will just follow him;” but he took care not to let Ananzi see him.
Now, when Ananzi got into the wood, he set his sacks down, and took one fish out and began to eat; then a fly came, and Ananzi said, “I cannot eat any more, for there is some one near;” so he tied the sack up, and went on farther into the mountains, where he set his sacks down, and took out two fish which he ate; and no fly came. He said, “There is no one near;” so he took out more fish. But when he had eaten about half a dozen the Lion came up and said:
“Well, brother Ananzi, a pretty tale you have told me.”
“Oh! Brother Lion, I am so glad you have come; never mind what tale I have told you, but come and sit down—it was only my fun.”
So Lion sat down and began to eat; but before Ananzi had eaten two fish, Lion had emptied one of the sacks. Then said Ananzi to himself:
“Greedy fellow, eating up all my fish.”
“What do you say, sir?”
“I only said you do not eat half fast enough,” for he was afraid the Lion would eat him up.
Then they went on eating, but Ananzi wanted to revenge himself, and he said to the Lion, “Which of us do you think is the stronger?”
The Lion said, “Why, I am, of course.”
Then Ananzi said, “We will tie one another to the tree, and we shall see which is the stronger.”
Now they agreed that the Lion should tie Ananzi first, and he tied him with some very fine string, and did not tie him tight. Ananzi twisted himself about two or three times, and the string broke.
Then it was Ananzi’s turn to tie the Lion, and he took some very strong cord. The Lion said, “You must not tie me tight, for I did not tie you tight.” And Ananzi said, “Oh! No, to be sure, I will not.” But he tied him as tight as ever he could, and then told him to try and get loose.
The Lion tried and tried in vain—he could not get loose.
Now there was a woman called Miss Nancy, who was going out one morning to get some “callalou” (spinach) in the wood, and as she was going she heard some one say, “Good morning, Miss Nancy!” She could not tell who spoke to her, but she looked where the voice came from, and saw the Lion tied to the tree.
“Good morning, Mr. Lion, what are you doing there?”
He said, “It is all that fellow Ananzi who has tied me to the tree, but will you loose me?”
 But he gave her his word he would not; still she could not trust him; but he begged her again and again, and said:
“Well, if I do try to eat you, I hope all the trees will cry out shame upon me.”
So at last she consented; but she had no sooner loosed him, than he came up to her to eat her, for he had been so many days without food that he was quite ravenous, but the trees immediately cried out, “Shame,” and so he could not eat her. Then she went away as fast as she could, and the Lion found his way home.
When Lion got home he told his wife and children all that happened to him, and how Miss Nancy had saved his life, so they said they would have a great dinner, and ask Miss Nancy. Now when Ananzi heard of it, he wanted to go to the dinner, so he went to Miss Nancy, and said she must take him with her as her child, but she said, “No.” Then he said, “I can turn myself into quite a little child and then you can take me,” and at last she said, “Yes;” and he told her, when she was asked what pap her baby ate, she must be sure to tell them it did not eat pap, but the same food as every one else; and so they went, and had a very good dinner, and set off home again—but somehow one of the Lion’s sons fancied that all was not right, and he told his father he was sure it was Ananzi, and the Lion set out after him.
Now as they were going along, before the Lion got up to them, Ananzi begged Miss Nancy to put him down, that he might run, which he did, and he got away and ran along the wood, and the Lion ran after him. When he found the Lion was overtaking him, he turned himself into an old man with a bundle of wood on his head—and when the Lion got up to him, he said, “Good morning, Mr. Lion,” and the Lion said, “Good morning, old gentleman.”
Then the old man said, “What are you after now?” and the Lion asked if he had seen Ananzi pass that way, but the old man said, “No, that fellow Ananzi is always meddling with some one; what mischief has he been up to now?”
Then the Lion told him, but the old man said it was no use to follow him any more, for he would never catch him, and so the Lion wished him good-day, and turned and went home again.


Marlabs- Divergence Lab
Welcome to Divergence Labs
Key Features of our Labs:
Generate Great Ideas
Design and test in fast Sprints
Thought Partner with YOU
Enable you for the Long Run
Have a look into our Divergence Lab
Web site
.


Usage
How to get started using anchart3d
These are the basic steps you need to go through - if you want more control please see the configuration.
Including the script in the html file
Setting up anchart3d is really simple and straightforward. First, you need to download the anchart3d.js and place it in your project folder - for example in a subfolder called "js". After that you simply need to include it in your html like this:
You do not need to include anything else - all dependecies are already bundled into that one file and you're ready to go. Have a look at the configuration to find out more.
Then you need to include a
 somewhere on your page. The div has to have an id with a name of your liking. For example, you could name it simply "chart":

Generating a chart via the fluent api
The last step would be to create a


SCARY MOVIE 2 RATING: 4/10
For more reviews and movie trailers, visit http://www.joblo.com/
PLOT: Something about a bunch of kids going into a haunted house and playing out parodies of other horror and non-horror movies. Oh yeah, there's also something about a ghost possessing the mansion and shit, but trust me, you won't care much about the "plot" in this film...
CRITIQUE: Parody movies either work or they don't and this one just doesn't work! The laughs aren't as pronounced this time around, the energy level, the gags and all of the characters just seem to be going through the motions here. It's like they were all in a hurry to finish the film or something (wink, wink). And the scariest part of it all? Check out the number of screenwriters it took to pen this puppy: seven! I say again, it took seven people to write 82-minutes worth of fart jokes, half-assed stunts and spoofs of films other than horror. Now I'm not exactly sure if each of the writers wrote their own parts separately or just tossed "funny sketch" ideas out there while smoking the chronic themselves, but the end result is a film that basically plays out like an extended skit on "Saturday Night Live". There are a couple of funny one-liners, but mostly just rehashed one-joke scenes, a lot of dead silence and lame gags. Add to that the very unoriginal title and movie poster and you gotta start asking yourself if anybody was even trying here (the film's website isn't even up yet!!! What the f***?!?). I do however have to give it up to James Woods, the man who opens up this movie with the funniest parody of them all (the EXORCIST take-off-- miss this and you've missed any reason to see the flick).  Very funny!
Unfortunately, the film plummets straight down after that, with dumb parodies of many teen flicks that have nothing to do with horror such as SAVE THE LAST DANCE and DUDE, WHERE'S MY CAR, and other action movies like CHARLIE'S ANGELS and MISSION IMPOSSIBLE 2. Now help me figure this one out, will you? Isn't this supposed to be a parody film of HORROR MOVIES?!? (or maybe that's just the title of the film F-ing with my head). Well, I'm sorry to have to say this but the only horror in this film is its lame-ass script! The Wayans brothers should have known better than to look towards the Weinstein brothers (money) instead of the Zucker brothers (comedy) for this sequel. Unfortunately for us, all we're left with here is a skeleton of a film which might've been funny, had it been worked over a few more times, tightened up here and there, and been injected with more solid laughs. But as things stand now, there is no doubt in my mind that the obvious greed to capitalize on the success of last year's film has led everyone down this path, so screw them for not trying as hard (critically speaking, of course).  Pooh on you! (That's telling 'em, JoBlo! Sheesh)
BTW, I'm allotting one point alone to actress Kathleen Robertson, whose massive breasts and skanky g-string had me chompin' at the bit. You go, girl! Everyone else...stay!
Where's JoBlo coming from? Airplane (10/10) - Airplane II (10/10) - Galaxy Quest (8/10) - Hannibal (7/10) - The Haunting (3/10) - Mafia (5/10) - Naked Gun (8/10) - Scary Movie (8/10) - Top Secret (9/10)
Review Date: July 3, 2001 Director: Keenan Ivory Wayans Writers: Seven different people! Producer: Eric L. Gold Actors: Anna Faris as Cindy Campbell Shawn Wayans as Ray Maker Marlon Wayans as Shorty Meeks Genre: Comedy Year of Release: 2001 ------------------------------------ JoBlo's Movie Emporium http://www.joblo.com/ ------------------------------------ (c) 2001 Berge Garabedian
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Server speed test
You can use this tool to test the servers located in different areas
Running
{{ x.name }}
Start
Check
Service free
Service free
Service allocated
Service allocated
Service usage
Service usage
Server free
Server free
Server total
Server total
Server usage
Server usage


Data Files¶
The core class in pygeostat is the DataFile
class which contains a Pandas DataFrame with the
data values and column names in addition to metadata, such as the name of the x, y and z coordinates
or grid definition.
DataFile Class¶
-
class
pygeostat.data.data.
DataFile
(flname=None, readfl=None, fltype=None, dftype=None, data=None, columns=None, null=None, title='data', griddef=None, dh=None, x=None, y=None, z=None, ifrom=None, ito=None, weights=None, cat=None, catdict=None, variables=None, notvariables=None, delimiter='\s+', headeronly=False, h5path=None, h5datasets=None, nreals=-1, tmin=None)¶ This class stores geostatistical data values and metadata.
DataFile classes may be created on initialization, or generated using pygeostat functions. This is the primary class for pygeostat and is used for reading and writing GSLIB, CSV, VTK, and HDF5 file formats.
Parameters: - flname (str) – Path (or name) of file to read
- readfl (bool) – True if the data file should be read on class initialization
- fltype (str) – Type of data file: either
csv
,gslib
orhdf5
- dftype (str) – Data file type as either ‘point’ or ‘grid’ used for writing out VTK files for visualization
- data (pandas.DataFrame) – Pandas dataframe containing array of data values
- dicts (List[dict] or dict) – List of dictionaries or dictionary for converting alphanumeric to numeric data
- null (float) – Null value for missing values in the data file
- title (str) – Title, or name, of the data file
- griddef (pygeostat.GridDef) – Grid definition for a gridded data file
- dh (str) – Name of drill hole variable
- x (str) – Name of X coordinate column
- y (str) – Name of Y coordinate column
- z (str) – Name of Z coordinate column
- ifrom (str) – Name of ‘from’ columns
- ito (str) – Name of ‘to’ columns
- weights (str or list) – Name of declustering weight column(s)
- cat (str) – Name of categorical (e.g., rock type or facies) column
- catdict (dict) – Set a dictionary for the categories, which should be formatted as:
catdict = {catcode:catname}
- variables (str or list) – Name of continuous variable(s), which if unspecified, are the columns not assigned to the above attributes (via kwargs or inference)
- notvariables (str or list) – Name of column(s) to exclude from variables
- delimiter (str) – Delimiter used in data file (ie: comma or space)
- headeronly (bool) – True to just read header + 1 line of data file This is useful for getting column numbers of large files OR if reading hdf5 files will only read in the hdf5 store information
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
read the dataset(s) specified by the argument
datasets
from. The dataset name cannot be passed using this argument, it is interpreted as a group name only. A value ofNone
places the dataset into the root directory of the HDF5 file. A value ofFalse
loads a blank pd.DataFrame(). - h5datasets (str or list) – Name of the dataset(s) to read from the group specified by
h5path
. Does nothing ifh5path
points to a dataset. - columns (list) – List of column labels to use for the resulting
data
pd.DataFrame - nreals (int) – number of realizations to read in. -1 will read all
- tmin (float) – If a number is provided, values less than this number (e.g., trimmed or null values) are convernted to NaN. May be useful since NaN’s are more easily handled within python, matplotlib and pandas. Set to None to disable.
Examples
Quickly reading in a GeoEAS data file:
data_file = gs.DataFile(flname='../data/oilsands.dat')
To read in a GeoEAS datafile and assign attributes
# Point Data Example data_file = gs.DataFile(flname='../data/oilsands.dat',readfl=True,dh='Drillhole Number', x='East',y='North',z='Elevation')
# Gridded Data Example griddef = gs.GridDef('''10 0.5 1 10 0.5 1 10 0.5 1''') data_file = gs.DataFile(flname='../data/3DDecor.dat', griddef=griddef) # To view grid definition string print(data_file.griddef()) # Access some Grid Deffinition attributes data_file.griddef.count() # returns number of blocks in grid data_file.griddef.extents() # returns an array of the extents for all directions data_file.griddef.nx # returns nunmber of blocks in x direction
HDF5
Using the HDF5 file format has its own positive features. For one it reads and writes much faster then using the ASCII format. Attributes (like the grid definition) can also be saved within the file. All files for a single project can also be saved in the same file. Please refer to the introduction on HDF5 files for more information
This class currently only searches for and loads a grid definition.
Examples
HDF5 file simple read example:
data_file = gs.DataFile(flname='../data/oilsands_out.hdf5')
To view the HDF5 header information (tables stored in the file):
data_file.store
If you have a HDF5 file with multiple tables and you just want to read in the file information to view what tables are in the file and any attributes saved to the file you can do a header style only read:
data_file = gs.DataFile(flname='../data/oilsands_out.hdf5', dftype='hdf5', headeronly=True)
Then to see what tables are written in the hdf5 file:
data_file.store
DataFile Attributes¶
Attributes of a datafile
object are accessed with datafile.<attribute>
.
Columns¶
Access the columns
of the datafile. Wrapper for datafile.data.columns
.
Num Variables¶
Access the nvar
of the datafile. e.g., the len(datafile.variables)
Locations¶
Access the locations
stored in the datafile. Wrapper for datafile[datafile.xyz]
.
Example:
>>> datafile = gs.DataFile("somefile.out") # this file has an x, y[, z] attribute that is found
>>> datafile.locations
... dataframe of x, y, z locations
Shape¶
Access the shape
of the data stored in the datafile. Wrapper for datafile.data.shape
Example:
>>> datafile = gs.DataFile("somefile.out")
>>> datafile.shape
... shape of datafile.data
Rename Columns¶
-
DataFile.
rename
(columns)¶ Applies a dictionary to alter self.DataFrame column names. This applies the DataFrame.rename function, but updates any special attributes (dh, x, y, etc.) with the new name, if previously set to the old name. Users should consider using the self.columns property if changing all column names.
Parameters: columns (dict) – formatted as {oldname1: newname1, oldname2:newname2}, etc, where the old and new names are strings. The old names must be present in data.columns.
Drop Columns¶
-
DataFile.
drop
(columns)¶ This applies the DataFrame.drop function, where axis=1, inplace=True and columns is used in place of the labels. It also updates any special attributes (dh, x, y, etc.), setting them to None if dropped. Similarly, if any variables are dropped, they are removed from self.variables.
Parameters: columns (str or list) – column names to drop
Check for Duplicate Columns¶
-
DataFile.
check_for_duplicate_cols
()¶ Run a quick check on the column names to see if any of them are duplicated. If they are duplicated then print a Warning and rename the columns
Set Columns¶
-
DataFile.
setcol
(colattr, colname=None)¶ Set a specialized column attribute (
dh, ifrom, ito, x, y, z, cat or weights
) for theDataFile
, whereDataFile.data
must be initialized. If colname is None, then the attribute will be set if a common name for it is detected inDataFile.data
.columns (e.g., ifcolattr='dh'
andcolname=None
, and'DHID'
is found inDataFile.data
, thenDataFile.dh='DHID'
. The attribute will be None if none of the common names are detected. If colname is not None, then the provided string will be assigned to the attribute, e.g. DataFile.colattr=colname. Note, however, that an error will be thrown if colname is not None and colname is not inDataFile.data
.columns. This is used on DataFile initialization, but may also be useful for calling after specialized columns are altered.Parameters: - colattr (str) – must match one of:
'dh'
,'ifrom'
,'ito'
,'x'
,'y'
,'z'
,'cat'
or'weights'
- colname (str or list) – if not None, must be the name(s) of a column in
DataFile.data
. List is only valid ifcolattr=weights
Examples
Set the x attribute (dat.x) based on a specified value:
>>> dat.setcol('x', 'Easting')
Set the x attribute (dat.x), where the function checks common names for x:
>>> dat.setcol('x')
- colattr (str) – must match one of:
Set Variable Columns¶
-
DataFile.
setvarcols
(variables=None, notvariables=None)¶ Set the variables for the DataFile. If provided, the function checks that the variables are present in the DataFrame. If not provided, the function assigns columns that are not specified as the variables (
dh, x, y, z, rt, weights
), as well as a list of user specified notvariables.This is used on DataFile initialization, but may also be useful for calling after variables are added or removed.
Parameters: - variables (list or str) – list of strings
- notvariables (list or str) – list of strings
Examples
Set the variables based on a specified list:
>>> dat.setvarcols(variables=['Au', 'Carbon'])
Set the variables based on the function excluding specialized columns (dh, x, y, etc.):
>>> dat.setvarcols()
Set the variables based on the function excluding specialized columns (dh, x, y, etc.), as well as a user specified list of what is not a variable:
>>> dat.setvarcols(notvariables=['Data Spacing', Keyout'])
Set Categorical Dictionary¶
-
DataFile.
setcatdict
(catdict)¶ Set a dictionary for the categories, which should be formatted as:
>>> catdict = {catcode:catname}
Example
>>> catdict = {0: "Mudstone", 1: "Sandstone"} >>> self.setcatdict(catdict)
Check DataFile¶
-
DataFile.
check_datafile
(flname, variables, sep, fltype)¶ Run some quick checks on the DataFile before writing and grab info if not provided
Add Coord¶
-
DataFile.
addcoord
()¶ Only use on DataFile classes containing GSLIB style gridded data.
If x, y, or z coordinate column(s) do not exist they are created. If the created or current columns only have null values, they are populated based on the GridDef class pass to the DataFile class.
Note
A griddef must be assigned to the DataFile class either at read in like here
>>> data_file = gs.DataFile(flname='test.out', griddef=grid)
Or later such it can be manually assigned such as here
>>> data_file.griddef = gs.GridDef(gridstr=my_grid_str)
Apply Dictionary¶
-
DataFile.
applydict
(origvar, outvar, mydict)¶ Applies a dictionary to the original variable to get a new variable.
This is particularly useful for alphanumeric drill hole IDs which cannot be used in GSLIB software.
Parameters: - origvar (str) – Name of original variable.
- outvar (str) – Name of output variable.
- mydict (dict) – Dictionary of values to apply.
Examples
>>> data_file.applydict('Drillhole', 'Drillhole-mod', mydict)
Describe DataFile¶
-
DataFile.
describe
(variables=None)¶ Describe a data set using pandas describe(), but exclude special variables.
Keyword Arguments: variables (List(str)) – List of variables to describe. Returns: Pandas description of variables. Return type: self.data[variables]describe() Examples
Describe all none special variables in the DataFrame (will exclued columns set as dh ID, coordinate columns, etc.)
>>> data_file.describe()
Or describe specific variables
>>> data_file.describe(['Bitumen', 'Fines'])
Infer Grid Definition¶
-
DataFile.
infergriddef
(blksize=None, databuffer=5, nblk=None)¶ Infer a grid definition with the specified dimensions to cover the set of data values. The function operates with two primary options:
- Provide a block size (node spacing), the function infers the required number of blocks (grid nodes) to cover the data
- Provide the number of blocks, the function infers the required block size
A data buffer may be used for expanding the grid beyond the data extents. Basic integer rounding is also used for attempting to provide a ‘nice’ grid in terms of the origin alignment.
Parameters: - blksize (float or 3-tuple) – provides (xsiz, ysiz, zsiz). If blksize is not None, nblk must be None. Set zsiz None if the grid is 2-D. A float may also be provided, where xsiz = ysiz = zsiz = float is assumed.
- databuffer (float or 3-tuple) – buffer between the data and the edge of the model, optionally for each direction
- nblk (int or 3-tuple) – provides (nx, ny, nz). If blksize is not None, nblk must be None. Set nz to None or 1 if the grid is 2-D. An int may also be provided, where nx = ny = nz = int is assumed.
Returns: this function returns the grid definition object as well as assigns the griddef to the current gs.DataFile
Return type: griddef (GridDef)
Note
this function assumes things are either 3D or 2D along the xy plane. If nx == 1 or ny == 1, nonsense will result!
Usage:
First, import a datafile using gs.DataFile(), make sure to assign the correct columns to x, y and z:
>>> datfl = gs.DataFile('test.dat',x='x',y='y',z='z')
Now create the griddef from the data contained within the dataframe:
>>> blksize = (100, 50, 1) >>> databuffer = (10, 25, 0) # buffer in the x, y and z directions >>> griddef = datfl.infergriddef(blksize, databuffer)
Check by printing out the resulting griddef:
>>> print(griddef)
File Name String¶
-
DataFile.
__str__
()¶ Return the name of the data file if asked to ‘print’ the data file… or use the datafile in a string!
Generate Dictionary¶
-
DataFile.
gendict
(var, outvar=None)¶ Generates a dictionary with unique IDs from alphanumeric IDs. This is particularly useful for alphanumeric drill hole IDs which cannot be used in GSLIB software.
Parameters: var (str) – Variable to generate a dictionary for Keyword Arguments: outvar (str) – Variable to generate using generated dictionary. Returns: Dictionary of alphanumerics to numeric ids. Return type: newdict (dict) Examples
A simple call
>>> data_file.gendict('Drillhole')
OR
>>> dh_dict = data_file.gendict('Drillhole')
GSLIB Column¶
-
DataFile.
gscol
(variables, string=True)¶ Returns the GSLIB (1-ordered) column given a (list of) variable(s).
Parameters: variables (str or List(str)) – Path, or name, of the data file. Keyword Arguments: string (bool) – If True returns the columns as a string. Returns: GSLIB 1-ordered column(s). Return type: cols (int or List(int) or string) Note
None input returns a 0, which may be necessary, for example, with 2-D data: >>> data.xyz … [‘East’, ‘North’, None] >>> data.gscol(data.xyz) … ‘2 3 0’
Examples
Some simple calls
>>> data_file.gscol('Bitumen') ... 5
>>> data_file.gscol(['Bitumen', 'Fines']) ... [5, 6]
>>> data_file.gscol(['Bitumen', 'Fines'], string=True) ... '5 6'
Truncate NaN’s¶
-
DataFile.
truncatenans
(variable)¶ Returns a truncated list with nans removed for a variable.
Parameters: variable (str) – Name of original variable. Returns: Truncated values. Return type: truncated (values) Examples
A simple call that will return the list
>>> data_file.truncatenans('Bitumen')
Unique Categories¶
-
DataFile.
unique_cats
(variable, truncatenans=False)¶ Returns a sorted list of the unique categories given a variable.
Parameters: variable (str) – Name of original variable. Keyword Arguments: truncatenans (bool) – Truncates missing values if True. Returns: Sorted, list of set(object). Return type: unique_cats (List(object)) Examples
A simple call that
>>> data_file.unique_cats('Drillhole')
Or to save the list
>>> unique_dh_list = data_file.unique_cats('Drillhole')
Write file¶
-
DataFile.
write_file
(flname, title=None, variables=None, fmt=None, sep=None, fltype=None, data=None, h5path=None, griddef=None, null=None)¶ Writes out a GSLIB-style, VTK, CSV, Excel (XLSX), HDF5 data file.
Parameters: flname (str) – Path (or name) of file to write out.
Keyword Arguments: - title (str) – Title for output file.
- variables (List(str)) – List of variables to write out if only a subset is desired.
- fmt (str) – Format to use for floating point numbers.
- sep (str) – Delimiter to use for file output, generally don’t need to change.
- fltype (str) – Type of file to write either
gslib
,vtk
,csv
,xlsx
, orhdf5
. - data (str) – Subset of data to write out - cannot be used with variables option!
- h5path (str) – The h5 group path to write data to (H5 filetype)
- griddef (obj) – a gslib griddef object
- null (float) – If a number is provided, NaN numbers are converted to this value prior to writing. May be useful since NaN’s are more easily handled within python and pandas than null values, but are not valid in GSLIB. Set to None to disable (but NaN’s must be handled prior to this function call if so).
Note
pygeostat.write_file is saved for backwards compatibility or as an overloaded class method. Current write functions can be called seperately with the functions listed below:
>>> import pygeostat as gs >>> import pandas as pd >>> gs.write_gslib(gs.DataFile or pd.DataFrame) >>> gs.write_csv(gs.DataFile or pd.DataFrame) >>> gs.write_hdf5(gs.DataFile or pd.DataFrame) >>> gs.write_vtk(gs.DataFile or pd.DataFrame)
The following calls are equivalent:
>>> data_file.write_file('testgslib.out')
is equivalent to:
>>> gs.write_gslib(data_file, 'testgslib.out')
and similar to:
>>> gs.write_gslib(data_file.data, 'testgslib.out')
Data Spacing¶
-
DataFile.
spacing
(n_nearest, var=None, inplace=True, dh=None, x=None, y=None)¶ Calculates data spacing in the xy plane, based on the average distance to the nearest n_nearest neighbours. The x, y coordinates of 3-D data may be provided in combination with a dh (drill hole or well), in which case the mean x, y of each dh is calculated before performing the calculation. If a dh is not provided in combination with 3-D xy’s, then calculation is applied to all data and may create memory issues if greater than ~5000-10000 records are provided. A var specifier allows for the calculation to only applied where var is not NaN.
If
inplace==True
:The output is concatenated as a ‘Data Spacing ({Parameters[‘plotting.unit’]})’ column ifinplace=False
(or ‘Data Spacing’ if Parameters[‘plotting.unit’] is None). If var is used, then the calculation is only performed where DataFile[var] is not NaN, and the output is concatenated as ‘{var} Data Spacing ({Parameters[‘plotting.unit’]})’.If
inplace==False
:The funciton returns dspace as a numpy array if dspace.shape[0] is equal to DataFile.shape[0], meaning that dh and var functionality was not used, or did not lead to differences in the length of dspace and DataFile (so that the x and y in DataFile can be used for plotting dspace in map view). The function returns a tuple of the form (dspace, dh, x, y), if dh is not None and dspace.shape[0] is not equal to DataFile.shape[0]. The function returns a tuple of the form (dspace, x, y) if dh is None and and var is not None and dspace.shape[0] is not equal to DataFile.shape[0].Parameters: - n_nearest (int) – number of nearest neighbours to consider in data spacing calculation
- var (str) – variable for calculating data spacing, where the calculation is only applied to locations where var is not NaN. If None, the calculation is to all locations.
- inplace (bool) – if True, the output data spacing is concatenated
- dh (str) – dh name, which can override self.dh
- x (str) – x coordinate name, which can override self.x
- y (str) – y coordinate name, which can override self.y
Examples
Calculate data spacing without consideration of underlying variables, based on the nearest 8 neighbours.
>>> dat.spacing(8)
Output as a numpy array rather than concatenating a column:
>>> dspace = dat.spacing(8, inplace=False):
Only consider values where Au is non NaN for the calculation:
>>> (dspace, x, y) = dat.spacing(8, inplace=False, var=Au)
Example Data¶
-
pygeostat.data.data.
ExampleData
(testfile, griddef=None, **kwargs)¶ Get an example pygeostat DataFile
Parameters: testfile (str) – one of the available pygeostat test files, listed below Test files available in pygeostat include:
- “point2d_ind”: 2d indicator dataset
- “point2d_surf”: 2d point dataset sampling a surface
- “grid2d_surf”: ‘Thickness’ from ‘point2d_surf’ interpolated on the grid
- “point3d_ind_mv”: 3d multivariate and indicator dataset
- “oilsands”: 3D Oil sands data set
- “accuracy_plot”: Simulated realizations to test accuracy plot
- “location_plot”: 2D data set to test location plot
- “3d_grid”: 3D gridded data set
- “point2d_mv” : 2D multivariate data set
- “cluster”: GSLIB datafile (data with declustering weights)
- “97data”: GSLIB datafile (the first 97 rows of cluster datafile)
- “data”: GSLIB datafile (2D data set of primary and secondary variable)
- “parta”: GSLIB datafile (small 2D dataset part A)
- “partb”: GSLIB datafile (small 2D dataset part B)
- “partc”: GSLIB datafile (small 2D dataset part C)
- “true”: GSLIB datafile (Primary secondary data pairs)
- “ydata”: GSLIB datafile (2D spatial seondary data with some primary data)
Input/Ouput Tools¶
iotools.py: Contains input/output utilities/functions for pygeostat. Many of which are based off of Pandas builtin functions.
Read File¶
-
pygeostat.data.iotools.
read_file
(flname, fltype=None, headeronly=False, delimiter='\\s*', h5path=None, h5datasets=None, columns=None, ireal=1, griddef=None, tmin=None)¶ Reads in a GSLIB-style Geo-EAS data file, CSV, or HDF5 data files.
Parameters: flname (str) – Path (or name) of file to read.
Keyword Arguments: - fltype (str) – Type of file to read: either
csv
,gslib
, orhdf5
. - headeronly (bool) – If True, only reads in the 1st line from the data file which is useful for just getting column numbers or testing. OR it allows you to open a hdf5 object with Pandas HDFStore functionality
- delimiter (str) – Delimiter specified instead of sniffing
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
read the dataset(s) specified by the argument
datasets
from. The dataset name cannot be passed using this argument, it is interpreted as a group name only. A value ofNone
places the dataset into the root directory of the HDF5 file. A value ofFalse
loads a blank pd.DataFrame(). - h5datasets (str or list) – Name of the dataset(s) to read from the group specified by
h5path
. Does nothing ifh5path
points to a dataset. - column (list) – List of column labels to use for resulting frame
- ireal (int) – Number of realizaitons in the file
- griddef (GridDef) – griddef for the realization
- tmin (float) – values less than this number are convernted to NaN, since NaN’s are natural handled within matplotlib, pandas, numpy, etc. If None, set to pygeostat.Parameters[‘data.tmin’].
Returns: Pandas DataFrame object with input data.
Return type: data (pandas.DataFrame)
Note
Functions can also be called seperately with the following code
>>> data.data = pygeostat.read_gslib(flname) >>> data.data = pygeostat.read_csv(flname) >>> data.data = pygeostat.read_h5(flname, h5path='') >>> data.data = pygeostat.open_hdf5(flname)
- fltype (str) – Type of file to read: either
Read CSV¶
-
pygeostat.data.iotools.
read_csv
(flname, headeronly=False, tmin=None)¶ Reads in a GSLIB-style CSV data file.
Parameters: flname (str) – Path (or name) of file to read.
Keyword Arguments: - headeronly (bool) – If True, only reads in the 1st line from the data file which is useful for just getting column numbers or testing
- delimiter (str) – Delimiter specified instead of sniffing
- tmin (float) – values less than this number are convernted to NaN, since NaN’s are natural handled within matplotlib, pandas, numpy, etc. If None, set to pygeostat.Parameters[‘data.tmin’].
Returns: Pandas DataFrame object with input data.
Return type: data (pandas.DataFrame)
Read GSLIB Python¶
-
pygeostat.data.iotools.
read_gslib
(flname, headeronly=False, delimiter='\\s*', tmin=None)¶ Reads in a GSLIB-style Geo-EAS data file
Parameters: flname (str) – Path (or name) of file to read.
Keyword Arguments: - headeronly (bool) – If True, only reads in the 1st line from the data file which is useful for just getting column numbers or testing
- delimiter (str) – Delimiter specified instead of sniffing
- tmin (float) – values less than this number are convernted to NaN, since NaN’s are natural handled within matplotlib, pandas, numpy, etc. If None, set to pygeostat.Parameters[‘data.tmin’].
Returns: Pandas DataFrame object with input data.
Return type: data (pandas.DataFrame)
Write GSLIB Python¶
-
pygeostat.data.iotools.
write_gslib
(data, flname, title=None, variables=None, fmt=None, sep=' ', null=None)¶ Writes out a GSLIB-style data file.
Parameters: - data (pygeostat.DataFile or pandas.DataFrame) – data to write out
- flname (str) – Path (or name) of file to write out.
Keyword Arguments: - title (str) – Title for output file.
- variables (List(str)) – List of variables to write out if only a subset is desired.
- fmt (str) – Format to use for floating point numbers.
- sep (str) – Delimiter to use for file output, generally don’t need to change.
- null (float) – NaN numbers are converted to this value prior to writing. If None, set to data.null. If data.Null is None, set to pygeostat.Parameters[‘data.null’].
Write CSV¶
-
pygeostat.data.iotools.
write_csv
(data, flname, variables=None, fmt='%.5f', sep=', ', fltype='csv', null=None)¶ Writes out a CSV or Excel (XLSX) data file.
Parameters: - data (pygeostat.DataFile or pandas.DataFrame) – data to write out
- flname (str) – Path (or name) of file to write out.
Keyword Arguments: - variables (List(str)) – List of variables to write out if only a subset is desired.
- fmt (str) – Format to use for floating point numbers.
- sep (str) – Delimiter to use for file output, generally don’t need to change.
- fltype (str) – Type of file to write either
csv
orxlsx
. - null (float) – NaN numbers are converted to this value prior to writing. If None, set to data.null. If data.Null is None, set to pygeostat.Parameters[‘data.null’].
Write VTK¶
-
pygeostat.data.iotools.
write_vtk
(data, flname, dftype=None, x=None, y=None, z=None, variables=None, griddef=None, null=None, vdtype=None, cdtype=None)¶ Writes out an XML VTK data file. A required dependency is pyevtk, which may be installed using the following command:
>>> pip install pyevtk
Users are also recommended to install the latest Paraview, as versions from 2017 were observed to have odd precision bugs with the XML format.
Parameters: - data (pygeostat.DataFile) – data to write out
- flname (str) – Path (or name) of file to write out (without extension)
Keyword Arguments: - dftype (str) – type of datafile options
grid
orpoint
, which if None, is drawn from data.dftype - x (str) – name of the x-coordinate, which is used if
point
. Drawn from data.x if the kwarg=None. If not provided by these means for`sgrid`
, calculated viasim.griddef.get_coordinates()
. - y (str) – name of the y-coordinate, which is used if
point
. Drawn from data.y if the kwarg=None. If not provided by these means for`sgrid`
, calculated via sim.griddef.get_coordinates(). - z (str) – name of the z-coordinate, which is used if
point
. Drawn from data.z if the kwarg=None. If not provided by these means for`sgrid`
, calculated via sim.griddef.get_coordinates(). - griddef (pygeostat.GridDef) – grid definition, which is required if
grid
. Drawn from data.griddef if the kwarg=None. - variables (list or str) – List or string of variables to write out. If None, then all columns aside from coordinates are written out by default.
- null (float) – NaNs are converted to this value prior to writing. If None, set to pygeostat.Parameters[‘data.null_vtk’].
- vdtype (dict(str)) – Dictionary of the format {‘varname’: dtype}, where dtype is
a numpy data format. May be used for reducing file size, by
specifying
int
,float32
, etc. If a format string is provided instead of a dictionary, that format is applied to all variables. This is not applied to coordinate variables (if applicable). If None, the value is drawn from Parameters[‘data.write_vtk.vdtype’]. - cdtype (str) – Numpy format to use for the output of coordinates, where valid formats
are
float64
(default) andfloat32
. The later is recommended for reducing file sizes, but may not provide the requisite precision for UTM coordinates. If None, the value is drawn from Parameters[‘data.write_vtk.cdtype’].
dftype
should be one of:- ‘point’ (irregular points) where
data.x
,data.y
anddata.z
are columns indata.data
- ‘grid’ (regular or rectilinear grid) where
data.griddef
must be initialized - ‘sgrid’ (structured grid) where
data.x
,data.y
anddata.z
are columns indata.data
.data.griddef
should also be initialized, although onlygriddef.nx
,griddef.ny
andgriddef.nz
are utilized (since the grid is assumed to not be regular)
Write HDF5 VTK¶
-
pygeostat.data.iotools.
write_hvtk
(data, flname, griddef, variables=None)¶ Writes out an H5 file and corresponding xdmf file that Paraview can read. Currently only supports 3D gridded datasets. This function will fail if the length of the DataFile or DataFrame does not equal
griddef.count()
.The extension xdmf is silently enforced. Any other extension passed is replaced.
Parameters: - data (pd.DataFrame) – The DataFrame to writeout
- flname (str) – Path (or name) of file to write out.
- griddef (GridDef) – Grid definitions for the realizations to be written out
- variables (str or list) – optional set of variables to write out from the DataFrame
Count Lines in File¶
-
pygeostat.data.iotools.
file_nlines
(flname)¶ Open a file and get the total number of lines. Seems pretty fast. Copied from stackoverflow http://stackoverflow.com/questions/845058/how-to-get-line-count-cheaply-in-python
Parameters: flname (str) – Name of the file to read
Write CCG GMM¶
-
pygeostat.data.iotools.
writeout_gslib_gmm
(gmm, outfile)¶ Writeout a fitted Gaussian mixture to the format consistent with
gmmfit
from the CCG Knowledge Base. Assumegmm
is a ansklearn.mixture.GaussianMixture
class fitted to dataNote
Recently GMM was replaced with GaussianMixture, and there are subtle differences in attributes between the different versions..
Parameters: - gmm (GaussianMixture) – a fitted mixture model
- outfile (str) – the output file
HDF5 I/O¶
Write HDF5¶
-
pygeostat.data.h5_io.
write_h5
(data, flname, h5path=None, datasets=None, dtype=None, gridstr=None, trim_variable=None, var_min=-998.0)¶ Write data to an HDF5 file using the python package H5PY. The file is appended to and in the case that a dataset already exists, it is overwritten.
Parameters: - data – A 1-D np.array/pd.Series or a
pd.DataFrame
containing different variables as columns - flname (str) – Path of the HDF5 you wish to write to or create
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
place the dataset(s) specified by the argument
datasets
into. The dataset name cannot be passed using this argument, it is interpreted as a group name. A value ofNone
places the dataset into the root directory of the HDF5 file. - datasets (str or list) – Name of the dataset(s) to write out. If a
pd.DataFrame
is passed, the values passed by the argumentdatasets
must match the DataFrame’s columns. - dtype (str) – The data type to write. Currently, only the following values are permitted:
['int32', 'float32', 'float64']
. If apd.DataFrame
is passed and this argument is left to it’s default value ofNone
, the DataFrame’s dtypes must be of the types listed above. - gridstr (str) – Grid definition string that is saved to the HDF5 file as an attribute
of the group defined by the parameter
h5path
. - trim_variable (str) – Variable to use for trimming the data. An index will be written to the h5file and will be used to rebuild dataset while only nontrimmed data will be written out
- var_min (float) – minimum trimming limit usedif trim_variable is passed
Examples
Write a single pd.Series or np.array to an HDF5 file:
>>> gs.write_h5(array, 'file.h5', h5path='Modeled/Var1', datasets='Realization_0001')
Write a whole
pd.DataFrame
in group (folder) ‘OriginalData’ that contains a dataset for every column in thepd.DataFrame
:>>> gs.write_h5('file.h5', DataFrame, h5path='OriginalData')
- data – A 1-D np.array/pd.Series or a
Read HDF5¶
-
pygeostat.data.h5_io.
read_h5
(flname, h5path=None, datasets=None, fill_value=-999)¶ Return a 1-D array from an HDF5 file or build a
pd.DataFrame()
from a list of datasets in a single group.The argument
h5path
must be a path to a group. If 1 or more specific variables are desired to be loaded, pass a list todatasets
to specify which to read.Parameters: - flname (str) – Path of the HDF5 you wish to write to or create
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
read the dataset(s) specified by the argument
datasets
from. The dataset name cannot be passed using this argument, it is interpreted as a group name only. A value ofNone
places the dataset into the root directory of the HDF5 file. A value ofFalse
loads a blank pd.DataFrame(). - datasets (str or list) – Name of the dataset(s) to read from the group specified by
h5path
. Does nothing ifh5path
points to a dataset. - fill_value (float or np.NaN) – value to fill in grid with if trimmed data was written out. default is -999
Returns: DataFrame containing one or more columns, each containing a single 1-D array of a variable.
Return type: data (pd.DataFrame)
Is HDF5¶
-
pygeostat.data.h5_io.
ish5dataset
(h5fl, dataset, h5path=None)¶ Check to see if a dataset exits within an HDF5 file
The argument
h5path
must be a path to a group and cannot contain the dataset name. Can only check for one dataset at a time.Parameters: - flname (str) – Path of the HDF5 you wish to check
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
check for the specified dataset. The dataset name cannot be passed using this
argument, it is interpreted as a group name only. A value of
None
places the dataset into the root directory of the HDF5 file. - dataset (str) – Name of the dataset to check for in the group specified by
h5path
.
Returns: Indicator if the specified dataset exists
Return type: exists (bool)
Combine Datasets from Multiple Paths¶
-
pygeostat.data.h5_io.
h5_combine_data
(flname, h5paths, datasets=None)¶ Combine data into one DataFrame from multiple paths in a HDF5 file.
Parameters: - flname (str) – Path of the HDF5 you wish to read from
- h5paths (list) – A list of h5paths to combine. Forward slash (/) delimited path through the
group hierarchy you wish to place the dataset(s) specified by the argument
datasets
into. The dataset name cannot be passed using this argument, it is interpreted as a group name. A value ofNone
places the dataset into the root directory of the HDF5 file. - datasets (list of lists) – If only a specific set of datasets from each path are desired then pass a list of lists of equal length as the h5paths list. An empty list within the list will cause all datasets in the corresponding path to be readin.
Returns: DataFrame
Example:
>>> flname = 'drilldata.h5' ... h5paths = ['/Orig_data/series4870/', 'NS/Declus/series4870/'] ... datasets = [['LOCATIONX', 'LOCATIONY', 'LOCATIONZ'], []] ... data = gs.h5_combine_data(flname, h5paths, datasets=datasets)
Pygeostat HDF5 Class¶
-
class
pygeostat.data.h5_io.
H5Store
(flname, replace=False)¶ A simple class within pygeostat to manage and use HDF5 files.
Variables: - flname (str) – Path to a HDF5 file to create or use
- h5data (h5py.File) – h5py File object
- paths (dict) – Dictionary containing all of the groups found in the HDF5 file that contain datasets
Parameters: flname (str) – Path to a HDF5 file to create or use
Usage:
Write a np.array or pd.Series to the HDF5 file:
>>> H5Store['Group1/Group2/Var1'] = np.array()
Write all the columns in a
pd.DataFrame
to the HDF5 file:>>> H5Store['Group1/Group2'] = pd.DataFrame()
Retrieve a single 1-D array:
>>> array = H5Store['Group1/Group2/Var1']
Retrieve a single 1-D array within the root directory of the HDF5 file:
>>> array = H5Store['Var1']
Retrieve the first value from the array:
>>> value = H5Store['Var1', 0]
Retrieve a slice of values from the array:
>>> values = H5Store['Var1', 10:15]
Write Data¶
-
H5Store.
__setitem__
(key, value)¶ Write the the HDF5 file using the self[key] notation.
If a pd.Series or np.array is passed, the last entry in the path is used as the dataset name. If a
pd.DataFrame
is passed, all columns are written to the path specified to datasets with their names retrieved from thepd.DataFrame
’s columns. If more flexible usage is required, please usegs.write_h5()
.Example
Write a np.array or pd.Series to the HDF5 file:
>>> H5Store['Group1/Group2/Var1'] = np.array()
Write all the columns in a
pd.DataFrame
to the HDF5 file:>>> H5Store['Group1/Group2'] = pd.DataFrame()
Read Data¶
-
H5Store.
__getitem__
(key)¶ Retrieve an array using the self[key] notation. The passed key is the path used to access the array desired and included direction through groups if required and the dataset name. The array may be selectively queried allowing a specific value or range of values to be loaded into the systems memory and not the whole array.
Example
Retrieve a single 1-D array:
>>> array = H5Store['Group1/Group2/Var1']
Retrieve a single 1-D array within the root directory of the HDF5 file:
>>> array = H5Store['Var1']
Retrieve the first value from the array:
>>> value = H5Store['Var1', 0]
Retrieve a slice of values from the array:
>>> values = H5Store['Var1', 10:15]
Print Contents of HDF5 File¶
-
H5Store.
__str__
()¶ Print a nice list of groups and the datasets found within them using the variable
self.paths
.Example
Print any groups found within the HDF5 file and the datasets within:
>>> print(H5Store)
Datasets in H5 Store¶
-
H5Store.
datasets
(h5path=None)¶ Return the datasets found in the specified group.
Keyword Arguments: h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to retrieve the lists of datasets from. A dataset name cannot be passed using this argument, it is interpreted as a group name. A value of None
places the dataset into the root directory of the HDF5 file.Returns: List of the datasets found within the specified h5path Return type: datasets (list)
Generate Iterator¶
-
H5Store.
iteritems
(h5path=None, datasets=None, wildcard=None)¶ Produces an iterator that can be used to iterate over HDF5 datasets.
Can use the parameter
h5path
to indicate which group to retrieve the datasets from. If a set of specific datasets are required, the parameterdatasets
will restrict the iterator to those. The parameterwildcard
allows a string wild-card value to restrict which datasets are iterated over.Keyword Arguments: - h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
retrieve datasets from. A dataset name cannot be passed using this argument, it is
interpreted as a group name. A value of
None
places the dataset into the root directory of the HDF5 file. - datasets (list) – List of specific dataset names found within the specified group to iterator over
- wildcard (str) – String to search for within the names of the datasets found within the specified group to iterate over
Examples
Load a HDF5 file to pygeostat:
>>> data = gs.H5Store('data.h5')
Iterate over all datasets within the root directory of a HDF5 file:
>>> for dataset in data.iteritems(): >>> gs.histplt(dataset)
Iterate over the datasets within a specific group that are realizations:
>>> for dataset in data.iteritems(h5path='Simulation/NS_AU', wildcard='Realization'): >>> gs.histplt(dataset)
- h5path (str) – Forward slash (/) delimited path through the group hierarchy you wish to
retrieve datasets from. A dataset name cannot be passed using this argument, it is
interpreted as a group name. A value of


WITNESS LIST Land & Resource Management Committee March 10, 2005-8:00A HB 1478 For: Lary, Trey (Allen Boone Humphries Robinson LLP) HB 1603 For: Patterson, Jerry (General Land Office) Against: Schwartz, A.R. (Self)


public class SourceSettings
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SourceSettings.AttenuationType |
| Modifier and Type | Method and Description |
|---|---|
int |
calculatePan(WorldSource source,
Player player)
Calculates the panning for the player.
|
int |
calculateVolume(WorldSource source,
Player player)
Calculates the attenuation for the player.
|
double |
getMaxRadius()
Gets the maximum radius of the attenuation.
|
double |
getMinRadius()
Gets the minimal radius of the attenuation.
|
static SourceSettings |
of()
Creates and returns a new instance of this class with panning and
attenuation disabled.
|
static SourceSettings |
of(boolean usePan)
Creates and returns a new instance of this class with no attenuation.
|
static SourceSettings |
of(boolean usePan,
boolean useAttenuation,
double minRadius,
double maxRadius,
SourceSettings.AttenuationType attenuationType)
Creates and returns a new instance of this class.
|
static SourceSettings |
of(boolean usePan,
double minRadius,
double maxRadius,
SourceSettings.AttenuationType attenuationType)
Creates and returns a new instance of this class with attenuation
enabled.
|
static SourceSettings |
of(double minRadius,
double maxRadius,
SourceSettings.AttenuationType attenuationType)
Creates and returns a new instance of this class with panning disabled
and attenuation enabled.
|
void |
setUseAttenuation(boolean useAttenuation)
Sets whether or not attenuation is enabled.
|
void |
setUsePan(boolean usePan)
Sets whether or not panning is enabled.
|
boolean |
useAttenuation()
Checks if attenuation is enabled.
|
boolean |
usePan()
Checks if panning is enabled.
|
public static SourceSettings of()
public static SourceSettings of(boolean usePan)
usePan
- Whether or not to use panningpublic static SourceSettings of(double minRadius, double maxRadius, SourceSettings.AttenuationType attenuationType)
minRadius
- The minimal radius of the attenuationmaxRadius
- The maximum radius of the attenuationattenuationType
- The type of the attenuationpublic static SourceSettings of(boolean usePan, double minRadius, double maxRadius, SourceSettings.AttenuationType attenuationType)
usePan
- Whether or not to use panningminRadius
- The minimal radius of the attenuationmaxRadius
- The maximum radius of the attenuationattenuationType
- The type of the attenuationpublic static SourceSettings of(boolean usePan, boolean useAttenuation, double minRadius, double maxRadius, SourceSettings.AttenuationType attenuationType)
usePan
- Whether or not to use panninguseAttenuation
- Whether or not to use attenuationminRadius
- The minimal radius of the attenuationmaxRadius
- The maximum radius of the attenuationattenuationType
- The type of the attenuationpublic int calculateVolume(WorldSource source, Player player)
source
- The sourceplayer
- The playerpublic int calculatePan(WorldSource source, Player player)
source
- The sourceplayer
- The playerpublic boolean useAttenuation()
public boolean usePan()
public void setUseAttenuation(boolean useAttenuation)
useAttenuation
- Whether or not attenuation is enabledpublic void setUsePan(boolean usePan)
usePan
- Whether or not panning is enabledpublic double getMinRadius()
public double getMaxRadius()


Food Bank Support
Toggle navigation
About
Contact
Search
Filter Results
Seniors
Youth
Families with Children
Filter


The EventManager is a component designed for the following use cases:
The basic architecture allows you to attach and detach listeners to named events, both on a per-instance basis as well as via shared collections; trigger events; and interrupt execution of listeners.
Typically, you will compose an EventManager instance in a class.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
class Foo implements EventManagerAwareInterface
{
protected $events;
public function setEventManager(EventManagerInterface $events)
{
$events->setIdentifiers(array(
__CLASS__,
get_called_class(),
));
$this->events = $events;
return $this;
}
public function getEventManager()
{
if (null === $this->events) {
$this->setEventManager(new EventManager());
}
return $this->events;
}
}
|
The above allows users to access the EventManager instance, or reset it with a new instance; if one does not exist, it will be lazily instantiated on-demand.
An EventManager is really only interesting if it triggers some events. Basic triggering takes three arguments: the event name, which is usually the current function/method name; the “context”, which is usually the current object instance; and the arguments, which are usually the arguments provided to the current function/method.
1 2 3 4 5 6 7 8 9 10 | class Foo
{
// ... assume events definition from above
public function bar($baz, $bat = null)
{
$params = compact('baz', 'bat');
$this->getEventManager()->trigger(__FUNCTION__, $this, $params);
}
}
|
In turn, triggering events is only interesting if something is listening for the event. Listeners attach to the EventManager, specifying a named event and the callback to notify. The callback receives an Event object, which has accessors for retrieving the event name, context, and parameters. Let’s add a listener, and trigger the event.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | use Zend\Log\Factory as LogFactory;
$log = LogFactory($someConfig);
$foo = new Foo();
$foo->getEventManager()->attach('bar', function ($e) use ($log) {
$event = $e->getName();
$target = get_class($e->getTarget());
$params = json_encode($e->getParams());
$log->info(sprintf(
'%s called on %s, using params %s',
$event,
$target,
$params
));
});
// Results in log message:
$foo->bar('baz', 'bat');
// reading: bar called on Foo, using params {"baz" : "baz", "bat" : "bat"}"
|
Note that the second argument to attach() is any valid callback; an anonymous function is shown in the example in order to keep the example self-contained. However, you could also utilize a valid function name, a functor, a string referencing a static method, or an array callback with a named static method or instance method. Again, any PHP callback is valid.
Sometimes you may want to specify listeners without yet having an object instance of the class composing an EventManager. Zend Framework enables this through the concept of a SharedEventCollection. Simply put, you can inject individual EventManager instances with a well-known SharedEventCollection, and the EventManager instance will query it for additional listeners. Listeners attach to a SharedEventCollection in roughly the same way the do normal event managers; the call to attach is identical to the EventManager, but expects an additional parameter at the beginning: a named instance. Remember the example of composing an EventManager, how we passed it __CLASS__? That value, or any strings you provide in an array to the constructor, may be used to identify an instance when using a SharedEventCollection. As an example, assuming we have a SharedEventManager instance that we know has been injected in our EventManager instances (for instance, via dependency injection), we could change the above example to attach via the shared collection:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | use Zend\Log\Factory as LogFactory;
// Assume $events is a Zend\EventManager\SharedEventManager instance
$log = LogFactory($someConfig);
$events->attach('Foo', 'bar', function ($e) use ($log) {
$event = $e->getName();
$target = get_class($e->getTarget());
$params = json_encode($e->getParams());
$log->info(sprintf(
'%s called on %s, using params %s',
$event,
$target,
$params
));
});
// Later, instantiate Foo:
$foo = new Foo();
$foo->getEventManager()->setSharedManager($events);
// And we can still trigger the above event:
$foo->bar('baz', 'bat');
// results in log message:
// bar called on Foo, using params {"baz" : "baz", "bat" : "bat"}"
|
Note
StaticEventManager
As of 2.0.0beta3, you can use the StaticEventManager singleton as a SharedEventCollection. As such, you do not need to worry about where and how to get access to the SharedEventCollection; it’s globally available by simply calling StaticEventManager::getInstance().
Be aware, however, that its usage is deprecated within the framework, and starting with 2.0.0beta4, you will instead configure a SharedEventManager instance that will be injected by the framework into individual EventManager instances.
The EventManager also provides the ability to detach listeners, short-circuit execution of an event either from within a listener or by testing return values of listeners, test and loop through the results returned by listeners, prioritize listeners, and more. Many of these features are detailed in the examples.
Sometimes you’ll want to attach the same listener to many events or to all events of a given instance – or potentially, with a shared event collection, many contexts, and many events. The EventManager component allows for this.
Attaching to many events at once
1 2 | $events = new EventManager();
$events->attach(array('these', 'are', 'event', 'names'), $callback);
|
Note that if you specify a priority, that priority will be used for all events specified.
Attaching using the wildcard
1 2 | $events = new EventManager();
$events->attach('*', $callback);
|
Note that if you specify a priority, that priority will be used for this listener for any event triggered.
What the above specifies is that any event triggered will result in notification of this particular listener.
1 2 3 4 5 6 | $events = new SharedEventManager();
// Attach to many events on the context "foo"
$events->attach('foo', array('these', 'are', 'event', 'names'), $callback);
// Attach to many events on the contexts "foo" and "bar"
$events->attach(array('foo', 'bar'), array('these', 'are', 'event', 'names'), $callback);
|
Note that if you specify a priority, that priority will be used for all events specified.
1 2 3 4 5 6 | $events = new SharedEventManager();
// Attach to all events on the context "foo"
$events->attach('foo', '*', $callback);
// Attach to all events on the contexts "foo" and "bar"
$events->attach(array('foo', 'bar'), '*', $callback);
|
Note that if you specify a priority, that priority will be used for all events specified.
The above is specifying that for the contexts “foo” and “bar”, the specified listener should be notified for any event they trigger.
EventManager Options
__construct(null|string|int $identifier)
Constructs a new EventManager instance, using the given identifier, if provided, for purposes of shared collections.
setEventClass(string $class)
Provide the name of an alternate Event class to use when creating events to pass to triggered listeners.
trigger(string $event, mixed $target = null, mixed $argv, callback $callback = null)
Triggers all listeners to a named event. The recommendation is to use the current function/method name for $event, appending it with values such as ”.pre”, ”.post”, etc. as needed. $target should be the current object instance, or the name of the function if not triggering within an object. $argv should typically be an associative array or ArrayAccess instance; we recommend using the parameters passed to the function/method (compact() is often useful here). This method can also take a callback and behave in the same way as triggerUntil().
The method returns an instance of ResponseCollection, which may be used to introspect return values of the various listeners, test for short-circuiting, and more.
triggerUntil(string $event, mixed $target, mixed $argv = null, callback $callback = null)
Triggers all listeners to a named event, just like trigger(), with the addition that it passes the return value from each listener to $callback; if $callback returns a boolean true value, execution of the listeners is interrupted. You can test for this using $result->stopped().
attach(string $event, callback $callback, int $priority)
Attaches $callback to the EventManager instance, listening for the event $event. If a $priority is provided, the listener will be inserted into the internal listener stack using that priority; higher values execute earliest. (Default priority is “1”, and negative priorities are allowed.)
The method returns an instance of Zend\Stdlib\CallbackHandler; this value can later be passed to detach() if desired.
attachAggregate(string|ListenerAggregate $aggregate)
If a string is passed for $aggregate, instantiates that class. The $aggregate is then passed the EventManager instance to its attach() method so that it may register listeners.
The ListenerAggregate instance is returned.
detach(CallbackHandler|ListenerAggregateInterface $listener)
Scans all listeners, and detaches any that match $listener so that they will no longer be triggered.
Returns a boolean true if any listeners have been identified and unsubscribed, and a boolean false otherwise.
detachAggregate(ListenerAggregateInterface $aggregate)
Loops through all listeners of all events to identify listeners that are represented by the aggregate; for all matches, the listeners will be removed.
Returns a boolean true if any listeners have been identified and unsubscribed, and a boolean false otherwise.
getEvents()
Returns an array of all event names that have listeners attached.
getListeners(string $event)
Returns a Zend\Stdlib\PriorityQueue instance of all listeners attached to $event.
clearListeners(string $event)
Removes all listeners attached to $event.
prepareArgs(array $args)
Creates an ArrayObject from the provided $args. This can be useful if you want yours listeners to be able to modify arguments such that later listeners or the triggering method can see the changes.
Modifying Arguments
Occasionally it can be useful to allow listeners to modify the arguments they receive so that later listeners or the calling method will receive those changed values.
As an example, you might want to pre-filter a date that you know will arrive as a string and convert it to a DateTime argument.
To do this, you can pass your arguments to prepareArgs(), and pass this new object when triggering an event. You will then pull that value back into your method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | class ValueObject
{
// assume a composed event manager
function inject(array $values)
{
$argv = compact('values');
$argv = $this->getEventManager()->prepareArgs($argv);
$this->getEventManager()->trigger(__FUNCTION__, $this, $argv);
$date = isset($argv['values']['date']) ? $argv['values']['date'] : new DateTime('now');
// ...
}
}
$v = new ValueObject();
$v->getEventManager()->attach('inject', function($e) {
$values = $e->getParam('values');
if (!$values) {
return;
}
if (!isset($values['date'])) {
$values['date'] = new \DateTime('now');
} else {
$values['date'] = new \Datetime($values['date']);
}
$e->setParam('values', $values);
});
$v->inject(array(
'date' => '2011-08-10 15:30:29',
));
|
Short Circuiting
One common use case for events is to trigger listeners until either one indicates no further processing should be done, or until a return value meets specific criteria. As examples, if an event creates a Response object, it may want execution to stop.
1 2 3 4 5 6 7 | $listener = function($e) {
// do some work
// Stop propagation and return a response
$e->stopPropagation(true);
return $response;
};
|
Alternately, we could do the check from the method triggering the event.
1 2 3 4 5 6 7 8 9 10 11 12 | class Foo implements DispatchableInterface
{
// assume composed event manager
public function dispatch(Request $request, Response $response = null)
{
$argv = compact('request', 'response');
$results = $this->getEventManager()->triggerUntil(__FUNCTION__, $this, $argv, function($v) {
return ($v instanceof Response);
});
}
}
|
Typically, you may want to return a value that stopped execution, or use it some way. Both trigger() and triggerUntil() return a ResponseCollection instance; call its stopped() method to test if execution was stopped, and last() method to retrieve the return value from the last executed listener:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | class Foo implements DispatchableInterface
{
// assume composed event manager
public function dispatch(Request $request, Response $response = null)
{
$argv = compact('request', 'response');
$results = $this->getEventManager()->triggerUntil(__FUNCTION__, $this, $argv, function($v) {
return ($v instanceof Response);
});
// Test if execution was halted, and return last result:
if ($results->stopped()) {
return $results->last();
}
// continue...
}
}
|
Assigning Priority to Listeners
One use case for the EventManager is for implementing caching systems. As such, you often want to check the cache early, and save to it late.
The third argument to attach() is a priority value. The higher this number, the earlier that listener will execute; the lower it is, the later it executes. The value defaults to 1, and values will trigger in the order registered within a given priority.
So, to implement a caching system, our method will need to trigger an event at method start as well as at method end. At method start, we want an event that will trigger early; at method end, an event should trigger late.
Here is the class in which we want caching:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | class SomeValueObject
{
// assume it composes an event manager
public function get($id)
{
$params = compact('id');
$results = $this->getEventManager()->trigger('get.pre', $this, $params);
// If an event stopped propagation, return the value
if ($results->stopped()) {
return $results->last();
}
// do some work...
$params['__RESULT__'] = $someComputedContent;
$this->getEventManager()->trigger('get.post', $this, $params);
}
}
|
Now, let’s create a ListenerAggregateInterface that can handle caching for us:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | use Zend\Cache\Cache;
use Zend\EventManager\EventManagerInterface;
use Zend\EventManager\ListenerAggregateInterface;
use Zend\EventManager\EventInterface;
class CacheListener implements ListenerAggregateInterface
{
protected $cache;
protected $listeners = array();
public function __construct(Cache $cache)
{
$this->cache = $cache;
}
public function attach(EventManagerInterface $events)
{
$this->listeners[] = $events->attach('get.pre', array($this, 'load'), 100);
$this->listeners[] = $events->attach('get.post', array($this, 'save'), -100);
}
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $index => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$index]);
}
}
}
public function load(EventInterface $e)
{
$id = get_class($e->getTarget()) . '-' . json_encode($e->getParams());
if (false !== ($content = $this->cache->load($id))) {
$e->stopPropagation(true);
return $content;
}
}
public function save(EventInterface $e)
{
$params = $e->getParams();
$content = $params['__RESULT__'];
unset($params['__RESULT__']);
$id = get_class($e->getTarget()) . '-' . json_encode($params);
$this->cache->save($content, $id);
}
}
|
We can then attach the aggregate to an instance.
1 2 3 | $value = new SomeValueObject();
$cacheListener = new CacheListener($cache);
$value->getEventManager()->attachAggregate($cacheListener);
|
Now, as we call get(), if we have a cached entry, it will be returned immediately; if not, a computed entry will be cached when we complete the method.
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.


The raytracer is pretty processor intensive - I recommend you run it in Google Chrome which has the fastest javascript engine I've found. Also tested in Firefox/Safari. Will certainly not work in IE.


Guardian is a widely used authentication library based on JWT (JSON Web Tokens).
Table of Contents
JWTs
A JWT can provide a rich token for authentication. Where many authentication systems provide access to only a subject identifier for the resource, JWTs provide this along with other information like:
- Who issued the token
- Who is the token for
- Which system should use the token
- What time was it issued
- What time does the token expire
In addition to these fields Guardian provides some other fields to facilitate additional functionality:
- What type is the token
- What permissions does the bearer have
These are just the basic fields in a JWT. You’re free to add any additional information that your application requires. Just remember to keep it short, as JWT has to fit in the HTTP header.
This richness means that you can pass JWTs around in your system as a fully contained unit of credentials.
Where to use them
JWT tokens can be used to authenticate any part of your application.
- Single page applications
- Controllers (via browser session)
- Controllers (via authorization headers - API)
- Phoenix Channels
- Service to Service requests
- Inter-process
- 3rd Party access (OAuth)
- Remember me functionality
- Other interfaces - raw TCP, UDP, CLI, etc
JWT tokens can be used everywhere in your application where you need to provide verifiable authentication.
Do I have to use a database?
You do not need to track JWT via a database. You can simply rely on the issued and expiry timestamps for controlling access. Often you’ll end up using a database to look up your user resource but the JWT itself does not require it.
For example, if you were going to use JWT to authenticate communication on a UDP socket you likely wouldn’t use a database. Encode all the information you need directly into the token when you issue it. Once you verify it (check that it’s signed correctly) you’re good to go.
You can however use a database to track JWT. If you do, you gain the ability to verify that the token is still valid - that is - it has not been revoked. Or you could use the records in the DB to force a log out of all tokens a for user. This is made simple in Guardian by using GuardianDb. GuardianDb uses Guardians ‘Hooks’ to perform validation checks, save and delete from the DB. We’ll cover that later.
Setup
There are many options for setting up Guardian. We’ll cover them at some point but let’s start with a simple setup.
Minimal Setup
To get started there are a handful of things that you’ll need.
Configuration
mix.exs
def application do
[
mod: {MyApp, []},
applications: [:guardian, ...]
]
end
def deps do
[
{guardian: "~> x.x"},
...
]
end
config/config.ex
# in each environment config file you should overwrite this if it's external
config :guardian, Guardian,
issuer: "MyAppId",
secret_key: Mix.env(),
serializer: MyApp.GuardianSerializer
This is the minimum set of information you need to provide Guardian with to operate.
You shouldn’t encode your secret key directly into your top-level config.
Instead, each environment should have its own key.
It’s common to use the Mix environment for secrets in dev and test.
Staging and production, however, must use strong secrets.
(e.g.
generated with mix phoenix.gen.secret
)
lib/my_app/guardian_serializer.ex
defmodule MyApp.GuardianSerializer do
@behaviour Guardian.Serializer
alias MyApp.Repo
alias MyApp.User
def for_token(user = %User{}), do: {:ok, "User:#{user.id}"}
def for_token(_), do: {:error, "Unknown resource type"}
def from_token("User:" <> id), do: {:ok, Repo.get(User, id)}
def from_token(_), do: {:error, "Unknown resource type"}
end
Your serializer is responsible for finding the resource identified in the sub
(subject) field.
This could be a lookup from a db, an API, or even a simple string.
It’s also responsible for serializing a resource into the sub
field.
That’s it for the minimum configuration. There’s plenty more you can do if you need to but to get started that’s enough.
Application Usage
Now that we have the configuration in place to use Guardian, we need to integrate it into the application. Since this is the minimum setup, let’s first consider HTTP requests.
HTTP requests
Guardian provides a number of Plugs to facilitate integration into HTTP requests. You can learn about Plug in a separate lesson. Guardian doesn’t require Phoenix, but using Phoenix in the following examples will be easiest to demonstrate.
The easiest way to integrate into HTTP is via the router. Since Guardian’s HTTP integrations are all based on plugs, you can use these anywhere a plug could be used.
The general flow of Guardian plug is:
- Find a token in the request (somewhere) and verify it:
Verify*
plugs - Optionally load the resource identified in the token:
LoadResource
plug - Ensure that there is a valid token for the request and refuse access if not:
EnsureAuthenticated
plug
To meet all the needs of application developers, Guardian implements these phases separately.
To find the token use the Verify*
plugs.
Let’s create some pipelines.
pipeline :maybe_browser_auth do
plug(Guardian.Plug.VerifySession)
plug(Guardian.Plug.VerifyHeader, realm: "Bearer")
plug(Guardian.Plug.LoadResource)
end
pipeline :ensure_authed_access do
plug(Guardian.Plug.EnsureAuthenticated, %{"typ" => "access", handler: MyApp.HttpErrorHandler})
end
These pipelines can be used to compose different authentication requirements. The first pipeline tries to find a token first in the session and then falls back to a header. If it finds one, it will load the resource for you.
The second pipeline requires that there is a valid, verified token present and that it is of type “access”. To use these, add them to your scope.
scope "/", MyApp do
pipe_through([:browser, :maybe_browser_auth])
get("/login", LoginController, :new)
post("/login", LoginController, :create)
delete("/login", LoginController, :delete)
end
scope "/", MyApp do
pipe_through([:browser, :maybe_browser_auth, :ensure_authed_access])
resource("/protected/things", ProtectedController)
end
The login routes above will have the authenticated user if there is one. The second scope ensures that there is a valid token passed for all actions. You don’t have to put them in pipelines, you could put them in your controllers for super flexible customization but we’re doing a minimal setup.
We’re missing one piece so far.
The error handler we added on the EnsureAuthenticated
plug.
This is a very simple module that responds to
unauthenticated/2
unauthorized/2
Both these functions receive a Plug.Conn struct and a params map and should handle their respective errors. You can even use a Phoenix controller!
In the controller
Inside the controller, there are a couple of options for how to access the currently logged in user. Let’s start with the simplest.
defmodule MyApp.MyController do
use MyApp.Web, :controller
use Guardian.Phoenix.Controller
def some_action(conn, params, user, claims) do
# do stuff
end
end
By using the Guardian.Phoenix.Controller
module, your actions will receive two additional arguments that you can pattern match on.
Remember, if you didn’t use EnsureAuthenticated
you may have a nil user and claims.
The other - more flexible/verbose version - is to use plug helpers.
defmodule MyApp.MyController do
use MyApp.Web, :controller
def some_action(conn, params) do
if Guardian.Plug.authenticated?(conn) do
user = Guardian.Plug.current_resource(conn)
else
# No user
end
end
end
Login/Logout
Logging in and out of a browser session is very simple. In your login controller:
def create(conn, params) do
case find_the_user_and_verify_them_from_params(params) do
{:ok, user} ->
# Use access tokens.
# Other tokens can be used, like :refresh etc
conn
|> Guardian.Plug.sign_in(user, :access)
|> respond_somehow()
{:error, reason} ->
nil
# handle not verifying the user's credentials
end
end
def delete(conn, params) do
conn
|> Guardian.Plug.sign_out()
|> respond_somehow()
end
When using API login, it’s slightly different because there’s no session and you need to provide the raw token back to the client.
For API login you’ll likely use the Authorization
header to provide the token to your application.
This method is useful when you do not intend on using a session.
def create(conn, params) do
case find_the_user_and_verify_them_from_params(params) do
{:ok, user} ->
{:ok, jwt, _claims} = Guardian.encode_and_sign(user, :access)
conn |> respond_somehow(%{token: jwt})
{:error, reason} ->
# handle not verifying the user's credentials
end
end
def delete(conn, params) do
jwt = Guardian.Plug.current_token(conn)
Guardian.revoke!(jwt)
respond_somehow(conn)
end
The browser session login calls encode_and_sign
under the hood so you can use them the same way.
Caught a mistake or want to contribute to the lesson? Edit this page on GitHub!


If you've always wanted to add infinite scrolling to your website, but don't know how or can't find the time to do so, ShittyInfiniteScroll.js is here to help.
This drop-in solution will add infinite scrolling to your page -- for free, with no coding knowledge required.
Benefits include:
- Make the page feel laggy by inserting tons of DOM elements!
- Give users who dare reach for the footer a hard time!
- I will revise ths copy later
To add this to your site, simply add this script tag to your page:
<script src="http://www.ajaska.com/ShittyInfiniteScroll.js/ShittyInfiniteScroll.js"></script>
Or, if you want to host it yourself, you may find the latest release via the Github repo.


Sponge Bob
Resume
Sponge Bob Squarepants is an intelligent sea sponge that protects the fishes of Bikini Bottom. Spongebob is known to be a frycook by day, but by night he is known to use his powerful abilities to protect the city of Bikini Bottom. Sponge Bob will do anything that is necessary to protect his city from evil people. People on the streets of Bikini Bottom have a motto which says, "Be ware of The Sponge!"
Experience
-
2017
Became a Head Fry Cook at The Krusty Krab
Responsible for all kitchen activities including: prepping ingredients, preparing food for customers, cleaning, and managing employee morale
-
2017-2013
Becomes a Senior Cook
Handles both positive and negative customer feedback
-
2013-2005
Becomes a Junior Cook
Protects the Krabby Patty secret formula
Core qualifications
-
Teamwork
Responsibility
Communication
Well Organized
other
-
Good at karate
Volunteer Litter Patrol for Bikini Bottom Police Department
Jelly fishing and harvesting jelly for use in exotic cuisines
Competes in Krabby Patty flipping contests
Bubble blowing extraordinaire
Life guard for a day
Always ready!
Accomplishments
-
The most gold stars for being a good noodle
Almost won a snail race
Saved Bikini Bottom
Convinced Squidward to try Krabby Patties
VOLUNTEER & COMMUNITY
-
Helping the elderly-15 hours weekly
Cleaning The Streets-15 hours weekly
Hall Monitor- 10 hours weekly


Lyq Options:
Lyq is not allowed to access your Twitter account.
Sign in
Sign out
Tweet options
Tweets with URL
Hashtag
#
Advanced settings
Bit.ly configuration
Account
API key
Visit
Lyq's page
.


CATE is a multicoin wallet based on the bitcoinj and libdohj libraries. It currently supports Bitcoin, Litecoin and Dogecoin, and is readily extensible to support any other currencies compatible with bitcoinj.
Application launch is via the {@link org.libdohj.cate.CATE} class, which constructs the JavaFX scene and passes control to {@link org.libdohj.cate.controller.MainController}. MainController is the main window permanently visible to the user, and interacts with the underly wallets on behalf of the user. Due to the architecture of bitcoinj using thread-local variables to track the active coin, each coin requires its own isolated thread(s). The {@link org.libdohj.cate.Network} class acts as a bridge from the UI to the underlying wallet, and each instance is its own independent thread.
Calls from the main controller to a wallet involve a jump between threads, and as such the result is returned via callbacks. Expected errors (i.e. insufficient funds to send a transaction) are returned via callbacks as well, while exceptions (i.e. null pointers) are sent out of band from the network to the main controller.


| Image | Title | Subtitle | Status | |
|---|---|---|---|---|
| Hero Image | Hero Title | Hero Subtitle | Active/ Inactive |
Title: Some Title
Subtitle: Some Subtitle
|
| Hero Image | Hero Title | Hero Subtitle | Active/ Inactive |
Title: Some Title 2
Subtitle: Some Subtitle 2
|


Student Admission Form
Home
Search
Student Name
Student Name is Required
Father's Name
Father's Name is Required
Date Of Birth
Date of Birth is required
Age
Age is required
Phone Number
Phone Number is Required
CNIC / B.Form No
CNIC / B.Form No is Required
Class
Select Your class
One
Two
Three
Four
Five
Six
seven
Eight
Nine
Ten
Class Is required
Enter Your Adress
Adress is required
Gender
Male
Female
Custom
Plese Select Your Gender.
Submit
Your Information
Student's Name
Father's Name
DOB
AGE
Phone #
Class
CNIC
Adress
Gender
Action


|
OPAE C API
-..
FPGA API
|
#include <opae/cxx/core/properties.h>
Public Types | |
| typedef std::shared_ptr< properties > | ptr_t |
Public Member Functions | |
| properties (const properties &p)=delete | |
| properties & | operator= (const properties &p)=delete |
| ~properties () | |
| fpga_properties | c_type () const |
| operator fpga_properties () const | |
Static Public Member Functions | |
| static properties::ptr_t | get () |
| static properties::ptr_t | get (fpga_guid guid_in) |
| static properties::ptr_t | get (fpga_objtype objtype) |
| static properties::ptr_t | get (std::shared_ptr< token > t) |
| static properties::ptr_t | get (fpga_token t) |
| static properties::ptr_t | get (std::shared_ptr< handle > h) |
Data Fields | |
| pvalue< fpga_objtype > | type |
| pvalue< uint32_t > | num_errors |
| pvalue< uint16_t > | segment |
| pvalue< uint8_t > | bus |
| pvalue< uint8_t > | device |
| pvalue< uint8_t > | function |
| pvalue< uint8_t > | socket_id |
| pvalue< uint32_t > | num_slots |
| pvalue< uint64_t > | bbs_id |
| pvalue< fpga_version > | bbs_version |
| pvalue< uint16_t > | vendor_id |
| pvalue< uint16_t > | device_id |
| pvalue< char * > | model |
| pvalue< uint64_t > | local_memory_size |
| pvalue< uint64_t > | capabilities |
| pvalue< uint32_t > | num_mmio |
| pvalue< uint32_t > | num_interrupts |
| pvalue< fpga_accelerator_state > | accelerator_state |
| pvalue< uint64_t > | object_id |
| pvalue< fpga_token > | parent |
| guid_t | guid |
Static Public Attributes | |
| const static std::vector< properties::ptr_t > | none |
Private Member Functions | |
| properties (bool alloc_props=true) | |
Private Attributes | |
| fpga_properties | props_ |
Wraps an OPAE fpga_properties object.
properties are information describing an accelerator resource that is identified by its token. The properties are used during enumeration to narrow the search for an accelerator resource, and after enumeration to provide the configuration of that resource.
Definition at line 51 of file properties.h.
| typedef std::shared_ptr<properties> opae::fpga::types::properties::ptr_t |
Definition at line 53 of file properties.h.
|
delete |
| opae::fpga::types::properties::~properties | ( | ) |
|
private |
|
delete |
|
inline |
Get the underlying fpga_properties object.
Definition at line 69 of file properties.h.
References props_.
|
inline |
Get the underlying fpga_properties object.
Definition at line 73 of file properties.h.
References props_.
|
static |
Create a new properties object.
Referenced by hssi_afu::ethernet_interface().
|
static |
Create a new properties object from a guid.
| guid_in | A guid to set in the properties |
|
static |
Create a new properties object from an fpga_objtype.
| objtype | An object type to set in the properties |
|
static |
Retrieve the properties for a given token object.
| [in] | t | A token identifying the accelerator resource. |
|
static |
Retrieve the properties for a given fpga_token.
| [in] | t | An fpga_token identifying the accelerator resource. |
|
static |
Retrieve the properties for a given handle object.
| [in] | h | A handle identifying the accelerator resource. |
|
static |
An empty vector of properties. Useful for enumerating based on a "match all" criteria.
Definition at line 59 of file properties.h.
|
private |
Definition at line 112 of file properties.h.
Referenced by c_type(), and operator fpga_properties().
| pvalue<fpga_objtype> opae::fpga::types::properties::type |
Definition at line 115 of file properties.h.
| pvalue<uint32_t> opae::fpga::types::properties::num_errors |
Definition at line 116 of file properties.h.
| pvalue<uint16_t> opae::fpga::types::properties::segment |
Definition at line 117 of file properties.h.
| pvalue<uint8_t> opae::fpga::types::properties::bus |
Definition at line 118 of file properties.h.
| pvalue<uint8_t> opae::fpga::types::properties::device |
Definition at line 119 of file properties.h.
| pvalue<uint8_t> opae::fpga::types::properties::function |
Definition at line 120 of file properties.h.
| pvalue<uint8_t> opae::fpga::types::properties::socket_id |
Definition at line 121 of file properties.h.
| pvalue<uint32_t> opae::fpga::types::properties::num_slots |
Definition at line 122 of file properties.h.
| pvalue<uint64_t> opae::fpga::types::properties::bbs_id |
Definition at line 123 of file properties.h.
| pvalue<fpga_version> opae::fpga::types::properties::bbs_version |
Definition at line 124 of file properties.h.
| pvalue<uint16_t> opae::fpga::types::properties::vendor_id |
Definition at line 125 of file properties.h.
| pvalue<uint16_t> opae::fpga::types::properties::device_id |
Definition at line 126 of file properties.h.
| pvalue<char *> opae::fpga::types::properties::model |
Definition at line 127 of file properties.h.
| pvalue<uint64_t> opae::fpga::types::properties::local_memory_size |
Definition at line 128 of file properties.h.
| pvalue<uint64_t> opae::fpga::types::properties::capabilities |
Definition at line 129 of file properties.h.
| pvalue<uint32_t> opae::fpga::types::properties::num_mmio |
Definition at line 130 of file properties.h.
| pvalue<uint32_t> opae::fpga::types::properties::num_interrupts |
Definition at line 131 of file properties.h.
| pvalue<fpga_accelerator_state> opae::fpga::types::properties::accelerator_state |
Definition at line 132 of file properties.h.
| pvalue<uint64_t> opae::fpga::types::properties::object_id |
Definition at line 133 of file properties.h.
| pvalue<fpga_token> opae::fpga::types::properties::parent |
Definition at line 134 of file properties.h.
| guid_t opae::fpga::types::properties::guid |
Definition at line 135 of file properties.h.


Known GUID's
Temperature sensor 1
[FF:FF:FF:FF:FF:FF:FF:FE:B8:27:EB:0A:00:02:00:05]
Fridge power cord with test circit
[FF:FF:FF:FF:FF:FF:FF:FE:B8:27:EB:0A:00:02:00:05]
Add...
Clear
Load
Save
Cancel
OK


Recommendations
Title
Prediction Score
{{i.movie}}
{{i.prediction}}
Predictions
Title
Score
{{i.movie}}
{{i.prediction}}


About me
My name is James. I started my journey to web dev some three months ago. Prior to that, i used to be just a final year student of biochemitry in the university of lagos. ive realized that tech is the future and im glad to hop in it. i intend to be a full stack, mobile and software developer. But for now, im just a budding web developer with a good eye for creativity. so hit me up if you want beautiful webites for your self or your business.
If you like my blog, please follow me on twitter and tell your family and friends about it. if you want to get in touch, please click on the contact link in the navigation bar.


dbus-send
Section: User Commands (1)Index Return to Main Contents
NAME
dbus-send - Send a message to a message busSYNOPSIS
dbus-send [--system | --session] [--dest=NAME] [--print-reply] [--type=TYPE] <destination object path> <message name> [contents ...]
DESCRIPTION
The dbus-send command is used to send a message to a D-Bus message bus. See http://www.freedesktop.org/software/dbus/ for more information about the big picture.
There are two well-known message buses: the systemwide message bus (installed on many systems as the "messagebus" service) and the per-user-login-session message bus (started each time a user logs in). The --system and --session options direct dbus-send to send messages to the system or session buses respectively. If neither is specified, dbus-send sends to the session bus.
Nearly all uses of dbus-send must provide the --dest argument which is the name of a connection on the bus to send the message to. If --dest is omitted, no destination is set.
The object path and the name of the message to send must always be specified. Following arguments, if any, are the message contents (message arguments). These are given as type-specified values and may include containers (arrays, dicts, and variants) as described below.
<contents> ::= <item> | <container> [ <item> | <container>...] <item> ::= <type>:<value> <container> ::= <array> | <dict> | <variant> <array> ::= array:<type>:<value>[,<value>...] <dict> ::= dict:<type>:<type>:<key>,<value>[,<key>,<value>...] <variant> ::= variant:<type>:<value> <type> ::= string | int16 | uint 16 | int32 | uint32 | int64 | uint64 | double | byte | boolean | objpath
D-Bus supports more types than these, but dbus-send currently does not. Also, dbus-send does not permit empty containers or nested containers (e.g. arrays of variants).
Here is an example invocation:
dbus-send --dest=org.freedesktop.ExampleName \ /org/freedesktop/sample/object/name \ org.freedesktop.ExampleInterface.ExampleMethod \ int32:47 string:'hello world' double:65.32 \ array:string:"1st item","next item","last item" \ dict:string:int32:"one",1,"two",2,"three",3 \ variant:int32:-8 \ objpath:/org/freedesktop/sample/object/name
Note that the interface is separated from a method or signal name by a dot, though in the actual protocol the interface and the interface member are separate fields.
OPTIONS
The following options are supported:- --dest=NAME
- Specify the name of the connection to receive the message.
- --print-reply
- Block for a reply to the message sent, and print any reply received.
- --system
- Send to the system message bus.
- --session
- Send to the session message bus. (This is the default.)
- --type=TYPE
-
Specify "method_call" or "signal" (defaults to "signal").
AUTHOR
dbus-send was written by Philip Blundell.BUGS
Please send bug reports to the D-Bus mailing list or bug tracker, see http://www.freedesktop.org/software/dbus/
Index
This document was created by man2html, using the manual pages.
Time: 05:29:02 GMT, December 24, 2015


Social Login, Custom Login, and Spring Boot Example
Hello!
If you're viewing this page then you have successfully configured and started this example server.
This example shows you how to use the Okta Spring Boot Starter to add the Authorization Code Flow to your application.
We will also be adding social login buttons to the custom login page.
When you click the login button below, you will be redirected to the login page on your Okta org. After you authenticate, you will be returned to this application.
Welcome back, Joe Coder!
You have successfully authenticated against your Okta org, and have been redirected back to this application.
Visit the My Profile page in this application to view the information retrieved with your OAuth Access Token.


Hoang Nguyen
Dashboard
Courses
Exams
Q&A
News
Hoang Nguyen
Student・
Learn More
2,707 exp
Knowledge
Courses
Exam
Q&A
News
Activity
Friends
12
Done Course
3
Unfinished Course
Basic for UX Designer
10 steps to improve your wireframe
A Better Way To Request App Ratings
How To Speed Up Your WordPress Website
Show More
27
Asking Question
7
Answered Question
12
How to make good logo?
3
What are the best mobile apps for ...
67
What's the difference between UI...
0
What logos include hidden messages ...
Show More
19
Following Exams
88
Done Exams
70%
Junior web designer
20%
Which is the best way to pass the PMP ...
35%
What are the great examples of viral UX/UI ...
90%
Why is consistency important in design?
Show More
Experience gained
COURSES
QUESTION
EXAM
+142
last month
Experience the day
friend activity
marry v. robinson
Asked question:
What is the best grid for desktop web ?
9:30 PM
shawn peterson
Finished the course:
Basic for UX Designer
9:20 PM
joe ramos
Finished the exam:
Junior web designer
7:45 PM
sean walker
Answered question:
How to make good logo?
11:15 PM
Show More


An overview of areas to live
Cambridge
- Most active metropolitan area in commuting distance
- Easy trips to london by train
- More nightlife and activities
- Skews younger and single
Bury St Edmunds
Similar commute time to Cambridge
- Active spouse community
- Larger houses and apartments
- Skews older and married
Newmarket
Newmarket is half way between Lakenheath and Cambridge; it offers a short
drive to either.
- Short commute (15 minutes)
- Short drive to Cambridge, but parking will be difficult


Whether done in person or individually the application must legally contain all pertinent information relating to the cost of the credit for the borrower
We are committed to researching, testing, and recommending the best products.
| Financial Institution | Product | Amount | Duration (Months) | Interest Rate (%) |
|---|


 This is done to make your login experience as seemless as possible. However you may need to reset these settings, perhaps to disable your pre-selected login provider(s).') }}
{{ gettext('Read more about how') }} {{ gettext('these settings are stored') }}.
{% endblock %} {% block final %} {% endblock %}


HOME
MERCHANDISE
HOME
MERCHANDISE
Merchandise
TSHIRT
Price:
10 $
Size:
S
M
L
Gender:
Male
Female
Is it a gift?
No
Yes
BUY
CAP
Price:
7 $
Size:
S
M
L
Is it a gift?
No
Yes
BUY


We are generating the PDFs for the buildings you requested. When they are ready {{email}} will receive an email.


Cut is also commonly used in conjunction with the
generate-and-test programming paradigm. For example, consider the
predicate find_solution/1
defined by
find_solution(X) :- candidate_solution(X), test_solution(X), !.
where candidate_solution/1
generates possible answers on
backtracking. The intent is to stop generating candidates as soon
as one is found that satisfies test_solution/1
. If the cut
were omitted, a future failure could cause backtracking into this
clause and restart the generation of candidate solutions. A
similar example is shown below:
process_file(F) :- see(F), repeat, read(X), process_and_fail(X), !, seen. process_and_fail(end_of_file) :- !. process_and_fail(X) :- process(X), fail.
The cut in process_file/1
is another example of terminating
a generate-and-test loop. In general, a cut should always be
placed after a repeat/0
so that the backtracking loop is
clearly terminated. If the cut were omitted in this case, on
later backtracking Prolog might try to read another term
after the end of the file had been reached.
The cut in process_and_fail/1
might be considered
unnecessary because, assuming the call shown is the only call to it, the
cut in process_file/1
ensures that backtracking into
process_and_fail/1
can never happen. While this is true, it is
also a good safeguard to include a cut in
process_and_fail/1
because someone may unwittingly change
process_file/1
in the future.