AddAffiliationRequest represents the request to add a new affiliation to the fabric-ca-server
type AddAffiliationRequest struct { Name string `json:"name"` Force bool `json:"force"` CAName string `json:"caname,omitempty"` }
AddAffiliationRequestNet is a network request for adding a new affiliation
type AddAffiliationRequestNet struct { AddAffiliationRequest }
AddIdentityRequest represents the request to add a new identity to the fabric-ca-server
type AddIdentityRequest struct { ID string `json:"id" skip:"true"` Type string `json:"type" def:"user" help:"Type of identity being registered (e.g. 'peer, app, user')"` Affiliation string `json:"affiliation" help:"The identity's affiliation"` Attributes []Attribute `json:"attrs" mapstructure:"attrs" ` MaxEnrollments int `json:"max_enrollments" mapstructure:"max_enrollments" help:"The maximum number of times the secret can be reused to enroll (default CA's Max Enrollment)"` // Secret is an optional password. If not specified, // a random secret is generated. In both cases, the secret // is returned in the RegistrationResponse. Secret string `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity being added"` CAName string `json:"caname,omitempty" skip:"true"` }
AddIdentityRequestNet is a network request for adding a new identity
type AddIdentityRequestNet struct { AddIdentityRequest }
AffiliationInfo contains the affiliation name, child affiliation info, and identities associated with this affiliation.
type AffiliationInfo struct { Name string `json:"name"` Affiliations []AffiliationInfo `json:"affiliations,omitempty"` Identities []IdentityInfo `json:"identities,omitempty"` }
AffiliationResponse contains the response for get, add, modify, and remove an affiliation
type AffiliationResponse struct { AffiliationInfo `mapstructure:",squash"` CAName string `json:"caname,omitempty"` }
Attribute is a name and value pair
type Attribute struct { Name string `json:"name"` Value string `json:"value"` ECert bool `json:"ecert,omitempty"` }
func (a *Attribute) GetName() string
GetName returns the name of the attribute
func (a *Attribute) GetValue() string
GetValue returns the value of the attribute
AttributeRequest is a request for an attribute. This implements the certmgr/AttributeRequest interface.
type AttributeRequest struct { Name string `json:"name"` Optional bool `json:"optional,omitempty"` }
func (ar *AttributeRequest) GetName() string
GetName returns the name of an attribute being requested
func (ar *AttributeRequest) IsRequired() bool
IsRequired returns true if the attribute being requested is required
BasicKeyRequest encapsulates size and algorithm for the key to be generated
type BasicKeyRequest struct { Algo string `json:"algo" yaml:"algo" help:"Specify key algorithm"` Size int `json:"size" yaml:"size" help:"Specify key size"` }
func NewBasicKeyRequest() *BasicKeyRequest
NewBasicKeyRequest returns the BasicKeyRequest object that is constructed from the object returned by the csr.NewBasicKeyRequest() function
CSRInfo is Certificate Signing Request (CSR) Information
type CSRInfo struct { CN string `json:"CN"` Names []csr.Name `json:"names,omitempty"` Hosts []string `json:"hosts,omitempty"` KeyRequest *BasicKeyRequest `json:"key,omitempty"` CA *csr.CAConfig `json:"ca,omitempty" hide:"true"` SerialNumber string `json:"serial_number,omitempty"` }
CertificateResponse contains the response from Get or Delete certificate request.
type CertificateResponse struct { Certs []string `json:"certs"` }
EnrollmentRequest is a request to enroll an identity
type EnrollmentRequest struct { // The identity name to enroll Name string `json:"name" skip:"true"` // The secret returned via Register Secret string `json:"secret,omitempty" skip:"true" mask:"password"` // CAName is the name of the CA to connect to CAName string `json:"caname,omitempty" skip:"true"` // AttrReqs are requests for attributes to add to the certificate. // Each attribute is added only if the requestor owns the attribute. AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"` // Profile is the name of the signing profile to use in issuing the X509 certificate Profile string `json:"profile,omitempty" help:"Name of the signing profile to use in issuing the certificate"` // Label is the label to use in HSM operations Label string `json:"label,omitempty" help:"Label to use in HSM operations"` // CSR is Certificate Signing Request info CSR *CSRInfo `json:"csr,omitempty" skip:"true"` // Skipping this because we pull the CSR from the CSR flags // The type of the enrollment request: x509 or idemix // The default is a request for an X509 enrollment certificate Type string `def:"x509" help:"The type of enrollment request: 'x509' or 'idemix'"` }
func (er EnrollmentRequest) String() string
EnrollmentRequestNet is a request to enroll an identity
type EnrollmentRequestNet struct { signer.SignRequest CAName string AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"` }
GenCRLRequest represents a request to get CRL for the specified certificate authority
type GenCRLRequest struct { CAName string `json:"caname,omitempty" skip:"true"` RevokedAfter time.Time `json:"revokedafter,omitempty"` RevokedBefore time.Time `json:"revokedbefore,omitempty"` ExpireAfter time.Time `json:"expireafter,omitempty"` ExpireBefore time.Time `json:"expirebefore,omitempty"` }
GenCRLResponse represents a response to get CRL
type GenCRLResponse struct { // CRL is PEM-encoded certificate revocation list (CRL) that contains requested unexpired revoked certificates CRL []byte }
GetAllIDsResponse is the response from the GetAllIdentities call
type GetAllIDsResponse struct { Identities []IdentityInfo `json:"identities"` CAName string `json:"caname,omitempty"` }
GetCAInfoRequest is request to get generic CA information
type GetCAInfoRequest struct { CAName string `json:"caname,omitempty" skip:"true"` }
GetCRIRequest is a request to send to server to get Idemix credential revocation information
type GetCRIRequest struct { CAName string `json:"caname,omitempty" skip:"true"` }
GetCRIResponse is the response from the server for get CRI request
type GetCRIResponse struct { // CRI is base64 encoded proto bytes of idemix.CredentialRevocationInformation CRI string }
GetCertificatesRequest represents the request to get certificates from the server per the enrollment ID and/or AKI and Serial. If neither ID or AKI/Serial are provided all certificates are returned which are in or under the caller's affiliation. By default all certificates are returned. However, only revoked and/or expired certificates can be requested by providing a time range.
type GetCertificatesRequest struct { ID string `skip:"true"` // Get certificates for this enrollment ID AKI string `help:"Get certificates for this AKI"` // Get certificate that matches this AKI Serial string `help:"Get certificates for this serial number"` // Get certificate that matches this serial Revoked TimeRange `skip:"true"` // Get certificates which were revoked between the specified time range Expired TimeRange `skip:"true"` // Get certificates which expire between the specified time range NotExpired bool `help:"Don't return expired certificates"` // Don't return expired certificates NotRevoked bool `help:"Don't return revoked certificates"` // Don't return revoked certificates CAName string `skip:"true"` // Name of CA to send request to within the server }
GetCertificatesRequestNet is a network request for getting certificates
type GetCertificatesRequestNet struct { GetCertificatesRequest }
GetIDResponse is the response from the GetIdentity call
type GetIDResponse struct { ID string `json:"id" skip:"true"` Type string `json:"type" def:"user"` Affiliation string `json:"affiliation"` Attributes []Attribute `json:"attrs" mapstructure:"attrs" ` MaxEnrollments int `json:"max_enrollments" mapstructure:"max_enrollments"` CAName string `json:"caname,omitempty"` }
GetTCertBatchRequest is input provided to identity.GetTCertBatch
type GetTCertBatchRequest struct { // Number of TCerts in the batch. Count int `json:"count"` // The attribute names whose names and values are to be sealed in the issued TCerts. AttrNames []string `json:"attr_names,omitempty"` // EncryptAttrs denotes whether to encrypt attribute values or not. // When set to true, each issued TCert in the batch will contain encrypted attribute values. EncryptAttrs bool `json:"encrypt_attrs,omitempty"` // Certificate Validity Period. If specified, the value used // is the minimum of this value and the configured validity period // of the TCert manager. ValidityPeriod time.Duration `json:"validity_period,omitempty"` // The pre-key to be used for key derivation. PreKey string `json:"prekey"` // DisableKeyDerivation if true disables key derivation so that a TCert is not // cryptographically related to an ECert. This may be necessary when using an // HSM which does not support the TCert's key derivation function. DisableKeyDerivation bool `json:"disable_kdf,omitempty"` // CAName is the name of the CA to connect to CAName string `json:"caname,omitempty" skip:"true"` }
GetTCertBatchRequestNet is a network request for a batch of transaction certificates
type GetTCertBatchRequestNet struct { GetTCertBatchRequest // KeySigs is an optional array of public keys and corresponding signatures. // If not set, the server generates it's own keys based on a key derivation function // which cryptographically relates the TCerts to an ECert. KeySigs []KeySig `json:"key_sigs,omitempty"` }
GetTCertBatchResponse is the return value of identity.GetTCertBatch
type GetTCertBatchResponse struct { ID *big.Int `json:"id"` TS time.Time `json:"ts"` Key []byte `json:"key"` TCerts []TCert `json:"tcerts"` }
GetTCertBatchResponseNet is the network response for a batch of transaction certificates
type GetTCertBatchResponseNet struct { GetTCertBatchResponse }
IdemixEnrollmentRequestNet is a request to enroll an identity and get idemix credential
type IdemixEnrollmentRequestNet struct { *idemix.CredRequest `json:"request"` CAName string `json:"caname"` }
IdentityInfo contains information about an identity
type IdentityInfo struct { ID string `json:"id"` Type string `json:"type"` Affiliation string `json:"affiliation"` Attributes []Attribute `json:"attrs" mapstructure:"attrs"` MaxEnrollments int `json:"max_enrollments" mapstructure:"max_enrollments"` }
IdentityResponse is the response from the any add/modify/remove identity call
type IdentityResponse struct { ID string `json:"id" skip:"true"` Type string `json:"type,omitempty"` Affiliation string `json:"affiliation"` Attributes []Attribute `json:"attrs,omitempty" mapstructure:"attrs"` MaxEnrollments int `json:"max_enrollments,omitempty" mapstructure:"max_enrollments"` Secret string `json:"secret,omitempty"` CAName string `json:"caname,omitempty"` }
KeySig is a public key, signature, and signature algorithm tuple
type KeySig struct { // Key is a public key Key []byte `json:"key"` // Sig is a signature over the PublicKey Sig []byte `json:"sig"` // Alg is the signature algorithm Alg string `json:"alg"` }
ModifyAffiliationRequest represents the request to modify an existing affiliation on the fabric-ca-server
type ModifyAffiliationRequest struct { Name string NewName string `json:"name"` Force bool `json:"force"` CAName string `json:"caname,omitempty"` }
ModifyAffiliationRequestNet is a network request for modifying an existing affiliation
type ModifyAffiliationRequestNet struct { ModifyAffiliationRequest }
ModifyIdentityRequest represents the request to modify an existing identity on the fabric-ca-server
type ModifyIdentityRequest struct { ID string `skip:"true"` Type string `json:"type" help:"Type of identity being registered (e.g. 'peer, app, user')"` Affiliation string `json:"affiliation" help:"The identity's affiliation"` Attributes []Attribute `mapstructure:"attrs" json:"attrs"` MaxEnrollments int `mapstructure:"max_enrollments" json:"max_enrollments" help:"The maximum number of times the secret can be reused to enroll"` Secret string `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity"` CAName string `json:"caname,omitempty" skip:"true"` }
ModifyIdentityRequestNet is a network request for modifying an existing identity
type ModifyIdentityRequestNet struct { ModifyIdentityRequest }
ReenrollmentRequest is a request to reenroll an identity. This is useful to renew a certificate before it has expired.
type ReenrollmentRequest struct { // Profile is the name of the signing profile to use in issuing the certificate Profile string `json:"profile,omitempty"` // Label is the label to use in HSM operations Label string `json:"label,omitempty"` // CSR is Certificate Signing Request info CSR *CSRInfo `json:"csr,omitempty"` // CAName is the name of the CA to connect to CAName string `json:"caname,omitempty" skip:"true"` // AttrReqs are requests for attributes to add to the certificate. // Each attribute is added only if the requestor owns the attribute. AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"` }
ReenrollmentRequestNet is a request to reenroll an identity. This is useful to renew a certificate before it has expired.
type ReenrollmentRequestNet struct { signer.SignRequest CAName string AttrReqs []*AttributeRequest `json:"attr_reqs,omitempty"` }
RegistrationRequest for a new identity
type RegistrationRequest struct { // Name is the unique name of the identity Name string `json:"id" help:"Unique name of the identity"` // Type of identity being registered (e.g. "peer, app, user") Type string `json:"type" def:"client" help:"Type of identity being registered (e.g. 'peer, app, user')"` // Secret is an optional password. If not specified, // a random secret is generated. In both cases, the secret // is returned in the RegistrationResponse. Secret string `json:"secret,omitempty" mask:"password" help:"The enrollment secret for the identity being registered"` // MaxEnrollments is the maximum number of times the secret can // be reused to enroll. MaxEnrollments int `json:"max_enrollments,omitempty" help:"The maximum number of times the secret can be reused to enroll (default CA's Max Enrollment)"` // is returned in the response. // The identity's affiliation. // For example, an affiliation of "org1.department1" associates the identity with "department1" in "org1". Affiliation string `json:"affiliation" help:"The identity's affiliation"` // Attributes associated with this identity Attributes []Attribute `json:"attrs,omitempty"` // CAName is the name of the CA to connect to CAName string `json:"caname,omitempty" skip:"true"` }
func (rr *RegistrationRequest) String() string
RegistrationRequestNet is the registration request for a new identity
type RegistrationRequestNet struct { RegistrationRequest }
RegistrationResponse is a registration response
type RegistrationResponse struct { // The secret returned from a successful registration response Secret string `json:"secret"` }
RegistrationResponseNet is a registration response
type RegistrationResponseNet struct { RegistrationResponse }
RemoveAffiliationRequest represents the request to remove an existing affiliation from the fabric-ca-server
type RemoveAffiliationRequest struct { Name string Force bool `json:"force"` CAName string `json:"caname,omitempty"` }
RemoveIdentityRequest represents the request to remove an existing identity from the fabric-ca-server
type RemoveIdentityRequest struct { ID string `skip:"true"` Force bool `json:"force"` CAName string `json:"caname,omitempty" skip:"true"` }
RevocationRequest is a revocation request for a single certificate or all certificates associated with an identity. To revoke a single certificate, both the Serial and AKI fields must be set; otherwise, to revoke all certificates and the identity associated with an enrollment ID, the Name field must be set to an existing enrollment ID. A RevocationRequest can only be performed by a user with the "hf.Revoker" attribute.
type RevocationRequest struct { // Name of the identity whose certificates should be revoked // If this field is omitted, then Serial and AKI must be specified. Name string `json:"id,omitempty" opt:"e" help:"Identity whose certificates should be revoked"` // Serial number of the certificate to be revoked // If this is omitted, then Name must be specified Serial string `json:"serial,omitempty" opt:"s" help:"Serial number of the certificate to be revoked"` // AKI (Authority Key Identifier) of the certificate to be revoked AKI string `json:"aki,omitempty" opt:"a" help:"AKI (Authority Key Identifier) of the certificate to be revoked"` // Reason is the reason for revocation. See https://godoc.org/golang.org/x/crypto/ocsp for // valid values. The default value is 0 (ocsp.Unspecified). Reason string `json:"reason,omitempty" opt:"r" help:"Reason for revocation"` // CAName is the name of the CA to connect to CAName string `json:"caname,omitempty" skip:"true"` // GenCRL specifies whether to generate a CRL GenCRL bool `def:"false" skip:"true" json:"gencrl,omitempty"` }
RevocationRequestNet is a revocation request which flows over the network to the fabric-ca server. To revoke a single certificate, both the Serial and AKI fields must be set; otherwise, to revoke all certificates and the identity associated with an enrollment ID, the Name field must be set to an existing enrollment ID. A RevocationRequest can only be performed by a user with the "hf.Revoker" attribute.
type RevocationRequestNet struct { RevocationRequest }
RevocationResponse represents response from the server for a revocation request
type RevocationResponse struct { // RevokedCerts is an array of certificates that were revoked RevokedCerts []RevokedCert // CRL is PEM-encoded certificate revocation list (CRL) that contains all unexpired revoked certificates CRL []byte }
RevokedCert represents a revoked certificate
type RevokedCert struct { // Serial number of the revoked certificate Serial string // AKI of the revoked certificate AKI string }
TCert encapsulates a signed transaction certificate and optionally a map of keys
type TCert struct { Cert []byte `json:"cert"` Keys map[string][]byte `json:"keys,omitempty"` //base64 encoded string as value }
TimeRange specifies a range of time
type TimeRange struct { StartTime string EndTime string }


A ridiculously light-weight function argument validator
``` var validate = require(“aproba”)
function myfunc(a, b, c) {
// a
must be a string, b
a number, c
a function
validate(‘SNF’, arguments) // [a,b,c] is also valid
}
myfunc(‘test’, 23, function () {}) // ok myfunc(123, 23, function () {}) // type error myfunc(‘test’, 23) // missing arg error myfunc(‘test’, 23, function () {}, true) // too many args error
```
Valid types are:
| type | description |
|---|---|
| * | matches any type |
| A | Array.isArray OR an arguments object |
| S | typeof == string |
| N | typeof == number |
| F | typeof == function |
| O | typeof == object and not type A and not type E |
| B | typeof == boolean |
| E | instanceof Error OR null (special: see below) |
| Z | == null |
Validation failures throw one of three exception types, distinguished by a
code
property of EMISSINGARG
, EINVALIDTYPE
or ETOOMANYARGS
.
If you pass in an invalid type then it will throw with a code of
EUNKNOWNTYPE
.
If an error argument is found and is not null then the remaining
arguments are optional. That is, if you say ESO
then that’s like using a
non-magical E
in: E|ESO|ZSO
.
You can provide more than one signature by separating them with pipes |
.
If any signature matches the arguments then they’ll be considered valid.
So for example, say you wanted to write a signature for
fs.createWriteStream
. The docs for it describe it thusly:
fs.createWriteStream(path[, options])
This would be a signature of SO|S
. That is, a string and and object, or
just a string.
 And options can be a string, that is:
path
To reproduce this you have to fully enumerate all of the possible
combinations and that implies a signature of SO|SS|OO|OS|S|O
. The
awkwardness is a feature: It reminds you of the complexity you’re adding to
your API when you do this sort of thing.
I wanted a very simple argument validator. It needed to do two things:
Be more concise and easier to use than assertions
Not encourage an infinite bikeshed of DSLs
This is why types are specified by a single character and there’s no such thing as an optional argument.
This is not intended to validate user data. This is specifically about asserting the interface of your functions.
If you need greater validation, I encourage you to write them by hand or look elsewhere.


2019 LA Auto Show: 2020 Audi S8 — BMW M760i Competitor
Arguably the most important car to debut at the 2019 LA Auto Show was the new Porsche Taycan 4S. We’ve all see the new Taycan …
by Nico DeMattiaIt seems like all cars in this uber-high-performance luxury car segment are just becoming gigantic, squishy, straight-line bullet trains. They’re all astonishingly quick but lack the sort of grace that used to make cars like the E38 BMW 7 Series and D2-generation Audi A8 so wonderful to drive. The all-new Audi S8 seems as if it wants to change all of that, though, and it just debuted in North America at the 2019 LA Auto Show.
The BMW M760Li is a good example of these cars becoming faster but less interesting to drive. Its monster V12 is incredibly powerful and makes the car very fast in a straight line. But its squishy suspension and asteroid-like curb weight push it further from the legendary E38-generation than ever before. The same can be said about the Mercedes-AMG S65. However, the all-new Audi S8 looks like it wants to do both.
Under its hood lies a 4.0 liter twin-turbocharged V8 that makes 591 hp and 590 lb-ft of torque. That’s about on par with the M760Li, just down a few ponies. However, the S8 is lighter, which is shocking because it’s still a very heavy car. Audi claims 0-60 mph in under four seconds but it’s likely closer to the low-three-second range.
What makes the Audi S8 more interesting is that the folks in Ingolstadt spent just as much time on developing new handling tech. Like the 7 Series and S-Class, the Audi S8 uses a system that checks the road ahead for bumps, so it can adjust accordingly, ahead of time. However, where the S8 differs from its competitors is that it actually uses an electromechanical suspension setup that utilizes electric motors to raise or lower the ride height on the fly and in milliseconds. So if it senses a bump ahead, it can actually adjust the ride height, as well as the firmness/softness, to cope. Clever stuff.
We were already impressed with the new Audi A8, which actually beat the 7 Series in a recent comparison test of ours. So we’re very interested to see what the Audi S8 has in store.


{% include 'herders/profile/compare/table.html' with title="Summary" data=crafts.summary %}
{% include 'herders/profile/compare/table.html' with title="Sets" data=crafts.sets %}
{% include 'herders/profile/compare/table.html' with title="Stats" data=crafts.stat %}
{% include 'herders/profile/compare/table.html' with title="Quality" data=crafts.quality %}


Pianpian Adelson is an Associate at Ares Management, which is a global alternatives asset manager, in the Credit Group’s Product Management and Investor Relations team. Her team is responsible for managing all fundraising efforts and working with investors for the direct lending strategy. Prior to that, she was an investment banking analyst at Goldman Sachs and an associate at EQT Partners. Pianpian graduated from Duke University in 2014 with a Bachelor of Science in Economics with the Finance Concentration and a minor in Neuroscience. During her time in BOW, she served as the Executive Vice President, and as an alumna, she helped start BOW’s Alumni Ambassadors program. She currently serves as one of the ambassadors for New York City.
How did your BOW experience and being on the Executive Board influence where you are now?
Joining BOW was one of the best decisions I made at Duke because it gave me such a broad network of friends and mentors. During sophomore year, I was a pre-med student but knew that it wasn’t my passion; I was more interested in finance. Making the transition was a daunting thing to navigate, but my BOW mentors provided every resource and coached me through the process, from course selection to landing an internship. It paved the path for starting my career in finance. In senior year, I wanted to give back to BOW by mentoring other students and served as the EVP. The experience taught me management responsibilities and honed my organizational skills, which are extremely valuable for the corporate world after college. BOW also showed me the strength of women empowering each other. I learned so many practical skills from BOW events specifically catered towards women in the business world.
Why did you originally pick investment banking, and what was the most valuable thing you learned from your banking experience?
I picked investment banking because I wanted to develop a foundation of corporate finance in a dynamic environment by executing transactions for large companies in a team setting. I also thought banking at Goldman would give me the opportunity to learn from a network of professionals in the industry.
The most valuable thing I learned from banking is to embrace my strengths. While I enjoyed many aspects of the job, it wasn’t a long-term fit because it didn’t leverage my key skill of managing relationships. Staying in finance felt like the safer choice, and I was worried about not having the option of returning, but I decided to be open minded and take a leap. I explored opportunities in strategy and investor relations, and it immediately felt like the right fit. I haven’t looked back ever since. It’s important to self-reflect and be honest with yourself, and choose a career that fits you, not one that you think you should have or one that you must change yourself for.
What traits do you think the most successful summer interns possess?
Being proactive and having a good attitude are incredibly important. Most interns don’t have a ton of experience and are there to learn. People want to help, so don’t hesitate to reach out with questions, but be thoughtful and always try to figure out/think through them before doing so. Don’t be afraid to voice ideas and opinions if you support them with reasoning – it’s a great way to learn and people will appreciate the effort.
How has mentorship factored into your career path?
Mentorship has always been important for me. Whenever I face big decisions in professional or personal spheres, I have always reached out for support and advice from my mentors and friends. It’s also important to find strong mentors who inspire you and motivate you to become the person who you want to be.
What is your #1 interview tip?
Always be prepared. Do your research on the company and the team so you are well-informed and can clearly articulate why you are the right choice for the opportunity. Don’t ask questions that can be easily found on the website, and don’t be afraid to show your personality.
What is something you’re trying to learn right now?
I’m trying to learn to be more comfortable with taking risks and to second-guess myself less. At Duke and even in banking, everything was very structured with a clear path forward, but I realized in life you can only achieve your goals by taking risks. Every successful person has taken risks and failed – you just need to learn from your mistakes.
What do you like to do in your free time?
One of my favorite things to do is travel, especially to different countries with vastly different cultures and histories. I also like to go to yoga classes (especially hot yoga) a few times a week – it really helps me stay balanced, especially during stressful times. I’ve always loved to read because every book can teach you something and help you see things from a different perspective. Other things I like to do in my free time include cooking, attending ballets/Broadway shows, and simply exploring New York.
What is one piece of advice you would like to pass on to BOW members just starting their careers?
Never underestimate the value in building relationships and strengthening your network. You never know what opportunities may emerge from grabbing a coffee with a coworker, old friend or an acquaintance in the community. When I first joined Goldman, I didn’t think senior bankers would have the time to get coffee with me, but people were very receptive, especially if there is an affinity (e.g. alums of Duke or the women’s network). Don’t be afraid to reach out and put yourself out there – you will be pleasantly surprised how willing people are to sharing insights. At the same time, try to embrace every opportunity to give back or help others in need.


The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. --Edsger Dijkstra [source]


Toggle navigation
{ Let's talk about... }
Forum
All
JavaScript
Java
PHP
C#
Ask
Search
Login
Register
Logout


Ocean [au16], ocean, in The Outer Sea ------------------------------------------------------------------------ Routes leaving Ocean: North, to Ocean [at16], 6 days East, plain, to Open Pampas [au17], Mandoria, 2 days South, plain, to Open Pampas [av16], Mandoria, 2 days West, to Ocean [au15], 6 days


public class Unit
extends java.lang.Object
| Constructor and Description |
|---|
Unit(double sc,
Players o,
int[][] s)
This is for pieces that are unknown to the AI.
|
Unit(int s,
java.lang.String n,
java.lang.String c,
Players o,
double sc,
PieceType t)
This is for pieces that are known and are owned by either the Player
or the AI.
|
Unit(Players o)
This is for pieces owned by the Lake.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getAmount(PieceType p)
Returns the amount used to calculate the score of a certain type.
|
java.lang.String |
getCharacter()
Returns the character of the Unit that will be printed on the board.
|
boolean |
getHasMoved()
Returns whether or not the Unit has moved.
|
java.lang.String |
getName()
Returns the name of the Unit.
|
Players |
getOwner()
Returns the owner of the Unit.
|
boolean |
getPlaced()
Returns whether or not the Unit was placed.
|
double |
getScore()
Returns the score of the Unit.
|
int |
getScore(PieceType p)
Returns the score of a certain type.
|
int |
getStrength()
Returns the strength of the Unit.
|
PieceType |
getType()
Returns the type of the Unit.
|
void |
moved()
Sets hasMoved to true, then lets the AI know that the
Unit is not a bomb or a flag.
|
void |
predictStrength()
Predicts the strength of the Unit based on where its
theoretical score falls.
|
void |
reCalculateScore()
Recalculates the theoretical score of the Unit based on statistics.
|
void |
setAmount(int s,
PieceType p)
Modifies the amount statistic for all the values of the given type.
|
void |
setPlaced(boolean p)
Sets placed.
|
void |
setScore(double s)
Sets the score of the Unit.
|
void |
setScore(int s,
PieceType p)
Modifies the score statistic for all the values of the given type.
|
public Unit(int s, java.lang.String n, java.lang.String c, Players o, double sc, PieceType t)
s
- The strength of the Unit.n
- The name of the Unit.c
- The character that will be printed on the board.o
- The owner of the Unit.sc
- The score of the Unit.t
- The type of the Unit.public Unit(double sc, Players o, int[][] s)
sc
- The score of the Unito
- The owner of the Units
- A 2D array containing various statistics used to predict what the Unit is.public Unit(Players o)
o
- The owner of the Unitpublic java.lang.String getName()
public int getStrength()
public Players getOwner()
public java.lang.String getCharacter()
public boolean getPlaced()
public void setPlaced(boolean p)
p
- True, the Unit was placed, otherwise false.public void setScore(double s)
s
- The score of the Unit.public void setScore(int s, PieceType p)
s
- The score of the Type.p
- The type to be changed.public void setAmount(int s, PieceType p)
s
- The amount of the Type.p
- The type to be changed.public int getAmount(PieceType p)
p
- The type in question.public void reCalculateScore()
public void predictStrength()
public double getScore()
public int getScore(PieceType p)
p
- The given type.public PieceType getType()
public boolean getHasMoved()
public void moved()


--- layout: post title: 单词本：蔬菜之洋葱 categories: [language] tags: [English] ---
洋葱应该也算是一种葱吧。小香葱叫 chives，大葱叫 leek，而洋葱却叫 onion，作为中国人，我觉得很恼火，为什么他们要给不同的葱取那么多不同的名字呢？
其实有时候觉得法语德语的词性还是很讨厌的，法语有阴阳性，而德语居然还有中性。更麻烦的是，德语法语中同样的东西还可能不同性。比如洋葱，德语里是阴性，而法语里却是阳性。
到底还是邻国日韩的文字的感觉更熟悉些。日语洋葱叫玉葱（たまねぎ，tamanegi）(jp)，我记得日语鸡蛋叫玉子 (たまご，tamago)(ja)，所以，是不是可以推断日本人管白色的东西叫玉呢？而朝鲜语叫 양파（yangpa）(ko)，파：葱。看来和我们一样，洋葱是从西洋引进的，所以都叫洋葱。
另外，我找到了关于洋葱的 40 个事实：
- Onions are vegetables
- Onions are edible
- They make you cry…
- They make good dip
- Onions grow underground
- They taste bad raw
- They give you bad breath
- Onions come in 3 designer colours (red yellow and white)
- They can predict the weather in winter
- They go good in a BBQ
- They are not sweet
- Onions have layers
- If you chew gum while cooking them you wont cry
- They are about 30 calories
- They can be sliced, chopped and diced
- Onions are shallot‘s cousin
- They can be pickled
- Onions are like ogres
- They can be peeled
- They are highly water based
- Onion breath can be cured with some parsley
- Onion in Japanese is onion
- If you leave them out in the sun for too long they start to grow roots
- They are eaten heaps in Libya
- The heaviest onion was 10 pounds and 14 ounces
- Onions don’t grow on the moon
- Onion spelled backwards is noinO
- They are not like cakes
- Onion is pronounced UN-YIN
- If onion was a number it would be 151491514
- An onion can make a bland sauce
- Onions has 3 vowels
- Onions have skins
- Onions don’t like garlic
- there are nice deep fried as rings
- Onion rhymes with bunion
- Onions make really bad gifts…
- Alliumphobia is the fear of smelling onion and garlic
- Onions wont stop vampires…
- Onions should NEVER be juiced
形容某人在某一方面很在行：
那么问题又来了，为什么“知道自己的洋葱”是很在行的意思呢？根据我的调查，是因为一百多年前，有一个叫 Charles Talbut Onions 的人，他参与了牛津英语词典（Oxford English Dictionary）编撰，是位单词专家，后来不知道为什么就有 to know one's onions 的说法，用来形容某人在某一行业很在行的意思。欲知详情，请点击附录链接阅读。
精心照顾某人。把某人放到小洋葱里（层层呵护）？法国人的浪漫气息体现在在日常生活中啊。
管好自己的事情。管好自己的洋葱？Mind your own business.
这次学习了洋葱的英法德写法，并且尝试性的扩展到了日韩的单词学习。感觉有点心有余而力不足啊……
I feel that, in vacabulary study, I am not the one who knows his onions, but I will try to learn as many as possible.


Popular Areas in do trojan condoms work
How Trojan Condoms Are Made [PHOTOS] - Business Insider
Mar 28, 2012 . So how does a massive condom maker like Trojan churn out more than one million condoms every day and ship them all around the world?
http://www.businessinsider.com/how-trojan-condoms-are-made-photos-2012-3?op=1
Trojan Ultra Thin Lubricated Condoms Reviews - Undercover ...
Customer Reviews for Trojan Ultra Thin Lubricated Condoms . My boyfriend can 't get enough of these condoms. Feels like he has . Keep up the good work.
http://www.undercovercondoms.com/readuserreview.asp?ID=23
Do Climax Control Condoms Work? - Climax ... - Condom Jungle
Do product like climax control condoms really work? We wanted to know what our customers think about climax control products (Durex Performax, Trojan .
http://www.condomjungle.com/do-climax-control-condoms-work-climax-control-condom-review-a/280.html
Trojancondoms.com - Tips and News - FAQs
Do latex condoms work to protect me from STDs and pregnancy? YES.  These did what a condom is supposed to do and the very wet lubricant on the tip made it easier to .
http://www.undercovercondoms.com/readuserreview.asp?ID=3
20 People Freaked Out by Spotify's Holiday Condom Ads
Dec 26, 2012 . Trojan condoms ads on Spotify are making some listeners feel really . During work, I heard one of the Trojan ads sandwiched between Taylor Swift's "We . do keep in mind that they're running a lot of Trojan ads right now.
http://mashable.com/2012/12/26/spotify-trojan-condom-ad-commerical/


FAILING IS LEARNING
Pick yourself up, dust yourself off, and start again.
ok
FLOWERS AND RAINBOWS
Always be yourself, unless you can be a unicorn.
ok
THE COUCH
If you want to grow, get outside your comfort zone.
ok


--- layout: root menuitem: Call for Papers author: Editor title: 'Call for Papers' subtitle: 'Call for Papers' description: "tweetable description for metadata." category: meta meta_image: "assets/img/filename.gif" ---
put in your CFPs here


Privacy Policy
The J. Paul Getty Trust is committed to protecting your privacy. We do not collect your personal information, such as your name, mailing address, or e-mail address, unless you knowingly provide it to us.
Most pages of our Web site contain a link to this privacy policy, which describes what information we collect and how we use it. By using the Getty's Web site or communicating with us by e-mail, you agree to the terms and conditions of this privacy policy.
General Policy on Collection of Information
We only collect personally identifiable information if you knowingly provide it to us.
We may record your e-mail address if you e-mail us, submit an online form that contains your e-mail address, opt to receive e-mail notices of Getty programs, news, and events, or register for an online service such as Getty Bookmarks or the Teacher Art Exchange discussion board.
We will never share your e-mail address with anyone.
Our Web server automatically records the IP addresses of visitors to our site. This information is used in aggregate form to helps us understand how visitors use the Getty online environment. The servers at this site also collect connection-related technical data. The data entries in these logs are used for server and network operation and maintenance and to help us understand general usage patterns.
Blogs
The Getty provides blogs on this site. You are welcome to post comments to these blogs. You may post comments anonymously or under your name or alias. Names and aliases are publicly displayed. We do not sell or share commenters' names or e-mail addresses; we do save commenters' e-mail addresses and will use them only to contact you if we have questions about or direct replies to the contents of your comments.
E-Cards
Some pages on this site allow you to send free e-cards to a friend. E-cards are sent as links to a Getty.edu Web page. We do not sell or share senders' or recipients' names or e-mail addresses; we do save e-mail addresses and we will use them only to contact you if necessary.
E-Newsletters
The Getty offers free electronic newsletters sent via e-mail.
To receive an e-newsletter by e-mail, you need to submit your name, zip code, and email address. Your personal information is stored on secure servers. When you sign up, you can choose to receive the e-newsletters in HTML, which includes graphics, or as text only, which does not include graphics.
You can view the e-Getty newsletter online, without submitting your e-mail address, at http://www.getty.edu/egetty/e-getty.html.
You can view GRI e-News online, without submitting your e-mail address, at http://www.getty.edu/egetty/grievents/index.html.
You can view GCI e-Bulletin online, without submitting your e-mail address, at http://www.getty.edu/conservation/publications/bulletin/current.html.
You can view Exploring Antiquity online, without submitting your e-mail address, at http://www.getty.edu/egetty/villa/index.html.
You can view the Getty Teacher Update newsletter online, without submitting your e-mail address, at http://www.getty.edu/egetty/getty_teacher_update/getty_teacher_update.html.
You can view Getty Foundation News online, without submitting your e-mail address, at http://www.getty.edu/foundation/news/foundation_news/current.html.
You can view ArtBound: New Books from the Getty online, without submitting your e-mail address, at http://www.getty.edu/museum/publications/art_bound/current.html.
You may stop receiving e-newsletters at any time. Follow the "unsubscribe" link in the footer of any newsletter.
Getty Bookmarks
To use the Getty Bookmark feature, you need to create an online account. Your e-mail address is used to identify your account and the associated bookmarks. The e-mail address tied to your account is stored on secure Getty servers and will not be used for marketing purposes or shared with anyone. We may occasionally use your e-mail address for purposes related to administration of your online account, such as sending service notices or password reminders.
We use cookies to administer your online account(s). However, we do not use cookies to collect personally identifiable information.
If you choose to e-mail Getty Bookmarks to a friend, we will ask you for your friend's e-mail address. We will automatically send your friend a one-time e-mail containing your bookmarks, but we will not store his or her e-mail address or use it for any other purpose.
You may review or change the password(s) for your online account(s) at any time. Log in to Getty Bookmarks and click "Edit Profile" to choose a new password.
You may contact us at<EMAIL_ADDRESS>to request that we remove your e-mail address from our database.
Planning a School Visit
To request a school visit to the Getty, you must submit information about yourself, your school, and the nature of your visit request. This information is used to help us accommodate school visit requests as equitably as possible. The information is recorded and stored in a database by our Education Department and may be used to contact you. We periodically send information to schools and teachers to notify them of additions to our Web site and of new educational programs at the Getty.
If you no longer wish to receive mailings from the Education Department, please call the school line at<PHONE_NUMBER>.
TeacherArtExchange Listserv
To use the TeacherArtExchange listserv on this site, you need to create an online account. Your e-mail address is used to identify your account. We will not use your e-mail for marketing purposes or share it with anyone.
The TeacherArtExchange listserv takes place primarily over e-mail. Messages are also archived to our Web site, where they are available in perpetuity. As a subscriber to TeacherArtExchange, you can choose how often you wish to receive e-mail messages from other subscribers.
We may occasionally send you e-mail for purposes related to administration of your online account, such as sending service notices or password reminders.
Please note that information you submit to the TeacherArtExchange listserv is nonconfidential and nonproprietary. TeacherArtExchange is also an unmoderated list. This means that no one reads or edits the e-mail messages sent to TeacherArtExchange before they are distributed to subscribers and archived to our Web site. To protect your privacy, do not send any message to the TeacherArtExchange listserv that contains personally identifiable information such as your name, mailing address, or phone number. Please be advised that your e-mail client may send your username to our list along with your e-mail address. If you wish to remain anonymous, please make sure your e-mail username is not your actual name.
You can unsubscribe from TeacherArtExchange at any time.
Cookies and Pixel Tags
A cookie is a piece of data we store on your computer's hard drive. This data contains information about you that we use to help make your visit to the Getty website easier. For example, one cookie we may store can remember what kind of video capability you have selected, so that you do not have to choose a bandwidth every time you watch a video. In addition, we have authorized various reputable companies to help us track cookies so that we can analyze how people are using the Getty website in order to continually offer the best possible experience for our visitors. Pixel tags are small pieces of code that may place cookies or provide non personally-identifiable information such as IP address, time of website visit, or browser used.
In addition, the Getty engages third-party service providers who use cookies and pixel tags on our behalf. See "Third-Party Service Providers," below.
Neither the Getty nor any of the companies we work with will collect personally-identifiable information using cookies or pixel tags.
You do not have to accept any Getty cookies to enjoy and use the Getty website; if you reject all Getty cookies you will simply have to re-enter the preferences that we would otherwise record for you.
Your iOS or Android device may provide a "Limit Ad Tracking" or "Opt out of interest-based advertising" setting that you can enable if you would like to limit ad tracking from pixel tags on mobile devices.
Third-Party Service Providers
The Getty engages reputable third-party vendors in order to help us manage the Getty website and mobile applications, process transactions, better respond to the needs of our visitors, and enhance our marketing efforts. This includes third-party e-commerce service providers who collect personal information necessary to process transactions, and may use the collected information to improve the services they provide. It also includes third-party marketing partners who serve advertisements across the Internet and sometimes on the Getty website and mobile applications on the Museum's behalf. These marketing partners may use information about your visits to the Getty website and mobile applications and other sites to personalize advertisements.
Links to Other Web Sites
This Web site contains links to other sites that are not owned or controlled by the Getty. We are not responsible for the content or privacy practices of other sites. This privacy statement applies only to this Web site.
Children Under 13 Years of Age
The Getty's Web site is not specifically dedicated to children and we do not actively solicit information from children. Children age 12 or under are required to obtain permission from a parent or guardian before submitting information to this Web site.
Changes in This Privacy Statement
We reserve the right to modify this privacy statement at any time. Please visit this page periodically to check our current policy.
Contact Us
If you have any questions or suggestions regarding our privacy policy, please contact us at<EMAIL_ADDRESS>Effective Date: June 30, 2011


Un entretien ?
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.
Go to space for free using the code gotospace.


class OpenSSL::ASN1::Primitive
The parent class for all primitive encodings. Attributes are the same as
for ASN1Data, with the addition of
tagging
. Primitive values can
never be infinite length encodings, thus it is not possible to set the
infinite_length
attribute for Primitive and its sub-classes.
Primitive sub-classes and their mapping to Ruby classes¶ ↑
-
OpenSSL::ASN1::EndOfContent <=>
value
is alwaysnil
-
OpenSSL::ASN1::Boolean <=>
value
is aBoolean
-
OpenSSL::ASN1::Integer <=>
value
is aNumber
-
OpenSSL::ASN1::BitString <=>
value
is aString
-
OpenSSL::ASN1::OctetString <=>
value
is aString
-
OpenSSL::ASN1::Null <=>
value
is alwaysnil
-
OpenSSL::ASN1::Object <=>
value
is aString
-
OpenSSL::ASN1::Enumerated <=>
value
is aNumber
-
OpenSSL::ASN1::UTF8String <=>
value
is aString
-
OpenSSL::ASN1::NumericString <=>
value
is aString
-
OpenSSL::ASN1::PrintableString <=>
value
is aString
-
OpenSSL::ASN1::T61String <=>
value
is aString
-
OpenSSL::ASN1::VideotexString <=>
value
is aString
-
OpenSSL::ASN1::IA5String <=>
value
is aString
-
OpenSSL::ASN1::UTCTime <=>
value
is aTime
-
OpenSSL::ASN1::GeneralizedTime <=>
value
is aTime
-
OpenSSL::ASN1::GraphicString <=>
value
is aString
-
OpenSSL::ASN1::ISO64String <=>
value
is aString
-
OpenSSL::ASN1::GeneralString <=>
value
is aString
-
OpenSSL::ASN1::UniversalString <=>
value
is aString
-
OpenSSL::ASN1::BMPString <=>
value
is aString
OpenSSL::ASN1::BitString¶ ↑
Additional attributes¶ ↑
unused_bits
: if the underlying BIT STRING's length is a
multiple of 8 then unused_bits
is 0. Otherwise
unused_bits
indicates the number of bits that are to be
ignored in the final octet of the BitString
's
value
.
OpenSSL::ASN1::ObjectId¶ ↑
NOTE: While ::new will allocate a new ObjectId, it is not typically allocated this way, but rather that are received from parsed ASN1 encodings.
Additional attributes¶ ↑
-
sn
: the short name as defined in <openssl/objects.h>. -
ln
: the long name as defined in <openssl/objects.h>. -
oid
: the object identifier as aString
, e.g. “<IP_ADDRESS>.5” -
short_name
: alias forsn
. -
long_name
: alias forln
.
Examples¶ ↑
With the Exception of
OpenSSL::ASN1::EndOfContent, each Primitive
class constructor takes at least one parameter, the value
.
Creating EndOfContent¶ ↑
eoc = OpenSSL::ASN1::EndOfContent.new
Creating any other Primitive¶ ↑
prim = <class>.new(value) # <class> being one of the sub-classes except EndOfContent prim_zero_tagged_implicit = <class>.new(value, 0, :IMPLICIT) prim_zero_tagged_explicit = <class>.new(value, 0, :EXPLICIT)
Attributes
May be used as a hint for encoding a value either implicitly or explicitly
by setting it either to :IMPLICIT
or to
:EXPLICIT
. tagging
is not set when a ASN.1
structure is parsed using OpenSSL::ASN1.decode.
Public Class Methods
value
: is mandatory.
tag
: optional, may be specified for tagged values. If no
tag
is specified, the UNIVERSAL tag corresponding to the Primitive sub-class is used by default.
tagging
: may be used as an encoding hint to encode a value
either explicitly or implicitly, see ASN1 for
possible values.
tag_class
: if tag
and tagging
are
nil
then this is set to :UNIVERSAL
by default. If
either tag
or tagging
are set then
:CONTEXT_SPECIFIC
is used as the default. For possible values
please cf. ASN1.
Example¶ ↑
int = OpenSSL::ASN1::Integer.new(42) zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :IMPLICIT) private_explicit_zero_tagged_int = OpenSSL::ASN1::Integer.new(42, 0, :EXPLICIT, :PRIVATE)
static VALUE ossl_asn1_initialize(int argc, VALUE *argv, VALUE self) { VALUE value, tag, tagging, tag_class; rb_scan_args(argc, argv, "13", &value, &tag, &tagging, &tag_class); if(argc > 1){ if(NIL_P(tag)) ossl_raise(eASN1Error, "must specify tag number"); if(!NIL_P(tagging) && !SYMBOL_P(tagging)) ossl_raise(eASN1Error, "invalid tagging method"); if(NIL_P(tag_class)) { if (NIL_P(tagging)) tag_class = sym_UNIVERSAL; else tag_class = sym_CONTEXT_SPECIFIC; } if(!SYMBOL_P(tag_class)) ossl_raise(eASN1Error, "invalid tag class"); if (tagging == sym_IMPLICIT && NUM2INT(tag) > 31) ossl_raise(eASN1Error, "tag number for Universal too large"); } else{ tag = INT2NUM(ossl_asn1_default_tag(self)); tagging = Qnil; tag_class = sym_UNIVERSAL; } ossl_asn1_set_tag(self, tag); ossl_asn1_set_value(self, value); ossl_asn1_set_tagging(self, tagging); ossl_asn1_set_tag_class(self, tag_class); ossl_asn1_set_infinite_length(self, Qfalse); return self; }
Public Instance Methods
See OpenSSL::ASN1::ASN1Data#to_der for details. *
static VALUE ossl_asn1prim_to_der(VALUE self) { ASN1_TYPE *asn1; int tn, tc, explicit; long len, reallen; unsigned char *buf, *p; VALUE str; tn = NUM2INT(ossl_asn1_get_tag(self)); tc = ossl_asn1_tag_class(self); explicit = ossl_asn1_is_explicit(self); asn1 = ossl_asn1_get_asn1type(self); len = ASN1_object_size(1, i2d_ASN1_TYPE(asn1, NULL), tn); if(!(buf = OPENSSL_malloc(len))){ ASN1_TYPE_free(asn1); ossl_raise(eASN1Error, "cannot alloc buffer"); } p = buf; if (tc == V_ASN1_UNIVERSAL) { i2d_ASN1_TYPE(asn1, &p); } else if (explicit) { ASN1_put_object(&p, 1, i2d_ASN1_TYPE(asn1, NULL), tn, tc); i2d_ASN1_TYPE(asn1, &p); } else { i2d_ASN1_TYPE(asn1, &p); *buf = tc | tn | (*buf & V_ASN1_CONSTRUCTED); } ASN1_TYPE_free(asn1); reallen = p - buf; assert(reallen <= len); str = ossl_buf2str((char *)buf, rb_long2int(reallen)); /* buf will be free in ossl_buf2str */ return str; }


(Team Submission)
{{ detailProblem.description }}
{{ detailProblem.sampleInput }}
{{ detailProblem.sampleOutput }}


Hi, my name is Isaac Staugaard. I'm a software developer who received my B.S. in Computer Science from University of California at Santa Barbara in 2017.
I am currently looking for work in either San Francisco, CA, or Santa Monica, CA.
Created a personal website using HTML, CSS, and JavaScript. Took about 1 week from knowing nothing to up-and-running. Currently adding new features for personal use.
A course project for my scientific and mathematical algorithms course. We had to make an algorithm using smooth diffusion to restore a photo to it's original quality by removing the noise.
An iOS application coded with Objective C, and using Parse for the backend. A simple, swiping-based free-for-sale application to make it easier for UCSB students to buy and sell books and clothes. Won 3rd place.
A course project to implement a virtual operating system over the course of 2 months. Worked with one classmate to implement everything including schedulers, threads, memory allocation, and kernel programming


| Toggle between circle and bar |
Click on protein |
| Zoom |
Mouse wheel |
| Pan |
Click and drag on background |
| Move protein |
Click and drag on protein |
| Expand bar |
Shift_left-click on protein |
| Rotate bar |
Hover over end of bar; drag handle |
| Hide/show protein (and links to it) |
Right-click on protein |
| Hide/show links between proteins |
Right click on link |
| Flip side for self-links |
Right-click on self-link |
Tip: To change the size of proteins in relation to the size of
the page press Ctrl/- or Ctrl/+.
(This zooms the browser, on a Mac its Cmd/- or Cmd/+.)


Toggle navigation
GitHub
Restaurant and Food Discovery Using Yelp and Google Places Reviews
Data Intensive Computing - Team 2
Search Food
Search Restaurant
Logs
Debug


David Heinemeier Hansson has some comments related to the Snakes and Rubies event. I have more I want to say in reaction to that post, and specifically to his comparison of Django models and Rails models. But I thought I'd at least start with a simple discussion of what can be done in Python. This is his Rails example:
class Person < ActiveRecord::Base belongs_to :project_manager has_many :milestones has_and_belongs_to_many :categories end
How do you implement this in Python? Here's the Django syntax:
class Project(meta.Model): project_manager = meta.ForeignKey(ProjectManager) milestones = meta.OneToManyField(Milestone) categories = meta.ManyToManyField(Category)
Here's the SQLObject syntax:
class Project(SQLObject): project_manager = ForeignKey('ProjectManager') milestones = MultipleJoin('Milestone') categories = RelatedJoin('Category')
To me they all look pretty similar. So maybe it's not such a good example. But anyway, here would be the direct syntactic port of ActiveRecord:
class Person(ActiveRecord): belongs_to('project_manager') has_many('milestones') has_and_belongs_to_many('categories')
This is quite hard to implement in Python. There's only two cases I know of that implement kind of function in a class body -- implements() and advise() in Zope and PEAK respectively. Doing this involves deep tricks, including putting the interpreter temporarily into trace mode and changing metaclasses around.
But it's still hard because belongs_to() in Python won't get the class as an argument (as it does in Ruby, as an implicit self aka @). And it's yet harder because the class doesn't exist; classes in Python only come into existance after their bodies are evaluated.
So the semantic (not syntactic) equivalent of the ActiveRecord code would be:
class Person(ActiveRecord): pass Person.belongs_to('project_manager') Person.has_many('milestones') Person.has_and_belongs_to_many('categories')
I think there are some Python ORMs that look like this. Basically you are running some class methods, and those methods modify the class. This is not complicated in Python at all, but admittedly it doesn't look as pretty. Some people have proposed that decorators should be allowed on classes, at which point this might look like:
@belongs_to('project_manager') @has_many('milestones') @has_and_belongs_to_many('categories') class Person(ActiveRecord): pass
A minor change here is that belongs_to and friends will probably not be in the ActiveRecord class. Also, I think if anything this looks worse than the last example (which unlike this one actually works). Now I think I'm -1 on class decorators.
Of course, neither SQLObject nor Django use these techniques. They use attributes to store these relations, because in Python the only easy annotations you can make on a class are with attributes. Everything else gets thrown away.
Attributes can be somewhat magic, but there is a limit in Python. That limit is what descriptors can do, and basically descriptors can respond to attribute access. They can't tell the class that they exist (until someone tries to access them), they never know what attribute name they are bound to, and they don't know what class they are bound to until they are accessed. In ORMs this causes some problems, because classes really want to know what columns they have, and columns want to know what name they were given.
Some systems use a model that's just a bunch of dead data, until a compilation phase that turns it into Python source code. MiddleKit does that; Django used to do that but doesn't anymore.
Other systems, SQLObject and now Django, use metaclasses. Metaclasses can be magic, but they aren't magic here. With a metaclass you can trigger some code to be run everytime a class with that metaclass is created (and subclasses inherit the superclass's metaclass).
In effect, it's like:
class Person(ActiveRecord): project_manager = belongs_to milestones = has_many categories = has_and_belongs_to_many # Implicitly: Person.setup_everything()
Where setup_everything looks at all the attributes for "magic" attributes, and lets those attributes modify the class.
SQLObject doesn't work quite like this, but it's moving that way. Now SQLObject uses a simple metaclass with a class method __classinit__ that takes the place of setup_everything. It's also (in the svn trunk) starting to use a convention for those magic attributes. Up until now SQLObject just knew that *Col values were columns. And then joins and indexes were also added. I don't want to add any more new things, so I've made __classinit__ look for any new attributes with a method to call like __addtoclass__(cls, attr_name), and the attribute can in turn modify the class however it chooses. I'd rather it not modify the class too much, but it's necessary at times. The other thing that's come up is that this all gets hairy with subclassing (and probably does in Ruby too), and I've found events to be important. But they are also more complicated than they should be just to fix things up on subclassing.
But anyway, in the end Python can be pretty much like that ActiveRecord example, except just slightly inverted, and using a superclass that supports that kind of programming. I would like for those specific techniques to become more widespread and idiomatic, and even better for us all to agree on some simple conventions. But there's no dramatic differences here from Ruby, just like similar original sources make clear.
Update: there's another technique for ActiveRecord-like functions which I hadn't thought of; since it showed up three times in the comments, clearly it needs acknowledgement: a Django experiment (wasn't actually applied to the codebase), and two examples with a mockup of the sort of code you'd write.
To summarize these, they involve having the belongs_to function (and any similar functions like has_many) saving an object to some global variable. Then when the class is actually created, it uses a metaclass to pull out any values it finds in that global variable and applies them to the class.
This is distinct from Zope's implements() (and PEAK's advise()) which can operate on any class. It's this ability to apply a function to a class that was not specifically designed for such application that makes it unique (and hard to implement). But with some cooperation from the class it is not hard to implement. Of course, it's a little funny that these two are equivalent using these recipes:
belongs_to('project_manager') class Person(ActiveRecord): pass
and:
class Person(ActiveRecord): belongs_to('project_manager')
But oh well.
The "attribute creation without assignment" thing (like the implements() and advise() examples you brought up) was considered for Django, but we ended up deciding it was too much magic and could confuse experienced Python programmers. Check out http://code.djangoproject.com/attachment/ticket/122/proof_of_concept.py for the proof-of-concept implementation by Robin Munn, if only because it's an interesting hack. :)
Pretty interesting. I'm working on some django stuff atm, and I have ended up using events (cheesy homegrown atm) and making the attributes do most of the work as well. So I think django and sqlobject will continue to be pretty similar...
I'd use syntax like this:
class Project(ActiveRecord): _db_attributes = dict( project_manager = meta.ForeignKey(ProjectManager), milestones = meta.OneToManyField(Milestone), categories = meta.ManyToManyField(Category))This makes the job of the metaclass slightly easier (and quite a bit more efficient) and satisfies EIBTI.
>EIBTI Nice DETLA. ;)
I think one of the key differences the snakes&rubies brought out was David's (and by extension, Ruby's) love of DomainSpecificLanguages. Which seems to be a hot item these days, and as David says in the post you linked to about the event, not a focus of as much interest or support in Python.
And part of the reason for that is highlighted in the Magic & Backtracking post: backtracking and clear indication of where something came from (via namespaces etc). I'm not saying Ruby doesn't do this nicely (I have no idea), but DSLs of the ruby-style in python seem to require metaprogramming monkeying, which immediately feels "unpythonic". But I'm not convinced that the ActiveRecord DSL is the only sane one for representing Database models.
Say we rename "ForeignKey->Is_A", "OneToMany->Are_Many" "ManyToMany->Is_Many_And_Are_Many", ignoring the awkward is_a inheritance meaning. Now, in the case where we actually have to specify the class that a column maps to:
Only slightly tortured English:
A Project belongs to a project manager who is a Person. A Project's projectManager is a Person A Project has many Milestones which are (of) Milestone. A Project's milestones are many (of) Milestone.(I personally think ManyToMany breaks down in both cases, because in both cases we are really specifying the attribute for this class to access via: I would rather specify just "Many" on both sides.):
A Project has many and belongs to many categories which are (of) Category A Project's categories are many (of) Category (and by the way, a Category's projects are many (of) Project Rails: Project belongs_to a projectManager (class Person) SQLObject: Project projectManager IsA Person Rails: Project has_many milestones (class Milestone). SQLObject: Project milestones Are_Many Milestone... (getting off track, leaving it in here to show my train of thought)
At which point Rails people will scream DRY, and I'll probably agree, so allow the class to be derived from the name.
Ok, so basically I'm saying with python we're stuck with parentheses and attributes. And because of attributes, we're somewhat stuck with = being our verb. But that just means our language for models is different:
class Project(SQLObject): projectManager = A(Person) milestones = Many() # explicitly: Many(Milestone) categories = ManyAndMany() # again, from the Project side I'd ideally like if this was just Many()(ie, to some extent we're getting pulled into a debate constrained by ActiveRecord's words in their DSL for models.)
# Luke Opperman
That limit is what descriptors can do, and basically descriptors can respond to attribute access. They can't tell the class that they exist (until someone tries to access them)I don't understand what you mean by that. Classes (and even instances) can certainly know that a descriptor exists in its own dict, like any other attribute.
...they never know what attribute name they are bound toUnless they are told what name they are bound to, which is easy enough to do in the constructor. In the case when you define a descriptor in the class body, you can use a metaclass to tell the descriptor what name it's bound to, and skip repeating the name.
...and they don't know what class they are bound to until they are accessed.Again, unless they are told, which is easy enough.
In ORMs this causes some problems, because classes really want to know what columns they have, and columns want to know what name they were given.In Dejavu*, I got around the second issue (column names) by giving each descriptor a "key" attribute, which is either provided in the constructor or (more commonly) by the metaclass. I got around the first issue by storing a _properties dict in the owner class, of the form: {descriptor.key: instance_value}. Each instance makes a copy of that dict for itself. In this way, both the owner class and its instances know which of their attributes are UnitProperty descriptors.
- http://projects.amor.org/dejavu/browser/trunk/units.py (the UnitProperty descriptor)
I don't understand what you mean by that. Classes (and even instances) can certainly know that a descriptor exists in its own dict, like any other attribute.The point is that the class has to do some extra stuff to find the attribute, where ActiveRecord/Ruby's technique doesn't require anything special in the class. You can't know that a column object exists until you search your __dict__. And follow MRO, for that matter.
I do explain right after this how you can make a class look for these things, and give attributes access to some of that extra information. I'd like for this to become a natural idiom in Python, not viewed as special magic. So I'd like a consistent set of practices, which doesn't presuppose what kind of object you are looking for (i.e., doesn't involve looking for all column attributes).
# Ian Bicking
Good discussion. I might add that while associations can be reasonably assigned to attributes mentally, it's harder to do something like that for acts_* and other meta-programming wrap-ups in Rails. So for example:
class Story < ActiveRecord::Base belongs_to :iteration acts_as_taggable acts_as_list :scope => :iteration end
If I were to do these in SQLObject (and someone else has started some of these), I'd do:
class Tag(SQLObject): name = StringCol(alternateID=True) # Assuming joins.PolyMorphic is a signifier to take the place of a class name: items = joins.ManyToMany(joins.Polymorphic) class Story(SQLObject): iteration = ForeignKeyCol('Iteration') sort = IntCol() tags = joins.ManyToMany('Tag', polymorphic=True) class Iteration(SQLObject): stories = OneToMany('Story', mutableOrderBy='sort') i = Iteration.get(1) i.stories.moveUp(1) # or maybe... i.stories.swap(0, 1) s = Story.get(1) fiction = Tag.byName('fiction') s.tags.add(fiction)Joins in SQLObject (unlike Django, I think) are defined on both sides of the relation. I'm okay with that for a few reasons:
- Each class is a fairly complete description, and nothing magically appears because of something else in the system.
- belongs_to or has_many? There's no reason to use one over the other. I dislike forcing people to make arbitrary decisions.
- Each side of the join has certain options which aren't symmetrical tied to the other end. Cascading makes sense on the ForeignKey. Ordering makes sense on the target of the key. You'd have to duplicate all these options to both ends for both ways of expressing the relation, but possibly with subtely different language.
- Less name generation means less rules. Rails pluralization rules certainly don't seem appealing. I get the impression from what I've heard from you and others that a lot of time has been spent on that feature and probably even more time on discussion of that feature. So (to me) it's just as well that the code includes both iterations and 'Iteration', and both stories and 'Story'.
Generally speaking, I'd like to see functionality like the acts_* functions in SQLObject, but for each case having the functions grouped under a single attribute. So where acts_as_nested_set adds a handful of methods, in SQLObject all those methods would live under a single attribute.
# Ian Bicking
During that part of the presentation, I was quite curious what the database generated underneath looks like for those polymorphic relationships. From the example in the presentation, how does it represent "Taggings"? Does it actually create:
Person Message | | PersonTaggings MessageTaggings (person_id, tag_id) (message_id, tag_id) \ / TagAnd then Tag.taggings.collect knows all the intermediate tables to combine?
Guess I have to dig into the ActiveRecord code.
I don't know whether it's really desirable, but it doesn't seem to be hard to achieve the 'direct syntactic port of ActiveRecord:' using an auxilliary queue and a registration callback e.g.,:
_RegisterPropertyQueue = [] class ActiveRecord(object): class __metaclass__(type): def __init__(cls, name, bases, dct): setattr(cls, "_has_many", set()) setattr(cls, "_belongs_to", set()) setattr(cls, "_has_and_belongs_to_many", set()) for obj in _RegisterPropertyQueue: obj.__register__(cls) del _RegisterPropertyQueue[:] class RegisterProperty(object): def __new__(cls, *args, **kw): o = object.__new__(cls) _RegisterPropertyQueue.append(o) return o def __register__(self, cls): raise NotImplementedError class Relation(RegisterProperty): def __init__(self, other): self.other = other class has_many(Relation): def __register__(self, cls): other = self.other cls._has_many.add(other) other._belongs_to.add(cls) class belongs_to(Relation): def __register__(self, cls): other = self.other cls._belongs_to.add(other) other._has_many.add(cls) class has_and_belongs_to_many(Relation): def __register__(self, cls): other = self.other other._has_and_belongs_to_many.add(cls) cls._has_and_belongs_to_many.add(other) class ProjectManager(ActiveRecord): pass class Milestones(ActiveRecord): pass class Categories(ActiveRecord): pass class Person(ActiveRecord): belongs_to(ProjectManager) has_many(Milestones) has_and_belongs_to_many(Categories) assert ProjectManager in Person._belongs_to assert Milestones in Person._has_many assert Person in Categories._has_and_belongs_to_many# Michael Spencer
Oooh, nice Python code. I'm really interested in how these techniques develop in the Python community.
There's a third trick you can do with Ruby's metaclasses, but it depends on a block-form lambda.
The following example is inspired by UnrealScript, which is a Java-like game programming language. UnrealScript objects can be in different states, and each state can selectively override methods:
class Monster < Actor on :make_noise do "Growl!" end # "default_" should be a decorator. default_state :awake do on :drink_warm_milk do |glasses| self.state = :asleep if glasses >= 1 end end state :asleep do on :make_noise do "Snore!" end end end monster = Monster.new monster.make_noise # -> "Growl!" monster.drink_warm_milk 2 monster.make_noise # -> "Snore!"There's more syntactic clutter here than I'd like, but the code works. The biggest limitation is that Ruby doesn't support default values for block parameters.
Is there an obvious way to approximate this in Python? I suspect there might be something with decorators that would get pretty close.

Can't those relations/constraints be defined right in the SQL schema?
Perhaps that's too much coupling to a specific storage model? I kinda like that because sometimes you end up with multiple toolkits (in multiple languages - including command-line sql) in place that could interact with the data storage, so having one consistent set of rules with no back-door seems like a good thing....
It's not so hard as you'd think
# Crack fingers # File orm.py: belongs_to_gatherer = [] def belongs_to(what): belongs_to_gatherer.append(what) has_many_gatherer = [] def has_many(what): has_many_gatherer.append(what) class MetaRecord(type): def __new__(cls, name, bases, dictionary): global belongs_to_gatherer, has_many_gatherer Record = super(MetaRecord, cls).__new__(cls, name, bases, dictionary) # Now we grab what we've gathered and run the respective methods on them: for i in belongs_to_gatherer: Record.belongs_to(i) belongs_to_gatherer = [] for i in has_many_gatherer: Record.has_many(i) has_many_gatherer = [] return Record class ActiveRecord(object): __metaclass__ = MetaRecord @classmethod def belongs_to(cls, what): # Set it to belong to: what print cls, "belongs to", what @classmethod def has_many(cls, what): # Set it to have many: what print cls, "has many", what __all__ = [ActiveRecord, belongs_to, has_many] # In another file: from orm import * class Person(ActiveRecord): belongs_to('project_manager') has_many('milestones')# brantley
Note that all these examples (this is the third along these lines) require cooperation on the part of the class. I hadn't really considered that, but it is different from Zope's implements() which can be applied to any class without any cooperation on the part of that class.
# Ian Bicking
I liked that! Pretty cool. What about?
- def belongs_to_classmethod(cls, what):
- print cls.__name__, " Belongs to ", what
- class MetaActiveRecord(type):
- def __new__(cls, name, bases, dictionary):
Record = super(MetaActiveRecord, cls).__new__(cls, name, bases, dictionary)
- if dictionary.has_key('belongs_to'):
- Record.belongs_to_classmethod = classmethod(belongs_to_classmethod) Record.belongs_to_classmethod(dictionary['belongs_to'])
return Record
- class ActiveRecord(object):
- __metaclass__ = MetaActiveRecord
- class Person(ActiveRecord):
belongs_to = 'project_manager' def __init__(self):
print "Person __init__"a = Person()
prints: Person Belongs to project_manager Person __init__
# Gordon Scott
By the way, Zope 3 has a few more things like 'implements' that are being used more and more as Zope 3 matures. Most commonly, these things are used on interfaces, which is the biggest in-language 'DSL' that Zope 3 has. A common thing is to make constraints about what kind of objects a container might hold, or what kind of containers an object might be placed in.
from zope.interface import Interface, Attribute from zope.app.container.constraints import contains, containers from zope.app.container.interfaces import IContainer, IContained class IThing(Interface): """ Just a thing. """ about = Attribute("What this thing is about.") class IThingHolder(IContainer): """ A container that can hold things. """ # This sets up a constraint on the container so that it can only # hold objects that implement the IThing interface contains(IThing) class IThingContained(IContained): """ An interface stating that things can be contained in thing holders. """ containers(IThingHolder)This is much better than an older way of doing the same thing.
from zope.app.container.constraints import ContainerTypesConstraint from zope.app.container.constraints import ItemTypePrecondition import zope.schema class IThingHolder(IContainer): """ A container that can hold things. """ def __setitem__(name, object): """ Redefine __setitem__ in the interface so that a precondition can be set to restrict contained objects to IThings """ __setitem__.precondition = ItemTypePrecondition(IThing) class IThingContained(IContained): """ Put a constraint on the __parent__ field """ __parent__ = zope.schema.Field( constraint=ContainerTypesConstraint(IContentContainer), )There are other little things around that also have made life a little bit nicer, such as object adaptation.
from zope.interface import implements from zope.app import zapi from example.interfaces import ISquarePeg, IRoundHole # Old Way class OldSquarePegToRoundHoleAdapter(object): # even older style would be __implements__ = IRoundHole implements(IRoundHole) __used_for__ = ISquarePeg # implementation.... # New Way class SquarePegToRoundHoleAdapter(object): implements(IRoundHole) zapi.adapts(ISquarePeg)It's a nice showcase for what is possible. What's nicest about this is that 'implements()', 'adapts()', and so on can be looked up easily in an API documentation tool. Trying to remember all of the __funny_names__ is not so easy.


{% extends "layout.html" %} {% block page_title %} GOV.UK prototype kit {% endblock %} {% block content %} BETA This is a new service – your feedback will help us to improve it. Log Out Your account {{releaseVersion | log }} Open Claims Previous Claims Your details Payee details You can press the button below to go straight to making a claim. Start new claim {% endblock %}
BETA This is a new service – your feedback will help us to improve it.
You can press the button below to go straight to making a claim.
Start new claim


| DOSE: T+ 0:00 |
100 mg |
oral |
6-APB |
| T+ 3:00 |
100 mg |
oral |
6-APB |
I've got a bit of experience with general stimulant and downers and quite a few 'research chemicals'. So after the almost constant year-long publicity campaign for 'benzo fury' I got some off a trusted source. I'd just come back from the royal wedding and was looking for something to do for a couple of hours.
T=0 I bombed 100mg
T= +2.20 I feel the first real effects they're quite subtle at the start and then it has a MDAI-like body load but without the bad side effects
T= +2.40 I'm now at a +2 level (its obvious but I can still function and its not my reality etc.) The visuals are 2-CE like so intensification of colour the walls are interesting hues etc.
T= +3.00 I get the feeling its leveling off and its still far too relaxed, after all the hype I wanna see what it can do! So I bomb the remaining 100mg in two 50mg bombs.
T= +4.00 its becoming more of a background effect now I dont know how I could possibly have developed a tolerence so quickly but I haven't felt any real noticable effects from the other 100mg yet.
T= +5.00 I'm just watching this film the human centipede for the last hour it's pretty fucked up but I couldn't stop laughing at it so kinda of a mellow high in that kinda way.
T= +7.00 I'm completely down and have been for way too long maybe for the last hour and a half or so.
Also I only really noticed this in retrospect but I was really relaxed and just confident but in a chilled out way, mainly because of that I would order this again. The high I got from it however wasn't anything really special and not the MD replacement as the vendors say, but finding out that vendors lie isn't anything new it's just a bit disappointing. Overall it was medium to mild and interesting I couldn't imagine taking this in a club on its own but nevertheless it's worth a try on a lazy sunday.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


SIAMEXHIBITION CO.,LTD.
Home
About
Portfolio
Event
Contact
Contact Us
You may leave us a message for any kind of business matter or personal greeting.
Name:
Email:
Phone:
Message:
Our Location


Hi, I'm Roman
Login to continue
LOGIN
UI DSGNR
ADMIN
CUSTOMER
Username
FORGOT
PASSWORD
Password
Forgot your password?
RESET
Your password is about to reset
New password will be sent to your e-mail. Our days fill she'd green doesn't behold heaven fly yielding
Check your inbox
Hath One likeness likeness upon there days herb. Our days fill she'd green doesn't behold heaven fly yielding
Please, login
Login
BUYER
SELLER
Forgot?
Password reset
Reset
New password will be sent to your e-mail. Our days fill she'd green doesn't behold heaven fly yielding
Success!
Check your mailbox for new passoword. Please, make sure you've checked SPAM folder either. Thank you!
Continue
UI HTML KIT
Daily
Welcome to Daily UI HTML kit project! It's a design challenge of mine. I am adding new design elements daily. Come back tomorrow, grab something new and implement whatever you want FREE
Login widgets with flipping confirmation and password reset form
21th of March
Thanks for download
Hope to see you tomorrow at
www.dailyuikit.com
ZIP file with HTML/CSS code
Download
Latest build


Marvel Comic Finder
Go!
Filter by
Any Format
Comic
Hardcover
Digital Comic
Trade Paperback
Digest
Infinite Comic
Graphic Novel
Magazine
Sort by
Default
Title (Ascending)
Title (Descending)
Issue Number (Ascending)
Issue Number (Descending)
Results
Thumbnail
Comic Title and Description
Data provided by Marvel. © 2014 Marvel


Dancing, Music & Books
Hands, Ears & Feet
Sleeping, Getting Dressed & Tooth Brushing
Firefighters, Lifeguards & Nurses


First Name
Last Name
Username
Email
% for user in users:
${user['firstName']}
${user['lastName']}
${user['username']}
${user['email']}
% endfor


Your browser must support Java Applets for this page to work.
My other fractals: http://pauldoo.com/fractals/


Please reach out with any questions or if you want to learn more about our organization.
President: Azzam Althagafi aazzam@seas.upenn.edu


B Tech. Undergraduate
I am just a curious explorer. Currently pursuing Bachelor's in Technology from Indraprastha Institute of Information Technology. Apart from programming, I am deeply inclined towards practical applications of theoritical computer sciences and the importance it holds while devloping technical solutions for everyday problems. I also like to cook! :P
Modifying Linux Process scheduler to make it consider soft real-time guarantees, also creating time value fields in task_struct and adding system calls to modify it.
An Arduino based water bottle which intelligently sensed the surrounding conditions and then calculating the ideal amount of water that user should take and reminding him/her to do in calculated intervals.
ESYA: TechFest IIIT Delhi
August' 19
Indraprastha Institute of Information
Current CGPA: 8.95
2019 - 2023 (tentatively)
AISSCE, Central Board of Secondary Education
Percentage: 96%
2018 - 2019
Central Board of Secondary Education
Sona Modern Public School, New Delhi
CGPA: 10.0
2016 - 2017


# Brewster Engineering #
![Brewster Logo](https://dl.dropbox.com/u/57592475/light%20-%20medium.jpg "Brewster Logo")
## Test-driven Ops at Brewster ##
# Brewster #
Your personalized address book
![Brewster People](https://dl.dropbox.com/u/57592475/1%20-%20people.jpg "Brewster People")
Connects everyone you know, however you know them
![Brewster Services](https://dl.dropbox.com/u/57592475/IMG_0287.PNG "Brewster Services")
Builds merged profiles for all your contacts
![Brewster People](https://dl.dropbox.com/u/57592475/6%20-%20profile.jpg "Brewster Contact")
Who's trending in your life, or losing touch
![Brewster Updates](https://dl.dropbox.com/u/57592475/2%20-%20feed.jpg "Brewster Updates")
Powerful search
![Brewster Search](https://dl.dropbox.com/u/57592475/3%20-%20search.jpg "Brewster Search")
Brewster Overview
- Download & store raw profiles (Riak)
- Store connection data (Cassandra)
- Analyze profiles to build contact documents for search (Elasticsearch)
- API serves data to client
- iOS app
- Periodic account sync for updates
# Front-end Loader #
### How much can you take? ###
# Tools #
* The wikipedia page lists 23 tools
* Many of which cost money
* And/or are monolithic testing tools
* None of which have a simple Ruby API
## JMeter ##
* Is great for static analysis but becomes more cumbersome when doing dynamic scripting.
# Front End Loader #
### Ruby library for declaring load tests and viewing their results ###
gem install front\_end\_loader
Declaring the experiment
require 'front_end_loader'
experiment = FrontEndLoader::Experiment.new.tap do |e|
e.user_count = 20
e.loop_count = 5
e.domain = 'https://www.google.com'
e.basic_auth('unreal_login', 'unreal_password')
e.default_parameters = { 'unnecessary' => 'true' }
e.debug = '/tmp/front_end_loader.txt'
e.requests do |r|
...
end
end
experiment.run
Scripting the requests
e.requests do |r|
r.get('privacy_policy', '/intl/en/policies')
word = r.get('test_srch', '/search', :q => 'test') do |response|
response.body.
split(/\s/).
reject { |i| i.length < 3 || i.length > 10 }.
sample
end
e.write_debug(word)
r.get('random_word_search', '/search', :q => word)
# also e.g. r.post(...), r.put(...), r.delete(...)
end
# Next Steps #
* Other display types
* Distribution
* Storing output and comparing data across runs
* Charts and graphs
# Auger #
### Drill your apps ###
# Why Auger? #
* Ops should test their stuff
* Writing tests should be quick and easy
* Test at the service level
# What is Auger? #
* Ruby DSL for testing remote applications
* Command-line client for running tests
* Plugin framework for wrapping gems
* Leverage existing gems as plugins
# What questions can Auger answer? #
* is port 80 open on all my webservers?
* does /index.html contain a particular tag?
* is redis running?
* is it configured as a master? a slave?
* is elasticsearch responding on all my hosts?
* what's the cluster state?
* do I have the correct number of data nodes?
# Installation #
gem install auger
# A Test #
project "Ganglia Web Servers" do
server "ganglia-r[01-03]"
http do
get '/ganglia/' do
test 'status code is 200' do |response|
response.code == '200'
end
test 'gmetad Version' do |response|
response.body.match /version\s+([\d\.]+)/
end
end
end
end
# The Output #
# More interesting #
require 'json'
project "Elasticsearch - Staging" do
server "staging-es-r[01-02]"
http 9200 do
timeout 3
get "/" do
before_tests do |response|
JSON.parse(response.body)
end
test "version" do |json|
json["version"]["number"]
end
...
# More interesting output #
# Plugin: Redis #
require 'redis'
module Auger
class Project
def redis(port = 6379, &block)
@connections << Auger::Redis.load(port, &block)
end
end
end
# Plugin: Connection #
module Auger
class Redis < Auger::Connection
def open(host, options)
::Redis.new options.merge({
:host => host,
:port => options[:port],
})
end
def close(redis)
redis.quit
end
def info(&block)
@requests << Auger::RedisInfo.load(nil, &block)
end
end
end
# Plugin: Request #
module Auger
class Redis < Auger::Connection
class RedisInfo < Auger::Request
def run(redis, arg)
redis.info
end
end
end
end
# Plugin: Usage #
project "Redis" do
server "staging-redis-r01"
redis 6379 do
info do
test "redis version" do |info|
info['redis_version']
end
test "server role" do |info|
info['role']
end
end
end
end
# Plugin: Output #
# How do we use Auger? #
* Test-driven deployment
* Debugging
* Triage
# Q&A #
Contact: ric@brewster.com


Man walks on earth in the pitiful shade of God's grace,
Where the earth embers with the fires of hate.
The tyrant above looks down upon man's travesty,
with a sense of overwhelming majesty!
Contempt fills the crack you made,
While others bow to your knees for it to be unmade.
Showering your forces of darkness,
Which we fools harness!
Sending shepherds to lead Lamb to the slaughter,
Here I stand to be your mocker!


FPS:
Restitution:
Radius (m):
Mass (kgs):
Your browser does not support the HTML5 canvas, please update it.
Your browser does not support JavaScript, please update it.


--- layout: page title: Lean Prover Zulip Chat Archive permalink: archive/144837PRreviews/13196931completelatticeshavecolimits.html ---
@Johan Commelin You approved this PR but did not mark it as ready to merge. Do you want it merged?
Also, you haven't assigned it to yourself
@Simon Hudon I wouldn't mind having it merged (which is what I tried to convey with my "Approve" :smiley:). But I wouldn't mind if another maintainer also took a look at the PR.
Anyone in particular?
I guess this PR defaults to Reid, since he is currently listed as maintainer of category theory.
{% endraw %}


This is the SGI port of NeHe's OpenGL tutorial.
Port done by Lakmal Gunasekara 1999.
It's mainly based on the Solaris port of myself which
is based on the linux port from Richard Campbell.
Usage:
make
This will build the tutorial you actually have (lesson1, lesson2...)
Hardware requirements:
- A SGI workstation (I've been using an INDY with Vino video graphic subsystem)
If you have, take something more powerfull.
Software requirements:Operating system:
- IRIX 5.3 (I don't think you also have such an oldtimer in front of you)
OpenGL:
- The version that's shipped with IRIX should be ok.
GLUT:
- GLUT 3.7beta.
GLUT is NOT shipped by SGI.
You can download the precompiled library from:
http://reality.sgi.com/opengl/glut3/glut3.html
But building it by yourself is very easy under IRIX.
cc:
- I've used version 3.19 but I think there are newer version out there ( :-/ )
Known bugs:
Probably a lot of...
Contact:
If you have problems, or have useful hints, email me at<EMAIL_ADDRESS>Credits:
Jeff Molofee<EMAIL_ADDRESS>for writing the tutorials.
Richard Campbell<EMAIL_ADDRESS>for doing the linux port.- Lakmal Gunasekara 1999


How To Evaluate A Company: Is This A Company I Want To Work For?
Social Media Presence
Engineering Blog
Open Source Work
Public API
LinkedIn / Glassdoor
Applying to jobs that you feel unqualified for
Interview
Ask what the interview questions will be beforehand.
Pre-interview coding challenges determine if you are technically fit for the role, in-person whiteboard challenges demonstrate if you are able to communicate and collaborate in a team.
They WANT to hire you.
Ask a lot of questions to show them how interested you are in the company/role.
"Do you have any hesitations about me as a candidate for this role?"


public ICommandBank
An interface that defines the methods a command registry needs.
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCommand(ICommand<?> command)
Adds a command to the registry.
|
boolean |
addPrefix(java.lang.String prefix)
Adds a prefix to the bank to keep track of all prefixes used by commands.
|
boolean |
changePrefix(ICommand<?> command,
java.lang.String newPrefix)
Change an existing command's prefix.
|
void |
clearAll()
Deletes all commands from the registry.
|
boolean |
deleteCommand(ICommand<?> command)
Deletes a command from the registry and destroys all subcommand references.
|
ICommand<?> |
getCommand(java.lang.String singleString)
Gets a command from the bank by providing a single string (usually the "prefix + alias" together).
|
java.util.Map<java.lang.String,com.github.kvnxiao.kommandant.command.ICommand> |
getCommands()
Gets an immutable map of all single-string identifiers to commands (usually all "prefix + alias" strings to commands)
|
java.util.Map<java.lang.String,com.github.kvnxiao.kommandant.command.ICommand> |
getCommandsForPrefix(java.lang.String prefix)
Gets an immutable map of alias to commands for the given prefix.
|
java.util.List<com.github.kvnxiao.kommandant.command.ICommand> |
getCommandsUnique()
Gets an immutable list of all commands
|
java.util.Set<java.lang.String> |
getPrefixes()
Gets an immutable set of all prefixes registered in the bank.
|
boolean |
hasCommand(java.lang.String singleString)
Returns whether a command queried using this single string exists in the registry.
|
boolean |
removeCommand(ICommand<?> command)
Removes a command from the registry, but does not destroy it.
|
boolean addCommand(ICommand<?> command)
Adds a command to the registry.
boolean removeCommand(ICommand<?> command)
Removes a command from the registry, but does not destroy it.
boolean deleteCommand(ICommand<?> command)
Deletes a command from the registry and destroys all subcommand references.
ICommand<?> getCommand(java.lang.String singleString)
Gets a command from the bank by providing a single string (usually the "prefix + alias" together).
class ICommand
The (nullable) command.boolean hasCommand(java.lang.String singleString)
Returns whether a command queried using this single string exists in the registry.
boolean addPrefix(java.lang.String prefix)
Adds a prefix to the bank to keep track of all prefixes used by commands.
boolean changePrefix(ICommand<?> command, java.lang.String newPrefix)
Change an existing command's prefix.
java.util.Set<java.lang.String> getPrefixes()
Gets an immutable set of all prefixes registered in the bank.
java.util.Map<java.lang.String,com.github.kvnxiao.kommandant.command.ICommand> getCommands()
Gets an immutable map of all single-string identifiers to commands (usually all "prefix + alias" strings to commands)
java.util.List<com.github.kvnxiao.kommandant.command.ICommand> getCommandsUnique()
Gets an immutable list of all commands
java.util.Map<java.lang.String,com.github.kvnxiao.kommandant.command.ICommand> getCommandsForPrefix(java.lang.String prefix)
Gets an immutable map of alias to commands for the given prefix.
void clearAll()
Deletes all commands from the registry.


This can mean a brand just redesigned their label or it is from a specialty line, but sometimes when you recognize the name but not the label, it might be from another era!
Since 1971, the Federal Trade Commission has required manufacturers to add labels explaining how to care for the item
1980s
The edges of these seams were either left untouched or turned into French Seams
Zig Zag pattern most commonly found on 1950's clothes
1960s+ when sewing machines became widely available
China, India, Thailand, Bangladesh, Vietnam, Indonesia, Guatemala, Mexico, Sri Lanka are all countries where contemporary clothing is mass manufactured today
These items were considered contemporary at the time


This post is the second in the series of “From JavaScript to Ruby”, which is aimed at helping JavaScript developers transition their thinking from JavaScript to Ruby. Here you’ll find a table of the ways we do things in JavaScript, and the way you’re supposed to do them in Ruby.
Style Guide
This post is a living document. Expect changes as necessary. Suggestions? Leave a comment below or email Josh.
Last updated: Apr 20, 2015
|
If you do this in JavaScript...
Airbnb |
...do it like this in Ruby
bbatsov |
|---|---|
| String quotes | |
'Some string' |
'Some string' |
| String concatenation | |
| Variable names | |
camelCaseVariable = true
|
camel_case_variable = false
|
| Tabs | |
| Callbacks | |
| Talking about methods | |
someClass.someMethod |
SomeClass#some_method |
| Comments | |
// single-line comment
|
# single-line comment
|
Like this post?
Share it with your followers
or
follow me on Twitter!


Created by Cal students like you.
Studybuddy is built by a team of two Cal students, Linus and Divyansh, studying computer science and economics. Feel free to get in touch!
When you study with strangers, you're distracted less and more productive than when studying with friends.
With Studybuddy, you don't have to waste time searching blindly for people who want to study together
Work with people who are taking the same classes, and get your questions answered working your peers.
See other classmates from your course looking for study partners, and study groups and reach out easily without giving out personal contact information.
Definitely more convenient than office hours.
Venkat Ramaraju, class of 2022
Easier than the hassle of messaging random people.
Kaushal Bommena, class of 2022
Studybuddy is built by a team of two Cal students, Linus and Divyansh, studying computer science and economics. Feel free to get in touch!


"The Redmi Y2 is a mid-ranger packing the Snapdragon 730G chipset under the hood along with 6GB of RAM. The phone’s highlight feature is its rear camera setup with five sensors that can adapt to pretty much any shooting style. But the Redmi Y2has more to offer than just its cameras. It sports a large 6.47-inch Full HD+ display, packs a massive 5,260mAh battery, and comes with a headphone jack as well as an IR blaster. Like the rest of Xiaomi’s lineup, it also offers great value for money."


...
Live data represents the newest values that the sensors have put into the database.
Shown is the values of the individual sensors in this room, as well as their thresholds.
You can also click on the graphs to zoom in on them, and make them easier to read.
The prediction graphs show the percentage chance that any of the sensors in this room exceeds their threshold again in the future.
There are always one graph that have all the sensor types in them, as well as the individual ones.
You can also click on the graphs to zoom in on them, and make them easier to read.
Here you can see the sensors that are in this room, as well as what sensor types they have.