Class LatitudePayConfiguration
Instances of this class represent configuration options for ILatitudePayClient instances. The static members of this class provide global configuration common to all instances.
Inherited Members
Namespace: Yort.LatitudePay.InStore
Assembly: Yort.LatitudePay.InStore.dll
Syntax
public sealed class LatitudePayConfiguration
Constructors
| Improve this Doc View SourceLatitudePayConfiguration()
Default contructor, creates a new instance.
Declaration
public LatitudePayConfiguration()
Remarks
Instances of this type become immmutable once passed to a
Properties
| Improve this Doc View SourceDefaultCurrency
Sets or returns the default currency for new LatitudePayMoney instances where the currency is not explicitly provided.
Declaration
public static string DefaultCurrency { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
If this property is null or an empty string then AustralianDollars will be used as a default.
DeviceId
Sets or returns the id this device previously registered with LatitudePay, used to obtain authorisation tokens.
Declaration
public string DeviceId { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
Leave null if you will be registering a new device. After registration is successful you can retrieve the id from this property.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
DeviceKey
Sets or returns the secret key of this device used to obtain authorisation tokens.
Declaration
public string DeviceKey { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
Leave null if you will be registering a new device. After registration is successful you can retrieve the key from this property.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
Environment
Sets or returns the LatitudePay API environment to be used.
Declaration
public LatitudePayEnvironment Environment { get; set; }
Property Value
| Type | Description |
|---|---|
| LatitudePayEnvironment |
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
HttpClient
Sets or returns an HttpClient instance used to make calls to the LatitudePay API. If null/unset, the system will create it's own instance on first use.
Declaration
public HttpClient HttpClient { get; set; }
Property Value
| Type | Description |
|---|---|
| HttpClient |
Remarks
The library reserves the right to modify the provided client, such as setting default headers. A client can be shared amongst configuration object, but should not be shared/use outside of other
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
MerchantId
Sets or returns the merchant ID that will be used as part of the user agent string when calling the LatitudePay API.
Declaration
public string MerchantId { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
MinimumRetries
The minumum number of automatic retries to perform when a create transaction (order/refund/order reversal/refund reversal etc) times out.
Declaration
public int MinimumRetries { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Remarks
This property defaults to a value of 2. A value of zero or less is allowed, in which case only the initial attempt will be made - no retries will be performed within the library and any error handling logic will need to be entirely implemented by the application.
The library may attempt more retries than specified if the total time since the initial call is less than the (full, LatitudePay) recommended timeout for the endpoint being called.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
ProductName
Sets or returns the product name that will be used as part of the user agent string when calling the LatitudePay API.
Declaration
public string ProductName { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
If null, empty string or only whitespace the name of the Yort.LatitudePay.Instore assembly being used will be substituted as a default.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
ProductVendor
Sets or returns the name of the vendor that will be used as part of the user agent string when calling the LatitudePay API.
Declaration
public string ProductVendor { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
If null, empty string or only whitespace, "Yort" assembly being used will be substituted as a default.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
ProductVersion
Sets or returns the version number of the ProductName name that will be used as part of the user agent string when calling the LatitudePay API.
Declaration
public string ProductVersion { get; set; }
Property Value
| Type | Description |
|---|---|
| String |
Remarks
If null, empty string or only whitespace the version of the Yort.LatitudePay.Instore assembly being used will be substituted as a default.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
RetryDelaySeconds
Sets or returns the number of seconds to wait before attempting a retry.
Declaration
public int RetryDelaySeconds { get; set; }
Property Value
| Type | Description |
|---|---|
| Int32 |
Remarks
When a transactional call (CreateOrder/Refund etc) times out the system will perform a retry (based on the MinimumRetries setting). If that retry attempt returns a 409 conflict response indicating the first request is still in progres, then the system will wait this many seconds before the next retry. See https://docs.LatitudePay.com.au/instore-api-v1.html#distributed-state-considerations and https://docs.LatitudePay.com.au/instore-api-v1.html#create-order for more details.
The minimum value is 5 seconds. Any value less than 5 seconds will be ignored, and a 5 second delay will occur instead.
Exceptions
| Type | Condition |
|---|---|
| InvalidProgramException | Thrown if this property is modified after it has been passed to a |
SystemClock
Sets or returns an implementation of ILatitudePaySystemClock that will be used by the library to determine the current date and time.
Declaration
public static ILatitudePaySystemClock SystemClock { get; set; }
Property Value
| Type | Description |
|---|---|
| ILatitudePaySystemClock |
Remarks
If not clock is explicitly set, or if the property is set to null, then DefaultInstance will be used (and returned as the current value of the property).
This property can be used to provide a mocked clock for unit testing, or to provide a clock adjusted by a calculated offset via an NTP client etc. if the system clock cannot be relied upon for accuracy.
This is a static property and the value set here affects all clients/objects from the Yort.LatitudePay.InStore API unless otherwise specified.


001/* 002MIT License 003 004Copyright (c) 2020 FBSQL Team 005 006Permission is hereby granted, free of charge, to any person obtaining a copy 007of this software and associated documentation files (the "Software"), to deal 008in the Software without restriction, including without limitation the rights 009to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 010copies of the Software, and to permit persons to whom the Software is 011furnished to do so, subject to the following conditions: 012 013The above copyright notice and this permission notice shall be included in all 014copies or substantial portions of the Software. 015 016THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 017IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 018FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 019AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 020LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 021OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 022SOFTWARE. 023 024Home: https://fbsql.github.io 025E-Mail<EMAIL_ADDRESS>026*/ 027 028package org.fbsql.connection_pool; 029 030import java.sql.CallableStatement; 031import java.sql.Connection; 032import java.sql.PreparedStatement; 033import java.sql.SQLException; 034import java.sql.Statement; 035import java.util.HashMap; 036import java.util.Map; 037 038/** 039 * DbConnection contains JDBC Connection and associated with this connection prepared statements 040 */ 041public class DbConnection { 042 private Connection connection; 043 private Map<String, PreparedStatement> mapPreparedStatements = new HashMap<>(); 044 private Map<String, CallableStatement> mapCallableStatements = new HashMap<>(); 045 private Statement st; 046 047 /** 048 * Constructs DbConnection 049 * 050 * @param connection 051 */ 052 public DbConnection(Connection connection) { 053 this.connection = connection; 054 } 055 056 /** 057 * Get JDBC Connection 058 * 059 * @return Connection 060 */ 061 public Connection getConnection() { 062 return connection; 063 } 064 065 /** 066 * Get PreparedStatement 067 * If the PreparedStatement is not prepared before it will be prepared and stored in map 068 * 069 * @param sql - SQL statement 070 * @return PreparedStatement 071 * @throws SQLException 072 */ 073 public PreparedStatement getPreparedStatement(String sql) throws SQLException { 074 PreparedStatement ps = mapPreparedStatements.get(sql); 075 if (ps == null) { 076 ps = connection.prepareStatement(sql, PreparedStatement.RETURN_GENERATED_KEYS); 077 mapPreparedStatements.put(sql, ps); 078 } 079 ps.clearParameters(); 080 return ps; 081 } 082 083 /** 084 * Get CallableStatement 085 * If the CallableStatement is not prepared before it will be prepared and stored in map 086 * 087 * @param sql - SQL statement 088 * @return CallableStatement 089 * @throws SQLException 090 */ 091 public CallableStatement getCallableStatement(String sql) throws SQLException { 092 CallableStatement ps = mapCallableStatements.get(sql); 093 if (ps == null) { 094 ps = connection.prepareCall(sql); 095 mapCallableStatements.put(sql, ps); 096 } 097 ps.clearParameters(); 098 return ps; 099 } 100 101 /** 102 * Get Statement 103 * If the Statement is not created before it will be created and stored as class member 104 * 105 * @return Statement 106 * @throws SQLException 107 */ 108 public Statement getStatement() throws SQLException { 109 if (st == null) 110 st = connection.createStatement(); 111 return st; 112 } 113 114} 115 116/* 117Please contact FBSQL Team by E-Mail<EMAIL_ADDRESS>118or visit https://fbsql.github.io if you need additional 119information or have any questions. 120*/ 121 122/* EOF */


public class EnglishGrammaticalRelations
extends java.lang.Object
EnglishGrammaticalRelations
is a
set of GrammaticalRelation
objects for the English language.
These relations are commonly called Stanford Dependencies (SD).
Grammatical relations can either be shown in their basic form, where each
input token receives a relation, or "collapsed" which does certain normalizations
which group words or turns them into relations. See
EnglishGrammaticalStructure
. What is presented here mainly
shows the basic form, though there is some mixture. The "collapsed" grammatical
relations primarily differ as follows:
GrammaticalRelation
for details of fields and matching.
If using LexicalizedParser, it should be run with the
-retainTmpSubcategories
option and one of the
-splitTMP
options (e.g., -splitTMP 1
) in order to
get the temporal NP dependencies maximally right!
Implementation notes: Don't change the set of GRs without discussing it
with people first. If a change is needed, to add a new grammatical relation:
values
array at the end of the file.GrammaticalStructure
,
GrammaticalRelation
,
EnglishGrammaticalStructure
| Modifier and Type | Field and Description |
|---|---|
static GrammaticalRelation |
ADJECTIVAL_COMPLEMENT
The "adjectival complement" grammatical relation.
|
static GrammaticalRelation |
ADJECTIVAL_MODIFIER
The "adjectival modifier" grammatical relation.
|
static GrammaticalRelation |
ADV_CLAUSE_MODIFIER
The "adverbial clause modifier" grammatical relation.
|
static GrammaticalRelation |
ADVERBIAL_MODIFIER
The "adverbial modifier" grammatical relation.
|
static GrammaticalRelation |
AGENT
The "agent" grammatical relation.
|
static GrammaticalRelation |
APPOSITIONAL_MODIFIER
The "appositional modifier" grammatical relation.
|
static GrammaticalRelation |
ARGUMENT
The "argument" grammatical relation.
|
static GrammaticalRelation |
AUX_MODIFIER
The "auxiliary" grammatical relation.
|
static GrammaticalRelation |
AUX_PASSIVE_MODIFIER
The "passive auxiliary" grammatical relation.
|
static GrammaticalRelation |
CLAUSAL_COMPLEMENT
The "clausal complement" grammatical relation.
|
static GrammaticalRelation |
CLAUSAL_PASSIVE_SUBJECT
The "clausal passive subject" grammatical relation.
|
static GrammaticalRelation |
CLAUSAL_SUBJECT
The "clausal subject" grammatical relation.
|
static GrammaticalRelation |
COMPLEMENT
The "complement" grammatical relation.
|
static GrammaticalRelation |
CONJUNCT
The "conjunct" grammatical relation.
|
static GrammaticalRelation |
COORDINATION
The "coordination" grammatical relation.
|
static GrammaticalRelation |
COPULA
The "copula" grammatical relation.
|
static GrammaticalRelation |
DETERMINER
The "determiner" grammatical relation.
|
static GrammaticalRelation |
DIRECT_OBJECT
The "direct object" grammatical relation.
|
static GrammaticalRelation |
DISCOURSE_ELEMENT
The "discourse element" grammatical relation.
|
static GrammaticalRelation |
EXPLETIVE
The "expletive" grammatical relation.
|
static GrammaticalRelation |
GOES_WITH
The "goes with" grammatical relation.
|
static GrammaticalRelation |
INDIRECT_OBJECT
The "indirect object" grammatical relation.
|
static GrammaticalRelation |
MARKER
The "marker" grammatical relation.
|
static GrammaticalRelation |
MODIFIER
The "modifier" grammatical relation.
|
static GrammaticalRelation |
MULTI_WORD_EXPRESSION
The "multi-word expression" grammatical relation.
|
static GrammaticalRelation |
NEGATION_MODIFIER
The "negation modifier" grammatical relation.
|
static GrammaticalRelation |
NOMINAL_PASSIVE_SUBJECT
The "nominal passive subject" grammatical relation.
|
static GrammaticalRelation |
NOMINAL_SUBJECT
The "nominal subject" grammatical relation.
|
static GrammaticalRelation |
NOUN_COMPOUND_MODIFIER
The "noun compound modifier" grammatical relation.
|
static GrammaticalRelation |
NP_ADVERBIAL_MODIFIER
The "noun phrase as adverbial modifier" grammatical relation.
|
static GrammaticalRelation |
NUMBER_MODIFIER
The "compound number modifier" grammatical relation.
|
static GrammaticalRelation |
NUMERIC_MODIFIER
The "numeric modifier" grammatical relation.
|
static GrammaticalRelation |
OBJECT
The "object" grammatical relation.
|
static GrammaticalRelation |
PARATAXIS
The "parataxis" grammatical relation.
|
static GrammaticalRelation |
PHRASAL_VERB_PARTICLE
The "phrasal verb particle" grammatical relation.
|
static GrammaticalRelation |
POSSESSION_MODIFIER
The "possession" grammatical relation between the possessum and the possessor.
|
static GrammaticalRelation |
POSSESSIVE_MODIFIER
The "possessive" grammatical relation.
|
static GrammaticalRelation |
PRECONJUNCT
The "preconjunct" grammatical relation.
|
static GrammaticalRelation |
PREDETERMINER
The "predeterminer" grammatical relation.
|
static GrammaticalRelation |
PREDICATE
The "predicate" grammatical relation.
|
static GrammaticalRelation |
PREPOSITIONAL_COMPLEMENT
The "prepositional complement" grammatical relation.
|
static GrammaticalRelation |
PREPOSITIONAL_MODIFIER
The "prepositional modifier" grammatical relation.
|
static GrammaticalRelation |
PREPOSITIONAL_OBJECT
The "prepositional object" grammatical relation.
|
static GrammaticalRelation |
PUNCTUATION
The "punctuation" grammatical relation.
|
static GrammaticalRelation |
QUANTIFIER_MODIFIER
The "quantifier phrase modifier" grammatical relation.
|
static GrammaticalRelation |
REFERENT
The "referent" grammatical relation.
|
static GrammaticalRelation |
RELATIVE
The RELATIVE grammatical relation is only here as a temporary
relation.
|
static GrammaticalRelation |
RELATIVE_CLAUSE_MODIFIER
The "relative clause modifier" grammatical relation.
|
static GrammaticalRelation |
SEMANTIC_DEPENDENT
The "semantic dependent" grammatical relation has been
introduced as a supertype for the controlling subject relation.
|
static java.util.Map<java.lang.String,GrammaticalRelation> |
shortNameToGRel |
static GrammaticalRelation |
SUBJECT
The "subject" grammatical relation.
|
static GrammaticalRelation |
TEMPORAL_MODIFIER
The "temporal modifier" grammatical relation.
|
static java.util.concurrent.locks.ReadWriteLock |
valuesLock
If you need exclusive access to these values lists, then you should
take out a valuesLock.
|
static GrammaticalRelation |
VERBAL_MODIFIER
The "verb modifier" grammatical relation.
|
static GrammaticalRelation |
XCLAUSAL_COMPLEMENT
An open clausal complement (xcomp) of a VP or an ADJP is a clausal
complement without its own subject, whose reference is determined by an
external subject.
|
| Modifier and Type | Method and Description |
|---|---|
static GrammaticalRelation |
getConj(java.lang.String conjunctionString)
The "conj" grammatical relation.
|
static java.util.Collection<GrammaticalRelation> |
getConjs() |
static GrammaticalRelation |
getPrep(java.lang.String prepositionString)
The "prep" grammatical relation.
|
static GrammaticalRelation |
getPrepC(java.lang.String prepositionString)
The "prepc" grammatical relation.
|
static java.util.Collection<GrammaticalRelation> |
getPreps() |
static java.util.Collection<GrammaticalRelation> |
getPrepsC() |
static void |
main(java.lang.String[] args)
Prints out the English grammatical relations hierarchy.
|
static GrammaticalRelation |
valueOf(java.lang.Object o)
Returns an EnglishGrammaticalRelation based on the argument.
|
static GrammaticalRelation |
valueOf(java.lang.String s)
Returns the EnglishGrammaticalRelation having the given string
representation (e.g.
|
static java.util.List<GrammaticalRelation> |
values()
Return a synchronized list of the known GrammaticalRelation entries.
|
static java.util.concurrent.locks.Lock |
valuesLock()
Returns a readLock for the grammatical relations values list.
|
public static final GrammaticalRelation PREDICATE
Example:
pred
(Reagan, died)public static final GrammaticalRelation AUX_MODIFIER
Example:
aux
(died, has)public static final GrammaticalRelation AUX_PASSIVE_MODIFIER
auxpass
(killed, been)public static final GrammaticalRelation COPULA
Examples:
cop
(big, is) cop
(man, is)public static final GrammaticalRelation CONJUNCT
Example:
conj
(big, honest)
Note:Modified in 2010 to exclude the case of a CC/CONJP first in its phrase: it has to conjoin things.public static final GrammaticalRelation COORDINATION
cc
(big, and)public static final GrammaticalRelation PUNCTUATION
punct
(Go, !)
The condition for NFP to appear hear is that it does not match the emoticon patterns under discourse.public static final GrammaticalRelation ARGUMENT
Example:
arg
(defeated, Clinton), arg
(defeated, Dole)public static final GrammaticalRelation SUBJECT
Examples:
subj
(defeated, Clinton) subj
(is, What she said)public static final GrammaticalRelation NOMINAL_SUBJECT
Example:
nsubj
(defeated, Clinton)public static final GrammaticalRelation NOMINAL_PASSIVE_SUBJECT
Example:
nsubjpass
(defeated, Dole)
This pattern recognizes basic (non-coordinated) examples. The coordinated examples are currently handled by correctDependencies() in EnglishGrammaticalStructure. This seemed more accurate than any tregex expression we could come up with.
public static final GrammaticalRelation CLAUSAL_SUBJECT
Examples: (subject is "what she said" in both examples)
csubj
(makes, said) csubj
(untrue, said)public static final GrammaticalRelation CLAUSAL_PASSIVE_SUBJECT
Example: (subject is "that she lied")
csubjpass
(suspected, lied)public static final GrammaticalRelation COMPLEMENT
Examples:
comp
(gave, me),
comp
(gave, a raise) comp
(like, to swim)public static final GrammaticalRelation OBJECT
Examples:
obj
(gave, me),
obj
(gave, raise)public static final GrammaticalRelation DIRECT_OBJECT
Example:
dobj
(gave, raise)
Note that dobj can also be assigned by the conversion of rel in the postprocessing.public static final GrammaticalRelation INDIRECT_OBJECT
iobj
(gave, me)public static final GrammaticalRelation PREPOSITIONAL_OBJECT
pobj
(on, chair)
(The preposition can be called a FW for pace, versus, etc. It can also
be called a CC - but we don't currently handle that and would need to
distinguish from conjoined PPs. Jan 2010 update: We now insist that the
NP must follow the preposition. This prevents a preceding NP measure
phrase being matched as a pobj. We do allow a preposition tagged RB
followed by an NP pobj, as happens in the Penn Treebank for adverbial uses
of PP like "up 19%")public static final GrammaticalRelation PREPOSITIONAL_COMPLEMENT
pcomp
(on, are) pcomp
(about, missing) pcomp
(than, in)public static final GrammaticalRelation CLAUSAL_COMPLEMENT
Example:
ccomp
(says, like) ccomp
(certain, did) ccomp
(fact, honest)public static final GrammaticalRelation XCLAUSAL_COMPLEMENT
xcomp
(like, swim) xcomp
(ready, leave)public static final GrammaticalRelation RELATIVE
public static final GrammaticalRelation REFERENT
ref
(book, which) ref
(book, which)public static final GrammaticalRelation EXPLETIVE
expl
(is, there)public static final GrammaticalRelation ADJECTIVAL_COMPLEMENT
Example:
acomp
(looks, beautiful)public static final GrammaticalRelation MODIFIER
ARGUMENT
of that
VP); a modifier of a clause is an modifier of the VP which is
the predicate of that clause.Examples:
mod
(swam, in the pool),
mod
(swam, last night)public static final GrammaticalRelation ADV_CLAUSE_MODIFIER
advcl
(happened, falling) advcl
(tell, know)public static final GrammaticalRelation RELATIVE_CLAUSE_MODIFIER
rcmod
(man, love) rcmod
(book, bought)public static final GrammaticalRelation MARKER
mark
(launched, after)public static final GrammaticalRelation ADJECTIVAL_MODIFIER
Example:
amod
(meat, red)
The relation amod is also used for multiword country adjectives, despite their
questionable treebank representation.
Example: amod
(German, West),
amod
(economy, German)public static final GrammaticalRelation NUMERIC_MODIFIER
Example:
num
(sheep, 3)public static final GrammaticalRelation NUMBER_MODIFIER
number
($, billion)public static final GrammaticalRelation QUANTIFIER_MODIFIER
quantmod
(200, About)public static final GrammaticalRelation NOUN_COMPOUND_MODIFIER
nn
(futures, oil),
nn
(futures, price) public static final GrammaticalRelation APPOSITIONAL_MODIFIER
appos
(Sam, brother) appos
(Bill, cousin).
"The Australian Broadcasting Corporation (ABC)" →
appos
(Corporation, ABC)public static final GrammaticalRelation DISCOURSE_ELEMENT
public static final GrammaticalRelation VERBAL_MODIFIER
vmod
(truffles, picked) vmod
(picked, demonstrating) vmod
(points, establish) vmod
(who, judge) public static final GrammaticalRelation ADVERBIAL_MODIFIER
Examples:
advmod
(modified, genetically) advmod
(often, less)public static final GrammaticalRelation NEGATION_MODIFIER
neg
(scientist, not) neg
(drive, n't)public static final GrammaticalRelation NP_ADVERBIAL_MODIFIER
npadvmod
(old, years)
npadvmod
(eased, fraction)
npadvmod
($, share)
npadvmod
(significant, itself)
npadvmod
(like, most)
public static final GrammaticalRelation TEMPORAL_MODIFIER
Example:
tmod
(swam, night)public static final GrammaticalRelation MULTI_WORD_EXPRESSION
mwe
(well, as)mwe
(well, as)
"fewer than 700 bottles" →
mwe
(than, fewer)public static final GrammaticalRelation DETERMINER
Examples:
det
(man,the) det
(man,which) public static final GrammaticalRelation PREDETERMINER
Example:
predet
(boys,all)public static final GrammaticalRelation PRECONJUNCT
preconj
(boys,both)public static final GrammaticalRelation POSSESSION_MODIFIER
Examples:
poss
(offices, their)poss
(clothes, Bill)public static final GrammaticalRelation POSSESSIVE_MODIFIER
Example:
possessive
(John, 's)public static final GrammaticalRelation PREPOSITIONAL_MODIFIER
Examples:
prep
(cat, in) prep
(saw, with) prep
(responsible, for)public static final GrammaticalRelation PHRASAL_VERB_PARTICLE
Example:
prt
(shut, down)public static final GrammaticalRelation PARATAXIS
Examples:
parataxis
(left,said) public static final GrammaticalRelation GOES_WITH
Example:
goeswith
(out, with)public static final GrammaticalRelation SEMANTIC_DEPENDENT
public static final GrammaticalRelation AGENT
Example:
agent
(killed, police)public static final java.util.concurrent.locks.ReadWriteLock valuesLock
public static final java.util.Map<java.lang.String,GrammaticalRelation> shortNameToGRel
public static java.util.List<GrammaticalRelation> values()
public static java.util.concurrent.locks.Lock valuesLock()
public static java.util.Collection<GrammaticalRelation> getConjs()
public static GrammaticalRelation getConj(java.lang.String conjunctionString)
conjunctionString
- The conjunction to make a GrammaticalRelation out ofpublic static java.util.Collection<GrammaticalRelation> getPreps()
public static java.util.Collection<GrammaticalRelation> getPrepsC()
public static GrammaticalRelation getPrep(java.lang.String prepositionString)
They will be turned into prep_word, where "word" is a preposition
prepositionString
- The preposition to make a GrammaticalRelation out ofpublic static GrammaticalRelation getPrepC(java.lang.String prepositionString)
They will be turned into prep_word, where "word" is a preposition
prepositionString
- The preposition to make a GrammaticalRelation out ofpublic static GrammaticalRelation valueOf(java.lang.String s)
s
- The short name of the GrammaticalRelationpublic static GrammaticalRelation valueOf(java.lang.Object o)
null
for other classes or if no string match is found.o
- A GrammaticalRelation or Stringpublic static void main(java.lang.String[] args)
EnglishGrammaticalStructure
for a main method that
will print the grammatical relations of a sentence or tree.args
- Args are ignored.


Disclaimer: The probability is predicted based upon the best of our understanding of the available information from the data set mentioned in the report. We understand that there are latent variables that affect the chances of your success and therefore we advise your discretion in taking the seriousness of the probability generated by our calculator. Any action you take upon the information provided by this website is strictly at your own risk. We will not be liable for any losses in connection with the use of our website.


The Poll tool allows users to set up an online vote.
Vote: Users can vote for one or more of any number of answer
options. The structure of the vote is governed by a maximum and minimum number
of options that may be selected.
Results: You can choose when results are available to voters:
immediately, after voting, after the closing date, or never.
- Always allows participants to see the results from the open date, even if they haven’t voted.
- Never restricts participants from seeing the results
- To participants who have voted allows participants to see the results from the open date, but only after they have voted
- After closing date restricts access to the results until the closing date, after which all participants (regardless of whether they have voted or not) will be able to view them.
To edit a poll, click Edit. Adjust the settings in the form. Links will be provided to add, edit and delete answer options. Click Save to finish.
To delete a poll, tick the relevant box in the Remove column and then click Update.
To view results click the Results link alongside the relevant poll. The number of votes for each answer option, the percentages associated with these figures, and the total number of votes will be displayed.
To control who may or may not vote, as well as who may create, edit and delete polls, click on Permissions in the options bar. Once you have adjusted the permissions by ticking the relevant boxes, click Save.


Ramp^Rate is committed to promoting Green data center operational practices that promote energy efficiency and A Commitment to the Green Data Centeradhere to sustainability guidelines of our customers.
RampRate’s SPY Index™ tracks key “green” criteria of IT services providers and Green data centers, and correlates those criteria to CapEx, OpEx, and other TCO considerations for our clients.
Some of the Green data center areas we track in the SPY Index include:
RampRate identifies the power generation mix and utility sources for Green data center vendors (hydro, nuclear, geo-thermal, wind, solar, coal, etc). RampRate helps clients analyze the cost impact of power generation to their monthly bill. At the client’s request, we can also prioritize Green standards for data center power generation during the vendor evaluation and selection process.
RampRate’s vendor ratings include Leadership in Energy and Environmental Design (LEED) Green Building Ratings on a per-facility basis, as well as the cost impact of pertinent energy-efficient designs for cooling, lighting, materials, and other building components.
RampRate tracks the effective use of power within the individual Green data center facilities, as defined by the Green Grid Consortium.
For areas where legislation has instituted a hard cost on carbon usage (through direct taxation or through cap & trade programs), RampRate identifies the potential cost of overall carbon emissions for the vendor’s facility, and estimates the cost of carbon impact for its customers within the facility.
RampRate has worked with many of its clients on their sustainability strategies as related to Green data centers. Read on to learn how RampRate can help you.
We help clients optimize their geographic location against their computing requirements, identifying and evaluating regions with a high percentage of grid power derived from renewable sources.
We advise clients on server, cooling, or other design approaches to achieve more efficient hardware architectures, including high density computing, virtualization, water-cooled blade servers, and DC power.
We help clients to structure relationships with qualifying Green data center vendors that access the savings available from renewable energy sources for their power supply
We help clients meet their corporate sustainability commitments, particularly related to Green data center and computing requirements.
Many European and Asia-Pacific countries have already passed critical legislation regulating carbon emissions from data centers. New requirements are on the table in almost all countries around the world. The United Kingdom, for example, has legislation that will impact data center customers significantly starting in 2010, completely changing the cost of sourcing co-location and outsourcing computing. The United States has several bills in Congress, awaiting action, any one of which could increase the cost of in-house and third-party data center services.
Ramp^Rate tracks the state of regulatory requirements on a per-country basis, to help our clients understand the potential impact of current and upcoming legislation on new and existing data center services.
Contact Ramp^Rate today to learn how our SPY Index Green Data Center metrics and industry knowledge base can help you cut operational costs, increase your PUE, fulfill your corporate sustainability commitments, and reach your green data center goals. If you have general exploratory questions or would like a consultation with one of our Green data center experts, please contact us at<EMAIL_ADDRESS>or call 1−310−802−3702


WiFi
SITCore line of products includes native support for the Microchip ATWINC1500 series of WiFi modules. These modules are available pre-certified from FCC, CE, and other regulatory agencies. For added security, WiFi module communication is handled through SPI, not through AT commands.
Important
To take security to the next level, all network cryptography and security are done internally inside SITCore and not inside the WiFi module, meaning the data going over SPI is all encrypted and secure.
Supported Modules
ATWINC1500 & 1510 both work identically with SITCore, except the 1510 has more memory that SITCore doesn't need. The part number with the correct firmware that has been tested with TinyCLR is ATWINC1500-MR210PB. A module with a different firmware version can still be used, but a firmware update becomes necessary. Using the exact version eliminates the need for this step.
Sample Code
The sample code is meant for the FEZ Portal with it's built in WiFi module. If you want to use a bare ATWINC1500 module instead, you'll need to connect interrupt, reset, and chip select lines in addition to the SPI lines (MOSI, MISO, SCK).
Important
If using WiFi 7 click module, there is an enable pin which needs to be pulled high.
Tip
Needed NuGets: GHIElectronics.TinyCLR.Core, GHIElectronics.TinyCLR.Devices.Gpio, GHIElectronics.TinyCLR.Devices.Network, GHIElectronics.TinyCLR.Devices.Spi, GHIElectronics.TinyCLR.Devices.Uart, GHIElectronics.TinyCLR.Native, GHIElectronics.TinyCLR.Networking, and GHIElectronics.TinyCLR.Pins.
using GHIElectronics.TinyCLR.Devices.Gpio;
using GHIElectronics.TinyCLR.Devices.Network;
using GHIElectronics.TinyCLR.Devices.Spi;
using GHIElectronics.TinyCLR.Pins;
using System;
using System.Diagnostics;
using System.Net;
using System.Threading;
static void Wifi_Example() {
var enablePin = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PA8);
enablePin.SetDriveMode(GpioPinDriveMode.Output);
enablePin.Write(GpioPinValue.High);
SpiNetworkCommunicationInterfaceSettings netInterfaceSettings =
new SpiNetworkCommunicationInterfaceSettings();
var cs = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PA6);
var settings = new SpiConnectionSettings() {
ChipSelectLine = cs,
ClockFrequency = 4000000,
Mode = SpiMode.Mode0,
ChipSelectType = SpiChipSelectType.Gpio,
ChipSelectHoldTime = TimeSpan.FromTicks(10),
ChipSelectSetupTime = TimeSpan.FromTicks(10)
};
netInterfaceSettings.SpiApiName = SC20260.SpiBus.Spi3;
netInterfaceSettings.GpioApiName = SC20260.GpioPin.Id;
netInterfaceSettings.SpiSettings = settings;
netInterfaceSettings.InterruptPin = GpioController.GetDefault().
OpenPin(SC20260.GpioPin.PF10);
netInterfaceSettings.InterruptEdge = GpioPinEdge.FallingEdge;
netInterfaceSettings.InterruptDriveMode = GpioPinDriveMode.InputPullUp;
netInterfaceSettings.ResetPin = GpioController.GetDefault().OpenPin(SC20260.GpioPin.PC3);
netInterfaceSettings.ResetActiveState = GpioPinValue.Low;
var networkController = NetworkController.FromName
(SC20260.NetworkController.ATWinc15x0);
WiFiNetworkInterfaceSettings wifiSettings = new WiFiNetworkInterfaceSettings() {
Ssid = "Your SSID",
Password = "Your Password",
};
wifiSettings.Address = new IPAddress(new byte[] { 192, 168, 1, 122 });
wifiSettings.SubnetMask = new IPAddress(new byte[] { 255, 255, 255, 0 });
wifiSettings.GatewayAddress = new IPAddress(new byte[] { 192, 168, 1, 1 });
wifiSettings.DnsAddresses = new IPAddress[] { new IPAddress(new byte[]
{ 75, 75, 75, 75 }), new IPAddress(new byte[] { 75, 75, 75, 76 }) };
wifiSettings.MacAddress = new byte[] { 0x00, 0x4, 0x00, 0x00, 0x00, 0x00 };
wifiSettings.DhcpEnable = true;
wifiSettings.DynamicDnsEnable = true;
networkController.SetInterfaceSettings(wifiSettings);
networkController.SetCommunicationInterfaceSettings(netInterfaceSettings);
networkController.SetAsDefaultController();
networkController.NetworkAddressChanged += NetworkController_NetworkAddressChanged;
networkController.NetworkLinkConnectedChanged +=
NetworkController_NetworkLinkConnectedChanged;
networkController.Enable();
// Network is ready to use
Thread.Sleep(Timeout.Infinite);
}
private static void NetworkController_NetworkLinkConnectedChanged
(NetworkController sender, NetworkLinkConnectedChangedEventArgs e) {
// Raise event connect/disconnect
}
private static void NetworkController_NetworkAddressChanged
(NetworkController sender, NetworkAddressChangedEventArgs e) {
var ipProperties = sender.GetIPProperties();
var address = ipProperties.Address.GetAddressBytes();
Debug.WriteLine("IP: " + address[0] + "." + address[1] + "." + address[2] +
"." + address[3]);
}
WINC1500 Utilities
The Winc15x0Interface class provides to access some of the native functions of the WINC1500 WiFi module. Such as getting the WiFi module's MAC address, getting RSSI (Relative Signal Strength Indicator), scanning for access points, checking the firmware version, and over-the-air (OTA) firmware update.
Unless provided, the MAC address of the WiFi module will be automatically used by default.
Tip
Needed NuGets: GHIElectronics.TinyCLR.Drivers.Microchip.Winc15x0
//Scan for WiFi access points:
string[] ssidList = Winc15x0Interface.Scan();
//Get Relative Signal Strength Indicator for the connected access point:
int signalStrength = Winc15x0Interface.GetRssi();
//Get the WiFi module's MAC address:
byte[] macAddress = Winc15x0Interface.GetMacAddress();
//Get the version of the installed WiFi firmware:
string fwVersion = Winc15x0Interface.GetFirmwareVersion();
//Print a list of WiFi firmware versions that have been tested with TinyCLR OS.
// Note: Untested WiFi firmware versions may also work.
for (int i = 0; i < Winc15x0Interface.FirmwareSupports.Length; i++) {
System.Diagnostics.Debug.WriteLine("Supported firmware version #" +
(i + 1).ToString() + ": " + Winc15x0Interface.FirmwareSupports[i].ToString());
}
//Download and install firmware from an OTA download (web) server:
// Must upload firmware file to root folder in server
// (e.g. http://<IP_ADDRESS>/m2m_ota_3a0.bin).
bool otaUpdate = Winc15x0Interface.FirmwareUpdate("http://<IP_ADDRESS>/m2m_ota_3a0.bin", TimeSpan.FromMilliseconds(5000));
Multicast IP
Multicast works as expected on all other network interfaces; however, in order to achieve this on WiFi, we need to convert a Multicast IP to a multicast MAC Address. Any online tool like this can be used.
This capture shows Multicast IP address <IP_ADDRESS> for example.
This Multicast MAC address is then used as below.
Winc15x0Interface.AddMulticastMacAddress(new byte[] { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xfe });
If more than one Multicast MAC address is needed, just call AddMulticastMacAddress multiple time.
There is also an API allows remove multicast mac address from the list as well.
Winc15x0Interface.RemoveMulticastMacAddress(new byte[] { 0x01, 0x00, 0x5e, 0x7f, 0xff, 0xfe });
Tip
Needed NuGets: GHIElectronics.TinyCLR.Drivers.Microchip.Winc15x0
AccessPoint
SITCore devices can be set up as a WiFi AccessPoint
. This creates a 1-to-1 connection between SITCore and other hardware devices through WiFi without the need to connect to a switch. An example might be, connecting a phone directly to the SITCore hardware. This may be necessary in some situations where access to a network isn't possible and a user needs to connect to the device directly.
Tip
AccessPoint only supports connecting to one device at a time.
Setting up a device as an access point works just like the default Station
mode except the Ssid
and now the one the device is broadcasting.
var networkInterfaceSetting = new WiFiNetworkInterfaceSettings() {
Ssid = "Your SSID",
Password = "Your Password",
Mode = WiFiMode.AccessPoint,
};
Tip
Only WEP password security is supported. Do not set the Password
for an open network.
AccessPoint
can provide an IP address to the connected device when networkInterfaceSetting.DhcpEnabled = true;
through a simple internal DHCP server. If desired, an event is triggered on completion.
WiFiNetworkInterfaceSettings wifiSettings = new WiFiNetworkInterfaceSettings() {
Ssid = "Your SSID",
Password = "Your Password",
};
//...
WiFiNetworkInterfaceSettings wifiSettings.AccessPointClientConnectionChanged += (a, b, c) => {
Debug.WriteLine("Provided IP = " + b.ToString());
Debug.WriteLine("Connected device's MAC Address = " + c);
};
The usual connection event is fired just like in Station
mode, except in this case it is fired when an external device is connected NetworkController.NetworkLinkConnectedChanged
.


Jimmy Young
Software Developer Graduate
Home
Blog
Android tips
Write.as
Android tip
19/12/20
This first tup is to off any
synchronization to any google
application you don't use.
read more


The demo and customization page is under development.
Documentation will be available here docs.warengonzaga.com/fork-corner


class: center, middle, main-title # Basics for coding optimization problems This document will give the reader an introduction to numerical optimization and the various trade-offs associated with the most common optimization algorithms. We will also cover how to code and evaluate an optimization problem in R. At the end, we will discuss what the cost function looks like for the most well-known statistical models and ML algorithms --- ## Basics of functional optimization - All statistical estimators are either minima of some error (aka "cost") function or maxima of some likelihood function - Examples: - linear regression (OLS) - logistic regression - naive Bayes classification - Multi-Layer Perceptron (MLP) aka artifical neural networks (ANN) - support vector machine (SVM) - ... - many others - Some estimators (e.g. OLS, Generalized Method of Moments) have **closed form** solutions for the extremum value - we covered this in our previous lecture - Other estimators (e.g. MLE, some non-linear least squares) require **numerical methods** to find the extremum value - we also showed this in the previous lecture (the case of logistic regression) - There are a number of different algorithms to numerically find extrema ("guess-and-check") - You can use these in R, Python, Julia, Matlab, ... --- ## Graph of the optimization problem
This is a graph of a likelihood function. The parameters are on the `x` and `y` axes and the likelihood is on the `z` axis. --- ## How numerical optimization works - User provides an **objective function** and a **starting value** - The optimizer then calculates the magnitude and direction of the *gradient vector* at the starting value - Given these values of the gradient vector, it decides - in which direction to move to get closer to the optimum - how far it should move to get closer to the optimum - Given the magnitude and direction of the gradient vector at the new point, it repeats these steps until convergence is achieved --- ## How to determine convergence? (How do we know when we've arrived?) There are generally three ways to determine if a numerical optimization algorithm has reached the optimum 1. The gradient vector (or Jacobian matrix) is numerically close to 0 - Intuition: we may be at an extremum if the derivative is 0 1. The location of the previous guess is numerically close to the location of the updated guess - Intuition: The optimizer didn't move very far in updating the guess, so we're probably close to the answer 1. The value of the objective function at the previous guess is numerically close to the value of the objective function at the updated guess - Intuition: The objective function is flat in the area of the previous and updated guesses, which is kind of like having a gradient of zero Note that "numerically close" generally refers to being within 10^-6 --- ## Local or global minimum? - Note that in the previous slide, no mention of second-order conditions was ever made - Hence, it is unclear if the answer our optimizer gave is a local optimum, a saddle point, or a global optimum - Luckily, most common statistical estimators have been proven to have **globally concave** objective functions - If you are unsure whether or not your objective function is globally concave, you can try different sets of starting values and see how much the answers differ *Note:* "globally concave" simply means that the function has only one "hump" or only one "dip" which means we will eventually get to the only extremum. --- ## Most commonly used optimization algorithms - Gradient descent - Stochastic gradient descent - BFGS/L-BFGS - Nelder-Mead (gradient-free simplex methods) - Gauss-Newton --- ## When should I use which algorithm? - It turns out that optimization can often be more of an "art" than a "science" - Often times your choice of objective function will dictate which optimization algorithm you should choose - We'll talk more about these considerations a bit later today --- ## How to use these in R? R has several packages for calling these commonly used optimizers, as well as many others. In a future problem set, you will get experience with the packages `optimr` and `nloptr`. Sadly, R is not the best language to be using if you need to optimize your own functions. I recommend Python or (especially) Julia! --- ## Gradient descent What is gradient descent? - Pretend you are on a mountain and there's a valley below that you're trying to get to - There's a fog over the whole mountain, such that you can't see down the mountain - You want to get down the mountain as quickly as possible - You have a special compass that will tell you the steepness of the hill in every direction - It's costly to look at the compass - You need to decide how often to look at the compass (i.e. how far to walk before checking the compass and potentially changing direction) The best way down the mountain is to follow the path of steepest descent while taking the minimum number of stops to look at the compass --- ## The math behind Gradient descent - Start with some initial value (call it x0) and some step size (call it γ) - The new guess of the solution is equal to x_n = x0 - γ∇f(x0) where ∇f(x0) is the gradient vector of our objective function f(·) Repeat this process until convergence (i.e. until ∇f(x0) is arbitrarily close to 0, until x doesn't change across iterations, or until f(x) doesn't change across iterations --- ## Famous quote "Victory will never be found by taking the line of least resistance." -- Winston Churchill - But in actuality, with gradient descent, victory *is* found by taking the line of (steepest descent)! --- ## Gradient descent in R Suppose we want to find the minimum of `f(x) = x^4 - 3*x^3 + 2` ```r # set up a stepsize alpha <- 0.003 # set up a number of iteration iter <- 500 # define the gradient of f(x) = x^4 - 3*x^3 + 2 gradient <- function(x) return((4*x^3) - (9*x^2)) # randomly initialize a value to x set.seed(100) x <- floor(runif(1)*10) # create a vector to contain all xs for all steps x.All <- vector("numeric",iter) # gradient descent method to find the minimum for(i in 1:iter){ x <- x - alpha*gradient(x) x.All[i] <- x print(x) } # print result and plot all xs for every iteration print(paste("The minimum of f(x) is ", x, sep = "")) ``` --- ## How to write a function in R How do you write a function in R? The function has four distinct elements: 1. Name 1. Arguments (aka inputs) 1. Statements (i.e. code) 1. Outputs ```r myfunction <- function(arg1, arg2, ... ){ statements return(object) } ``` Note the braces! --- ## Calling a function Once you have your function written, you call it as follows: ```r output <- myfunction(arg1, arg2, ...) ``` where `output` can be any name you'd like, and `arg1` etc. are the specific arguments you're interested in --- ## Example of a simple function ```r customMean <- function(x){ mean <- sum(x)/length(x) return(mean) } # Now let's call the function sample.average <- customMean(iris$Sepal.Width) print(sample.average) # Check that it's correct mean(iris$Sepal.Width) ``` --- ## Function scope - It doesn't matter what you name your variables when you call the function - i.e. when we called `customMean()` above, we sent it `iris$Sepal.Width` even though we called the input `x` in the function definition - This is all to say that when a function is *evaluated*, its new workspace is whatever is sent to the function - This is important to keep in mind when trying to optimize your own objective function
--- ## Using nloptr Now that we know how to write a function, let's optimize the same function we did before (using gradient descent) but instead now let's use one of the optimizers in the `nloptr` package. To use the package we need to provide the following information: - Objective function - Gradient vector of the objective function - Algorithm - Initial value - Tolerance parameter --- ## Code ```r library(nloptr) ## Our objective function eval_f <- function(x) { return( x[1]^4 - 3*x[1]^3 + 2 ) } ## Gradient of our objective function eval_grad_f <- function(x) { return( 4*x[1]^3 - 9*x[1]^2 ) } ## initial values x0 <- -5 ## Algorithm parameters opts <- list("algorithm"="NLOPT_LD_LBFGS","xtol_rel"=1.0e-8) ## Find the optimum! res <- nloptr( x0=x0,eval_f=eval_f,eval_grad_f=eval_grad_f,opts=opts) print(res) ``` --- ## Comparison with previous result As you can see, we got the same result using this method as we did with our simple gradient descent. --- ## What if my function isn't differentiable? By now you might be wondering how we can find the optimum of a function that is not differentiable. The answer is to use what's called a "simplex method." A simplex is a multi-dimensional triangle. Rather than find the "steepest" path, the triangle moves around to find lower spots of the objective function. The triangle can do one of many operations: - reflect - expand - contract - shrink The alogrithm uses the ordering of the points of the mutli-dimensional triangle to figure out which operation it should next use in order to find the minimum. --- ## Nelder-Mead code ```r library(nloptr) ## Our objective function objfun <- function(x) { return( x[1]^4 - 3*x[1]^3 + 2 ) } ## initial values xstart <- 5 ## Algorithm parameters options <- list("algorithm"="NLOPT_LN_NELDERMEAD","xtol_rel"=1.0e-8) ## Find the optimum! res <- nloptr( x0=xstart,eval_f=objfun,opts=options) print(res) ``` --- ## Computing OLS and MLE estimates using the nloptr package Now let's see how we can actually optimize a statistical model using the `nloptr` package in R. OLS objective function: ```r library(nloptr) ## Our objective function objfun <- function(beta,y,X) { return (sum((y-X%*%beta)^2)) # equivalently, if we want to use matrix algebra: # return ( crossprod(y-X%*%beta) ) } ## Gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*t(X)%*%(y-X%*%beta)) ) } ## read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) ## initial values beta0 <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients ## Algorithm parameters options <- list("algorithm"="NLOPT_LD_LBFGS","xtol_rel"=1.0e-6,"maxeval"=1e3) ## Optimize! result <- nloptr( x0=beta0,eval_f=objfun,eval_grad_f=gradient,opts=options,y=y,X=X) print(result) ## Check solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` --- ## MLE estimation using the nloptr package Now let's estimate the same model, but this time using the MLE formulation of the linear regression model: MLE objective function: ```r library(nloptr) ## Our objective function objfun <- function(theta,y,X) { # need to slice our parameter vector into beta and sigma components beta <- theta[1:(length(theta)-1)] sig <- theta[length(theta)] # write objective function as *negative* log likelihood (since NLOPT minimizes) loglike <- -sum( -.5*(log(2*pi*(sig^2)) + ((y-X%*%beta)/sig)^2) ) return (loglike) } ## read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) ## initial values theta0 <- runif(dim(X)[2]+1) #start at uniform random numbers equal to number of coefficients theta0 <- append(as.vector(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))$coefficients[,1]),runif(1)) ## Algorithm parameters options <- list("algorithm"="NLOPT_LN_NELDERMEAD","xtol_rel"=1.0e-6,"maxeval"=1e4) ## Optimize! result <- nloptr( x0=theta0,eval_f=objfun,opts=options,y=y,X=X) print(result) betahat <- result$solution[1:(length(result$solution)-1)] sigmahat <- result$solution[length(result$solution)] ## Check solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` --- ## Stochastic gradient descent **Stochastic gradient descent (SGD)** is the most popular way to optimize a neural network. (What does "stochastic" mean, anyway, and why is it called stochastic gradient descent?) Recall regular gradient descent (often called *batch gradient descent*): - Start with some initial value (call it x0) and some step size (call it γ) - The new guess of the solution is equal to x_n = x0 - γ∇f(x0) where ∇f(x0) is the gradient vector of our objective function f(·) Repeat this process until convergence (i.e. until ∇f(x0) is arbitrarily close to 0, until x doesn't change across iterations, or until f(x) doesn't change across iterations --- ## Stochastic gradient descent (continued) With SGD, we instead update the gradient for *each observation*. - each iteration now has N updates within it - we re-shuffle the data between each iteration --- ## Let's see how it works, using OLS as our objective function. Batch gradient descent first: ```r # set up a stepsize alpha <- 0.00003 # set up a number of iterations maxiter <- 500000 ## Our objective function objfun <- function(beta,y,X) { return ( sum((y-X%*%beta)^2) ) } # define the gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*t(X)%*%(y-X%*%beta)) ) } ## read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) ## initial values beta <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients # randomly initialize a value to beta set.seed(100) # create a vector to contain all beta's for all steps beta.All <- matrix("numeric",length(beta),maxiter) # gradient descent method to find the minimum iter <- 1 beta0 <- 0*beta while (norm(as.matrix(beta0)-as.matrix(beta))>1e-8) { beta0 <- beta beta <- beta0 - alpha*gradient(beta0,y,X) beta.All[,iter] <- beta if (iter%%10000==0) { print(beta) } iter <- iter+1 } # print result and plot all xs for every iteration print(iter) print(paste("The minimum of f(beta,y,X) is ", beta, sep = "")) ## Closed-form solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` Now SGD: ```r # set up a stepsize alpha <- 0.0003 ## Our objective function objfun <- function(beta,y,X) { return ( sum((y-X%*%beta)^2) ) } # define the gradient of our objective function gradient <- function(beta,y,X) { return ( as.vector(-2*X%*%(y-t(X)%*%beta)) ) } ## read in the data y <- iris$Sepal.Length X <- model.matrix(~Sepal.Width+Petal.Length+Petal.Width+Species,iris) ## initial values beta <- runif(dim(X)[2]) #start at uniform random numbers equal to number of coefficients # randomly initialize a value to beta set.seed(100) # create a vector to contain all beta's for all steps beta.All <- matrix("numeric",length(beta),iter) # stochastic gradient descent method to find the minimum iter <- 1 beta0 <- 0*beta while (norm(as.matrix(beta0)-as.matrix(beta))>1e-12) { # Randomly re-order the data random <- sample(nrow(X)) X <- X[random,] y <- y[random] # Update parameters for each row of data for(i in 1:dim(X)[1]){ beta0 <- beta beta <- beta0 - alpha*gradient(beta0,y[i],as.matrix(X[i,])) beta.All[,i] <- beta } alpha <- alpha/1.0005 if (iter%%1000==0) { print(beta) } iter <- iter+1 } # print result and plot all xs for every iteration print(iter) print(paste("The minimum of f(beta,y,X) is ", beta, sep = "")) ## Closed-form solution print(summary(lm(Sepal.Length~Sepal.Width+Petal.Length+Petal.Width+Species,data=iris))) ``` --- ## Why is SGD useful? Pros: - much faster (if properly tuned) - can be parallelized fairly easily - can be used for streaming data - randomness in data across observations can help it find global optima - Gauss-Newton, L-BFGS can't be used for Big Data sets Cons: - convergence is more complicated - slower in R (since loops are awful) - must slowly decrease `alpha` (the learning rate) to achieve convergence --- ## Mini-batch gradient descent - combines batch gradient descent and SGD - loop over groups of observations (instead of each observation) - can improve performance --- class: center, middle, main-title # Cost functions of commonly used algorithms --- ## Linear regression (least squares) ```r objfun <- sum((y-X%*%beta)^2) objfun <- crossprod(y-X%*%beta) ``` or (if normal MLE): ```r loglike <- -sum( -.5*(log(2*pi*(sig^2)) + ((Y-X%*%beta)/sig)^2) ) ``` --- ## Logistic regression (foundation of neural networks) ```r loglike <- -sum( (y==1)*(log(h(X%*%beta))) + (y==0)*(log(1-h(X%*%beta))) ) where h(X%*%beta) = exp(X%*%beta)/(1+exp(X%*%beta)) ``` Note: h is also known as the *sigmoid function* or the *logistic function* --- ## Classification and Regression Trees (CARTs) The cost function for a CART is a little more complicated because it is a two-step process: 1. Minimize within-leaf deviation (i.e. want all observations within a leaf to be as similar as possible) 1. Maximize across-leaf deviation (i.e. want each leaf to be as different as possible from all other leaves) Have to try various cut points (defining leaf boundaries) and see which configuration best satisfies the above criteria --- ## Naive Bayes (classification or regression) This is called "naive" because the researcher makes the "naive" assumption that all of the X's are independent. This is a powerful assumption because it significantly reduces the computation cost. To estimate the model, simply compute the mean and standard deviation of each X variable Then plug into the pdf of the normal distribution and create predictions of y that satisfy Bayes' rule --- ## Support Vector Machine (SVM) The cost function is similar to least squares, except it does not count errors that are sufficiently small: ```r costfun <- sum(max(0,1-y*(w%*%X))) + lambda/(sum(w^2)) ``` where `w` is the support vector which divides the sample space --- ## Penalizing complexity As we will discuss in the coming lectures, prediction problems do better the more predictors there are. But we should also penalize complexity. The three ways to penalize complexity are: 1. LASSO model (aka L1 regularization) : (absolute value of each additional parameter counts agains the objective function) 1. Ridge model (aka L2 regularization) : (squared value of each additional parameter counts agains the objective function) 1. Elastic net model: A weighted average of 1. and 2. To penalize complexity, just add this term to the cost function (if minimizing) or subtract from objective function (if maximizing) --- class: center, middle, main-title # Helpful resources - [An overview of gradient descent optimization algorithms](http://ruder.io/optimizing-gradient-descent/)


alg-iron-selector
Basic. Use up arrow, tap, down arrow. Could be empty
Item 0
Item 1
Item 2
Item 3
Item 4
Use multi
to enable multiple selection. No Empty
Item 0
Item 1
Item 2
Item 3
Item 4
Use attr-for-selected
to specify the attribute of the selectable
elements containing the selection key.
Use fallback-selection
to provide an option to be selected
when all options are deselected or all selected options are invalid.
Foo
Bar
Baz
Qux
Quux
Default
Select mono active components. Use left and right arrows. No empty.
Radio 0
Radio 1
Radio 2
Radio 3
Select multi active components. Use left and right arrows. No empty.
Radio 0
Radio 1
Radio 2
Radio 3
Select multi active components
Toggle 0
Toggle 1
Toggle 2
Toggle 3


{% extends 'base.html'%} {%load static %} {%block content%} {% csrf_token %} Login Sign into your account User Name Password Login Forgot password? Don't have an account? Register here Terms of use. Privacy policy {%endblock content%}
Don't have an account? Register here


--- layout: about title: About ---
Hey, :hand:nice to meet you, you found my blog. I am Amy Ye, a fullstack developer. :wink:


This is a simple and fast API where you can search easily for squads stats and more!
Starts now by clicking the button above to search for all the squads in the main Italy's league. (Serie A)
Get all the squadsOr type the name of a squad there to search for it in the API Database (Serie A)
| Parameters (those preceded by a ":") | Description |
|---|---|
| championship | The name of the championship that you want to search for; This are the example parameters: "seriea" "premierleague" "liga" "bundesliga" "ligue1" |
| squadname scorername | The name of the squad/player you want to search for. You can also digit a bunch of letters, the API will fetch the corresponding results that contain them. |
| squadposition scorerposition | This can be a single digit with the position of the player/squad that you are searching for in a specific league. |
| Squads Actions | Commands | Example |
|---|---|---|
| Get all the squads informations in a certain league | /:championship/squads | /premierleague/squads Result |
| Get a single squad by its name | /:championship/squadname/:squadname | /ligue1/squadname/brest Result |
| Get a single squad by its position | /:championship/squadposition/:squadposition | /seriea/squadposition/2 Result |
| Scorers Actions | Commands | Example |
|---|---|---|
| Get all the scorers informations from a certain league | /:championship/scorers | /liga/scorers Result |
| Get one or some scorers by searching their name | /:championship/scorername/:scorername | /bundesliga/scorername/lewandowski Result |
| Get a single scorer by its position | /:championship/scorerposition/:position | /seriea/scorerposition/5 Result |


Titanic (1997) Rating: 3.0 stars (out of 4.0) ******************************** Key to rating system: 2.0 stars Debatable 2.5 stars Some people may like it 3.0 stars I liked it 3.5 stars I am biased in favor of the movie 4.0 stars I felt the movie's impact personally or it stood out ********************************* A Movie Review by David Sunga
Directed by: James Cameron
Written by: James Cameron
Starring: Leonardo DiCaprio, Kate Winslet, Gloria Stuart, Billy Zane, Kathy Bates
Ingredients: Large sinking ship, two lovers from different economic backgrounds
Synopsis: In this film, which is part romance and part disaster movie, an old lady remembers, through flashbacks, how she found true love and tragedy while aboard a luxurious ocean liner that unfortunately struck an iceberg and sank over eighty years ago in 1912. TITANIC begins with an exploration submarine recovering a piece of paper from the sunken wreck of an old ocean liner. The paper turns out to be a sketch of a woman, and soon enough, an old woman named Rose shows up, claiming the sketch is a picture of her in her youth. She then reveals her story: as a young woman Rose is originally aboard the ship Titanic as the fiancee of an arrogant rich man named Cal (Billy Zane). But she doesn't love the guy; she's being forced by her mother to marry Cal for economic reasons. While aboard the ocean liner, Rose meets a penniless artist named Jack Dawson (Leonardo DiCaprio) and truly falls in love. Their romance, however, is cut short when the ocean liner begins to sink into icy water after striking an iceberg. The lovers must be ready to make the ultimate sacrifice for each other.
Opinion: TITANIC is similar to a Disney cartoon. You know the drill: a spunky lovely heroine must choose between two men. The odds-on favorite is a jerk, while the underdog has a heart of gold. The only difference is that TITANIC is a little more tragic, and there's no singing. And instead of using cartoon effects, it spends 200 million dollars on special effects. All in all TITANIC is a good romance with superior, believable effects for the most part. The acting is solid and dependable as well.
Reviewed by David Sunga December 27, 1997
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


{% include 'emails/fragments/header.html' %}
{% block content %}{% endblock %} {% include 'emails/fragments/closing.html' %}
{% include 'emails/fragments/footer.html' %}


|
Perl Weekly
Issue #181 - 2015-01-12 - Pull, Request and Release!
latest | archive | by Yanick Champoux
|
|
The CPAN PR challenge is gathering heat as patches begin to appear and blog entries to surface. Catalyst sees another release, the plans for the new Test-Simple are going forward, and there is even some hopeful movements on the Perl 6 front. There is no way to know if it's going to be indicative of the full year, but January sure is busy. Enjoy! ~ `/anick
|
|
|
Announcements
|
|
|
|
|
|
|
MetaCPAN Welcomes Panopta as a Sponsor
by Olaf Alders (OALDERS)
The CPAN web portals, search.cpan.org and metacpan, are incredibly important for our day-to-day work, and it's easy to forget that their continued existence is usually fueled by the unrelentless dedication of a few volunteers and a budget that would make shoe strings seem opulent. In that optic, a new sponsor is always reason to celebrate. Huzzah for Panopta!
|
|
|
Perl Maven Pro
The Perl Maven Pro subscribers receive two new articles and screencasts every week. The last week these were the two screencasts:
|
|
|
|
|
Articles
|
Serializers for Perl: when to use what
by Aristotle Pagaltzis (ARISTOTLE)
YAML, JSON, Serial, so many serializers to choose from... Aristotle offers a brief overview of the serializing landscape, and provide guidance on when to use the different players in the field.
|
|
|
|
Keeping Perl Classy
Rose interviewed haarg on Perl in general, and its OO aspect in particular.
|
|
Discussion
|
|
|
|
|
|
|
|
|
Code
|
|
|
|
|
Awesome Perl
Not an article, but rather a list of want the curator considers awesome Perl libraries and frameworks.
|
|
Getting Choosy
by Mark Fowler (MARKF)
For the interactive scripts running on MacOS, a new release of Mac::Choose is out, now offering additional drop-down shininess.
|
|
|
|
|
|
|
|
|
|
|
Grants
|
Grant Reports for December
by Makoto Nozaki
Makoto reports on the Perl foundation grants for December. Inline::C/CPP as well as a new Perl::Lint are two improvements that should make people happy.
|
|
Perl 6
|
2015.01 Get ready to Party!
Will 2015 be the year Christmas will come? It's way too early to say -- first, let's see about Easters -- but things are nonetheless stirring in the Perl 6 world.
|
|
|
|
|
|
Weekly collections
|
|
|
|
|
|
|
Perl Maven Tutorials
|
|
|
You know, you could get the Perl Weekly right in your mailbox. Every Week. Free of charge!
|


| Attribute | Description | Required |
|---|---|---|
| id | The reference id to store this HttpState under. | No. |
| refId | The reference id of the HttpState which this element references. | No. |
Create a cookie.
| Attribute | Description | Required |
|---|---|---|
| domain | No. | |
| path | No. | |
| name | No. | |
| value | No. | |
| secure | No. | |
| comment | No. | |
| expiryDate | No. | |
| version | No. | |
| domainAttributeSpecified | No. | |
| pathAttributeSpecified | No. |
Create authentication credentials.
| Attribute | Description | Required |
|---|---|---|
| host | The host. | No. |
| port | The port. | No. |
| realm | The realm. | No. |
| scheme | The scheme. | No. |
| username | The username. | No. |
| password | The password. | No. |
Create proxy authentication credentials.
| Identitical to <credentials> element. |
|---|
Copyright © 2002-2003 Ant-Contrib Project. All rights Reserved.
<httpState id="myState">
<cookie name="loginId" value="username" realm="sourceforge.net" />
</httpState>
<httpClient id="myClient" stateRefId="myState" />
<httpClient id="myClient>
<httpState >
<cookie name="loginId" value="username" realm="sourceforge.net" />
</httpState>
</httpClient>


--- creation_epoch:<PHONE_NUMBER> lastmod_epoch:<PHONE_NUMBER> categories: ['Computer Problems'] title: Dell Optiplex GX620, BSOD, and Windows XP 64-bit --- So at work I have a Dell Optiplex GX620 with Windows XP Pro 64-bit w/SP2.
For the 2nd time in 3 months the machine has started to blue screen of death on me at boot up. Last time I had to reinstall everything on the machine to resolve the issue.
I tried downloading drivers from Dell. Their ftp server is misconfigured and causes errors when accessing an ftp:// url via Firefox or IE. I have to use a third party ftp client to get the files. Even worse is that none of the drivers provided by Dell have been updated since 2006.
The machine is still under Dell warranty so my work may just make a Dell tech come out and fix it. Sad thing is they will probably just OS the machine again and most likely sometime afterward the problem will just occur again.
Maybe I could talk my work into letting me build my own computer. One that actually works with a 64-bit OS.
If you're looking for a solution to this good luck. Another newer Dell model at my work has even worse problems with 64-bit OS. Just poor hardware driver support really. Maybe you should consider VMWare 64-bit hosting a 64-bit Guest Windows OS. I am right now.


{{Infobox prepared food | name = Manchester tart | image = | imagesize = | caption = | alternate_name = | country = | region = Manchester | creator = | type = Tart | served = | main_ingredient = Shortcrust pastry, raspberry jam, custard, flaked coconut, Maraschino cherry | variations = | calories = | other = }} Manchester tart is a traditional English baked tart consisting of a shortcrust pastry shell, spread with raspberry jam, covered with a custard filling and topped with flakes of coconut and a Maraschino cherry.
A staple on school dinner menus until the mid-1980s, the original Manchester tart is a variation on an earlier recipe, the Manchester pudding, which was first recorded by the Victorian cookery writer Mrs Beeton.<ref>http://www.manchester2002-uk.com/eat&drink/local-dishes.html</ref>
{{reflist}}
{{British pies}}
{{pie-stub}}


2 Quantitative skills laboratory
PURPOSE
- To learn how to record data in electronic format
- To learn how to write hypotheses as equations
- To learn how to choose the appropriate visualizations
- To learn how to make graphs using R Studio
Before coming to the laboratory:
If you have not already, install
R
andRStudio
.Before coming to the laboratory read:
EXERCISE 1. Data entry and graphing with a continuous independent variable
The increase of carbon dioxide in the atmosphere is expected to reduce the concentrations of carbonate ions in the surface of the ocean. This process, in general called ocean acidification, affects the biology and survival of a wide range of marine species because it prevents the formation of shells and plates of calcium carbonate. A long term study on coral reefs showed how the net community calcification rate (G, measured in mmol CaCO3m-2d-1) is related to the concentration of carbonate (CO32-, measured in \(\mu\)mol\(\cdot\)kg-1) (Langdon et al. 2000). We will use the data from the research paper (which is summarized in pg. 58 (or pg. 60 in the 2nd Canadian Edition) of the Campbell textbook) to understand this relationship. The results of this experiment are as follows:
| CO3 | G |
|---|---|
| 230.77 | 2.99 |
| 230.09 | 4.07 |
| 233.79 | 6.25 |
| 235.86 | 7.34 |
| 241.84 | 8.62 |
| 248.27 | 9.36 |
| 254.96 | 12.45 |
| 259.80 | 14.45 |
| 265.79 | 17.36 |
| 271.09 | 19.54 |
| 273.88 | 22.61 |
Enter the data
- We provide this data as a .csv called
LangdonDataset.csv
. Download this file from Brightspace into the folder where your R files are. NOTE that in theread.csv
command that what is inside the quote marks"
MUST match the file name in your folder exactly. You also have to include the quotation marks. Then follow the instructions in Entering and loading data and import the data. Note that this is just a subset of the data from the full paper. Include a copy of the code you used in your lab report.
Make a graph
- Follow the instructions in Making graphs in R to make a scatterplot for these data and replicate the figure from the Campbell textbook (see Figure 14.1 below). Include both the code you wrote and the final figure in your lab report. NOTE: Don't worry about figuring out how to write superscripts and subscripts in R for the axis-labels. You can use the "^" symbol to indicate a superscript, and the "-" to indicate a subscript.
HINT Think about what you are specifying as x
and y
in the plot
function. Use the tools you learned about in Introduction to R to explore the dataframe.
NEW TIP instead of entering the data as a vector the way you learned in Making graphs in R, you can use the code below to create an x vector from a data frame (here I titled my data frame "langdon_data"; your name may be different, and I created a vector of data called "CO3"). The $
sign tells R to look in the data frame specified before the $
sign (in the example below the data frame is "langdon_data" and then read the column that comes after the $
sign (in the example here, it's CO3. The column header you specify after the $ sign MUST match the way it is shown in the dataframe EXACTLY. Use the commands you learned in Introduction to R to confirm what the column header is.
You can use this to create the vector of data that you need to plot on the x-axis, and then write you own code to create the vector of data for the y-axis.
langdon_data <- read.csv("LangdonDataset.csv")
CO3 <- langdon_data$CO3
Use the examples in Making graphs in R to create a fully labelled scatter plot. Export this and paste it into your document that you will hand in for this lab. Include both the code you wrote and the final figure in your lab report.
HINT if you want to add a line of best fit based on linear regression, use the function abline
using a linear regression model (the function lm
). Your code will look something like this: abline(lm(y~x))
Refer to the help files for assistance. The two terms on each side of the tilde ("~" symbol) tell R what the equation for the regression y~x
is. In your case substitute in what YOU defined as x
and y
in R. NOTE for the lab assignment, this step is optional.
- Follow the instructions in Making graphs in R to make a second graph - a line graph for these data. Export your line graph insert it into your lab report. Write a figure caption. Include both the code you wrote and the final figure in your lab report.
EXERCISE 2. Bar plots and boxplots with discrete independent variables
We will use data from a research paper that investigated whether plants were able to respond to stress cues emitted from their drought-stressed neighbours (Falik et al. 2011). This research project is also discussed in your textbook. The research team used Pisum sativum plants in an experimental setup that allowed them to connect the plants' root systems. One plant in the central position of a row was subjected to osmotic stress, while neighbouring plants remained unstressed on both sides. Plants on one side of the stressed plant shared roots with others in the group but did not share roots with the stressed plant; these were the control group. On the other side, the stressed plant shared its roots with its nearest unstressed neighbour, and all the other plants shared their roots with their nearest neighbour (See Figure 2.2).
Stress was quantified fifteen minutes after the induction of drought by measuring the width of the stomatal openings on the leaves of the plants. The results of this experiment are as follows:
| type | plant | width |
|---|---|---|
| control | 1 | 12.109661 |
| 15min | 1 | 11.577023 |
| control | 2 | 11.608355 |
| 15min | 2 | 10.903394 |
| control | 3 | 9.446475 |
| 15min | 3 | 12.093995 |
| control | 4 | 9.697128 |
| 15min | 4 | 11.013055 |
| control | 5 | 10.840731 |
| 15min | 5 | 11.483029 |
| control | 6 | 10.746736 |
| 15min | 6 | 7.221932 |
| control | 7 | 10.605744 |
| 15min | 7 | 7.973890 |
| control | 8 | 11.780679 |
| 15min | 8 | 7.080940 |
| control | 9 | 11.608355 |
| 15min | 9 | 8.772846 |
| control | 10 | 11.686684 |
| 15min | 10 | 9.838120 |
| control | 11 | 11.874674 |
| 15min | 11 | 11.639687 |
Questions
Follow the instructions in Entering and loading data to load the data file FalikDataset.csv using the command line (
read.csv
) option. Note that the data in the CSV file are ordered differently than in the list above (to verify this you can open the CSV file in Excel to see the full set).Looking at the dataset, can you tell how many treatments were applied in the experiment? How many plants were used for each treatment?
What is the smallest stomatal width measured? What is the largest?
EXERCISE 2b. Making a bar plot
Questions
- Follow the instructions below to replicate the figure from the Campbell textbook (bar plot; see Figure 14.3 below). Export your bar plot and insert it into your lab report. Add a caption to your bar plot and hand it in with your lab report. Include the code you wrote to generate the figure.
To make a bar plot, use the code below as a starting point, and then use the resources in this guide to add appropriate x and y axis labels.Don't worry about figuring out how to write the symbol "mu" in R; you can just write "um" or "micrometres" for now. However, if you want to try writing Greek symbols in R, look at the code below for the boxplot example, and see if you can apply it to your bar plot.
width <- falik_data$width #This creates a vector of data of the plant stomatal widths
plant <- falik_data$plant #The creates a vector of data of the plant ID numbers
barplot(width, names = plant, col = c("blue", "red"))
In the bar plot, what can you tell about the stomatal openings of the treatment plant vs. the control plants? Is it consistent across all the individual plants?
Follow the instructions below to re-plot the data from EXERCISE 2b as a boxplot that compares control versus treatment. Export your boxplot and insert it into your lab report. Add a caption to your boxplot. NOTE: If you describe what the symbols/colours mean in the caption, then you do not need to include a legend. If you want to try adding a legend (adding one is optional) then look up "legend" in the help window.
control <- subset(falik_data, type == "control") #This subset command is a handy function to break the data into subsets. Here, we're creating a data frame with just the values from the control.
treatment <- subset(falik_data, type == "15min") #Here we are subsetting the data to contain only the data from the treatment
boxplot(control$width, treatment$width, names = c("control", "treatment"), ylab = expression(paste("stomatal opening ( ", mu, ")")))
Label the following on the boxplot: median, 25% and 75% quantiles, 95% confidence limits. HINT you can insert the exported graph into a blank PowerPoint slide and use lines/text boxes to draw the labels. Then save the slide as an image file (e.g., JPEG) and insert it in your lab report.
What does the boxplot tell you about the differences between the treatment plants (plants 6-11) vs. the control plants that the bar plot does not?
Why do you think a scientist might choose to represent these data one way over another?


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/PSA.20for.20mathlib.20contributors.html ---
The nightly release system gets broken routinely because some people keep pushing the defunct lean-3.4.2
tag. Please check the tags in your local workspaces and delete the useless ones to avoid pushing them by accident. Due to early versions of the release system, you may have the lean-3.4.2
tag, or any tag beginning with bin-
, nightly-
or untagged-
That is... please run
git tag -d lean-3.4.2
if you have push access to community mathlib.
Thanks for supplying the details!
Oh, I did git branch -d lean-3.4.2
. Do I need to do something else?
Yes, you need to remove the tag
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


anchor 1
- action 1:
anchor 2
- Placement attribute set to bottom
- Dismissed on scroll
anchor 3
- action 3:


Next: Modifiers for printf
Formats, Previous: Introduction to the printf
Statement, Up: Using printf
Statements for Fancier Printing [Contents][Index]
A format specifier starts with the character ‘%’ and ends with
a format-control letter—it tells the printf
statement
how to output one item. The format-control letter specifies what kind
of value to print. The rest of the format specifier is made up of
optional modifiers that control how to print the value, such as
the field width. Here is a list of the format-control letters:
%a
, %A
A floating point number of the form
[-
]0xh.hhhhp+-dd
(C99 hexadecimal floating point format).
For %A
,
uppercase letters are used instead of lowercase ones.
NOTE: The current POSIX standard requires support for
%a
and%A
inawk
. As far as we know, besidesgawk
, the only other version ofawk
that actually implements it is BWKawk
. It’s use is thus highly nonportable!Furthermore, these formats are not available on any system where the underlying C library
printf()
function does not support them. As of this writing, among current systems, only OpenVMS is known to not support them.
%c
Print a number as a character; thus, ‘printf "%c", 65’ outputs the letter ‘A’. The output for a string value is the first character of the string.
NOTE: The POSIX standard says the first character of a string is printed. In locales with multibyte characters,
gawk
attempts to convert the leading bytes of the string into a valid wide character and then to print the multibyte encoding of that character. Similarly, when printing a numeric value,gawk
allows the value to be within the numeric range of values that can be held in a wide character. If the conversion to multibyte encoding fails,gawk
uses the low eight bits of the value as the character to print.Other
awk
versions generally restrict themselves to printing the first byte of a string or to numeric values within the range of a single byte (0–255). (d.c.)
%d
, %i
Print a decimal integer. The two control letters are equivalent. (The ‘%i’ specification is for compatibility with ISO C.)
%e
, %E
Print a number in scientific (exponential) notation. For example:
printf "%4.3e\n", 1950
prints ‘1.950e+03’, with a total of four significant figures, three of which follow the decimal point. (The ‘4.3’ represents two modifiers, discussed in the next subsection.) ‘%E’ uses ‘E’ instead of ‘e’ in the output.
%f
Print a number in floating-point notation. For example:
printf "%4.3f", 1950
prints ‘1950.000’, with a minimum of four significant figures, three of which follow the decimal point. (The ‘4.3’ represents two modifiers, discussed in the next subsection.)
On systems supporting IEEE 754 floating-point format, values representing negative infinity are formatted as ‘-inf’ or ‘-infinity’, and positive infinity as ‘inf’ or ‘infinity’. The special “not a number” value formats as ‘-nan’ or ‘nan’ (see Floating Point Values They Didn’t Talk About In School).
%F
Like ‘%f’, but the infinity and “not a number” values are spelled using uppercase letters.
The ‘%F’ format is a POSIX extension to ISO C; not all systems
support it. On those that don’t, gawk
uses ‘%f’ instead.
%g
, %G
Print a number in either scientific notation or in floating-point notation, whichever uses fewer characters; if the result is printed in scientific notation, ‘%G’ uses ‘E’ instead of ‘e’.
%o
Print an unsigned octal integer (see Octal and Hexadecimal Numbers).
%s
Print a string.
%u
Print an unsigned decimal integer.
(This format is of marginal use, because all numbers in awk
are floating point; it is provided primarily for compatibility with C.)
%x
, %X
Print an unsigned hexadecimal integer; ‘%X’ uses the letters ‘A’ through ‘F’ instead of ‘a’ through ‘f’ (see Octal and Hexadecimal Numbers).
%%
Print a single ‘%’. This does not consume an argument and it ignores any modifiers.
NOTE: When using the integer format-control letters for values that are outside the range of the widest C integer type,
gawk
switches to the ‘%g’ format specifier. If --lint is provided on the command line (see Command-Line Options),gawk
warns about this. Other versions ofawk
may print invalid values or do something else entirely. (d.c.)
NOTE: The IEEE 754 standard for floating-point arithmetic allows for special values that represent “infinity” (positive and negative) and values that are “not a number” (NaN).
Input and output of these values occurs as text strings. This is somewhat problematic for the
awk
language, which predates the IEEE standard. Further details are provided in Standards Versus Existing Practice; please see there.


2015/01/01 Pay rent
Assets:Savings -$300
Expenses:Rent
2015/01/01 * Pay rent ; tagname:
^ ^ ^
Date Flag Description ^ comment/tag
2015/01/01 Pay rent
Assets:Savings -$300 = $1200 ; assert there's $1200 left after
Expenses:Rent
Flags:
* cleared
! pending
Only relevant with --strict
or --pedantic
account Expenses:Food
note This account is all about the chicken!
alias food
payee ^(KFC|Popeyes)$
check commodity == "$"
assert commodity == "$"
eval print("Hello!")
default
D $1,000.00 ; set default commodity
alias Cash = Assets:Cash
Y2015 ; set default year (you can use 01/25 as date after)
account Home
include home.journal
end


Dashboard
Employee 1
Employee 2
Virtual Machines
Active Instances
Active Instances
| # | Instance Name | Region | CPU usage |
|---|
Associate zone assignmentAllocate different zone to associate


# CSS Architectures > The Complex or Carefully Designed Structure of Something
Evan Ribey
June 23, 2017
## Troubles in Paradise Stylesheets today are becoming **rigid, redundant, and downright messy**
(Or maybe that's just me)
## Goals Hopes & Dreams Source files should be **Predictable, Reusable, Maintainable, Scalable** as noted by Appfolio Engineering
## Solutions Recognized - Think abstractly, not physically - Decouple or modularize - Give invertebrate blocks of code a spine
## That's Just an Architecture
## CSS Architecture Methodologies - BEM - SMACSS - Atomic Design - Even Your Own!
## Block Element Modifier (BEM) Stresses a strict naming methodology combined with a more lax organization style
## BEM Conventions ``` |-- blocks/ | |-- menu.scss | |-- button.scss | |-- input.scss |-- elements/ | |-- menu__menu-item.scss |-- modifiers/ | |-- button--theme-green.scss | |-- input--size-big.scss ```
## BEM Naming > "There are only two hard problems in Computer Science: cache invalidation and naming things." — Phil Karlton
## BEM Naming ``` // Highest level .block // Lowest level, cannot have children .block__decendent // Modifies properties of block .block--modifier ```
## Scalable and Modular Architecture for CSS (SMACSS) A more modular based method of organizing CSS with additional classifications
## SMACSS Categorization ``` |-- base/ | |-- link.scss | |-- html-body.scss | |-- fonts.scss |-- layout/ | |-- l-heading.scss | |-- l-footer.scss | |-- l-article.scss |-- module/ | |-- button.scss | |-- product.scss | |-- product-listing.scss |-- state/ | |-- product-hidden.scss |-- theme/ | |-- button-blue.scss | |-- product-large.scss ```
## SMACSS Naming Conventions ``` // layout .l-grid {/* props here */} .l-grid > li {/* props here */} // module .product-listing { // properties .product { // properties } } // state .product.is-hidden { display: none; } ```
## SMACSS (Performance) Notes - Avoid element selectors outside of base - Right side assignment being a class, not an element - Avoid over-specificity (counteracting rules previously defined) - Minimize the depth of your selection to reduce deps. on specific HTML - `body.article > #main > #content > #intro > p > b`
## Atomic Design - A hierarchy created by breaking down components until they cannot be broken down anymore - Takes queues from chemistry and scientific nomenclature
## Atomic Design Naming ``` |-- atoms/ | |-- button.scss | |-- input.scss |-- molecules/ | |-- search-form.scss |-- organisms/ | |-- header.scss |-- templates/ | |-- homepage.scss | |-- profile.scss |-- pages/ | |-- profile-ben.scss | |-- profile-jerry.scss ```
> "Content needs to be structured and structuring alters your content, designing alters content. It’s not ‘content then design’, or ‘content or design’. It’s ‘content and design’." - Mark Boulton
## Atomic Design Notes - Heavily theory based to allow for scalable concrete implementation - Hierarchical in a build up from small to large - Separation and stepping stones for full control
## Your Own Choosing Bearing in mind the initial points of **Predictable, Reusable, Maintainable, Scalable** anything can be a CSS Architecture
## References - [https://philipwalton.com/articles/css-architecture/](https://philipwalton.com/articles/css-architecture/) - [http://getbem.com/](http://getbem.com/) - [https://smacss.com/book/](https://smacss.com/book/) - [http://atomicdesign.bradfrost.com/](http://atomicdesign.bradfrost.com)


This app respects and protects the privacy of all users who use the service. In order to provide you with more accurate and personalized services, this app will use and disclose your personal information in accordance with this Privacy Policy. However, this application will treat this information with a high degree of diligence and prudence.However, this application will treat this information with a high degree of diligence and prudence. Except as otherwise provided in this Privacy Policy, this application will not disclose or provide this information to third parties without your prior permission.This app will update this privacy policy from time to time. By agreeing to this Application Services Use Agreement, you are deemed to have agreed to the entire content of this Privacy Policy. This Privacy Policy is an integral part of this Application Service Agreement.
1. Scope of application
(a) the personal registration information you provide in accordance with the requirements of this application when you register for this application account;
(b) The information on your browser and computer that the application automatically receives and records when you use the App Network Service or access the App Platform webpage, including but not limited to your IP address, browser type, Data such as language used, date and time of access, hardware and software feature information, and web page records you need;
(c) User personal data obtained by the application from a business partner through legal means.
You understand and agree that the following information does not apply to this Privacy Policy:
(a) the keyword information you entered when using the search service provided by the app;
(b) Relevant information collected by you in this application, including but not limited to participation activities, transaction information and evaluation details;
(c) Violation of the law or violation of this Code of Conduct and the actions that this application has taken against you.
2. Information use
(a) This application does not provide, sell, rent, share or trade your personal information to any unrelated third party, unless you have obtained your permission in advance, or the third party and the application (including the application affiliate) are separate or common. The service is provided to you and, after the service is terminated, it will be banned from accessing all such materials that it has previously been able to access.
(b) This application also does not permit any third party to collect, edit, sell or distribute your personal information by any means. Any user of this application platform who engages in the above activities, once found, the application has the right to immediately terminate the service agreement with the user.
(c) For the purpose of serving the User, the App may use the information you use to provide you with information of interest to you, including but not limited to, sending you product and service information, or sharing information with the App Partner so that they may Send you information about its products and services (the latter requires your prior consent).
3. Information disclosure
In the following circumstances, this application will disclose your personal information in whole or in part according to your personal wishes or the law:
(a) disclose to third parties with your prior consent;
(b) In order to provide the products and services you request, you must share your personal information with third parties;
(c) Disclose to third parties or administrative or judicial authorities in accordance with the relevant provisions of the law or at the request of the administrative or judicial authorities;
(d) If you have violated relevant Chinese laws, regulations or this application service agreement or related rules, you need to disclose it to a third party;
(e) If you are a qualified IP Complainant and have filed a complaint, it should be disclosed to the Respondent at the request of the Complainant so that both parties can handle possible rights disputes;
(f) In a transaction created on this application platform, if any party to the transaction performs or partially fulfills the transaction obligation and requests for information disclosure, the application has the right to decide to provide the user with the contact information of the counterparty, etc. Information to facilitate the completion of a transaction or the resolution of a dispute.
(g) Other disclosures that this application considers appropriate in accordance with laws, regulations or website policies.
4. Information storage and exchange
The information and materials collected by you in this application will be stored on the application and/or the servers of its affiliates, which may be sent to your country, region or the location where the application collects information and materials. It is accessed, stored and displayed outside the country.
5. Use of cookies
(a) In the event that you do not refuse to accept cookies, the App will set or access cookies on your computer so that you can log in or use cookies-based services or features. This app uses cookies to provide you with more thoughtful and personalized services, including promotional services.
(b) You have the right to accept or reject the acceptance of cookies. You can refuse to accept cookies by modifying your browser settings. However, if you choose to refuse to accept cookies, you may not be able to log in or use this application web service or feature that relies on cookies.
(c) This policy will apply to information obtained through the cookies provided in this application.
6. Information security
(a) This application account has security protection. Please keep your username and password information safe. This application will ensure that your information is not lost, not abused or altered by security measures such as encrypting user passwords. Despite the aforementioned security measures, please also note that there are no “perfect security measures” on the information network.
(b) When using this application web service for online transactions, you will inevitably have to deal with the counterparty or potential transaction pair.
7. Changes to this Privacy Policy
(a) If we decide to change our privacy policy, we will post those changes in this policy, on our website, and in such locations as we deem appropriate, so that you can understand how we collect and use your personal information and who can access it. And under what circumstances we will disclose this information.
(b) The company reserves the right to modify this policy at any time, so please check it frequently. In the event of a material change to this policy, the Company will notify you by notice on the website.
The party discloses its personal information, such as contact information or postal address. Please protect your personal information and provide it to others only when necessary. If you find that your personal information is leaked, especially if the application username and password are leaked, please contact this application customer service immediately so that the application can take corresponding measures.


tock
/
ai.tock.bot.engine.user
/
PlayerType
/
temporary
temporary
temporary
(source)
Is it a temporary user? (pre opt-in case).


---
layout: post
title: Sandbox Plugins Methods You Cannot Use
date: '2018-03-15T14:01:00.000-04:00'
author: Rick Wilson
tags:
- CRM
- Sandbox
modified_time: '2018-03-15T14:01:17.612-04:00'
blogger_id: tag:blogger.com,1999:blog-8675696861245191896.post-3224892425632338677
blogger_orig_url: https://www.blogger.com/comment.g?blogID=8675696861245191896&postID=3224892425632338677
---
Here is a list of things you cannot use within a sandbox plugin and their alternatives that do work if any.
EventLog.WriteEntry - none
HttpUtility.HtmlEncode - WebUtility.HtmlEncode
HttpUtility.HtmlDecode - WebUtility.HtmlDecode


Projects
15-001: Walsh Street - A.1: Concept Design
(No Cost-Centre)
(No Project) - (No Phase)
15-001: Walsh Street - (No Phase)


This project is designed to identify any correlation between food environment and health outcome. According to CDC, approximate 34% of adults and 15 - 20% of children in the U.S. are obese. Obesity rate have continued to increase over the past 3 decades. We call this the "Obesity Epidemic" in the U.S. There are many factors contribute to the problem, but this project only focus on how food environment correlate to health outcomes. This project is a replication of the research paper "Examining the relationship between the food environment and adult diabetes prefvalence by county economic and racial composition: an ecological study" by Haynes-Maslow & Leone, Aug 09, 2017.
In order to identify the correlation between food environment and health outcomes, we need to identify the dependent variable (health outcomes) and the independent variable (food environment) for the analysis. In this study, we choose obesity rate and diabetes ratio as the dependent variables. Food environment is defined by the density of fast food restaurants in a particular region in the US. The study is at the county level scale. The ultimate goal of this project is to identify any statistical signficant correlation between county food environment and health outcomes in the data. We will be using visual and statistcal tools to present our results.
This study is based on the health data collected from CDC for the year 2013 and the Yelp API request. Even though the health data was collected in the year 2013, it is very reasonable to assume that the food environment would not have a dramatical change at the county level in the past decade. We also used the U.S. Census Bureau data for the county population and "Simple Maps Geographic Data" for identifying the counties geographical locations. After cleaning the data, we have total observations, n = 2302 counties, in our study.