class: center, middle # Continuity and Discontinuity in Gothic and Horror Matthew J. Lavin Clinical Assistant Professor of English and Director of Digital Media Lab University of Pittsburgh 4 November, 2016 @mjlavin80 on Twitter https://github.com/mjlavin80/fiction --- # Overview - ### Emergence of Horror as a Genre - ### Computational Approaches to Genre Classification - ### Underwood's "The Life Cycles of Genres" - ### Areas for Follow Up and Expansion - ### What I've Done So Far - ### Results So Far - ### Challenges and Lessons Learned - ### Emerging Questions - ### Next Steps --- # Emergence of Horror as a Genre - ### Gothic - ### Victorian ghost story (especially in periodicals) - ### Weird fiction (especially pulps) - ### Horror and the paperback revolution - ### Horror fiction and the rise of Hollywood --- # Computational Approaches to Genre Classification - ### Are genres fundamentally historical categories, or are there narrative continuities that define and characterize them? - ### To what degree are historical and textual elements intertwined? Computational methods uniquely situated to address (Underwood) - ### Are horror and the Gothic a unified genre, cyclical, generational? (Moretti) - ### How does literary diction change over time? (Underwood and Sellers) - ### Can machine learning approaches aid processes of genre classification? --- # Underwood's "The Life Cycles of Genres" - ### Dataset of 950+ works of fiction from 1750 to 1989 - ### Metadata and term frequency tables - ### Genre tags for "detective," "sci-fi," "Gothic," and "random" - ### Supervised learning approach - ### Series of binary-assigned logistic regression tests (i.e. "crime" vs. "not crime") - ### Compared accuracy of various genre predictions - ### Found more continuity/predictability in the detective genre than in Gothic or science fiction. - ### Full data available on [Github](https://github.com/tedunderwood/fiction) --- # Areas for Follow Up and Expansion - ### Thinking about horror as owing a debt to a small subset of the Gothic - ### Horror subgenres - ### Unsupervised learning (especially clustering) - ### Influence of multi-genre classification system - ### Controlling for a text's date signal - ### Corpus Development: Is there a missing link between 1860 and 1930? --- # My research question - ### Is our understanding of the discontinuity between Gothic and horror over time altered or complicated by digging deeper into subgenre and multigenre constructions? --- # What I've Done So Far - ### Various unsupervised methods using Python's Scikit Learn - ### Hand-tagged gothic subgenres in corpus, including
ghost-haunting monster killer-slasher-gore demon-occult-witch-magic-psychic insanity-deranged
- ### Exploratory analysis of features correlated with date and genre ---
--- # Unsupervised Learning Procedures - ### Does not assume "ground truth" of genres - ### Tried multiple methods - ### Affinity clusters - ### Mini batch k-means - ### Hierarchical (Ward, Average, Complete) - ### Ran results on 9k, 500, and 100 features - ### Feature selection uses absolute values of genre correlations --- # Results So Far
inferred
detective/crime
gothic/horror/horror
multi
non_genre
scifi
sensation
0
65
10
5
51
46
0
1
48
32
6
74
4
6
2
20
1
0
5
6
0
3
24
4
4
12
3
1
4
21
3
2
25
50
0
5
79
14
7
76
34
0
6
20
75
3
61
47
1
7
11
2
0
22
3
1
#### Table 1: Mini batch k-means clustering on 9000 features --- # Results So Far
inferred
lavin_deranged
lavin_ghost
lavin_magic
lavin_multi
lavin_slasher
no_lavin_tag
0
0
1
6
2
0
168
1
6
16
0
2
0
146
2
1
0
0
0
0
31
3
2
1
0
0
0
45
4
0
0
1
0
0
100
5
0
2
8
2
3
195
6
4
22
8
9
0
164
7
0
2
0
0
0
37
#### Table 2: Same as Table 1, with Lavin flag planting --- # Results So Far
inferred
detective/crime
gothic/horror
multi
non_genre
scifi
sensation
0
89
8
5
30
3
4
1
9
55
3
23
5
0
2
7
21
1
80
64
0
3
1
1
0
12
62
0
4
2
10
2
46
36
2
5
100
16
11
45
11
0
6
9
9
0
28
1
0
7
27
16
2
34
3
2
8
25
4
3
27
6
1
9
19
1
0
1
2
0
#### Table 3: Ward Hierarchical Clustering on 500 features correlated with genre --- # Results So Far
inferred
detective/crime
gothic/horror
multi
non_genre
scifi
sensation
0
0
1
1
8
52
0
1
102
11
5
52
11
4
2
109
15
12
74
16
0
3
34
24
2
50
3
3
4
24
2
1
9
21
0
5
13
44
5
32
6
0
6
3
27
1
45
32
0
7
3
17
0
56
52
2
#### Table 4: Mini batch k-means clustering on 500 features --- # Results So Far
inferred
detective/crime
gothic/horror
multi
non_genre
scifi
sensation
0
0
1
1
8
52
0
1
102
11
5
52
11
4
2
109
15
12
74
16
0
3
34
24
2
50
3
3
4
24
2
1
9
21
0
5
13
44
5
32
6
0
6
3
27
1
45
32
0
7
3
17
0
56
52
2
#### Table 5: Mini batch k-means clustering on 100 features --- # Results So Far
inferred
lavin_deranged
lavin_ghost
lavin_magic
lavin_multi
lavin_slasher
no_lavin_tag
0
0
0
1
0
0
61
1
4
3
2
0
0
176
2
0
3
5
4
3
211
3
4
7
1
1
0
103
4
1
0
0
0
0
56
5
2
24
7
5
0
62
6
1
4
5
2
0
96
7
1
3
2
3
0
121
#### Table 6: Same data with flag planting --- # Results So Far
inferred
lavin_deranged
lavin_ghost
lavin_magic
lavin_multi
lavin_slasher
no_lavin_tag
0
0
1
2
2
0
7
1
4
2
1
0
0
5
2
2
6
5
1
0
15
3
0
22
5
2
1
6
4
1
2
2
5
0
2
5
2
6
1
1
0
9
6
0
0
0
0
0
1
7
2
0
0
0
0
5
#### Table 7: Flag planting, 100 features, on gothic-horror only --- # Challenges Faced - ### Current difficulty with clustering appears to be a feature selection problem - ### When working at scale, bugs, mistakes and surprises take longer to solve - ### More refactoring on the fly has potential to cause even more mistakes - ### Clustering methods tend to have either a set number of clusters or bandwidth - ### Visualizing results of unsupervised learning - ### Assessing results of unsupervised learning --- # Lessons Learned - ### See forked repo in [Github](https://github.com/mjlavin80/fiction) - ### Numerous steps can be pre-processed and stored (punctuation scrubbing, reducing to features) - ### Cost-benefit analysis of optimization changes at scale - ### Experimented with iterating over flat files, mysql database, and pickled data (.p files) - ### Feature dictionaries are most performant - ### Sklearn pipe feature with pickled data (built from db) is fastest and most portable - ### Haven't tried going straight from flat file to .p data - ### Interested in other key-value store approaches --- # Emerging Questions - ### If a machine learning model is highly accurate but based on very few terms, have we learned anything? - ### Do date signals affect some genres' continuity more than others? - ### Can unsupervised clusters be applied as training data to a horror dataset to better classify subgenres? - ### To what degree do these approaches tell us about cataloging practices over time? - ### How do we grow a horror corpus to best represent the genre's rich history and many subgenres? - ### How do we unlock the potential of analogue bibliographies and refrence guides to inform large-scale DH? --- # Next Steps - ### Logistic regression using additional feature selection methods - #### By removing top N features most correlated with date - #### By selecting only top N features correlated with genre - ### Multi-label and multi-class machine learning - ### Expansion of gothic and horror corpus - #### Tag not just by topic but by medium of first publication (periodical, pulp, etc.) - ### Next Spring: First Experiences in Research program - #### Three undergrads working on "Gothic and Horror Bibliography" - ### Better visualizations for unsupervised learning results?


Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
V
W
A
add(int, int, int)
- Method in class customer.
Shoppingcart
addBook(Book)
- Method in class book.
BookKatalog
anlegen()
- Method in class author.
Author
anlegen()
- Method in class customer.
Customer
anzahlBuecher()
- Method in class book.
BookKatalog
author
- package author
author
- Variable in class author.
AuthorForm
author
- Variable in class book.
Book
author
- Variable in class customer.
ShoppingcartPosition
Author
- class author.
Author
.
Author()
- Constructor for class author.
Author
Author(int)
- Constructor for class author.
Author
AuthorAction
- class author.
AuthorAction
.
AuthorAction()
- Constructor for class author.
AuthorAction
AuthorForm
- class author.
AuthorForm
.
AuthorForm()
- Constructor for class author.
AuthorForm
authorName
- Variable in class book.
Book
B
book
- package book
book
- Variable in class book.
BookForm
book
- Variable in class customer.
ShoppingcartPosition
Book
- class book.
Book
.
Book()
- Constructor for class book.
Book
Standard constructor.
BookAction
- class book.
BookAction
.
BookAction()
- Constructor for class book.
BookAction
BookForm
- class book.
BookForm
.
BookForm()
- Constructor for class book.
BookForm
BookKatalog
- class book.
BookKatalog
.
BookKatalog()
- Constructor for class book.
BookKatalog
buecher
- Variable in class book.
BookKatalog
SortedSet ist schon nach Titeln sortiert.
C
compareTo(Object)
- Method in class book.
Book
config
- Static variable in class author.
Author
config
- Static variable in class book.
BookKatalog
config
- Static variable in class customer.
Shoppingcart
config
- Static variable in class customer.
Customer
createConnection()
- Method in class author.
Author
createConnection()
- Method in class book.
BookKatalog
createConnection()
- Method in class customer.
Shoppingcart
createConnection()
- Method in class customer.
Customer
D
DuplicateKeyException
- exception exceptions.
DuplicateKeyException
.
DuplicateKeyException()
- Constructor for class exceptions.
DuplicateKeyException
DuplicateKeyExceptionHandler
- class exceptions.
DuplicateKeyExceptionHandler
.
DuplicateKeyExceptionHandler()
- Constructor for class exceptions.
DuplicateKeyExceptionHandler
E
exceptions
- package exceptions
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class author.
AuthorAction
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class book.
BookAction
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class customer.
LoginAction
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class customer.
CustomerAction
execute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class customer.
FulfillOrderAction
execute(Exception, ExceptionConfig, ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)
- Method in class exceptions.
DuplicateKeyExceptionHandler
F
FulfillOrderAction
- class customer.
FulfillOrderAction
.
FulfillOrderAction()
- Constructor for class customer.
FulfillOrderAction
G
getAuthor()
- Method in class author.
AuthorForm
getAuthor()
- Method in class book.
Book
getAuthor()
- Method in class customer.
ShoppingcartPosition
getAuthorName()
- Method in class book.
Book
getBook()
- Method in class book.
BookForm
getBook()
- Method in class customer.
ShoppingcartPosition
getBook(int)
- Method in class book.
BookKatalog
getBuecher()
- Method in class book.
BookKatalog
getHausnummer()
- Method in class customer.
Customer
getId()
- Method in class author.
Author
getId()
- Method in class customer.
Customer
getIsbn()
- Method in class book.
Book
getIter()
- Method in class book.
BookKatalog
getCustomer()
- Method in class customer.
CustomerForm
getList()
- Method in class book.
BookKatalog
getMail()
- Method in class customer.
Customer
getName()
- Method in class author.
Author
getName()
- Method in class customer.
Customer
getOrt()
- Method in class customer.
Customer
getPasswort()
- Method in class customer.
Customer
getPlz()
- Method in class customer.
Customer
getPreis()
- Method in class book.
Book
getPreis()
- Method in class customer.
ShoppingcartPosition
getPreisSortierteBuecher()
- Method in class book.
BookKatalog
getStrasse()
- Method in class customer.
Customer
getTitel()
- Method in class book.
BookForm
getTitel()
- Method in class book.
Book
getFirstname()
- Method in class author.
Author
getFirstname()
- Method in class customer.
Customer
H
hausnummer
- Variable in class customer.
Customer
I
id
- Variable in class author.
Author
id
- Variable in class customer.
Customer
isbn
- Variable in class book.
Book
K
customer
- package customer
customer
- Variable in class customer.
CustomerForm
Customer
- class customer.
Customer
.
Customer()
- Constructor for class customer.
Customer
Standard constructor.
Customer(String, String)
- Constructor for class customer.
Customer
CustomerAction
- class customer.
CustomerAction
.
CustomerAction()
- Constructor for class customer.
CustomerAction
CustomerForm
- class customer.
CustomerForm
.
CustomerForm()
- Constructor for class customer.
CustomerForm
L
laden()
- Method in class author.
Author
laden()
- Method in class book.
BookKatalog
laden()
- Method in class customer.
Customer
laden(int)
- Method in class customer.
Shoppingcart
list
- Variable in class book.

AuthorForm
logger
- Variable in class author.
AuthorAction
logger
- Variable in class book.
BookKatalog
logger
- Variable in class book.
BookForm
logger
- Variable in class book.
BookAction
logger
- Variable in class customer.
Shoppingcart
logger
- Variable in class customer.
LoginAction
logger
- Variable in class customer.
CustomerAction
logger
- Variable in class customer.
Customer
logger
- Variable in class customer.
FulfillOrderAction
LoginAction
- class customer.
LoginAction
.
LoginAction()
- Constructor for class customer.
LoginAction
M
mail
- Variable in class customer.
Customer
N
name
- Variable in class author.
Author
name
- Variable in class customer.
Customer
O
ort
- Variable in class customer.
Customer
P
passwort
- Variable in class customer.
Customer
plz
- Variable in class customer.
Customer
preis
- Variable in class book.
Book
preis
- Variable in class customer.
ShoppingcartPosition
R
reset(ActionMapping, HttpServletRequest)
- Method in class author.
AuthorForm
Reset all properties to their default values.
reset(ActionMapping, HttpServletRequest)
- Method in class book.
BookForm
reset(ActionMapping, HttpServletRequest)
- Method in class customer.
CustomerForm
Reset all properties to their default values.
S
setAuthor(Author)
- Method in class author.
AuthorForm
setAuthor(int)
- Method in class book.
Book
setAuthor(String)
- Method in class customer.
ShoppingcartPosition
setAuthorName(String)
- Method in class book.
Book
setBook(Book)
- Method in class book.
BookForm
setBook(String)
- Method in class customer.
ShoppingcartPosition
setHausnummer(int)
- Method in class customer.
Customer
setId(int)
- Method in class author.
Author
setId(int)
- Method in class customer.
Customer
setIsbn(int)
- Method in class book.
Book
setCustomer(Customer)
- Method in class customer.
CustomerForm
setMail(String)
- Method in class customer.
Customer
setName(String)
- Method in class author.
Author
setName(String)
- Method in class customer.
Customer
setOrt(String)
- Method in class customer.
Customer
setPasswort(String)
- Method in class customer.
Customer
setPlz(int)
- Method in class customer.
Customer
setPreis(int)
- Method in class book.
Book
setPreis(int)
- Method in class customer.
ShoppingcartPosition
setStrasse(String)
- Method in class customer.
Customer
setTitel(String)
- Method in class book.
BookForm
setTitel(String)
- Method in class book.
Book
setFirstname(String)
- Method in class author.
Author
setFirstname(String)
- Method in class customer.
Customer
sortByPreis()
- Method in class book.
BookKatalog
Sortiert die Bücher nach Preis, shellSort Zeitkomplexität: n^(6/5))
speichern()
- Method in class author.
Author
strasse
- Variable in class customer.
Customer
T
titel
- Variable in class book.
Book
V
validate(ActionMapping, HttpServletRequest)
- Method in class book.
BookForm
validate(ActionMapping, HttpServletRequest)
- Method in class customer.
CustomerForm
firstname
- Variable in class author.
Author
firstname
- Variable in class customer.
Customer
W
Shoppingcart
- class customer.
Shoppingcart
.
Shoppingcart()
- Constructor for class customer.
Shoppingcart
Standard constructor.
ShoppingcartPosition
- class customer.
ShoppingcartPosition
.
ShoppingcartPosition()
- Constructor for class customer.
ShoppingcartPosition
Standard constructor.
ShoppingcartPosition(String, String, int)
- Constructor for class customer.
ShoppingcartPosition
A
B
C
D
E
F
G
H
I
K
L
M
N
O
P
R
S
T
V
W
Overview
Package
Class
Use
Tree
Deprecated
Index
Help
PREV NEXT
FRAMES
NO FRAMES
All Classes
Copyright © 2003 Stephan Wiesner. All Rights Reserved.


 It is the result which counts, no matter how it is achieved.
Light's Imagination View more


Checking for a Company Logo
Hey y’all. I found myself using a company logo quite a bit in jamfHelper and AppleScript prompts during policies, so I though it would be handy to have a script with logic to check and see if an icon is present and installing on demand, rather than including a .pkg installer in every policy that requires it.
It’s a relatively simple script, which you can see here. Replace the /path/to/CompanyLogo.icns
with wherever the logo is you want to check for. Echos are included so that the policy logs show if the icon needed to be installed or not. This script could be easily updated to check for all sorts of things and install other things as needed.
In the JSS you need two policies:
-
Whatever policy you are running that includes a script with jamfHelper pop-ups, etc., with the policy_CompanyLogo.sh also included set to run
Before
other installers/scripts. -
A second policy that runs on the custom trigger you specify in the policy_CompanyLogo.sh.
I got the idea for this from both my NoMAD update script and Rich Trouton’s printer driver check script.
As always, test before deploying in production!


Before Change
// to the input layer we just created.
layer(x)
if len(layer.inbound_nodes) != 1:
raise ValueError("A layer added to a Sequential model must "
"not already be connected somewhere else. "
"Model received layer " + layer.name +
" which has " +
str(len(layer.inbound_nodes)) +
" pre-existing inbound connections.")
if len(layer.inbound_nodes[0].output_tensors) != 1:
raise ValueError("All layers in a Sequential model "
"should have a single output tensor. "
"For multi-output layers, "
"use the functional API.")
After Change
"Found: " + str(layer))
if not self.outputs:
// First layer in model: check that it is an input layer.
if not isinstance(layer, (InputLayer, legacy_layers.Merge)):
// Create an input layer.
// First, we need to infer its expected input shape and dtype.
if isinstance(layer, (Model, Sequential)):
// We were passed a model as first layer.
// This requires a specific way to figure out the
// input shape and dtype.
if not layer.layers:
raise ValueError("Cannot add an empty model "
"to a `Sequential` model.")
// In case of nested models: recover the first layer
// of the deepest model to infer input shape and dtype.
first_layer = layer.layers[0]
while isinstance(first_layer, (Model, Sequential)):
first_layer = first_layer.layers[0]
batch_shape = first_layer.batch_input_shape
dtype = first_layer.dtype
else:
// We were passed a regular layer, and it should
// know about its input shape. Otherwise, that"s an error.
if not hasattr(layer, "batch_input_shape"):
raise ValueError("The first layer in a "
"Sequential model must "
"get an `input_shape` or "
"`batch_input_shape` argument.")
batch_shape = layer.batch_input_shape
dtype = layer.dtype
// Instantiate the input layer.
x = Input(batch_shape=batch_shape,
dtype=dtype,
name=layer.name + "_input")
// This will build the current layer
// and create the node connecting the current layer
// to the input layer we just created.
layer(x)
if len(layer.inbound_nodes[-1].output_tensors) != 1:
raise ValueError("All layers in a Sequential model "
"should have a single output tensor. "
"For multi-output layers, "


li
is used after either an ordered list tae/element ol
or an unordered list tag/element ul
The tag for ordered list is ol
and we can create an entry with the usage of the tag list li
The tag for unordered list is ul
and we can create an entry with the usage of the tag list li
The tag for definition list is dl
and we can create an entry with the usage of definition term dt
and definition definition dd
- Technology
- The practical application of knowledge especially in a particular area
- Odour
- Smell
- to perceive the odor or scent of through stimuli affecting the olfactory nerves
The general idea is that you can have an ordered list or unordered list inside another list
Example:Return to the top of the page------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Peter Luo


Sponsor Information
Please tell us a little about yourself.
Category:
Address:
City:
State:
Zip:
Phone:
Piggy Information
Name your Piggy, set a fundraising goal and tell us the name of the company or organization adopting this pig (if applicable).
Adopt Pig
Piggy Name:
Fundraiser Goal: (enter numbers only, no symbols)
Sponsor Name for Business or Organizations: (Individuals Names will be used for Individual Sponsors)
{{>_footer}}


Can I have some help with a Pw shifter on a Low magic world and also roleplayable? With Skill points used every level and Ideas for Equipment that sticks to the Druid Tradition. I was thinking for a Druid/Shifter/Monk (I heard they are superb on a low magic world) or a Druid/Shifter/Rogue (for all those nifty skill points), specialing in Tumble/Discipline/ and Move silently. Will all 'normal' forms, like dragon and undead.
Thanks~ PlyrSilver
Well Ply, your options are way open. What type of Shifter do you want to be? Front row melle? Second row support? Sneak attack Shifter? 3rd row Artilery/Spellcasting?
With so many forms, I'd suggest focusing on two forms for your primary roll. When the first form doesn't prove useful in a situation, hop into the second.
Shifters are very strong on low magic worlds if they are not nerfed.
It's true that Monk offers many benefits for a shifter, but that's not the only choice.
A nice Cleric/Shifter offers a party a good buffer and damage dealer. A Mage Shifter also.
Assassin Shifter will get some nice damage in most forms (assassin kobold for instance).
Shifter Shadow Dancer is a nice combo too. Manticore Spike out of the shadows will hurt anyone who doesn't have DR.
So. Are you a melle type, casster or sneaker type?
I prefer melee, and with some heal skill points for Healing kits incase a healer is not available. But thats how I play, not really thinking ahead.
FYI once in shifted forms you cannot use heal kits; only potions. It is generally best not to waste too many points unless you plan to do a lot of shifting _________________ -4SakN
The Moonshae Isles - Forgotten Realms A Role Play, Low Magic world
I knew that, I use the healing kits when Im in normal form and its just that the PW im on dosent allow Skilldumping.
Is Dev Crit nerfed?
Any other special rules to follow?
There isnt one, or at least that I know of.
I haven't posted a build yet since I want to avoid the generic "Risen Lord Monk Dev Crit" build. Or Any Risen Lord Build for that matter.
It's true that Monk will give you awesome AC for a shifter, but... it's just such a vanilla flavor.
How about a non-dev crit Weapons Master Epic Drider?
Or a Blackguard Epic Drow?
Or an Assassin Elder Air Elemental?
Well, I dont know much about all that, I would just like the ancient Dragon form and it to be mainly druid based. Because IC he is a Human whos father is a {insert Chromatic/Metalic here} dragon and didnt get the RDD attributes, but he did get the ability to turn into a dragon.
well if you just want to be a dragon, then I'd ommit the shifter portion of your build.
take a look at one of these:
(*) Puff the Magic Dragon v.1.0 by cdualepp & SBully (*) Puff the Magic Dragon v.2.0 by cdualepp (*) Puff the Magic Dragon v.3.0 by cdualepp & SBully
The Reason I want a Shifter is b/c If I figured it right, have a good chance on living on a Low Magic PW and there cool, those builds look nice, but I'd also like to live, imo, they dont look very livable, and Im on the Raathi PW
so, a shifter dragon + (what other form?)
A Druid Dragon is just as good as a shifter dragon. A druid Dragon has better buffing spells also.
A shifter dragon has an option for more forms.
Well what I guess im trying to say is I want a Shifter that can turn into a dragon, that dosent mean that will be my main form, like I said Id like is to be able to shift and have atleast a decient number of good buffing spells.
The classic dragon with shifter is Druid/Monk/Shifter, for decent buffs I'd probably take 24 Druid levels since that maxes out Owl's Insight and gets good durations, leaves only 16 levels for Monk and Shifter (Monk2/Shifter14 I guess), I don't know if that's enough for you, you don't really need to take so much Druid to buff good. _________________
Quote: Posted 12/19/06 19:54 (GMT) -- FinneousPJ
Thax the Shadow Dragon sez: MONKS USE KAMAS. Just ask him.


public class Hashtable
extends totalcross.lang.Object
null
object can be used as a key or as a value.
An instance of Hashtable
has two parameters that
affect its efficiency: its capacity and its load
factor. The load factor should be between 0.0 and 1.0. When
the number of entries in the hashtable exceeds the product of the
load factor and the current capacity, the capacity is increased by
calling the rehash
method. Larger load factors use
memory more efficiently, at the expense of larger expected time
per lookup.
If many entries are to be made into a Hashtable
,
creating it with a sufficiently large capacity may allow the
entries to be inserted more efficiently than letting it perform
automatic rehashing as needed to grow the table.
This example creates a hashtable of numbers. It uses the names of the numbers as keys:
Hashtable numbers = new Hashtable(3); numbers.put("one", Convert.toString(1)); numbers.put("two", Convert.toString(2)); numbers.put("three", Convert.toString(3));
To retrieve a number, use the following code:
totalcross.lang.String n = (String)numbers.get("two"); if (n != null) // "two = " + Convert.toInt(n);This Hashtable class does not support Generics; use the HashMap class instead.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Hashtable.Entry
Hashtable collision list.
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
allowDuplicateKeys
Setting this to true will allow the hashtable to have more than one key with the same value.
|
int |
collisions
Computes the number of collisions for a set of inserts.
|
protected Hashtable.Entry[] |
table
The hash table data.
|
| Constructor and Description |
|---|
Hashtable(int initialCapacity)
Constructs a new, empty hashtable with the specified initial capacity
and default load factor of 0.75f.
|
Hashtable(int initialCapacity,
double loadFactor)
Constructs a new, empty hashtable with the specified initial
capacity and the specified load factor.
|
Hashtable(Object[] keys,
Object values)
Creates a Hashtable with the given keys and values.
|
Hashtable(String res)
Constructs a new hashtable, parsing the elements from the given String.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears this hashtable so that it contains no keys.
|
void |
copyInto(Hashtable target)
Copies the keys and values of this Hashtable into the given Hashtable.
|
StringBuffer |
dumpKeysValues(StringBuffer sb,
String keyvalueSeparator,
String lineSeparator)
Dumps the keys and values into the given StringBuffer.
|
boolean |
exists(Object key)
Checks if the value with the specified key is mapped in this hashtable.
|
Object |
get(int hash)
Returns the value to which the specified hash is mapped in this hashtable.
|
Object |
get(int hash,
Object defaultValue)
Returns the value to which the specified key is mapped in this hashtable.
|
Object |
get(Object key)
Returns the value to which the specified key is mapped in this hashtable.
|
Object |
get(Object key,
Object defaultValue)
Returns the value to which the specified key is mapped in this hashtable.
|
Vector |
getKeys()
Return a Vector of the keys in the Hashtable.
|
Vector |
getKeyValuePairs(String separator)
Return a Vector with pairs in the form
key=value from the Hashtable. |
String |
getString(Object key)
Returns the value to which the specified key is mapped in this hashtable as a String.
|
String |
getString(Object key,
String defaultValue)
Returns the value to which the specified key is mapped in this hashtable as a String.
|
Vector |
getValues()
Return a Vector of the values in the Hashtable.
|
Object |
put(int hash,
Object value)
Maps the specified
key to the specified
value in this hashtable. |
Object |
put(Object key,
Object value)
Maps the specified
key to the specified
value in this hashtable. |
protected void |
rehash()
Rehashes the contents of the hashtable into a hashtable with a
larger capacity.
|
Object |
remove(int hash)
Removes the key (and its corresponding value) from this
hashtable.
|
Object |
remove(Object key)
Removes the key (and its corresponding value) from this
hashtable.
|
int |
size()
Returns the number of keys in this hashtable.
|
protected Hashtable.Entry[] table
public int collisions
int max = 0xFFFFFFF; for (int h = 5; ; h++) { IntHashtable ht = new IntHashtable(h); ht.put("nbsp".hashCode(),' '); ht.put("shy".hashCode(),''); ht.put("quot".hashCode(),'"'); ... if (ht.collisions < max) { Vm.debug("h: "+h+" colli: "+ht.collisions); max = ht.collisions; if (max == 0) break; } }
public boolean allowDuplicateKeys
public Hashtable(int initialCapacity)
initialCapacity
- The number of elements you think the hashtable will end with. The hashtable will grow if necessary, but using
a number near or above the final size can improve performance.public Hashtable(int initialCapacity, double loadFactor)
initialCapacity
- The number of elements you think the hashtable will end with. The hashtable will grow if necessary, but using
a number near or above the final size can improve performance.loadFactor
- a number between 0.0 and 1.0.public Hashtable(String res)
// save these two lines in a file named EN.txt: Message = Message TestMsg = This is a test Exit = Exit // save these other two in a file named PT.txt: Message = Mensagem TestMsg = Isso é um teste Exit = SairThe TotalCross deployer will include the two files referenced below in the tcz file.
totalcross.lang.String txt = idiom == EN ? "EN.txt" : "PT.txt"; byte[] b = Vm.getFile(txt); Hashtable res = new Hashtable(new String(b,0,b.length)); new MessageBox(res.get("Message"), res.get("TestMsg"), new totalcross.lang.String[]{res.get("Exit")}).popupNonBlocking();Note that the keys are case sensitive, and that all strings are trimmed.
public Hashtable(Object[] keys, Object values)
totalcross.lang.Object[]
). In this case, the number of keys and values must match.
public void clear()
public Object get(Object key)
key
- a key in the hashtable.null
if the key is not mapped to any value in
this hashtable.public String getString(Object key)
key
- a key in the hashtable.null
if the key is not mapped to any value in
this hashtable.public String getString(Object key, String defaultValue)
key
- a key in the hashtable.defaultValue
if the key is not mapped to any value in
this hashtable.public Object get(Object key, Object defaultValue)
key
- a key in the hashtable.defaultValue
- The default value to be returned if none is found.defaultValue
if the key is not mapped to any value in
this hashtable.public Object get(int hash, Object defaultValue)
hash
- The key hash in the hashtable.defaultValue
- The default value to be returned if none is found.defaultValue
if the key is not mapped to any value in
this hashtable.public Object get(int hash)
Caution: since you're passing an integer instead of an object, if there are two objects that map to the same key, this method will always return the first one only.
hash
- The key hash in the hashtable.null
if the key is not mapped to any value in
this hashtable.public boolean exists(Object key)
key
- a key in the hashtable.public Vector getKeys()
public Vector getValues()
getKeys()
,
getKeyValuePairs(totalcross.lang.String)
public Vector getKeyValuePairs(String separator)
key=value
from the Hashtable.
Each vector's element can safely be casted to a String.separator
- the separator between the key and the value. Should be ": ","=", etc.public void copyInto(Hashtable target)
public Object put(Object key, Object value)
key
to the specified
value
in this hashtable. Neither the key nor the
value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
key
- the hashtable key.value
- the value.null
if it did not have one.Object.equals(totalcross.lang.Object)
public Object put(int hash, Object value)
key
to the specified
value
in this hashtable. Neither the key nor the
value can be null
.
The value can be retrieved by calling the get
method
with a key that is equal to the original key.
This method receives a hashcode instead of the object. You MUST use the get(int) method to retrieve the value, otherwise you will get a NullPointerException, because no key is stored using this method.
hash
- the hashtable key's hash.value
- the value.null
if it did not have one.Object.equals(totalcross.lang.Object)
protected void rehash()
public Object remove(Object key)
key
- the key that needs to be removed.null
if the key did not have a mapping.public Object remove(int hash)
hash
- the hash code of the key that needs to be removed.null
if the key did not have a mapping.public int size()
public StringBuffer dumpKeysValues(StringBuffer sb, String keyvalueSeparator, String lineSeparator)
sb
- The totalcross.lang.StringBuffer where the data will be dumped tokeyvalueSeparator
- The separator between the key and the value (E.G.: ": ")lineSeparator
- The separator placed after each key+value pair (E.G.: "\r\n"). The last separator is cut from the StringBuffer.


Bike Name is : {{bikes.name}}
Bike Ingine is : {{bikes.ingine}}
Bike speed is : {{bikes.speed}}
Bike mileage is : {{bikes.mileage}}
Bike Price is : {{bikes.price}}


VDT Decentralized Render Farm. Built on the NEO Smart Economy.
Twitter - Telegram Community - Telegram Announcements
Our Whitepaper will contain the technical details surrounding VDT.Network.
Our Commercial Paper will explain VDT.Network in a visual, easy to understand manner.
VDT.Network offers familiar APIs and modules for developers to easily integrate VDT.Network's decentralized render farm with their applications.
The VDT team has built the first application on VDT.Network: Vidiato. Vidiato is an easy to use platform that lets users produce data-driven videos with Adobe After Effects templates quickly and conveniently.
VDT will manage top tier Render Nodes connected to the VDT.Network, increasing render network speed & efficiency.
The VDT team offers consultation & development services. We build applications on the VDT.Network for enterprise clients and partners.
VDT.Network is operated in The Netherlands and internationally, and incorporated in Estonia.
If you have any questions, please do not hesitate to contact us.
VDT.Network OÜ
Estonia Company Registry Code 14404117
Harju maakond, Kuusalu vald, Pudisoo küla, Männimäe, 74626


In this release of the Open Targets Platform we integrate over 2.2 million target-disease associations covering 9,294 diseases and 20,633 targets from the following public resources:
This release also includes several new features in the Open Targets Platform website:
For more details on the Open Targets Platform releases, check our blog
In this release of the Open Targets Platform we have included two new data sources: somatic mutations from UniProt and affected pathway evidence from SLAPEnrich. In total we integrate over 2.6 million target-disease associations covering 9,341 diseases and 19,803 targets from the following public resources:
This release also includes several new features in the Open Targets Platform website:
For more details on this new release, check our blog
In this release of the Open Targets Platform we integrate over 2.8 million target-disease associations covering 9,150 diseases and 26,122 targets from the following public resources:
Apart from several bug fixes, this release also includes a new table showing the homology relationships for targets in the "Gene tree" section of the target profile page
For more details on this new release, check our blog
In this release of the Open Targets Platform we integrate over 2.6 million target-disease associations covering 8,891 diseases and 31,380 targets from the following public resources:
This release also includes several bug fixes
For more details on this new release, check our blog
This release includes several new features in the Open Targets Platform website:
In this release of the Open Targets Platform we integrate over 2.6 million target-disease associations covering 8,718 diseases and 31,352 targets from the following public resources:
This release also includes several bug fixes
For more details on this new release, check our blog
In this release of the Open Targets Platform we integrate over 2.5 million target-disease associations covering 8,659 diseases and 31,071 targets from the following public resources:
Some other highlights include:
For more details on this new release, check our blog
In this minor release we have incorporated some data and bug fixes
In this third release of the Open Targets Platform, we have new web displays and plenty of new data to assist you in drug discovery and validation:
Some highlights:
For more details on this new release, check our blog
This is the second public version of the Open Targets Platform
The Open Targets Platform integrates over 2.1M target-disease associations covering 7,954 diseases and 24,774 targets from the following public resources:
This release includes the following features described in details in the documentation:
For more details on this new release, check our blog
This is the first public version of the CTTV platorm
The CTTV platform integrates over 2M target-disease associations covering 7,359 diseases and 24,309 targets from the following public resources:
This release includes the following features described in details in the documentation:
The CTTV platform also integrates third-party visualisations components:


... so you run a program and the box gets hot, but there is no output
because it does not have side effects ...
One of the designers of Haskell
Why you would want to learn it?
It is the coolest language ever (sorry lispers...)
New way of thinking
New patterns and ideas
Very expressive and concise
Opens whole new class of languages/tools
What is Functional Programming?
Function application
Higher order functions
Avoids state and mutable data
Recursion
Pure functions over side effects
Favour composition
Type systems
What is Haskell?
Purely-functional programming language
Lazy
Statically typed
Type inference
Strongly typed
Parametric polymorphism
Purely-functional
Everything is immutable (almost)
Functions are values
No Side effects (almost)
Recursion, TCO
Function application
g (f x)
Lazy Evaluation
f x y = x
> f 2 3
2
> 1 + undefined
*** Exception: Prelude.undefined
> f 2 undefined
2
Statically typed
square :: Int -> Int
square x = x * x
pp :: Expr -> String
pp (IntLit x) = show x
pp (BoolLit x) = show x
pp (Plus a b) = pp a ++ " + " ++ pp b
Statically typed: GHCI
> :t length (take 3 "Hello")
length (take 3 "Hello") :: Int
> :t map
map :: (a -> b) -> [a] -> [b]
Strongly typed
This will fail to compile:
2 + True
Parametric polymorphism
map :: (a -> b) -> [a] -> [b]
map _ [] = []
map f (x:xs) = f x : map f xs
Algebraic data types
data Bool = True | False
data Point = Point Int Int
data List a = Empty | Elem a (List a)
data Product = Product {
productName :: String,
productPrice :: Int
} deriving Show
ADT: Point - I
type Coordinate = Int
data Point = Point Coordinate Coordinate
isOrigin :: Point -> Bool
isOrigin (Point 0 0) = True
isOrigin _ = False
ADT: Point - II
distance :: Point -> Point -> Double
distance (Point x1 y1) (Point x2 y2) = ...
ADT: Point - III
data Line = Line Point Point
slope :: Line -> Double
slope (Line (Point x1 y1) (Point x2 y2)) =
...
Lists
> maximum [1,9,2,3,4]
9
> drop 3 [8,4,2,1,5,6]
[1,5,6]
> [x*2 | x <- [1..10], x*2 >= 12]
[12,14,16,18,20]
> take 5 [10..]
[10,11,12,13,14]


PURSUE:
White seeks ball.
Red seeks White.
Black pursues (Seek with prediction) White.
Move mouse on the floor to change ball position.
ALT + Click to reposition entities
View source


Architecture bibendum eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae justo pulvinar cursus.
Interior design eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae the justo pulvinar of cursus.
Urban design eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae the justo pulvinar of cursus.
Urban design eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae the justo pulvinar of cursus.
Urban design eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae the justo pulvinar of cursus.
Urban design eros eget lacus the vulputate, sit amet vehicula nibh placerat in lectus vitae the justo pulvinar of cursus.
SLV Associates was started in the year 1996. we feel extremely proud in announcing that we are one of the fastest growing realtors in Bangalore with our primary. being on Residential Apartments. We have been credited over 15 projects in and around Bangalore. We are happy to state that all our projects were given possession to our customers within the promised time frames.
SLV Associates offers a life style of luxury and elegance with creativity. We are focused on offering High quality apartments at affordable costs. our structure safety is considered as our prime concern, we therefore always remained attentive on the civil engineers team who work with us. with the experienced and committed team of engineers and architects we have, we confidently assure the finest Homes to our customers.
We believe in developing and constructing aesthetically designed, functionally efficient residential projects offering more value for money. we believe that our constructions should reflect engineering excellence with a view to providing complete customer satisfaction.Provide highest quality constructions at economical cost, driving towards their utmost satisfaction. Ensure health & safety of all the employees. Stand on the core values and business ethics.
To create affordable, qualitative and comfortable living.
To create a self sustainable business that builds dreams.
" Vivamus faucibus lorem non mi varius, vel euismod magna malesuada. Nam nec diam in nisl porttitor commodo in et ligula. "
" Qaulity faucibus lorem non mi varius, vel euismod magna malesuada. Nam nec diam in nisl porttitor commodo in et ligula. "
310, 1st floor, 39th B'Cross 9th main 5th Block, Jayanagar Bangalore-560041
+91<PHONE_NUMBER> /<PHONE_NUMBER>
sales@slvassociates.com


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.text.StringCharacterIterator
public final class StringCharacterIterator
StringCharacterIterator
implements the
CharacterIterater
protocol for a String
.
The StringCharacterIterator
class iterates over the
entire String
.
CharacterIterator
| Field Summary |
|---|
| Fields inherited from interface java.text.CharacterIterator |
|---|
DONE |
| Constructor Summary | |
|---|---|
StringCharacterIterator(String text)
Constructs an iterator with an initial index of 0. |
|
StringCharacterIterator(String text,
int pos)
Constructs an iterator with the specified initial index. |
|
StringCharacterIterator(String text,
int begin,
int end,
int pos)
Constructs an iterator over the given range of the given string, with the index set at the specified position. |
| Method Summary | |
|---|---|
Object |
clone()
Creates a copy of this iterator. |
char |
current()
Implements CharacterIterator.current() for String. |
boolean |
equals(Object obj)
Compares the equality of two StringCharacterIterator objects. |
char |
first()
Implements CharacterIterator.first() for String. |
int |
getBeginIndex()
Implements CharacterIterator.getBeginIndex() for String. |
int |
getEndIndex()
Implements CharacterIterator.getEndIndex() for String. |
int |
getIndex()
Implements CharacterIterator.getIndex() for String. |
int |
hashCode()
Computes a hashcode for this iterator. |
char |
last()
Implements CharacterIterator.last() for String. |
char |
next()
Implements CharacterIterator.next() for String. |
char |
previous()
Implements CharacterIterator.previous() for String. |
char |
setIndex(int p)
Implements CharacterIterator.setIndex() for String. |
void |
setText(String text)
Reset this iterator to point to a new string. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringCharacterIterator(String text)
public StringCharacterIterator(String text, int pos)
text
- The String to be iterated overpos
- Initial iterator positionpublic StringCharacterIterator(String text, int begin, int end, int pos)
text
- The String to be iterated overbegin
- Index of the first characterend
- Index of the character following the last characterpos
- Initial iterator position| Method Detail |
|---|
public void setText(String text)
text
- The String to be iterated overpublic char first()
first
in interface CharacterIterator
CharacterIterator.first()
public char last()
last
in interface CharacterIterator
CharacterIterator.last()
public char setIndex(int p)
setIndex
in interface CharacterIterator
p
- the position within the text. Valid values range from
getBeginIndex() to getEndIndex(). An IllegalArgumentException is thrown
if an invalid value is supplied.
CharacterIterator.setIndex(int)
public char current()
current
in interface CharacterIterator
CharacterIterator.current()
public char next()
next
in interface CharacterIterator
CharacterIterator.next()
public char previous()
previous
in interface CharacterIterator
CharacterIterator.previous()
public int getBeginIndex()
getBeginIndex
in interface CharacterIterator
CharacterIterator.getBeginIndex()
public int getEndIndex()
getEndIndex
in interface CharacterIterator
CharacterIterator.getEndIndex()
public int getIndex()
getIndex
in interface CharacterIterator
CharacterIterator.getIndex()
public boolean equals(Object obj)
equals
in class Object
obj
- the StringCharacterIterator object to be compared with.
Object.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public Object clone()
clone
in interface CharacterIterator
clone
in class Object
Cloneable
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


--- layout: default category: start category_page: Information permalink: /approach title: Approach description: "Learn about our vision and focus in the development of this tool." ---
This is a tool for the whole family of developers, those who are not
familiar with the design of sites and do not know preprocessors like SASS but also
the great web design gurus.
It is a single file. CSS loaded with great components, browse through the documentation
and you will see its great potential and incredible styles.
Content rating A, For the whole family!
While we know that we only include a single CSS file, we work based on
our first approach, which is simple and for the whole family.
Even a single CSS file with the full package included is quite flexible, lightweight
and fun. Created for great style gurus and for non-experienced developers.
Use this file, extracting the greatest potential from its components and utilities.
For the experienced, the SASS source files are included.


Steelers WR JuJu Smith-Schuster Might Be Out vs. Cincinnati
by Alek ArendMyles Garrett’s helmet swinging hit on Mason Rudolph and subsequent brawl has dominated the NFL discussion since Thursday night. Lost in the shuffle is JuJu Smith-Schuster and the crushing helmet-to-helmet hit he absorbed, leading to his early exit from the game.
The Steelers receiver found himself in between three Browns defenders, two of which made contact with Smith-Schuster’s helmet with their own helmet. Pittsburgh’s star receiver suffered a concussion as a result.
According to the latest report from ESPN’s Adam Schefter, it appears Smith-Schuster is dealing with more than just a concussion. The receiver also suffered an undisclosed knee injury which may sideline him for Sunday’s game against the Bengals.
Schefter offers the latest update in the tweet below.
With Smith-Schuster’s status up in the air, the Steelers may be in some trouble. Sunday’s game against Cincinnati is a must-win for Pittsburgh.
Remarkably, the Steelers are still alive in the AFC playoff hunt. Baltimore is on its way to winning the AFC North Division. But the Steelers are currently battling for a wildcard spot. As a current 8-seed in the AFC, Pittsburgh will need some help and has to win on Sunday.
As the week progresses, we’ll get a much better idea as to whether Smith-Schuster will play against the Bengals.


We were very pleased with the staff and all there is to do at Spring Mill Park! Delightful location, lots of trails for walking, excellent staff, nice room and a great restaurant. If you are looking for a family friendly break from the daily grind - this is a good choice.
Benjamin - Bowling Green, Ohio
I really enjoyed this park. The inn is very nice, great service from the front desk. The hiking was great. The trails are fun and most are easy enough for a part time hiker like me. There’s an indoor pool at the inn along with a few arcade type games. Really nice!
Jeanne - Page, Arizona
Stayed here for a couple days of relaxation. Got a two queen bed room with fridge and microwave. Nice spacious room. Clean and comfortable. The dining room had AWESOME fried chicken. The staff was very friendly. They keep the building up very nicely!
Doug - Salem, Indiana
Wonderful staff, beautiful location and dining hall on site. Entrance fee also gives you access to Pioneer Village and the Gus Grissom Museum. Has a delicious breakfast and dinner buffet. Loved the trails, pool, game area, reading nook. Highly recommend.
Mary - Indianapoils, Indiana


A2ZDB Basic Taxonomy Modeling
The A2Z object model is first and foremost designed from an enterprise perspective that is a holistic top-down logical model. What this means is the model is created in an abstract manner using taxonomy namespaces to isolate and partition a variety of schemas. Accordingly, a specific application may not implement all the entities in a physical model.
Modeling Overview
A2ZDB is different than a traditional "View Integration Model" or bottom-up relational model in a variety of ways. Most notable is the vast and growing business computing taxonomy infrastructure combined with managed metadata repository dependencies that allows the A2Z object model to be very maliable with extremely flexible definition integration patterns that can be predictably asserted. What this ultimately means is, refactoring storage structure (adding a table or a new column) of your business data becomes a very rare event in feature driven development. Originally - the A2ZDB consisted of 23 EAV Tables, that was almost 20 years ago. Today, the core database architecture requires less than 50 tables. Less than 100% growth in tables in 20 years says something toward the legitamcy of flexibility in this model.
Top-Down Object Model
Father of All Object Models
- Everything is an "ENTITY"
- All "ENTITY" data has a "TYPE_OF_ENTITY"
- An "ENTITY" can have a "RELATIONSHIP" with another "ENTITY"
- All "RELATIONSHIPS" have a "TYPE_OF_RELATIONSHIP"
- An "ENTITY" can have one or more "ATTRIBUTES"
- An "ATTRIBUTE" has a "TYPE_OF_ATTRIBUTE"
- An "ATTRIBUTE" can have one or more "DATA_VALUES"
A2ZDB makes maximum use of effeciency and performance when designing a taxonomy namespace. Great care is given toward properly identifying the nature of not just the data being stored, but also the relationships within a domain of discourse this model facilitates. Decades of effort has made this model quite complete in it's core form. More over, it is my experience once developers learn and undertsand this holistic approach, they prefer developing under EAV based Semantic models over "View Integration Models". After getting used to develolping under an A2Z taxonomy, you will quickly realize how quickley you can prototype the ground work for your next software project. After your understanding of Arizona and the A2Z modeling strategy has matured, you will start to realize you model much less and your development effort begins at cunsumption of the appropriate taxonomy. When properly implemented, you will be in a "sweet spot" position where your sustainability is greatly increased and your development effort is more focused toward feature enhancements via API libraries and existing taxonomies. In essence, You are no longer writing programs but assembling API's and connecting them to user interfaces with complete separation of concern between the variety of tiers found in modern web tier containers.
View Integration Model
- Everything is an "ENTITY"
- All "ENTITY" data has a "TYPE_OF_ENTITY"
- An "ENTITY" can have a "RELATIONSHIP" with another "ENTITY"
- All "RELATIONSHIPS" have a "TYPE_OF_RELATIONSHIP"
- An "ENTITY" can have one or more "ATTRIBUTES"
- An "ATTRIBUTE" has a "TYPE_OF_ATTRIBUTE"
- An "ATTRIBUTE" can have one or more "DATA_VALUES"
Bottom-Up Object Model
toward supporting the data you need to store without creating new mechanisms to store this data on disk. Because we use metadata to describe relationships with other taxonomy namespaces, data is not structured and stored in accordance with some market/project driven requirements. Instead, the Entities and Attributes that make up a storage container are modeled after the "Real World". While marketing and project requirements ultimately rule the day in typical DevOps cycles. The goal of A2Z's top-down model approach is designed not to restrict how you choose to describe an object within a managed framework using existing source code and runtime.
Top-Down Object Model
Father of All Object Models
- Everything is an "ENTITY"
- All "ENTITY" data has a "TYPE_OF_ENTITY"
- An "ENTITY" can have a "RELATIONSHIP" with another "ENTITY"
- All "RELATIONSHIPS" have a "TYPE_OF_RELATIONSHIP"
- An "ENTITY" can have one or more "ATTRIBUTES"
- An "ATTRIBUTE" has a "TYPE_OF_ATTRIBUTE"
- An "ATTRIBUTE" can have one or more "DATA_VALUES"


Repurposing Drugs with Semantics
Repurposing Drugs with Semantics - Two steps upstream
Search for entities related to:


|
BINGER
V1.0
Data Analysis Code Project for the External Target Facility, HIRFL-CSR, @IMP
|
A class for multi-sampleing ionization chamber. It is for the measurement of particle charge information. More...
#include <TAMUSIC.h>
Public Member Functions | |
| TAMUSIC (const string &name="", const string &title="", unsigned uid=999999999) | |
| virtual | ~TAMUSIC ()=0 |
| void | SetBeta (const double beta) |
| double | GetBeta () const |
| int | GetNChannel () const |
| const vector< TAChannel * > & | GetChArr () const |
| double | GetPileUp () const |
| return the value of pileUp channel More... | |
| bool | IsPileUp () const |
| void | SetPileUp (bool opt) |
| bool | GetFiredStatus () const |
| int | GetNFiredChannel () const |
| virtual double | GetDeltaE ()=0 |
| virtual double | GetZ ()=0 |
| particle charge More... | |
| virtual void | Initialize () |
| virtual TAStuff * | GetChannel (unsigned uid) const |
| get the channel that belongs to this with uid More... | |
| Public Member Functions inherited from TAStuff | |
| TAStuff (const string &name="", const string &title="", unsigned uid=999999999) | |
| virtual | ~TAStuff ()=0 |
| const string & | GetName () const |
| const string & | GetTitle () const |
| unsigned | GetUID () const |
| void | SetName (const string &name) |
| void | SetName (const char *name) |
| void | AppendName (const string &tail) |
| void | AppendName (const char *tail) |
| void | SetUID (unsigned uid) |
| void | SetTitle (const string &title) |
| void | SetTitle (const char *title) |
| void | AppendTitle (const string &tail) |
| void | AppendTitle (const char *tail) |
| virtual void | Info () const |
| virtual TAChPara * | GetPara () const |
| to mark the shared part of TAChannel and TAAnode More... | |
| virtual TAChData * | GetData () const |
| to mark the shared part of TAChannel and TAAnode More... | |
| Public Member Functions inherited from TADetUnion | |
| TADetUnion (unsigned uid) | |
| virtual | ~TADetUnion () |
| virtual void | Configure ()=0 |
| create detector objects More... | |
| virtual bool | IsDCArr () const |
| whether this is an MWDC array or not More... | |
| short | GetDetId () const |
| detector Id More... | |
Protected Attributes | |
| vector< TAChannel * > | fChArr |
| double | fBeta |
| particle velocity More... | |
| double | fDeltaE |
| measured energy deposit in MUSIC More... | |
| double | fZ |
| measured particle charge number More... | |
| int | fNChannel |
| number of channels in the MUSIC More... | |
| bool | fIsPileUp |
| Protected Attributes inherited from TAStuff | |
| string | fName |
| string | fTitle |
| unsigned | fUID |
A class for multi-sampleing ionization chamber. It is for the measurement of particle charge information.
| TAMUSIC::TAMUSIC | ( | const string & | name = "" , |
| const string & | title = "" , |
||
| unsigned | uid = 999999999 |
||
| ) |
|
pure virtual |
| double TAMUSIC::GetBeta | ( | ) | const |
|
virtual |
get the channel that belongs to this with uid
Implements TADetUnion.
|
inline |
| bool TAMUSIC::GetFiredStatus | ( | ) | const |
| int TAMUSIC::GetNChannel | ( | ) | const |
| int TAMUSIC::GetNFiredChannel | ( | ) | const |
| double TAMUSIC::GetPileUp | ( | ) | const |
return the value of pileUp channel
|
pure virtual |
|
virtual |
Implements TADetUnion.
|
inline |
| void TAMUSIC::SetBeta | ( | const double | beta | ) |
|
inline |
|
protected |
particle velocity
|
protected |
|
protected |
measured energy deposit in MUSIC
|
protected |
|
protected |
number of channels in the MUSIC
|
protected |
measured particle charge number


The paper proposes GradNorm, a gradient normalization algorithm that improves multi-task training by dynamically tuning the magnitude of gradients corresponding to different tasks.
During multi-task training, some tasks can dominate the training, at the expense of others.
It is common to define the multi-task loss as a linearly weighted combination of the individual task losses.
The paper proposes two changes to this setup:
Adapt weight-coefficients, assigned to each loss term, at each training step.
Directly modify the gradient magnitudes, corresponding to different tasks, so that all the tasks are learning at similar rates.
Proposed GradNorm algorithm is similar to BatchNorm, but it performs normalization across tasks, not data batches.
Gradient norm at timestep $t$, for the $i^{th}$ task, is computed as the product between average gradient norm (across all tasks at timestep $t$) and $r_i(t) ^ {\alpha}$.
$r_i$ is the relative inverse training rate of task $i$. It is defined as the ratio between the loss ratio of task $i$ and the average loss ratio (across all the tasks).
$\alpha$ is a hyperparameter.
This computed per-task gradient norm is treated as the target value for actual gradient norms.
An additional $L_1$ loss is incorporated between the actual and the target gradient norms, summed over all the tasks, and optimizes the weight-coefficients only.
After every step, the weight-coefficients are renormalized to decouple the gradient normalization from the global learning rate.
Note that all the gradient norm computations are performed only for the layers on which GradNorm is applied. Generally, GradNorm is used with only the last shared layer of weights (to save on computational costs).
Two variants of NYUv2 dataset – NYUv2+seg (small dataset) and NYUv2+kpts (big dataset).
Both regression and classification setups were used.
Models:
SegNet with a symmetric VGG16 encoder/decoder
FCN with modified ResNet-50 as the encoder and shallow ResNet as the decoder.
Standard pixel-wise losses for each task.
GradNorm with $\alpha=1.5$ outperforms the equal-weight baseline and either surpasses or matches the best performance of single networks for each task.
Almost any value of 0 < $\alpha$ < 3 improves the network’s performance over an equal weight baseline.


Currency Converter
Please select currency details
Amount:
From
SEK
USD
GBP
CNY
To
SEK
USD
GBP
CNY
Conversion Result
Amount:
Missing
, Result:
Missing


{% extends "layout.html" %} {% block body %}
{{ received_message.body }}
You have no messages here
{{ sent_message.body }}


The ::first-line CSS pseudo-element applies styles to the first line of a block-level element. Note that the length of the first line depends on many factors, including the width of the element, the width of the document, and the font size of the text.
CSS3 introduced the ::first-line notation (with two colons) to distinguish pseudo-classes from pseudo-elements. Browsers also accept :first-line, introduced in CSS2.


{{ define "main" }} {{ partial "hero.html" . }} {{ partial "mission.html" . }} {{ partial "how.html" . }} {{ partial "subscribe.html" . }} {{"" | safeHTML}}


--- layout: default title: Fuzzy search plugin ---
Note: The fuzzy search plugin is deprecated since v1.5.0, it's now bundled into List.js.
To use the plugin you first need to download it:
bower install list.fuzzysearch.js

The default search will conduct a time efficient search for an exact match in the content searched, while the fuzzy search will render results depending on if they are included anywhere in the content.
var items = [
{ character: "Guybrush Threepwood", game: "The Secret of Monkey Island" },
{ character: "Manny Calavera", game: "Grim Fandango" },
{ character: "Bernard Bernoulli", game: "Maniac Mansion" }
];
list.search('gu thre'); // return none
list.fuzzySearch.search('gu thre') // return 1 item

<input class="fuzzy-search" />

/ A bunch of items /

All options are optional. Simplest implementation is:
plugins: [ ListFuzzySearch() ]
0.0
requires a perfect match (of both letters and location), a threshold of 1.0
would match anything.
searchString
or put searchString
as only argument
A big thanks to LuukvE who made a commit from which I could create this Fuzzy Search plugin.


Modular CSS toolkit based on OOCSS principles
Basscss is a lightweight collection of base element styles, utilities, layout modules, and color styles designed for speed, performance, and scalability.
Lightweight
10KB minified, 2KB gzipped
Modular
Composable and highly reusable styles
Consistent and Flexible
Smart defaults balanced with basic utility
Fast
Performant and simple design to code faster
Hamburger 1
Hamburger 2
Hamburger 3
Base Elements
Core typographic, form, button, and base element styles keep designs consistent where it matters most.
Utility Styles
Simple, composable typographic and layout utilities based on common scales promote faster design and development in the browser and more performant, more readable code.
.sm-col-4
.sm-col-4
.sm-col-4
.sm-col-4
.sm-col-4
.sm-col-4
Layout Modules
Flexible, responsive, and reusable layout modules control page structure across a wide variety of devices.
Color
Simple, concrete color utilities encourage iterative design and flexibility over time.
Get Started
View the docs to download Basscss and learn more.


example
note: Please upload a photo of the outer packaging of the drug, and the text on the packaging must be clearly visible. Support jpg, jpeg, bmp, gif format photos. The size does not exceed 2M


manipulate_image module¶
-
manipulate_image.
check_UUID_input
(UUID)¶ Function checks to make sure UUID is a string
Parameters: UUID – user inputted unique identifier of the picture Raises: ValueError – if UUID is not a string Returns True: if pass test
-
manipulate_image.
check_b64
(b64)¶ Function checks if string is base64 and not empty
Parameters: b64 – base64 string
Raises: - TypeError – if input is not base64
- ValueError – if input is empty
-
manipulate_image.
check_image_input
(export_type)¶ Function checks if file type is .jpg, .png or .tiff
Parameters: export_type – user identified file type for image to be saved as Raises: ValueError – if file extension is not .jpg, .png or .tiff Returns True: if pass test
-
manipulate_image.
check_proc_type
(image_proc_type)¶ check_proc_type function checks to make sure image_proc_type is a string :param image_proc_type: user selected processing technique :raises ValueError: if image_proc_type is not a string :returns True: if pass test
-
manipulate_image.
image_to_b64
(filename)¶ Function transforms image to b64
Parameters: filename – image to be transformed to b64 Returns image_string: string of b64 code
-
manipulate_image.
numpy_to_pic
(np_array, filename)¶ Function transforms numpy array to image
Parameters: - np_array – numpy array to be turned into image
- filename – file name image will be saved as
Returns image: named filename
-
manipulate_image.
pic_to_numpy
(temp_file)¶ Function transforms image to numpy array
Parameters: temp_file – image to be numpified Returns np_array: numpy array of image
-
manipulate_image.
string_to_image
(base64string, new_file_name)¶ Function transforms b64string to b64 to new file
Parameters: - base64string – b64 string of the image
- new_file_name – name of image that b64 string will become
Returns image: saved as new_file_name


 Oh, and they explode when you shoot them.
Maybe they're zombies, but probably not. Maybe they're fairies.
Just make sure you shoot them, kay? And share your highscore. Highscores are cool too.
©2014 All rights reserved.


I've always been suspicious of the PHASECAL algorithm (we all learnt at school that extrapolation is dangerous) but a link posted by Robert Wall yesterday encouraged me to look at this building block entry.
It includes this nice diagram...
The red dots show the required phase shifted waveform as calculated by the PHASECAL algorithm.
The graphical equivalent of this function is to draw a line between two adjacent points and then extend the line by half the distance between them. It's clear just looking at the diagram that the result will always be on the outside of the grey shaded area, i.e. always above the black line where the true phase shifted value lies.
The net result of this is that the value given by the PHASECAL algorithm will always be too large and the errors will therefore accumulate. In contrast, if you didn't try to correct at all the errors largely cancel, less than 0.1% error for a 2 degree phase shift.
I contend that the error resulting from using PHASECAL will, at least for some values, be larger than if you hadn't corrected at all. Anyone care to prove me wrong?
Re: does PHASECAL really work?
I know it's a nice diagram, I drew it ;-). But you're wrong when you say "the result will always be on the outside of the grey shaded area". It depends on the value of phasecal that you use, and it isn't always 1.5 as I used to illustrate the effect. If you change the order of reading V and I, phasecal may well come inside the range 0 - 1, in which case it will be interpolating and the result will always be on or under the curve. Proven?
But as has been pointed out previously, when the wave is a true sine wave, only the amplitude is affected, and this can be corrected by recalibrating. But when top of the wave is flattened, then there's a big distortion at the corners, and that's an error that can be mitigated but not removed by recalibrating. (Interpolation rounds the corners, extrapolation makes them stick out - like shoulder pads.)
There's an argument (a good one in my view) for changing the order of the readings to make the value of phasecal as close as possible to the ideal - 0 or 1 - as both these values introduce no distortion at all. The 'standard' value for the shop transducers and example sketch is 1.7. If I remember correctly, reversing the order of readings would bring this down to 0.7, which would give much less distortion, because it's now only 0.3 away from the ideal value. The argument against is the confusion that would arise from having a switch in the library and its proper use.
There's a danger here (if I haven't already done so) of opening up the whole phase shift can of worms. The ideal is zero phase shift from both transducers and truly simultaneous readings of both. The next best is the phase shift of one equals the sum of the phase shift of the other plus the time delay between readings. In both those cases, phasecal wouldn't be needed. Otherwise, you've got to do it the easy way as a time shift in software like this, or the hard way is insert hardware filters to do a real phase shift.
Re: does PHASECAL really work?
If you change the order of reading V and I, phasecal may well come inside the range 0 - 1, in which case it will be interpolating and the result will always be on or under the curve.
Precisely so now all errored values will be too small and the errors will still accumulate. So no, not proven :)
I think that for any value of PHASECAL >0.5 and <1.5 the error in real power will be greater if you correct using the library method than if you just used the raw, unshifted voltage. Even outside this range you'd get a better result by simply using the previous or following voltage sample.
How about that one? :)
It's perfectly possible, given enough CPU power, to phase shift the voltage correctly in software by assuming the voltage is a sine wave and not a straight line, it just takes a bit of trigonometry.
Nothing wrong with opening a can of worms - question everything, that's my motto!
Re: does PHASECAL really work?
Can you explain exactly what you mean with: "errors will still accumulate"? I can't see any mechanism for that to happen, you're not storing the shifted value to use next time. You're changing the amplitude, yes, but that can be corrected provided no other distortion is added to the wave.
Re: does PHASECAL really work?
What I'm trying to say is that over a single cycle all the errored values are either too large (phasecal>1) or too small (phasecal<1) so there is no cancelation at all. All the errors contribute to the overall error in the calculated power.
By contrast, if you don't phase shift the voltage some errored values are too small and some are too large so there's a degree of cancelation and the error in calculated power is smaller.
This is why the power factor for small current leads/lags is small. The instantaneous power swings about but the total power over a cycle is only slightly different to when the PF is 1. Or to put it another way cos(a) is very close to 1 when a is small.
Re: does PHASECAL really work?
(1) The amplitude error is zero at phasecal = 0 and at phasecal = 1. The error curve is a parabola with a negative minimum at 0.5. Notwithstanding that, you're ignoring the fact that the amplitude distortion is consistent and can be corrected by adjusting the calibration?
(2) "This is why the power factor for small current leads/lags is small."
The normal way of analysing a complex phasor is to resolve it on orthogonal axes into real and imaginary parts, so the real component is aligned with the real axis and the imaginary or reactive component with the imaginary axis. If you have a difference in phase shifts between your transducers, you're effectively adding another pair of axes twisted in relation to the first, so you're drawing voltage phasors according to one frame of reference and current phasors with respect to the other.
Using that framework, can you explain a bit further the point you're trying to make?
Re: does PHASECAL really work?
I think you're trying to baffle me with science there Robert but I also think I now understand what you are trying to tell me. Let me put this into my own words and see if you agree...
If we have a perfect system, voltage and current are pure sine waves, the load is purely resistive, neither transformer introduces any phase shift and VCAL and ICAL are correctly set. The only error is the delay between sampling voltage and current.
If we calculated real power in this system we'd get a value that was too small by a factor of cos(current delay angle)
If we then simply applied the phasecal algorithm and recalculated real power we'd still get an incorrect result and the error would be greater than the previous error.
This was the gist of my point.
BUT, and I think this is your point, because all the individual sample errors are in the same direction this latter error can largely be compensated for by changing the amplitude, i.e. by adjusting VCAL.
This is also why it's important to use the phase shifted voltage for the Vrms calculation because VCAL is now incorrect for the raw voltage samples.
Is this correct?
I now just need to convince myself that the amplitude corrected error is smaller than the raw error and I'll be happy.
Re: does PHASECAL really work?
Yes, that's correct but with one proviso: the mains wave isn't a sine wave! I have a sampled mains wave in a spreadsheet - here it is resampled at 53 per cycle. Column B is the raw mains, Column C is the Mascot adapter output. You can run the algorithm on this in the spreadsheet and see what effect the various changes have.
Re: does PHASECAL really work?
Thanks for that Robert, it's interesting to look at real-world data.
I see what you mean about distortion in the corners...
This is for a phasecal value of 1.7 so we would be extrapolating. As you'd expect you get a much better result by interpolating between the following 2 values instead.
This would be easy to do in the library for phasecal values of 1-2 by just using the older current value that is already saved. Something like this...
if(PHASECAL>1) { phaseShiftedV = lastFilteredV + (PHASECAL-1) * (filteredV - lastFilteredV); instP = phaseShiftedV * lastFilteredI; }
else { phaseShiftedV = lastFilteredV + PHASECAL * (filteredV - lastFilteredV); instP = phaseShiftedV * filteredI; }
Re: does PHASECAL really work?
Yep, that looks exactly like the curves I have. Obviously, the more frequent the samples, the more history you need and the less distortion you get because there is less of a gap to fill. The original data was recorded at 44.1 or 48 k samples per second, so can be resampled at any rate (any that the Arduino can keep up with!).
But don't forget, with the v.t. phase shift varying with voltage and the c.t likewise with current, you can only aim for an average correction without unreasonably complicating the algorithm. And you can't get rid of those and remain non-invasive and at reasonable cost and complexity.


JNI has been enhanced in the Java SE to:
#define JNI_VERSION_1_1 0x00010001 #define JNI_VERSION_1_2 0x00010002 /* Error codes */ #define JNI_EDETACHED (-2) /* thread detached from the VM */ #define JNI_EVERSION (-3) /* JNI version error */
FindClass
has been
extended so that it finds classes loaded with a class loader.
jclass FindClass(JNIEnv *env, const char
*name);
In JDK 1.1, FindClass
searched only local classes
in CLASSPATH
. The resulting classes did not have a
class loader.
The Java security model has been extended to allow non-system
classes to load and call native methods. In the Java SE Platform,
FindClass
locates the class loader associated with the
current native method. If the native code belongs to a system
class, no class loader will be involved. Otherwise, the proper
class loader will be invoked to load and link the named class.
When FindClass
is called through the Invocation
Interface, there is no current native method or its associated
class loader. In that case, the result of
ClassLoader.getBaseClassLoader
is used. This is the
class loader the virtual machine creates for applications, and is
able to locate classes listed in the java.class.path
property.
In the JDK, each class loader manages its own set of
native libraries. The same JNI native library cannot be
loaded into more than one class loader. Doing so causes
UnsatisfiedLinkError
to be thrown. For example,
System.loadLibrary
throws an
UnsatisfiedLinkError
when used to load a native
library into two class loaders. The benefits of the new approach
are:
To facilitate versioning control and resource management, JNI libraries in the Java Platform may optionally export the following two functions:
jint
JNI_OnLoad(JavaVM *vm, void *reserved);
JNI_OnLoad
when the native library is
loaded (for example, through System.loadLibrary
).
JNI_OnLoad
must return the JNI version needed by the
native library.
In order to use any of the new JNI functions, a native library
must export a JNI_OnLoad
function that returns
JNI_VERSION_1_2
. If the native library does not export
a JNI_OnLoad
function, the VM assumes that the library
only requires JNI version JNI_VERSION_1_1
. If the VM
does not recognize the version number returned by
JNI_OnLoad
, the native library cannot be loaded.
void
JNI_OnUnload(JavaVM *vm, void *reserved);
JNI_OnUnload
when the class loader
containing the native library is garbage collected. This function
can be used to perform cleanup operations. Because this function is
called in an unknown context (such as from a finalizer), the
programmer should be conservative on using Java VM services, and
refrain from arbitrary Java call-backs.
Note that JNI_OnLoad
and JNI_OnUnload
are two functions optionally supplied by JNI libraries, not
exported from the VM.
JDK 1.1 provides a DeleteLocalRef
function so that
programmers can manually delete local references. For example, if
native code iterates through a potentially large array of objects
and uses one element in each iteration, it is a good practice to
delete the local reference to the no-longer-used array element
before a new local reference is created in the next iteration.
The JDK provides an additional set of functions for local reference lifetime management.
jint EnsureLocalCapacity(JNIEnv *env, jint
capacity);
Ensures that at least a given number of local
references can be created in the current thread. Returns 0 on
success; otherwise returns a negative number and throws an
OutOfMemoryError
.
Before it enters a native method, the VM automatically ensures that at least 16 local references can be created.
For backward compatibility, the VM allocates local references
beyond the ensured capacity. (As a debugging support, the VM may
give the user warnings that too many local references are being
created. In the JDK, the programmer can supply the
-verbose:jni
command line option to turn on these
messages.) The VM calls FatalError
if no more local
references can be created beyond the ensured capacity.
jint
PushLocalFrame(JNIEnv *env, jint capacity);
Creates a new local reference frame, in which at least a given
number of local references can be created. Returns 0 on success, a
negative number and a pending OutOfMemoryError
on
failure.
Note that local references already created in previous local frames are still valid in the current local frame.
jobject
PopLocalFrame(JNIEnv *env, jobject result);
Pops off the current local reference frame, frees all the local
references, and returns a local reference in the previous local
reference frame for the given result
object.
Pass NULL
as result
if you do not need
to return a reference to the previous frame.
jobject
NewLocalRef(JNIEnv *env, jobject ref);
ref
. The given ref
may be a global or
local reference. Returns NULL
if ref
refers to null
.
jboolean
ExceptionCheck(JNIEnv *env);
JNI_TRUE
when there is a pending exception;
otherwise, returns JNI_FALSE
.
NULL
. Programmers can
detect whether a weak global reference points to a freed object by
using IsSameObject
to compare the weak reference
against NULL
.
Weak global references in JNI are a simplified version of the
Java Weak References, available as part of the Java SE API
( java.lang.ref
package and its classes).
Clarification (added June 2001)
Since garbage collection may occur while native methods are
running, objects referred to by weak global references can be freed
at any time. While weak global references can be used where global
references are used, it is generally inappropriate to do so, as
they may become functionally equivalent to NULL
without notice.
While IsSameObject
can be used to
determine whether a weak global reference refers to a freed object,
it does not prevent the object from being freed immediately
thereafter. Consequently, programmers may not rely on this check to
determine whether a weak global reference may used (as a
non-NULL
reference) in any future JNI function
call.
To overcome this inherent limitation, it is recommended that
a standard (strong) local or global reference to the same object be
acquired using the JNI functions NewLocalRef
or NewGlobalRef
, and that this strong
reference be used to access the intended object. These functions
will return NULL
if the object has been freed,
and otherwise will return a strong reference (which will prevent
the object from being freed). The new reference should be
explicitly deleted when immediate access to the object is no longer
required, allowing the object to be freed.
The weak global reference is weaker than other types of weak
references (Java objects of the SoftReference or WeakReference
classes). A weak global reference to a specific object will not
become functionally equivalent to NULL
until
after SoftReference or WeakReference objects referring to that same
specific object have had their references cleared.
The weak global reference is weaker than Java's internal
references to objects requiring finalization. A weak global
reference will not become functionally equivalent to
NULL
until after the completion of the finalizer
for the referenced object, if present.
Interactions between weak global references and PhantomReferences are undefined. In particular, implementations of a Java VM may (or may not) process weak global references after PhantomReferences, and it may (or may not) be possible to use weak global references to hold on to objects which are also referred to by PhantomReference objects. This undefined use of weak global references should be avoided.
jweak NewWeakGlobalRef(JNIEnv *env, jobject obj);
NULL
if
obj
refers to null
, or if the VM runs out
of memory. If the VM runs out of memory, an
OutOfMemoryError
will be thrown.
void DeleteWeakGlobalRef(JNIEnv *env, jweak obj);
In JDK 1.1, programmers can use
Get/Release<PrimitiveType>ArrayElements
functions to obtain a pointer to primitive array elements. If the
VM supports pinning, the pointer to the original data is returned;
otherwise, a copy is made.
New functions allow native code to obtain a direct pointer to array elements even if the VM does not support pinning.
void *
GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean
*isCopy);
void
ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, void
*carray, jint mode);
Get/Release<PrimitiveType>ArrayElements
functions. If possible, the VM returns a pointer to the primitive
array; otherwise, a copy is made. However, there are
significant restrictions on how these functions can be
used.
After calling GetPrimitiveArrayCritical
, the native
code should not run for an extended period of time before it calls
ReleasePrimitiveArrayCritical
. We must treat the code
inside this pair of functions as running in a "critical region."
Inside a critical region, native code must not call other JNI
functions, or any system call that may cause the current thread to
block and wait for another Java thread. (For example, the current
thread must not call read
on a stream being written by
another Java thread.)
These restrictions make it more likely that the native
code will obtain an uncopied version of the array, even if the VM
does not support pinning. For example, a VM may
temporarily disable garbage collection when the native code is
holding a pointer to an array obtained via
GetPrimitiveArrayCritical
.
Multiple pairs of GetPrimtiveArrayCritical
and
ReleasePrimitiveArrayCritical
may be nested. For
example:
jint len = (*env)->GetArrayLength(env, arr1); jbyte *a1 = (*env)->GetPrimitiveArrayCritical(env, arr1, 0); jbyte *a2 = (*env)->GetPrimitiveArrayCritical(env, arr2, 0); /* We need to check in case the VM tried to make a copy. */ if (a1 == NULL || a2 == NULL) { ... /* out of memory exception thrown */ } memcpy(a1, a2, len); (*env)->ReleasePrimitiveArrayCritical(env, arr2, a2, 0); (*env)->ReleasePrimitiveArrayCritical(env, arr1, a1, 0);
Note that GetPrimitiveArrayCritical
might still
make a copy of the array if the VM internally represents arrays in
a different format. Therefore we need to check its return value
against NULL
for possible out of memory situations.
void
GetStringRegion(JNIEnv *env, jstring str, jsize start, jsize len,
jchar *buf);
len
number of Unicode characters beginning at
offset start
to the given buffer buf
.
Throws StringIndexOutOfBoundsException
on index
overflow.
<
void GetStringUTFRegion(JNIEnv *env, jstring str, jsize
start, jsize len, char *buf);
len
number of Unicode characters beginning
at offset start
into UTF-8 format and place the result
in the given buffer buf
.
Throws StringIndexOutOfBoundsException
on index
overflow.
const jchar * GetStringCritical(JNIEnv *env, jstring string,
jboolean *isCopy);
void ReleaseStringCritical(JNIEnv *env, jstring string, const jchar
*carray);
Get/ReleaseStringChars
functions. If possible, the VM
returns a pointer to string elements; otherwise, a copy is made.
However, there are significant restrictions on how these
functions can be used. In a code segment enclosed by
Get/ReleaseStringCritical
calls, the native code must
not issue arbitrary JNI calls, or cause the current thread to
block.
The restrictions on Get/ReleaseStringCritical
are
similar to those on
Get/ReleasePrimitiveArrayCritical
.
Programmers can use the JNI to call Java methods or access Java fields if they know the name and type of the methods or fields. The Java Core Reflection API allows programmers to introspect Java classes at runtime. JNI provides a set of conversion functions between field and method IDs used in the JNI to field and method objects used in the Java Core Reflection API.
jmethodID FromReflectedMethod(JNIEnv *env, jobject
method);
java.lang.reflect.Method
or
java.lang.reflect.Constructor
object to a method ID.
jfieldID FromReflectedField(JNIEnv *env, jobject
field);
java.lang.reflect.Field
to a field ID.
jobject ToReflectedMethod(JNIEnv *env, jclass cls,
jmethodID methodID);
cls
to a
java.lang.reflect.Method
or
java.lang.reflect.Constructor
object.
Throws OutOfMemoryError
and returns 0 if fails.
jobject ToReflectedField(JNIEnv *env, jclass cls,
jfieldID fieldID);
cls
to a
java.lang.reflect.Field
object.
Throws OutOfMemoryError
and returns 0 if fails.
jint JNI_CreateJavaVM(JavaVM **pvm, void **penv, void
*args);
JNI_CreateJavaVM
is
always a pointer to JNIEnv *
. The third argument is a
pointer to a JDK 1.1 specific structure
(JDK1_1InitArgs
). The JDK1_1InitArgs
structure is clearly not designed to be portable on all VMs.
In the JDK, we introduce a standard VM initialization
structure. Backward compatibility is preserved. If the VM
initialization argument points to a JDK1_1InitArgs
structure, JNI_CreateJavaVM
still returns the 1.1
version of JNI interface pointer. The VM returns the 1.2 version of
JNI interface pointer if the third argument points to a
JavaVMInitArgs
structure. Unlike
JDK1_1InitArgs
, which contains a fixed set of options,
JavaVMInitArgs
uses option strings to encode arbitrary
VM start up options.
typedef struct JavaVMInitArgs { jint version; jint nOptions; JavaVMOption *options; jboolean ignoreUnrecognized; } JavaVMInitArgs;The
version
field must be set to
JNI_VERSION_1_2
. (In contrast, the version field in
JDK1_1InitArgs
must be set to
JNI_VERSION_1_1
.) The options
field is an
array of the following type:
typedef struct JavaVMOption { char *optionString; void *extraInfo; } JavaVMOption;The size of the array is denoted by the nOptions field in
JavaVMInitArgs
. If ignoreUnrecognized
is
JNI_TRUE
, JNI_CreateJavaVM
ignore all
unrecognized option strings that begin with "-X
" or
"_
". If ignoreUnrecognized
is
JNI_FALSE
, JNI_CreateJavaVM
returns
JNI_ERR
as soon as it encounters any unrecognized
option strings. All Java VMs must recognize the following set of
standard options:
| optionString | meaning |
|---|---|
-D<name>=<value> |
Set a system property |
-verbose[:class|gc|jni] |
Enable verbose output. The options can be followed by a
comma-separated list of names indicating what kind of messages will
be printed by the VM. For example, "-verbose:gc,class "
instructs the VM to print GC and class loading related messages.
Standard names include: gc , class , and
jni . All nonstandard (VM-specific) names must begin
with "X ". |
vfprintf |
extraInfo is a pointer to the
vfprintf hook. |
exit |
extraInfo is a pointer to the exit
hook. |
abort |
extraInfo is a pointer to the abort
hook. |
In addition, each VM implementation may support its own set of
non-standard option strings. Non-standard option names must begin
with "-X
" or an underscore ("_
"). For
example, the JDK supports -Xms
and
-Xmx
options to allow programmers specify the initial
and maximum heap size. Options that begin with "-X
"
are accessible from the "java
" command line.
Here is the example code that creates a Java VM in the JDK:
JavaVMInitArgs vm_args; JavaVMOption options[4]; options[0].optionString = "-Djava.compiler=NONE"; /* disable JIT */ options[1].optionString = "-Djava.class.path=c:\myclasses"; /* user classes */ options[2].optionString = "-Djava.library.path=c:\mylibs"; /* set native library path */ options[3].optionString = "-verbose:jni"; /* print JNI-related messages */ vm_args.version = JNI_VERSION_1_2; vm_args.options = options; vm_args.nOptions = 4; vm_args.ignoreUnrecognized = TRUE; /* Note that in the JDK, there is no longer any need to call * JNI_GetDefaultJavaVMInitArgs. */ res = JNI_CreateJavaVM(&vm, (void **)&env, &vm_args); if (res < 0) ...
The JDK still supports JDK1_1InitArgs
in
exactly the same way as JDK 1.1.
jint AttachCurrentThread(JavaVM *vm, void **penv, void
*args);
AttachCurrentThread
is always a pointer to JNIEnv
. The third argument to
AttachCurrentThread
was reserved, and should be set to
NULL
.
In the JDK, you pass NULL
as the third
argument for 1.1 behavior, or pass a pointer to the following
structure to specify additional information:
typedef struct JavaVMAttachArgs { jint version; /* must be JNI_VERSION_1_2 */ char *name; /* the name of the thread, or NULL */ jobject group; /* global ref of a ThreadGroup object, or NULL */ } JavaVMAttachArgs;
jint DetachCurrentThread(JavaVM *vm);
DestroyJavaVM
to unload the entire VM.
In the JDK, the main thread can be detached from the VM.
jint DestroyJavaVM(JavaVM *vm);
DestroyJavaVM
was not complete in 1.1.
Only the main thread may call DestroyJavaVM
. In the
JDK, any thread, whether attached or not, can call this
function. If the current thread is attached, the VM waits until the
current thread is the only user-level Java thread. If the current
thread is not attached, the VM attaches the current thread and then
waits until the current thread is the only user-level thread. The
JDK still does not support VM unloading, however.
DestroyJavaVM
always returns an error code.
jint GetEnv(JavaVM *vm,
void **env, jint version);
*env
to NULL
, and returns
JNI_EDETACHED
. If the specified version is not
supported, sets *env
to NULL
, and returns
JNI_EVERSION
. Otherwise, sets *env
to the
appropriate interface, and returns JNI_OK
.


Explicitly specifies a list of values for which to generate Group By values.
You can use trailing wildcards to include ranges of values.
Example:
The array
["foo", "bar*"]
would return Group By values forfoo
and any value starting withbar
.
The pattern type to use for the IGroupByRequest.allowedValues property (see AllowedValuesPatternType).
This option is empty by default, which makes it behave as legacy
.
Specifies an array of computed fields that should be evaluated for each Group By value that is returned.
Computed fields are used to perform aggregate operations on other fields for all the matching items having a specific value in the Group By field in the results. See Computed Fields.
Specifies a constant query expression on which to compute the Group By operation.
This feature is similar to the queryOverride
feature, except that in this
case, the index keeps the constant query expression in cache for faster queries. You should avoid specifying a
dynamic query expression for this parameter, for doing so will negatively impact performance.
By default, the constant part of the query expression being executed is used.
Specifies the field on which to perform the Group By request. The Group By request returns a Group By value for each distinct value of this field within the result set.
Specifies whether to let the index calculate the ranges.
Default value is false
.
Specifies how deep the index should scan the results to identify missing Group By values.
When executing a Group By operation, the index uses various heuristics to try to list all of the field values that
appear in the result set. In some corner cases, certain values might be omitted (it is a classical example of a
trade-off between precision and performance). Using injectionDepth
forces the index to explicitly scan the field
values of the top n results of the query, and ensure that the field values present in those results are included.
Consequently, specifying a high value for this parameter may negatively impact query performance.
Default value is 1000
. Minimum value is 0
.
Specifies the maximum number of values that the Group By operation can return.
Default value is 10
. Minimum value is 0
.
Specifies a different query expression on which to compute the Group By operation.
This feature is typically used for performance reasons to retrieve Group By values on separate expressions while executing a normal query in a single operation.
By default, the query expression being executed is used.
Explicitly specifies a list of range values for which Group By values should be generated.
Specifies how the indexer should sort the Group By values.
The possible values are:
score
: Sort by score. Score is computed from the number of occurrences of a field value, as well as from the
position where results having this field value appear in the ranked result set. When using this sort criterion, a
field value with 100 occurrences might appear after one with only 10 occurrences, if the occurrences of the latter
tend to appear sooner in the ranked result set.occurrences
: Sort by number of occurrences, with values having the highest number of occurrences appearing
first.alphaascending
/ alphadescending
: Sort alphabetically on the field values.computedfieldascending
/ computedfielddescending
: Sort on the values of the first computed field for each
Group By value (see Computed Fields).chisquare
: Sort based on the relative frequency of values in the result set compared to the frequency in the
entire index. This means that a value that does not appear often in the index but does appear often in the result
set will tend to appear first.nosort
: Do not sort the Group By values. When using this sort criterion, the index returns the Group By values
in a random order.Default value is score
.
The
IGroupByRequest
interface describes a Group By operation to perform against the index.See Group By Operations.


Jim Earley
The JSON Event Parser (JEP) is a push-based event processor that uses some of the same design
principles that SAX processors provided for XML. The main premise is that the processor fires
events that an event handler JSONEventHandler
class consumes to either build a JSON instance or to use in another type of process, e.g., ETL.
Internally, the processor consumes either from a byte stream or from a character streams. In either case
the processors are designed to optimize performance by minimizing the number of reads from the underlying
stream or reader by working with blocks of byte or character data. While this may have minimal impact
on small JSON data, the expectation is to improve performance on very large data (e.g, 100MB or larger)
where many parsers see degradation due to reading one byte/character at a time.
The event model is designed to recognize the various types of JSON entities:
Objects: Typically this is an instance of a Map, but no assumptions
are made about the underlying implementation other than to indicate that a new object token
was recognized. There are two events - one for when a start token is recognized, and another
when a corresponding end token is detected. Internally tokens are mapped to a given key (or null for the document),
to align object boundaries, particularly when JSON data is heavily nested.
Arrays: This might be an instance of a List, but no assumptions are
made about the underlying implementation other than to indicate that new array has been
recognized in the JSON data
Strings: Strings will be interpreted as a Java String instance, Object keys will also be
recognized as Strings, but will can be handled through separate events from values
Numbers: Internally numbers will either be interpreted as BigDecimal or BigInteger values, but then can be
processed into the appropriate primitive and Boxed classes.
Booleans: will be interpreted as a boolean primitive type
Null Values: Since various implementations handle null values differently, there is a set of
events that indicate when a null value has been detected. The implementation can determine
how to reflect the value in the Event Handler.
Typically, there are usually two events for each entity, one when the entity starts, and a corresponding
event when the entity ends.