text
stringlengths 2
1.04M
| meta
dict |
---|---|
"""
Program to filter BLAT alignment transcript file
Usage : GFF file created by psl_to_gff.pl program
Here the upper bound mismatch as 4 and minimum matching length of nucleotide as 25
based on the criteria, program filters the fragments and writes a GFF file
"""
import sys
def gff_clean():
"""
clean the gff file based on the filter
"""
NM=0
seqLen=25
featdb=dict()
gfh=open(gffname, 'rU')
for rec in gfh:
rec = rec.strip('\n\r').split('\t')
if rec[2]=='transcript':
if not int(rec[7])<=NM:
continue
mLen,fid=0,None
for atb in rec[-1].split(';'):
key,val=atb.split('=')
if key=='ID':
fid=val
if key=='Match':
mLen=int(val)
if mLen >= seqLen:
featdb[fid]=1
else:
parent,codLen=None,0
for atb in rec[-1].split(';'):
key,val=atb.split('=')
if key=='Parent':
parent=val
if key=='Len':
codLen=int(val)
if parent in featdb:
if codLen >= seqLen:
print '\t'.join(rec)
#break
gfh.close()
if __name__=="__main__":
try:
gffname=sys.argv[1]
except:
print __doc__
sys.exit(-1)
gff_clean(gffname)
| {
"content_hash": "1c78f05cd3bddae029c4574abf32c8ab",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 83,
"avg_line_length": 25.263157894736842,
"alnum_prop": 0.46944444444444444,
"repo_name": "vipints/genomeutils",
"id": "e2564ccc37244a0aa77c7d23fb9fbd6b90331fe7",
"size": "1463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "utils/filter_blat_alignments.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Perl",
"bytes": "4073"
},
{
"name": "Python",
"bytes": "443100"
},
{
"name": "R",
"bytes": "647"
}
],
"symlink_target": ""
} |
Direct API interactions in Lagoon are done via [GraphQL](../using_lagoon/graphql_api.md).
In order to authenticate with the API, we need a JWT \(JSON Web Token\) that allows us to use the GraphQL API as admin. To generate this token, open the terminal of the `auto-idler` pod via the OpenShift UI and run the following command:
```bash
./create_jwt.sh
```
This can also be done with the `oc` command:
```bash
oc -n lagoon-master rsh dc/auto-idler ./create_jwt.sh
```
This will return a long string which is the JWT token. Make a note of this, as we will need it to send queries.
We also need the URL of the API endpoint, which can be found under "Routes" in the OpenShift UI or `oc get route api` on the command line. Make a note of this endpoint URL, which we will also need.
To compose and send GraphQL queries, we recommend [GraphiQL.app](https://github.com/skevy/graphiql-app), a desktop GraphQL client with features such as autocomplete. To continue with the next steps, install and start the app.
Under "GraphQL Endpoint", enter the API endpoint URL with `/graphql` on the end. Then click on "Edit HTTP Headers" and add a new header:
* "Header name": `Authorization`
* "Header value": `Bearer [JWT token]` \(make sure that the JWT token has no spaces, as this would not work\)
Press ESC to close the HTTP header overlay and now we are ready to send the first GraphQL request!

Enter this in the left panel
```graphql
query allProjects{
allProjects {
name
}
}
```

And press the ▶️button \(or press CTRL+ENTER\).
If all went well, your first GraphQL response should appear shortly afterwards in the right pane.
## Creating the first project
Let's create the first project for Lagoon to deploy! For this we'll use the queries from the GraphQL query template in [`create-project.gql`](https://github.com/amazeeio/lagoon/blob/master/docs/administering_lagoon/create-project.gql).
For each of the queries \(the blocks starting with `mutation {`\), fill in all of the empty fields marked by TODO comments and run the queries in GraphiQL.app. This will create one of each of the following two objects:
1. `openshift` : The OpenShift cluster to which Lagoon should deploy. Lagoon is not only capable of deploying to its own OpenShift, but also to any OpenShift anywhere in the world.
2. `project` : The Lagoon project to be deployed, which is a Git repository with a `.lagoon.yml` configuration file committed in the root.
## Allowing access to the project
In Lagoon, each developer authenticates via their SSH key\(s\). This determines their access to:
1. The Lagoon API, where they can see and edit projects they have access to.
2. Remote shell access to containers that are running in projects they have access to.
3. The Lagoon logging system, where a developer can find request logs, container logs, Lagoon logs and more.
To allow access to the project, we first need to add a new group to the API:
```graphql
mutation {
addGroup (
input: {
# TODO: Enter the name for your new group.
name: ""
}
) {
id
name
}
}
```
Then we need to add a new user to the API:
```graphql
mutation {
addUser(
input: {
email: "[email protected]"
firstName: "Michael"
lastName: "Schmid"
comment: "CTO"
}
) {
# TODO: Make a note of the user ID that is returned.
id
}
}
```
Then we can add an SSH public key for the user to the API:
```graphql
mutation {
addSshKey(
input: {
# TODO: Fill in the name field.
# This is a non-unique identifier for the SSH key.
name: ""
# TODO: Fill in the keyValue field.
# This is the actual SSH public key (without the type at the beginning and without the comment at the end, ex. `AAAAB3NzaC1yc2EAAAADAQ...3QjzIOtdQERGZuMsi0p`).
keyValue: ""
# TODO: Fill in the keyType field.
# Valid values are either SSH_RSA or SSH_ED25519.
keyType: SSH_RSA
user: {
# TODO: Fill in the userId field.
# This is the user ID that we noted from the addUser query.
id:"0",
email:"[email protected]"
}
}
) {
id
}
}
```
After we add the key, we need to add the user to a group:
```graphql
mutation {
addUserToGroup (
input: {
user: {
#TODO: Enter the email address of the user.
email: ""
}
group: {
#TODO: Enter the name of the group you want to add the user to.
name: ""
}
#TODO: Enter the role of the user.
role: OWNER
}
) {
id
name
}
}
```
After running one or more of these kinds of queries, the user will be granted access to create tokens via SSH, access containers and more.
## Adding notifications to the project
If you want to know what is going on during a deployment, we suggest configuring notifications for your project, which provide:
* Push notifications
* Build start information
* Build success or failure messages
* And many more!
As notifications can be quite different in terms of the information they need, each notification type has its own mutation.
As with users, we first add the notification:
```graphql
mutation {
addNotificationSlack(
input: {
# TODO: Fill in the name field.
# This is your own identifier for the notification.
name: ""
# TODO: Fill in the channel field.
# This is the channel for the message to be sent to.
channel: ""
# TODO: Fill in the webhook field.
# This is the URL of the webhook where messages should be sent, this is usually provided by the chat system to you.
webhook: ""
}
) {
id
}
}
```
After the notification is created, we can now assign it to our project:
```graphql
mutation {
addNotificationToProject(
input: {
notificationType: SLACK
# TODO: Fill in the project field.
# This is the project name.
project: ""
# TODO: Fill in the notification field.
# This is the notification name.
notificationName: ""
# TODO: OPTIONAL
# The kind notification class you're interested in defaults to DEPLOYMENT
contentType: DEPLOYMENT/PROBLEM
# TODO: OPTIONAL
# Related to contentType PROBLEM, we can set the threshold for the kinds of problems
# we'd like to be notified about
notificationSeverityThreshold "NONE/UNKNOWN/NEGLIGIBLE/LOW/MEDIUM/HIGH/CRITICAL
}
) {
id
}
}
```
Now for every deployment you will receive messages in your defined channel.
## Example GraphQL queries
### Adding a new OpenShift target
The OpenShift cluster to which Lagoon should deploy. Lagoon is not only capable of deploying to its own OpenShift, but also to any OpenShift anywhere in the world.
```graphql
mutation {
addOpenshift(
input: {
# TODO: Fill in the name field.
# This is the unique identifier of the OpenShift.
name: ""
# TODO: Fill in consoleUrl field.
# This is the URL of the OpenShift console (without any `/console` suffix).
consoleUrl: ""
# TODO: Fill in the token field.
# This is the token of the `lagoon` service account created in this OpenShift (this is the same token that we also used during installation of Lagoon).
token: ""
}
) {
name
id
}
}
```
### Adding a group to a project
This query will add a group to a project. Users of that group will be able to access the project. They will be able to make changes, based on their role in that group.
```graphql
mutation {
mutation {
addGroupsToProject (
input: {
project: {
#TODO: Enter the name of the project.
name: ""
}
groups: {
#TODO: Enter the name of the group that will be added to the project.
name: ""
}
}
) {
id
}
}
```
### Adding a new project
This query adds a new Lagoon project to be deployed, which is a Git repository with a `.lagoon.yml` configuration file committed in the root.
If you omit the `privateKey` field, a new SSH key for the project will be generated automatically.
If you would like to reuse a key from another project. you will need to supply the key in the `addProject` mutation.
```graphql
mutation {
addProject(
input: {
# TODO: Fill in the name field.
# This is the project name.
name: ""
# TODO: Fill in the private key field (replace newlines with '\n').
# This is the private key for a project, which is used to access the Git code.
privateKey: ""
# TODO: Fill in the OpenShift field.
# This is the id of the OpenShift to assign to the project.
openshift: 0
# TODO: Fill in the name field.
# This is the project name.
gitUrl: ""
# TODO: Fill in the branches to be deployed.
branches: ""
# TODO: Define the production environment.
productionEnvironment: ""
}
) {
name
openshift {
name
id
}
gitUrl
activeSystemsDeploy
activeSystemsRemove
branches
pullrequests
}
}
```
### List projects and groups
This is a good query to see an overview of all projects, OpenShifts and groups that exist within our Lagoon.
```graphql
query {
allProjects {
name
gitUrl
}
allOpenshifts {
name
id
}
allGroups{
id
name
members {
# This will display the users in this group.
user {
id
firstName
lastName
}
role
}
groups {
id
name
}
}
}
```
### Single project
If you want a detailed look at a single project, this query has been proven quite good:
```graphql
query {
projectByName(
# TODO: Fill in the project name.
name: ""
) {
id
branches
gitUrl
pullrequests
productionEnvironment
notifications(type: SLACK) {
... on NotificationSlack {
name
channel
webhook
id
}
}
environments {
name
deployType
environmentType
}
openshift {
id
}
}
}
```
### Querying a project by its Git URL
Don't remember the name of a project, but know the Git URL? Search no longer, there is a GraphQL query for that:
```graphql
query {
projectByGitUrl(gitUrl: "[email protected]:org/repo.git") {
name
}
}
```
### Updating objects
The Lagoon GraphQL API can not only disply objects and create objects, it also has the capability to update existing objects, using [a patch object](https://blog.apollographql.com/designing-graphql-mutations-e09de826ed97).
Update the branches to deploy within a project:
```graphql
mutation {
updateProject(
input: { id: 109, patch: { branches: "^(prod|stage|dev|update)$" } }
) {
id
}
}
```
Update the production environment within a project:
!!!hint
This needs a redeploy in order for the changes to be reflected in the containers.
```graphql
mutation {
updateProject(
input: { id: 109, patch: { productionEnvironment: "master" } }
) {
id
}
}
```
You can also combine multiple changes at once:
```graphql
mutation {
updateProject(
input: {
id: 109
patch: {
productionEnvironment: "master"
branches: "^(prod|stage|dev|update)$"
}
}
) {
id
}
}
```
### Deleting Environments
You can also use the Lagoon GraphQL API to delete an environment. You'll need to know the project name and the environment name in order to run the command.
```graphql
mutation {
deleteEnvironment(
input: {
# TODO: Fill in the name field.
# This is the environment name.
name:""
# TODO: Fill in the project field.
# This is the project name.
project:""
execute:true
}
)
}
```
### Querying a project to see what groups and users are assigned
Want to see what groups and users have access to a project? Want to know what their roles are? Do I have a query for you! Using the query below you can search for a project and display the groups, users, and roles that are assigned to that project.
```graphql
query search{
projectByName(
#TODO: Enter the name of the project.
name: ""
) {
id,
branches,
productionEnvironment,
pullrequests,
gitUrl,
openshift {
id
},
groups{
id
name
groups {
id
name
}
members {
role
user {
id
email
}
}
}
}
}
```
## Maintaining project metadata
Project metadata can be assigned using arbitrary key/value pairs. Projects can then be queried by the associated metadata; for example you may categorise projects by type of software, version number, or any other categorisation you may wish to query on later.
### Add/update metadata on a project
Updates to metadata expect a key/value pair. It operates as an `UPSERT`, meaning if a key already exists the value will be updated, otherwise inserted.
You may have any number of k/v pairs stored against a project.
```graphql
mutation {
updateProjectMetadata(
input: { id: 1, patch: { key: "type", value: "saas" } }
) {
id
metadata
}
}
```
### Query for projects by metadata
Queries may be by `key` only (e.g return all projects where a specific key exists) or both `key` and `value` where both key and value must match.
All projects that have the `version` tag:
```graphql
query projectsByMetadata {
projectsByMetadata(metadata: [{key: "version"] ) {
id
name
}
}
```
All projects that have the `version` tag, specifically version `8`:
```graphql
query projectsByMetadata {
projectsByMetadata(metadata: [{key: "version", value: "8"] ) {
id
name
}
}
```
### Removing metadata on a project
Metadata can be removed on a per-key basis. Other metadata key/value pairs will persist.
```graphql
mutation {
removeProjectMetadataByKey (
input: { id: 1, key: "version" }
) {
id
metadata
}
}
``` | {
"content_hash": "3e03af7a9730283e27971da9696f464d",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 259,
"avg_line_length": 25.454873646209386,
"alnum_prop": 0.6621755779322082,
"repo_name": "amazeeio/lagoon",
"id": "7fdc767439f8da672f9cf7100a7990737816d983",
"size": "14149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/administering_lagoon/graphql_api.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "327"
},
{
"name": "Dockerfile",
"bytes": "91473"
},
{
"name": "HTML",
"bytes": "3270"
},
{
"name": "JavaScript",
"bytes": "917507"
},
{
"name": "Makefile",
"bytes": "41263"
},
{
"name": "PHP",
"bytes": "148874"
},
{
"name": "PLSQL",
"bytes": "148"
},
{
"name": "Python",
"bytes": "777"
},
{
"name": "Roff",
"bytes": "3321"
},
{
"name": "SQLPL",
"bytes": "33383"
},
{
"name": "Shell",
"bytes": "336135"
},
{
"name": "Smarty",
"bytes": "590"
},
{
"name": "TSQL",
"bytes": "13766"
},
{
"name": "TypeScript",
"bytes": "196542"
},
{
"name": "VCL",
"bytes": "16240"
}
],
"symlink_target": ""
} |
class PipelineMetricsWorker # rubocop:disable Scalability/IdempotentWorker
include ApplicationWorker
include PipelineQueue
urgency :high
# rubocop: disable CodeReuse/ActiveRecord
def perform(pipeline_id)
Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline|
update_metrics_for_active_pipeline(pipeline) if pipeline.active?
update_metrics_for_succeeded_pipeline(pipeline) if pipeline.success?
end
end
# rubocop: enable CodeReuse/ActiveRecord
private
def update_metrics_for_active_pipeline(pipeline)
metrics(pipeline).update_all(latest_build_started_at: pipeline.started_at, latest_build_finished_at: nil, pipeline_id: pipeline.id)
end
def update_metrics_for_succeeded_pipeline(pipeline)
metrics(pipeline).update_all(latest_build_started_at: pipeline.started_at, latest_build_finished_at: pipeline.finished_at, pipeline_id: pipeline.id)
end
# rubocop: disable CodeReuse/ActiveRecord
def metrics(pipeline)
MergeRequest::Metrics.where(merge_request_id: merge_requests(pipeline))
end
# rubocop: enable CodeReuse/ActiveRecord
def merge_requests(pipeline)
pipeline.merge_requests_as_head_pipeline.map(&:id)
end
end
| {
"content_hash": "45b3f149542e96cdd37726955ad78124",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 152,
"avg_line_length": 33.97142857142857,
"alnum_prop": 0.767031118587048,
"repo_name": "mmkassem/gitlabhq",
"id": "1eb9b4ce08914c36e8d26e8ffb608bfd0e684bb8",
"size": "1220",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/workers/pipeline_metrics_worker.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113683"
},
{
"name": "CoffeeScript",
"bytes": "139197"
},
{
"name": "Cucumber",
"bytes": "119759"
},
{
"name": "HTML",
"bytes": "447030"
},
{
"name": "JavaScript",
"bytes": "29805"
},
{
"name": "Ruby",
"bytes": "2417833"
},
{
"name": "Shell",
"bytes": "14336"
}
],
"symlink_target": ""
} |
package tls
import (
"crypto"
"crypto/rand"
"crypto/x509"
"io"
"strings"
"sync"
"time"
)
const (
maxPlaintext = 16384 // maximum plaintext payload length
maxCiphertext = 16384 + 2048 // maximum ciphertext payload length
recordHeaderLen = 5 // record header length
maxHandshake = 65536 // maximum handshake we support (protocol max is 16 MB)
versionSSL30 = 0x0300
versionTLS10 = 0x0301
minVersion = versionSSL30
maxVersion = versionTLS10
)
// TLS record types.
type recordType uint8
const (
recordTypeChangeCipherSpec recordType = 20
recordTypeAlert recordType = 21
recordTypeHandshake recordType = 22
recordTypeApplicationData recordType = 23
)
// TLS handshake message types.
const (
typeClientHello uint8 = 1
typeServerHello uint8 = 2
typeNewSessionTicket uint8 = 4
typeCertificate uint8 = 11
typeServerKeyExchange uint8 = 12
typeCertificateRequest uint8 = 13
typeServerHelloDone uint8 = 14
typeCertificateVerify uint8 = 15
typeClientKeyExchange uint8 = 16
typeFinished uint8 = 20
typeCertificateStatus uint8 = 22
typeNextProtocol uint8 = 67 // Not IANA assigned
)
// TLS compression types.
const (
compressionNone uint8 = 0
)
// TLS extension numbers
var (
extensionServerName uint16 = 0
extensionStatusRequest uint16 = 5
extensionSupportedCurves uint16 = 10
extensionSupportedPoints uint16 = 11
extensionSessionTicket uint16 = 35
extensionNextProtoNeg uint16 = 13172 // not IANA assigned
)
// TLS Elliptic Curves
// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-8
var (
curveP256 uint16 = 23
curveP384 uint16 = 24
curveP521 uint16 = 25
)
// TLS Elliptic Curve Point Formats
// http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-9
var (
pointFormatUncompressed uint8 = 0
)
// TLS CertificateStatusType (RFC 3546)
const (
statusTypeOCSP uint8 = 1
)
// Certificate types (for certificateRequestMsg)
const (
certTypeRSASign = 1 // A certificate containing an RSA key
certTypeDSSSign = 2 // A certificate containing a DSA key
certTypeRSAFixedDH = 3 // A certificate containing a static DH key
certTypeDSSFixedDH = 4 // A certificate containing a static DH key
// Rest of these are reserved by the TLS spec
)
// ConnectionState records basic TLS details about the connection.
type ConnectionState struct {
HandshakeComplete bool
DidResume bool
CipherSuite uint16
NegotiatedProtocol string
NegotiatedProtocolIsMutual bool
// ServerName contains the server name indicated by the client, if any.
// (Only valid for server connections.)
ServerName string
// the certificate chain that was presented by the other side
PeerCertificates []*x509.Certificate
// the verified certificate chains built from PeerCertificates.
VerifiedChains [][]*x509.Certificate
}
// ClientAuthType declares the policy the server will follow for
// TLS Client Authentication.
type ClientAuthType int
const (
NoClientCert ClientAuthType = iota
RequestClientCert
RequireAnyClientCert
VerifyClientCertIfGiven
RequireAndVerifyClientCert
)
// A Config structure is used to configure a TLS client or server. After one
// has been passed to a TLS function it must not be modified.
type Config struct {
// Rand provides the source of entropy for nonces and RSA blinding.
// If Rand is nil, TLS uses the cryptographic random reader in package
// crypto/rand.
Rand io.Reader
// Time returns the current time as the number of seconds since the epoch.
// If Time is nil, TLS uses time.Now.
Time func() time.Time
// Certificates contains one or more certificate chains
// to present to the other side of the connection.
// Server configurations must include at least one certificate.
Certificates []Certificate
// NameToCertificate maps from a certificate name to an element of
// Certificates. Note that a certificate name can be of the form
// '*.example.com' and so doesn't have to be a domain name as such.
// See Config.BuildNameToCertificate
// The nil value causes the first element of Certificates to be used
// for all connections.
NameToCertificate map[string]*Certificate
// RootCAs defines the set of root certificate authorities
// that clients use when verifying server certificates.
// If RootCAs is nil, TLS uses the host's root CA set.
RootCAs *x509.CertPool
// NextProtos is a list of supported, application level protocols.
NextProtos []string
// ServerName is included in the client's handshake to support virtual
// hosting.
ServerName string
// ClientAuth determines the server's policy for
// TLS Client Authentication. The default is NoClientCert.
ClientAuth ClientAuthType
// ClientCAs defines the set of root certificate authorities
// that servers use if required to verify a client certificate
// by the policy in ClientAuth.
ClientCAs *x509.CertPool
// InsecureSkipVerify controls whether a client verifies the
// server's certificate chain and host name.
// If InsecureSkipVerify is true, TLS accepts any certificate
// presented by the server and any host name in that certificate.
// In this mode, TLS is susceptible to man-in-the-middle attacks.
// This should be used only for testing.
InsecureSkipVerify bool
// CipherSuites is a list of supported cipher suites. If CipherSuites
// is nil, TLS uses a list of suites supported by the implementation.
CipherSuites []uint16
// SessionTicketsDisabled may be set to true to disable session ticket
// (resumption) support.
SessionTicketsDisabled bool
// SessionTicketKey is used by TLS servers to provide session
// resumption. See RFC 5077. If zero, it will be filled with
// random data before the first server handshake.
//
// If multiple servers are terminating connections for the same host
// they should all have the same SessionTicketKey. If the
// SessionTicketKey leaks, previously recorded and future TLS
// connections using that key are compromised.
SessionTicketKey [32]byte
serverInitOnce sync.Once
}
func (c *Config) rand() io.Reader {
r := c.Rand
if r == nil {
return rand.Reader
}
return r
}
func (c *Config) time() time.Time {
t := c.Time
if t == nil {
t = time.Now
}
return t()
}
func (c *Config) cipherSuites() []uint16 {
s := c.CipherSuites
if s == nil {
s = defaultCipherSuites()
}
return s
}
// getCertificateForName returns the best certificate for the given name,
// defaulting to the first element of c.Certificates if there are no good
// options.
func (c *Config) getCertificateForName(name string) *Certificate {
if len(c.Certificates) == 1 || c.NameToCertificate == nil {
// There's only one choice, so no point doing any work.
return &c.Certificates[0]
}
name = strings.ToLower(name)
for len(name) > 0 && name[len(name)-1] == '.' {
name = name[:len(name)-1]
}
if cert, ok := c.NameToCertificate[name]; ok {
return cert
}
// try replacing labels in the name with wildcards until we get a
// match.
labels := strings.Split(name, ".")
for i := range labels {
labels[i] = "*"
candidate := strings.Join(labels, ".")
if cert, ok := c.NameToCertificate[candidate]; ok {
return cert
}
}
// If nothing matches, return the first certificate.
return &c.Certificates[0]
}
// BuildNameToCertificate parses c.Certificates and builds c.NameToCertificate
// from the CommonName and SubjectAlternateName fields of each of the leaf
// certificates.
func (c *Config) BuildNameToCertificate() {
c.NameToCertificate = make(map[string]*Certificate)
for i := range c.Certificates {
cert := &c.Certificates[i]
x509Cert, err := x509.ParseCertificate(cert.Certificate[0])
if err != nil {
continue
}
if len(x509Cert.Subject.CommonName) > 0 {
c.NameToCertificate[x509Cert.Subject.CommonName] = cert
}
for _, san := range x509Cert.DNSNames {
c.NameToCertificate[san] = cert
}
}
}
// A Certificate is a chain of one or more certificates, leaf first.
type Certificate struct {
Certificate [][]byte
PrivateKey crypto.PrivateKey // supported types: *rsa.PrivateKey
// OCSPStaple contains an optional OCSP response which will be served
// to clients that request it.
OCSPStaple []byte
// Leaf is the parsed form of the leaf certificate, which may be
// initialized using x509.ParseCertificate to reduce per-handshake
// processing for TLS clients doing client authentication. If nil, the
// leaf certificate will be parsed as needed.
Leaf *x509.Certificate
}
// A TLS record.
type record struct {
contentType recordType
major, minor uint8
payload []byte
}
type handshakeMessage interface {
marshal() []byte
unmarshal([]byte) bool
}
// mutualVersion returns the protocol version to use given the advertised
// version of the peer.
func mutualVersion(vers uint16) (uint16, bool) {
if vers < minVersion {
return 0, false
}
if vers > maxVersion {
vers = maxVersion
}
return vers, true
}
var emptyConfig Config
func defaultConfig() *Config {
return &emptyConfig
}
var (
once sync.Once
varDefaultCipherSuites []uint16
)
func defaultCipherSuites() []uint16 {
once.Do(initDefaultCipherSuites)
return varDefaultCipherSuites
}
func initDefaultCipherSuites() {
varDefaultCipherSuites = make([]uint16, len(cipherSuites))
for i, suite := range cipherSuites {
varDefaultCipherSuites[i] = suite.id
}
}
| {
"content_hash": "b41a4eccc4772d6668a05701c1390398",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 87,
"avg_line_length": 28.157738095238095,
"alnum_prop": 0.7337490751506184,
"repo_name": "rflanagan/reginaldflanagan-project1",
"id": "cfe2f2227fb104ec32dd565e736f3d74be50ada2",
"size": "9621",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/pkg/crypto/tls/common.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "312383"
},
{
"name": "Awk",
"bytes": "3780"
},
{
"name": "Bison",
"bytes": "93818"
},
{
"name": "C",
"bytes": "4712670"
},
{
"name": "C++",
"bytes": "93164"
},
{
"name": "CSS",
"bytes": "1897"
},
{
"name": "Emacs Lisp",
"bytes": "34415"
},
{
"name": "Go",
"bytes": "18307023"
},
{
"name": "HTML",
"bytes": "105884"
},
{
"name": "JavaScript",
"bytes": "2308"
},
{
"name": "Logos",
"bytes": "1248"
},
{
"name": "Makefile",
"bytes": "9219"
},
{
"name": "Objective-C",
"bytes": "749"
},
{
"name": "OpenEdge ABL",
"bytes": "9784"
},
{
"name": "Perl",
"bytes": "191105"
},
{
"name": "Python",
"bytes": "123100"
},
{
"name": "Shell",
"bytes": "80030"
},
{
"name": "VimL",
"bytes": "24060"
}
],
"symlink_target": ""
} |
import * as React from 'react'
import { useSelector, useDispatch } from 'react-redux'
import { Link } from 'react-router-dom'
import {
fetchSettings,
updateSetting,
getRobotSettings,
} from '../../robot-settings'
import { CONNECTABLE } from '../../discovery'
import { downloadLogs } from '../../shell/robot-logs/actions'
import { getRobotLogsDownloading } from '../../shell/robot-logs/selectors'
import { Portal } from '../portal'
import {
BORDER_SOLID_LIGHT,
AlertModal,
Card,
LabeledButton,
LabeledToggle,
Icon,
} from '@opentrons/components'
import { UpdateFromFileControl } from './UpdateFromFileControl'
import { OpenJupyterControl } from './OpenJupyterControl'
import type { State, Dispatch } from '../../types'
import type { ViewableRobot } from '../../discovery/types'
import type { RobotSettings } from '../../robot-settings/types'
export type AdvancedSettingsCardProps = {|
robot: ViewableRobot,
resetUrl: string,
|}
const TITLE = 'Advanced Settings'
const ROBOT_LOGS_OPTOUT_ID = 'disableLogAggregation'
const ROBOT_LOGS_OUTOUT_HEADING = 'Robot Logging'
const ROBOT_LOGS_OPTOUT_MESSAGE = (
<>
<p>
If your OT-2 is connected to the internet, Opentrons will collect logs
from your robot to troubleshoot issues and identify error trends.
</p>
<p>
If you would like to disable log collection, please click "Opt
out" below.
</p>
</>
)
export function AdvancedSettingsCard(
props: AdvancedSettingsCardProps
): React.Node {
const { robot, resetUrl } = props
const { name, ip, health, status } = robot
const settings = useSelector<State, RobotSettings>(state =>
getRobotSettings(state, name)
)
const robotLogsDownloading = useSelector(getRobotLogsDownloading)
const dispatch = useDispatch<Dispatch>()
const controlsDisabled = status !== CONNECTABLE
const logsAvailable = health && health.logs
const showLogOptoutModal = settings.some(
s => s.id === ROBOT_LOGS_OPTOUT_ID && s.value === null
)
const setLogOptout = (value: boolean) =>
dispatch(updateSetting(name, ROBOT_LOGS_OPTOUT_ID, value))
React.useEffect(() => {
dispatch(fetchSettings(name))
}, [dispatch, name])
return (
<Card title={TITLE}>
<LabeledButton
label="Download Logs"
buttonProps={{
children: robotLogsDownloading ? (
<Icon name="ot-spinner" height="1em" spin />
) : (
'Download'
),
disabled: controlsDisabled || !logsAvailable || robotLogsDownloading,
onClick: () => dispatch(downloadLogs(robot)),
}}
>
<p>Access logs from this robot.</p>
</LabeledButton>
<LabeledButton
label="Factory Reset"
buttonProps={{
disabled: controlsDisabled,
Component: Link,
to: resetUrl,
children: 'Reset',
}}
>
<p>Restore robot to factory configuration</p>
</LabeledButton>
<UpdateFromFileControl
robotName={name}
borderBottom={BORDER_SOLID_LIGHT}
/>
<OpenJupyterControl robotIp={ip} borderBottom={BORDER_SOLID_LIGHT} />
{settings.map(({ id, title, description, value }) => (
<LabeledToggle
key={id}
label={title}
toggledOn={value === true}
disabled={controlsDisabled}
onClick={() => dispatch(updateSetting(name, id, !value))}
>
<p>{description}</p>
</LabeledToggle>
))}
{showLogOptoutModal && (
<Portal>
<AlertModal
alertOverlay
heading={ROBOT_LOGS_OUTOUT_HEADING}
buttons={[
{ children: 'Opt out', onClick: () => setLogOptout(true) },
{ children: 'Sounds Good!', onClick: () => setLogOptout(false) },
]}
>
{ROBOT_LOGS_OPTOUT_MESSAGE}
</AlertModal>
</Portal>
)}
</Card>
)
}
| {
"content_hash": "4d7718cbfcdb6f61ca88b84964a4f331",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 79,
"avg_line_length": 29.303703703703704,
"alnum_prop": 0.6172901921132457,
"repo_name": "OpenTrons/opentrons-api",
"id": "59f788dd5c746a09ba1730ad90b08f98ea7dd27f",
"size": "4007",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/src/components/RobotSettings/AdvancedSettingsCard.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "11593"
},
{
"name": "CSS",
"bytes": "30408"
},
{
"name": "HTML",
"bytes": "15337"
},
{
"name": "JavaScript",
"bytes": "89667"
},
{
"name": "Makefile",
"bytes": "9280"
},
{
"name": "Python",
"bytes": "642726"
},
{
"name": "Ruby",
"bytes": "17204"
},
{
"name": "Shell",
"bytes": "6478"
},
{
"name": "Vue",
"bytes": "28755"
}
],
"symlink_target": ""
} |
<?php
namespace xpl\Data\Model;
interface ModelInterface extends
\Traversable,
\ArrayAccess,
\xpl\Common\Arrayable,
\xpl\Common\Importable
{
}
| {
"content_hash": "c2eebfbdf60a412afad28d66ad8033f2",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 33,
"avg_line_length": 13,
"alnum_prop": 0.7243589743589743,
"repo_name": "xpl-php/Data",
"id": "59b1b131754fd0bafe1c81b501325e33ed8fb917",
"size": "156",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Model/ModelInterface.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "18619"
}
],
"symlink_target": ""
} |
package com.ruesga.rview.gerrit;
import android.annotation.SuppressLint;
import android.net.TrafficStats;
import android.os.Build;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.X509Certificate;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import okhttp3.ConnectionSpec;
import okhttp3.OkHttpClient;
public class OkHttpHelper {
// https://github.com/square/okhttp/blob/master/okhttp-tests/src/test/java/okhttp3/DelegatingSocketFactory.java
private static class DelegatingSocketFactory extends SocketFactory {
private final javax.net.SocketFactory mDelegate;
private DelegatingSocketFactory(javax.net.SocketFactory delegate) {
this.mDelegate = delegate;
}
@Override public Socket createSocket() throws IOException {
Socket socket = mDelegate.createSocket();
return configureSocket(socket);
}
@Override public Socket createSocket(String host, int port) throws IOException {
Socket socket = mDelegate.createSocket(host, port);
return configureSocket(socket);
}
@Override public Socket createSocket(String host, int port, InetAddress localAddress,
int localPort) throws IOException {
Socket socket = mDelegate.createSocket(host, port, localAddress, localPort);
return configureSocket(socket);
}
@Override public Socket createSocket(InetAddress host, int port) throws IOException {
Socket socket = mDelegate.createSocket(host, port);
return configureSocket(socket);
}
@Override public Socket createSocket(InetAddress host, int port, InetAddress localAddress,
int localPort) throws IOException {
Socket socket = mDelegate.createSocket(host, port, localAddress, localPort);
return configureSocket(socket);
}
private Socket configureSocket(Socket socket) {
try {
TrafficStats.setThreadStatsTag(
Math.max(1, Math.min(0xFFFFFEFF, Thread.currentThread().hashCode())));
TrafficStats.tagSocket(socket);
} catch (Throwable cause) {
// Ignore for testing
}
return socket;
}
}
@SuppressLint("TrustAllX509TrustManager")
private static final X509TrustManager TRUST_ALL_CERTS = new X509TrustManager() {
@Override
public void checkClientTrusted(
X509Certificate[] x509Certificates, String authType) {
}
@Override
public void checkServerTrusted(
X509Certificate[] x509Certificates, String authType) {
}
@Override
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[]{};
}
};
private static SSLSocketFactory sSSLSocketFactory;
private static DelegatingSocketFactory sDelegatingSocketFactory;
public static OkHttpClient.Builder getSafeClientBuilder() {
if (sDelegatingSocketFactory == null) {
sDelegatingSocketFactory = new DelegatingSocketFactory(SocketFactory.getDefault());
}
return new OkHttpClient.Builder()
.connectionSpecs(createConnectionSpecs(ConnectionSpec.RESTRICTED_TLS, false))
.socketFactory(sDelegatingSocketFactory);
}
@SuppressLint("BadHostnameVerifier")
static OkHttpClient.Builder getUnsafeClientBuilder() {
OkHttpClient.Builder builder = getSafeClientBuilder();
try {
if (sSSLSocketFactory == null) {
final SSLContext sslContext = SSLContext.getInstance("SSL");
sslContext.init(null, new X509TrustManager[]{TRUST_ALL_CERTS}, null);
sSSLSocketFactory = sslContext.getSocketFactory();
}
builder.connectionSpecs(createConnectionSpecs(ConnectionSpec.MODERN_TLS, true));
builder.sslSocketFactory(sSSLSocketFactory, TRUST_ALL_CERTS);
builder.hostnameVerifier((hostname, session) -> hostname != null);
} catch (NoSuchAlgorithmException | KeyManagementException e) {
// Ignore
}
return builder;
}
private static List<ConnectionSpec> createConnectionSpecs(ConnectionSpec specs,
boolean forceAllCipherSuites) {
ConnectionSpec.Builder spec = new ConnectionSpec.Builder(specs);
if (Build.VERSION.RELEASE.equals("7.0") || forceAllCipherSuites) {
// There is a bug in Android 7.0 (https://issuetracker.google.com/issues/37122132)
// that only supports the prime256v1 elliptic curve. So in just release the
// cipher requirements if we are in that case.
spec.allEnabledCipherSuites();
}
return Arrays.asList(spec.build(), ConnectionSpec.CLEARTEXT);
}
}
| {
"content_hash": "816ff490e80e87272fb64e288353047b",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 115,
"avg_line_length": 38.3014705882353,
"alnum_prop": 0.6709541178729123,
"repo_name": "jruesga/rview",
"id": "bb4ced741bea966c4624b5c6860f24ff54635f9f",
"size": "5809",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gerrit/src/main/java/com/ruesga/rview/gerrit/OkHttpHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GAP",
"bytes": "3148"
},
{
"name": "HTML",
"bytes": "8062"
},
{
"name": "Java",
"bytes": "2653651"
},
{
"name": "JavaScript",
"bytes": "18637"
}
],
"symlink_target": ""
} |
// Copyright 2010-2022 Google LLC
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// [START program]
package com.google.ortools.graph.samples;
// [START import]
import com.google.ortools.Loader;
import com.google.ortools.graph.MinCostFlow;
import com.google.ortools.graph.MinCostFlowBase;
// [END import]
/** Minimal Assignment Min Flow. */
public class AssignmentMinFlow {
public static void main(String[] args) throws Exception {
Loader.loadNativeLibraries();
// [START solver]
// Instantiate a SimpleMinCostFlow solver.
MinCostFlow minCostFlow = new MinCostFlow();
// [END solver]
// [START data]
// Define four parallel arrays: sources, destinations, capacities, and unit costs
// between each pair.
int[] startNodes =
new int[] {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 6, 7, 8};
int[] endNodes =
new int[] {1, 2, 3, 4, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 5, 6, 7, 8, 9, 9, 9, 9};
int[] capacities =
new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
int[] unitCosts = new int[] {
0, 0, 0, 0, 90, 76, 75, 70, 35, 85, 55, 65, 125, 95, 90, 105, 45, 110, 95, 115, 0, 0, 0, 0};
int source = 0;
int sink = 9;
int tasks = 4;
// Define an array of supplies at each node.
int[] supplies = new int[] {tasks, 0, 0, 0, 0, 0, 0, 0, 0, -tasks};
// [END data]
// [START constraints]
// Add each arc.
for (int i = 0; i < startNodes.length; ++i) {
int arc = minCostFlow.addArcWithCapacityAndUnitCost(
startNodes[i], endNodes[i], capacities[i], unitCosts[i]);
if (arc != i) {
throw new Exception("Internal error");
}
}
// Add node supplies.
for (int i = 0; i < supplies.length; ++i) {
minCostFlow.setNodeSupply(i, supplies[i]);
}
// [END constraints]
// [START solve]
// Find the min cost flow.
MinCostFlowBase.Status status = minCostFlow.solve();
// [END solve]
// [START print_solution]
if (status == MinCostFlow.Status.OPTIMAL) {
System.out.println("Total cost: " + minCostFlow.getOptimalCost());
System.out.println();
for (int i = 0; i < minCostFlow.getNumArcs(); ++i) {
// Can ignore arcs leading out of source or into sink.
if (minCostFlow.getTail(i) != source && minCostFlow.getHead(i) != sink) {
// Arcs in the solution have a flow value of 1. Their start and end nodes
// give an assignment of worker to task.
if (minCostFlow.getFlow(i) > 0) {
System.out.println("Worker " + minCostFlow.getTail(i) + " assigned to task "
+ minCostFlow.getHead(i) + " Cost: " + minCostFlow.getUnitCost(i));
}
}
}
} else {
System.out.println("Solving the min cost flow problem failed.");
System.out.println("Solver status: " + status);
}
// [END print_solution]
}
private AssignmentMinFlow() {}
}
// [END program]
| {
"content_hash": "de272d472db09ad75aac3a2e3ba7d63d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 100,
"avg_line_length": 36.95789473684211,
"alnum_prop": 0.608088863571632,
"repo_name": "google/or-tools",
"id": "e80a957037f0bb030c68810d8c43ed7f730e253c",
"size": "3511",
"binary": false,
"copies": "2",
"ref": "refs/heads/stable",
"path": "ortools/graph/samples/AssignmentMinFlow.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "18599"
},
{
"name": "C",
"bytes": "11382"
},
{
"name": "C#",
"bytes": "498888"
},
{
"name": "C++",
"bytes": "14071164"
},
{
"name": "CMake",
"bytes": "219723"
},
{
"name": "Dockerfile",
"bytes": "149476"
},
{
"name": "Java",
"bytes": "459136"
},
{
"name": "Lex",
"bytes": "2271"
},
{
"name": "Makefile",
"bytes": "207007"
},
{
"name": "Python",
"bytes": "629275"
},
{
"name": "SWIG",
"bytes": "414259"
},
{
"name": "Shell",
"bytes": "83555"
},
{
"name": "Starlark",
"bytes": "235950"
},
{
"name": "Yacc",
"bytes": "26027"
},
{
"name": "sed",
"bytes": "45"
}
],
"symlink_target": ""
} |
namespace Cloudlab.Logic
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Cloudlab.Helpers;
using Cloudlab.Models;
using DropNet;
using Jurassic;
using Jurassic.Library;
using Jurassic.Numerics;
using MongoDB.Driver;
[Serializable]
public class APIVM
{
#region Data Members
public string User { get; set; }
ScriptEngine Engine { get; set; }
public DropNetClient Storage { get; protected set; }
private TimeSpan Timeout { get; set; }
#endregion
public APIVM(string username, TimeSpan maxTime, bool readFiles, bool writeFiles)
{
this.User = username;
this.Timeout = maxTime;
GetStorage();
var kvConnStr = System.Configuration.ConfigurationManager.AppSettings.Get("MONGOLAB_URI");
this.Engine = Jurassic.Numerics.Configurator.New();
this.Engine = Jurassic.Cloudlab.Configurator.Configure(this.Engine, username, this.Storage, kvConnStr);
}
private void GetStorage()
{
try
{
this.Storage = Dropbox.GetSession(this.User);
}
catch (Exception ex)
{
this.Storage = null;
ex.SendToACP();
}
}
public string Interpret(string javascript)
{
if (string.IsNullOrWhiteSpace(javascript))
{
return string.Empty;
}
try
{
var cts = new CancellationTokenSource();
var task = Task.Factory.StartNew(() => this.Engine.Execute(javascript), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
if (!task.Wait((int)this.Timeout.TotalMilliseconds, cts.Token))
{
cts.Cancel();
}
this.Engine.Execute(javascript);
return JSONObject.Stringify(this.Engine, this.Engine.GetGlobalValue("APIResponse"));
}
catch (Exception e)
{
e.SendToACP();
return JSONObject.Stringify(this.Engine, e.Message);
}
}
}
} | {
"content_hash": "964a46d02ce907f1f1b4d9ca52005ac6",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 155,
"avg_line_length": 28.475,
"alnum_prop": 0.5460930640913082,
"repo_name": "tmcnab/cloudlab.io",
"id": "f7c27ad6369381e15efdc2ad37cdec9c51cc7ef1",
"size": "2280",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "v2/Cloudlab/Logic/APIVM.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "196"
},
{
"name": "C#",
"bytes": "3853237"
},
{
"name": "JavaScript",
"bytes": "5527294"
},
{
"name": "PowerShell",
"bytes": "155045"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="24dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="购物愿望"
android:textStyle="bold"
android:textSize="20sp"
android:textColor="#212121"
android:paddingBottom="24dp" />
<EditText
android:id="@+id/content_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#424242"
android:hint="愿望内容"
android:paddingBottom="12dp"
android:layout_marginBottom="15dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/price_edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="number"
android:hint="价格" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元"
android:textColor="@color/secondary_text" />
<Switch
android:id="@+id/switch_completed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textOn="已完成"
android:textOff="未完成" />
</LinearLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<Button
android:text="删除"
android:id="@+id/btn_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:textColor="@color/dialog_second_button_text_color"
/>
<LinearLayout
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:text="取消"
android:id="@+id/btn_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:textColor="@color/dialog_second_button_text_color"
/>
<Button
android:text="确定"
android:id="@+id/btn_comfirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:textColor="@color/dialog_main_button_text_color"
/>
</LinearLayout>
</RelativeLayout>
</LinearLayout> | {
"content_hash": "9f194a3b62a3acb4836595df8bf75d1f",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 74,
"avg_line_length": 35.00990099009901,
"alnum_prop": 0.5565610859728507,
"repo_name": "leikaiyi43/WishList",
"id": "5c45e0c3551fd7ea197921bd35fda7ce7a66a868",
"size": "3582",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/edit_shop_dialog.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "1033"
},
{
"name": "Java",
"bytes": "35101"
}
],
"symlink_target": ""
} |
var lib = process.env.GEAR_COVER ? '../lib-cov/' : '../lib/',
should = require('should'),
Blob = require(lib + 'blob').Blob,
test = require(lib + 'tasks/core').test,
fixtures = {
blob: new Blob('HELLO'),
result: 'HELLO'
};
describe('test()', function() {
it('should test blobs', function(done) {
test({callback: function(blob) {
return blob.result;
}}, fixtures.blob, function(err) {
err.should.equal(fixtures.result);
done();
});
});
}); | {
"content_hash": "deae9c3b33252a0a904406414aa3de3a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 61,
"avg_line_length": 28.57894736842105,
"alnum_prop": 0.5174953959484346,
"repo_name": "twobit/gear",
"id": "57fb9a789d18d14ad68f0cb8050cc52201bb8df3",
"size": "543",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "test/core.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "576260"
},
{
"name": "Makefile",
"bytes": "446"
}
],
"symlink_target": ""
} |
These will be cleaned up and enhanced, then moved to the README
### Vagrant Image
A vagrant box for the Virtualbox provider is available to team members via the Hashicorp Atlas
repository. Downloading and booting the box provides standard environment components, such as
docker, consul, graphite, statsd, elastisearch, logstash, kibana, fluentd, etc.
The details on how the box was created are available in the [xavi-docker](https://github.com/xtracdev/xavi-docker)
project.
When running xavi locally using services running in the Vagrant box, set environment variables
as needed. Current the consul and statsd directories must be set:
<pre>
export XAVI_CONSUL_AGENT_IP=172.20.20.70
export XAVI_STATSD_ADDRESS=172.20.20.70:8125
</pre>
A pre-built box (private image) is available via Hashicorp Atlas to team members.
### Codeship Setup - Copy to S3 Bucket
Note for simple CI on commit there's no need to do an S3 deploy
Test setup:
<pre>
go get github.com/tools/godep
</pre>
Test commands
<pre>
godep go test ./...
</pre>
1st deploy
* Custom Script
godep go build
2nd deploy
* Amazon S3
access key id, secret access key
region - us-west-1
localpath - xavi (go build artifact)
s3 bucket - ds-codeship
acl - bucket-owner-full-control
### Register Service - Consul
/v1/agent/service/register
<pre>
{
"ID": "demo-service-1",
"Name": "demo-service",
"Tags": [
"demosvc",
"v1"
],
"Address": "172.20.20.70",
"Port": 3000
}
</pre>
<pre>
{
"ID": "demo-service-2",
"Name": "demo-service",
"Tags": [
"demosvc",
"v1"
],
"Address": "172.20.20.70",
"Port": 3100
}
</pre>
### Register Health Check for Service
/v1/agent/check/register
<pre>
{
"ID": "demo-service-check-1",
"service_id": "demo-service-1",
"service-name":"demo-service",
"Name": "hello",
"Notes": "Get /hello",
"HTTP": "http://172.20.20.70:3000/hello",
"Interval": "10s"
}
</pre>
<pre>
{
"ID": "demo-service-check-2",
"service_id": "demo-service-2",
"service-name":"demo-service",
"Name": "hello",
"Notes": "Get /hello",
"HTTP": "http://172.20.20.70:3100/hello",
"Interval": "10s"
}
</pre>
### Registered Service DNS query
dig @172.20.20.70 -p 8600 demo-service.service.consul SRV
dig @172.20.20.70 -p 8600 v1.demo-service.service.consul SRV
### Deregister Health Check
curl http://172.20.20.70:8500/v1/agent/check/deregister/demo-service-check
### Deregister service
curl http://172.20.20.70:8500/v1/agent/service/deregister/demo-service
### Expvar URI on listener host:port
/debug/vars
### Log Rotation
In /etc/logrotate.d, sudo vi xavi-demo-svc.log:
/home/vagrant/xavi-logs/demo.log {
missingok
copytruncate
size 50k
create 755 vagrant vagrant
su vagrant vagrant
rotate 20
}
Then add an entry in /etc/crontab (sudo vi /etc/crontab)
30 * * * * root /usr/sbin/logrotate /etc/logrotate.d/xavi-demo-svc.log
Or, alternatively create a script in /etc/cron.hourly (make sure to chmod +x the script)
#!/bin/sh
/usr/sbin/logrotate /etc/logrotate.d/xavi-demo-svc.log
logrotate is fussy about the permissions. I created a umask of 022 in the .vagrant .bashrc
The above assumes writing the stdout to a logfile named xavi-demo-svc.log
xavi listen -ln demo-listener -address 0.0.0.0:11223 >> xavi-logs/demo.log
Note if you don't 'append' via >> you will not see the file size diminish
on truncation (it will have null bytes prepended to the up to the last write offset).
### Statsd Setup - Ubuntu
apt-get install nodejs npm
sudo apt-get install nodejs npm
sudo apt-get install git
git clone https://github.com/etsy/statsd/
cd statsd/
cp exampleConfig.js config.js
vi config.js
nodejs stats.js ./config.js
config.js contents:
<pre>
{
graphitePort: 2003
, graphiteHost: "172.20.20.50"
,port: 8125
, backends: [ "./backends/console","./backends/graphite" ]
, debug: true
, dumpMessages: true
}
</pre>
| {
"content_hash": "789b8b8f489697dd5df1dcc44205ff5c",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 114,
"avg_line_length": 20.825396825396826,
"alnum_prop": 0.6923272357723578,
"repo_name": "xtracdev/xavi",
"id": "d66702c2fda689e1d4d9545efaf460b2dd42352e",
"size": "3952",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/notes/misc.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "572"
},
{
"name": "Gherkin",
"bytes": "1527"
},
{
"name": "Go",
"bytes": "341482"
},
{
"name": "Shell",
"bytes": "445"
}
],
"symlink_target": ""
} |
BeforeAll {
. $PSScriptRoot\Shared.ps1
. $modulePath\Utils.ps1
}
Describe 'Utils Function Tests' {
Context 'Add-PoshGitToProfile Tests' {
BeforeAll {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$newLine = [System.Environment]::NewLine
}
BeforeEach {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$profilePath = [System.IO.Path]::GetTempFileName()
}
AfterEach {
Remove-Item $profilePath -Recurse -ErrorAction SilentlyContinue
}
It 'Creates profile file if it does not exist that imports absolute path' {
Mock Get-PSModulePath {
return @()
}
Remove-Item -LiteralPath $profilePath
Test-Path -LiteralPath $profilePath | Should -Be $false
Add-PoshGitToProfile $profilePath
Test-Path -LiteralPath $profilePath | Should -Be $true
Get-FileEncoding $profilePath | Should -Be $expectedEncoding
$content = Get-Content $profilePath
$content.Count | Should -Be 2
$nativePath = MakeNativePath $modulePath\posh-git.psd1
@($content)[1] | Should -BeExactly "Import-Module '$nativePath'"
}
It 'Creates profile file if it does not exist that imports from module path' {
$parentDir = Split-Path $profilePath -Parent
Mock Get-PSModulePath {
return @(
'C:\Users\Keith\Documents\WindowsPowerShell\Modules',
'C:\Program Files\WindowsPowerShell\Modules',
'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\',
"$parentDir")
}
Remove-Item -LiteralPath $profilePath
Test-Path -LiteralPath $profilePath | Should -Be $false
Add-PoshGitToProfile $profilePath $parentDir
Test-Path -LiteralPath $profilePath | Should -Be $true
Get-FileEncoding $profilePath | Should -Be $expectedEncoding
$content = Get-Content $profilePath
$content.Count | Should -Be 2
@($content)[1] | Should -BeExactly "Import-Module posh-git"
}
It 'Creates profile file if the profile dir does not exist' {
# Use $profilePath as missing parent directory (auto-cleanup)
Remove-Item -LiteralPath $profilePath
Test-Path -LiteralPath $profilePath | Should -Be $false
$childProfilePath = Join-Path $profilePath profile.ps1
Add-PoshGitToProfile $childProfilePath
Test-Path -LiteralPath $childProfilePath | Should -Be $true
$childProfilePath | Should -FileContentMatch "^Import-Module .*posh-git"
}
It 'Does not modify profile that already refers to posh-git' {
$profileContent = @'
Import-Module PSCX
Import-Module posh-git
'@
Set-Content $profilePath -Value $profileContent -Encoding Ascii
$output = Add-PoshGitToProfile $profilePath 3>&1
$output[1] | Should -Match 'posh-git appears'
Get-FileEncoding $profilePath | Should -Be 'ascii'
$content = Get-Content $profilePath
$content.Count | Should -Be 2
$expectedContent = Convert-NativeLineEnding $profileContent
$content -join $newline | Should -BeExactly $expectedContent
}
It 'Adds import from PSModulePath on existing (Unicode) profile file correctly' {
$profileContent = @'
Import-Module PSCX
New-Alias pscore C:\Users\Keith\GitHub\rkeithhill\PowerShell\src\powershell-win-core\bin\Debug\netcoreapp1.1\win10-x64\powershell.exe
'@
Set-Content $profilePath -Value $profileContent -Encoding Unicode
$moduleBasePath = Split-Path $profilePath -Parent
Add-PoshGitToProfile $profilePath $moduleBasePath
Test-Path -LiteralPath $profilePath | Should -Be $true
Get-FileEncoding $profilePath | Should -Be 'unicode'
$content = Get-Content $profilePath
$content.Count | Should -Be 5
$expectedContent = Convert-NativeLineEnding $profileContent
$expectedContent += "${newLine}${newLine}Import-Module '$(Join-Path $moduleBasePath posh-git).psd1'"
$content -join $newLine | Should -BeExactly $expectedContent
}
}
Context 'Remove-PoshGitFromProfile Tests' {
BeforeAll {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$newLine = [System.Environment]::NewLine
}
BeforeEach {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$profilePath = [System.IO.Path]::GetTempFileName()
}
AfterEach {
Remove-Item $profilePath -Recurse -ErrorAction SilentlyContinue
}
It 'Removes import from the profile correctly' {
$profileContent = @'
Import-Module PSCX
# import posh-git here:
'@
Set-Content $profilePath -Value $profileContent -Encoding Ascii
$moduleBasePath = Split-Path $profilePath -Parent
Add-PoshGitToProfile $profilePath $moduleBasePath
$output = Remove-PoshGitFromProfile $profilePath 3>&1
Write-Host "output: $output"
$output.Length | Should -Be 0
Get-FileEncoding $profilePath | Should -Be 'ascii'
$content = Get-Content $profilePath -Raw
$content | Should -Be "$profileContent${newline}"
}
}
Context 'Get-PromptConnectionInfo' {
BeforeEach {
if (Test-Path Env:SSH_CONNECTION) {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$ssh_connection = $Env:SSH_CONNECTION
Remove-Item Env:SSH_CONNECTION
}
}
AfterEach {
if ($ssh_connection) {
Set-Item Env:SSH_CONNECTION $ssh_connection
}
elseif (Test-Path Env:SSH_CONNECTION) {
Remove-Item Env:SSH_CONNECTION
}
}
It 'Returns null if Env:SSH_CONNECTION is not set' {
Get-PromptConnectionInfo | Should -BeExactly $null
}
It 'Returns null if Env:SSH_CONNECTION is empty' {
Set-Item Env:SSH_CONNECTION ''
Get-PromptConnectionInfo | Should -BeExactly $null
}
It 'Returns "[username@hostname]: " if Env:SSH_CONNECTION is set' {
Set-Item Env:SSH_CONNECTION 'test'
Get-PromptConnectionInfo | Should -BeExactly "[$([System.Environment]::UserName)@$([System.Environment]::MachineName)]: "
}
It 'Returns formatted string if Env:SSH_CONNECTION is set with -Format' {
Set-Item Env:SSH_CONNECTION 'test'
Get-PromptConnectionInfo -Format "[{0}]({1}) " | Should -BeExactly "[$([System.Environment]::MachineName)]($([System.Environment]::UserName)) "
}
}
Context 'Test-PoshGitImportedInScript Tests' {
BeforeEach {
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssigments', '')]
$profilePath = [System.IO.Path]::GetTempFileName()
}
AfterEach {
Remove-Item $profilePath -ErrorAction SilentlyContinue
}
It 'Detects Import-Module posh-git in profile script' {
$profileContent = "Import-Module posh-git"
Set-Content $profilePath -Value $profileContent -Encoding Unicode
Test-PoshGitImportedInScript $profilePath | Should -Be $true
}
It 'Detects chocolatey installed line in profile script' {
$profileContent = ". 'C:\tools\poshgit\dahlbyk-posh-git-18d600a\profile.example.ps1"
Set-Content $profilePath -Value $profileContent -Encoding Unicode
Test-PoshGitImportedInScript $profilePath | Should -Be $true
}
It 'Returns false when one-line profile script does not import posh-git' {
$profileContent = "# Test"
Set-Content $profilePath -Value $profileContent -Encoding Unicode
Test-PoshGitImportedInScript $profilePath | Should -Be $false
}
It 'Returns false when profile script does not import posh-git' {
$profileContent = "Import-Module Pscx`nImport-Module platyPS`nImport-Module Plaster"
Set-Content $profilePath -Value $profileContent -Encoding Unicode
Test-PoshGitImportedInScript $profilePath | Should -Be $false
}
}
Context 'Test-InPSModulePath Tests' {
It 'Returns false for install not under any PSModulePaths' {
Mock Get-PSModulePath { }
$path = "C:\Users\Keith\Documents\WindowsPowerShell\Modules\posh-git\0.7.0\"
Test-InPSModulePath $path | Should -Be $false
Assert-MockCalled Get-PSModulePath
}
It 'Returns true for install under single PSModulePath' {
Mock Get-PSModulePath {
return MakeNativePath "$HOME\Documents\WindowsPowerShell\Modules\posh-git\"
}
$path = MakeNativePath "$HOME\Documents\WindowsPowerShell\Modules\posh-git\0.7.0"
Test-InPSModulePath $path | Should -Be $true
Assert-MockCalled Get-PSModulePath
}
It 'Returns true for install under multiple PSModulePaths' {
Mock Get-PSModulePath {
return (MakeNativePath "$HOME\Documents\WindowsPowerShell\Modules\posh-git\"),
(MakeNativePath "$HOME\GitHub\dahlbyk\posh-git\0.6.1.20160330\")
}
$path = MakeNativePath "$HOME\Documents\WindowsPowerShell\Modules\posh-git\0.7.0"
Test-InPSModulePath $path | Should -Be $true
Assert-MockCalled Get-PSModulePath
}
It 'Returns false when current posh-git module location is not under PSModulePaths' {
Mock Get-PSModulePath {
return (MakeNativePath "$HOME\Documents\WindowsPowerShell\Modules\posh-git\"),
(MakeNativePath "$HOME\GitHub\dahlbyk\posh-git\0.6.1.20160330\")
}
$path = MakeNativePath "\tools\posh-git\dahlbyk-posh-git-18d600a"
Test-InPSModulePath $path | Should -Be $false
Assert-MockCalled Get-PSModulePath
}
It 'Returns false when current posh-git module location is under PSModulePath, but in a src directory' {
Mock Get-PSModulePath {
return MakeNativePath '\GitHub'
}
$path = MakeNativePath "\GitHub\posh-git\src"
Test-InPSModulePath $path | Should -Be $false
Assert-MockCalled Get-PSModulePath
}
}
}
| {
"content_hash": "a33788a35ab6928ab8a5d6e0d12f2887",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 155,
"avg_line_length": 44.45161290322581,
"alnum_prop": 0.6195573294629898,
"repo_name": "dahlbyk/posh-git",
"id": "0f77383b00bc51ffdecefbfbe62ead371e2cc778",
"size": "11024",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/Utils.Tests.ps1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "280282"
}
],
"symlink_target": ""
} |
import _ from 'lodash';
import React from 'react';
import { branch as BranchMixin } from 'baobab-react/mixins';
import BaobabPropTypes from 'baobab-prop-types';
/**
* SchemaCursorMixin is designed for use with baobab-react mixin `branch`.
* General purpose of mixin is tree autogeneration with schema.
*
* This mixin add cursors from component `schema` for `tree` component prop or root tree.
*
* Example of usage:
*
* Our tree (auto-generated from schema):
* {
* globalVal: 'global value (predefined)',
* form: {
* name: '',
* externalId: ''
* }
* }
*
* const EditForm = React.createClass({
* mixins: [SchemaBranchMixin],
* schema: {
* name: '',
* externalId: ''
* },
* cursors: {
* globalVal: ['globalVal']
* },
* render() {
* We have this.cursors.globalVal (via baobab-react branch mixin)
* And we have `this.cursors.name`, `this.cursors.externalId` via
* SchemaBranchMixin.
* `this.state.name` and others state params contains value from
* appropriate cursor via baobab-react branch mixin
*
* If `tree` props is not received from child component, global tree will
* be used
* }
* });
*
* const Page = React.createClass({
* mixins: [SchemaBranchMixin],
*
* schema: {
* form: {}
* },
*
* render() {
* return (<EditForm tree={this.cursors.form} />);
* }
* });
*/
const SchemaBranchMixin = {
propTypes: {
tree: React.PropTypes.oneOfType([BaobabPropTypes.baobab, BaobabPropTypes.cursor]),
},
contextTypes: {
tree: BaobabPropTypes.baobab,
},
getTreeCursor(props) {
return props.tree || this.context.tree.select();
},
getInitialState() {
if (_.isFunction(this.cursors)) {
this.cursors = this.cursors(this.props, this.context);
} else {
this.cursors = _.cloneDeep(this.cursors) || {};
}
this.schema = _.cloneDeep(this.schema || {});
const tree = this.getTreeCursor(this.props);
// Add initial cursors to first-level schema
// Baobab-react branch mixin will add watchers for this cursors
_.each(this.schema, (value, key) => this.cursors[key] = tree.select(key));
},
componentWillMount() {
const tree = this.getTreeCursor(this.props);
this.updateStateFromTree(tree);
},
componentWillReceiveProps(nextProps) {
const oldTree = this.getTreeCursor(this.props);
const newTree = this.getTreeCursor(nextProps);
if (oldTree !== newTree) {
// Change cursor mapping for new tree via accessing to private `__cursorsMapping`
// Baobab-react branch mixin will refresh watcher in this step
_.each(this.schema, (value, key) => this.__cursorsMapping[key] = newTree.select(key));
this.updateStateFromTree(newTree);
}
},
/**
* Create state from tree and update current state with created state
*
* @param tree
*/
updateStateFromTree(tree) {
this.setState(this.createState(tree));
},
/**
* Create state in tree corresponding to schema at first-level
* Returns object which represent state
*
* @param tree Baobab Tree
* @returns {Object}
*/
createState(tree) {
function iterate(curTree, curSchema) {
return _.mapValues(curSchema, (value, key) => {
const cursor = curTree.select(key);
if (!cursor.exists() || curSchema._override === true) {
cursor.set(value);
} else if (_.isPlainObject(value) && _.isPlainObject(cursor.get())) {
iterate(cursor, value);
}
return cursor.get();
});
}
const state = iterate(tree, this.schema);
this.context.tree.commit();
return state;
},
};
export default {
displayName: 'SchemaBranchMixin',
mixins: [SchemaBranchMixin, BranchMixin],
};
| {
"content_hash": "1fe9d386877e1c8fabe3b77e61be24f9",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 92,
"avg_line_length": 25.482993197278912,
"alnum_prop": 0.6353443673251469,
"repo_name": "Brogency/baobab-react-schemabranchmixin",
"id": "13bec535b9ec227e3b4ee18fde8556ae998a952b",
"size": "3746",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "12520"
}
],
"symlink_target": ""
} |
/**
* Process Editor - CMMN Package
*
* (C) 2014 the authors
*/
package net.frapu.code.visualization.cmmn;
import net.frapu.code.visualization.Cluster;
import java.awt.*;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
/**
* @author Stephan
* @version 12.10.2014.
*/
public class CasePlanModel extends Cluster {
public CasePlanModel() {
super();
initializeProperties();
}
private void initializeProperties() {
setSize(300, 200);
setText("Case Plan Model");
}
@Override
protected void paintInternal(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(CMMNUtils.defaultStroke);
int yPos = 10;
int spacing = 0;
if (!getStereotype().isEmpty()) spacing = 20;
Rectangle2D outline = new Rectangle2D.Float(getPos().x - (getSize().width / 2),
getPos().y - (getSize().height / 2)+20+spacing,
getSize().width, getSize().height-20-spacing);
g2.setPaint(getBackground());
g2.fill(outline);
g2.setPaint(Color.BLACK);
g2.draw(outline);
Polygon titleBox = new Polygon();
titleBox.addPoint(getPos().x - (getSize().width / 2) + 15, getPos().y - (getSize().height / 2));
titleBox.addPoint(getPos().x - 15, getPos().y - (getSize().height / 2));
titleBox.addPoint(getPos().x, getPos().y - (getSize().height / 2 - 20 - spacing));
titleBox.addPoint(getPos().x - (getSize().width / 2), getPos().y - (getSize().height / 2 - 20 - spacing));
g2.setPaint(getBackground());
g2.fill(titleBox);
g2.setPaint(Color.BLACK);
g2.draw(titleBox);
g2.setFont(CMMNUtils.defaultFont.deriveFont(Font.BOLD));
CMMNUtils.drawText(g2, getPos().x-(getSize().width/4), getPos().y - getSize().height/2+yPos,
getSize().width / 2, getText(), CMMNUtils.Orientation.CENTER);
}
@Override
protected Shape getOutlineShape() {
int spacing = 0;
if (!getStereotype().isEmpty()) spacing = 20;
Path2D path = new Path2D.Double();
path.moveTo(getPos().x - (getSize().width / 2), getPos().y - (getSize().height / 2 - 20 - spacing));
path.lineTo(getPos().x - (getSize().width / 2) + 15, getPos().y - (getSize().height / 2));
path.lineTo(getPos().x - 15, getPos().y - (getSize().height / 2));
path.lineTo(getPos().x, getPos().y - (getSize().height / 2 - 20 - spacing));
path.lineTo(getPos().x + (getSize().width / 2), getPos().y - (getSize().height / 2 - 20 - spacing));
path.lineTo(getPos().x + (getSize().width / 2), getPos().y + (getSize().height / 2));
path.lineTo(getPos().x - (getSize().width / 2), getPos().y + (getSize().height / 2));
path.lineTo(getPos().x - (getSize().width / 2), getPos().y - (getSize().height / 2 - 20 - spacing));
path.closePath();
return path;
}
@Override
public String toString() {
return "CMMN Case Plan Model ("+getText()+")";
}
}
| {
"content_hash": "d67587c3a0cd5257f7e61385a6a66562",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 114,
"avg_line_length": 33.25,
"alnum_prop": 0.5802549852893102,
"repo_name": "frapu78/processeditor",
"id": "51326aeea08710a1d95859a8032cd8fa3ad6d8f7",
"size": "3059",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/net/frapu/code/visualization/cmmn/CasePlanModel.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2400"
},
{
"name": "HTML",
"bytes": "82845"
},
{
"name": "Java",
"bytes": "4685120"
},
{
"name": "JavaScript",
"bytes": "546302"
},
{
"name": "Shell",
"bytes": "1697"
}
],
"symlink_target": ""
} |
#ifndef VECTOR_SET_H
#define VECTOR_SET_H
#include <popt.h>
#include <bignum/bignum.h>
/**
\file vector_set.h
\defgroup vector_set Data structures for manipulating sets of vectors.
For manipulating sets of vectors, we need use three objects: domains,
sets and relations.
*/
//@{
extern struct poptOption vset_options[];
/**
\brief Abstract type for a domain.
*/
typedef struct vector_domain *vdom_t;
/**
\brief Abstract type for a set in a domain.
*/
typedef struct vector_set *vset_t;
/**
\brief Abstract type for a relation over a domain.
*/
typedef struct vector_relation *vrel_t;
/**
\brief Vector set implementation identifier.
*/
typedef enum {
VSET_IMPL_AUTOSELECT,
VSET_AtermDD_list,
VSET_AtermDD_tree,
VSET_BuDDy_fdd,
VSET_DDD,
VSET_ListDD,
VSET_ListDD64,
VSET_Sylvan,
VSET_LDDmc,
} vset_implementation_t;
extern vset_implementation_t vset_default_domain;
/**
\brief Create a domain that uses some vector set implementation.
\param n The length of vectors in the domain.
\param impl The particular vector set implementation identifier
*/
extern vdom_t vdom_create_domain(int n, vset_implementation_t impl);
/**
\brief Create a domain that uses some vector set implementation from a file where the same
vector set implementation was saved earlier using vdom_save.
\param f a file
\param impl The particular vector set implementation identifier
*/
extern vdom_t vdom_create_domain_from_file(FILE *f, vset_implementation_t impl);
int vdom_vector_size(vdom_t dom);
/**
\brief Create a set.
\param k If non-negative this indicates the length of the sub-domain.
\param proj If non-NULL this is a sorted list of the indices of the sub-domain.
*/
extern vset_t vset_create(vdom_t dom,int k,int* proj);
/**
* \brief Saves a set to a file.
* \param f the file
* \param set the set
*/
extern void vset_save(FILE* f, vset_t set);
/**
* \brief Reads a set from a file.
* \param f the file
* \return the set
*/
extern vset_t vset_load(FILE* f, vdom_t dom);
/**
\brief Add an element to a set.
*/
extern void vset_add(vset_t set,const int* e);
/**
\brief Callback for vset_update. Given state vector e, add new states to set.
*/
typedef void(*vset_update_cb)(vset_t set, void *context, int *e);
/**
\brief Update a set with new states, obtained by calling cb for every state in set.
*/
extern void vset_update(vset_t dst, vset_t set, vset_update_cb cb, void *context);
/**
\brief Update a set with new states, obtained by calling cb for every state in set.
This is a sequential operation.
*/
extern void vset_update_seq(vset_t dst, vset_t set, vset_update_cb cb, void *context);
/**
\brief Test if an element is a member.
*/
extern int vset_member(vset_t set,const int* e);
/**
\brief Test if two sets are equal.
*/
extern int vset_equal(vset_t set1,vset_t set2);
/**
\brief Test if a set is empty.
*/
extern int vset_is_empty(vset_t set);
/**
\brief Remove all elements from a set.
*/
extern void vset_clear(vset_t set);
/**
\brief Callback for set enumeration.
*/
typedef void(*vset_element_cb)(void*context,int *e);
/**
\brief Enumerate the elements of a set.
For each element of the given set, the given callback with be called with as arguments
the given context and the set element.
*/
extern void vset_enum(vset_t set,vset_element_cb cb,void* context);
/**
\brief Enumerate the elements of a set that match the given projection.
For each element of the given set, the given callback with be called with as arguments
the given context and the set element.
*/
extern void vset_enum_match(vset_t set,int p_len,int* proj,int*match,vset_element_cb cb,void* context);
/**
\brief Copy the elements of a set that match the given projection.
*/
extern void vset_copy_match(vset_t dst, vset_t src, int p_len,int* proj,int*match);
/**
\brief Copy the elements of a set that match the given projection.
*/
extern void vset_copy_match_proj(vset_t dst, vset_t src, int p_len, int* proj, int p_id, int*match);
/**
\brief Create a projection.
*/
extern int vproj_create(vdom_t dom, int p_len, int* proj);
/**
\brief Produce a member of a non-empty set.
*/
extern void vset_example(vset_t set,int *e);
/**
\brief Produce a member of a non-empty set that matches the given projection.
*/
extern void vset_example_match(vset_t set, int *e, int p_len, int* proj, int*match);
/**
\brief Randomly produce a member of a non-empty set.
*/
extern void vset_random(vset_t set,int *e);
/**
\brief Copy a vset.
*/
extern void vset_copy(vset_t dst,vset_t src);
/**
\brief Project src down to dst.
*/
extern void vset_project(vset_t dst,vset_t src);
/**
\brief Project src down to dst and minus with minus.
*/
extern void vset_project_minus(vset_t dst,vset_t src,vset_t minus);
/**
\brief dst := dst U src
*/
extern void vset_union(vset_t dst,vset_t src);
/**
\brief dst := (a | a in dst and a in src)
*/
extern void vset_intersect(vset_t dst,vset_t src);
/**
\brief dst := dst \\ src
*/
extern void vset_minus(vset_t dst,vset_t src);
/**
\brief (dst,src) := (dst U src,src \\ dst)
*/
extern void vset_zip(vset_t dst,vset_t src);
/**
\brief Count the number of diagram nodes and the number of elements stored.
\param elements Pointer to bignum that will contain the count; this bignum
is initialized by vset_count.
*/
extern void vset_count(vset_t set,long *nodes,double *elements);
extern void vset_count_precise(vset_t set,long nodes,bn_int_t *elements);
extern int vdom_supports_precise_counting(vdom_t dom);
extern void vset_ccount(vset_t set,long *nodes,long double *elements);
extern int vdom_supports_ccount(vdom_t dom);
/**
\brief Create a relation
*/
extern vrel_t vrel_create(vdom_t dom,int k,int* proj);
/**
\brief Create a relation with read write separation
*/
extern vrel_t vrel_create_rw(vdom_t dom,int r_k,int* r_proj,int w_k,int* w_proj);
/**
* \brief Saves the projection of a relation to a file.
* \param f the file
* \param rel the relation
*/
extern void vrel_save_proj(FILE* f, vrel_t rel);
/**
* \brief Saves a relation to a file.
* \param f the file
* \param rel the relation
*/
extern void vrel_save(FILE* f, vrel_t rel);
/**
* \brief Reads a projection from file and creates a relation based on the projection.
* \param f the file
* \param dom the domain
* \return the relation
*/
extern vrel_t vrel_load_proj(FILE* f, vdom_t dom);
/**
* \brief Reads a relation from a file.
* \param f the file
* \param rel the relation
*/
extern void vrel_load(FILE* f, vrel_t rel);
/**
\brief Add an element to a relation.
*/
extern void vrel_add(vrel_t rel,const int* src,const int* dst);
/**
\brief Callback for vrel_update. Given state vector e, add new relations to rel.
*/
typedef void(*vrel_update_cb)(vrel_t rel, void *context, int *e);
/**
\brief Update a relation with new transitions, obtained by calling cb for every state in set.
*/
extern void vrel_update(vrel_t rel, vset_t set, vrel_update_cb cb, void *context);
/**
\brief Update a relation with new transitions, obtained by calling cb for every state in set.
This is a sequential operation.
*/
extern void vrel_update_seq(vrel_t rel, vset_t set, vrel_update_cb cb, void *context);
/**
\brief Add an element to a relation, with a copy vector.
*/
extern void vrel_add_cpy(vrel_t rel,const int* src,const int* dst,const int* cpy);
/**
\brief Add an element to a relation, with a copy vector, and an action
*/
extern void vrel_add_act(vrel_t rel,const int* src,const int* dst,const int* cpy,const int act);
/**
\brief Count the number of diagram nodes and the number of elements stored.
\param elements Pointer to bignum that will contain the count; this bignum
is initialized by vset_count.
*/
extern void vrel_count(vrel_t rel,long *nodes,double *elements);
/**
\brief dst := { y | exists x in src : x rel y }
*/
extern void vset_next(vset_t dst,vset_t src,vrel_t rel);
extern void vset_next_union(vset_t dst,vset_t src,vrel_t rel,vset_t uni);
/**
\brief univ = NULL => dst := { x | exists y in src : x rel y }
univ != NULL => dst := { x | exists y in src : x rel y } ...
*/
extern void vset_prev(vset_t dst,vset_t src,vrel_t rel, vset_t univ);
extern void vset_universe(vset_t dst, vset_t src);
extern void vset_reorder(vdom_t dom);
/**
\brief Destroy a vset
*/
extern void vset_destroy(vset_t set);
/**
\brief Callback for expanding a relation
*/
typedef void (*expand_cb)(vrel_t rel, vset_t set, void *context);
/**
\brief Set the method for expanding a relation
*/
void vrel_set_expand(vrel_t rel, expand_cb cb, void *context);
/**
\brief Do a least fixpoint using the argument rels on the source states.
This computes the smallest set S inductively satisfying source in S
and rels(S) in S.
Both dst and src arguments must be defined over the complete domain and
not over sub-domains. A relation in rels is expanded on-the-fly in case
an expand callback is set.
*/
void vset_least_fixpoint(vset_t dst, vset_t src, vrel_t rels[], int rel_count);
void vset_dot(FILE* fp, vset_t src);
void vrel_dot(FILE* fp, vrel_t src);
/**
\brief res := (a | a in left and a in right), like join in relational databases.
Put result in dst.
*/
extern void vset_join(vset_t dst, vset_t left, vset_t right);
/**
\brief Hook to call before all loading.
*/
void vset_pre_load(FILE* f, vdom_t dom);
/**
\brief Hook to call after all loading.
*/
void vset_post_load(FILE* f, vdom_t dom);
/**
\brief Hook to call before all saving.
*/
void vset_pre_save(FILE* f, vdom_t dom);
/**
\brief Hook to call after all saving.
*/
void vset_post_save(FILE* f, vdom_t dom);
/**
* \brief Saves domain information to a file;
* \param f the file
* \param dom the domain
*/
void vdom_save(FILE *f, vdom_t dom);
/**
\brief returns whether the vset implementation separates read and write dependencies.
*/
int vdom_separates_rw(vdom_t dom);
/**
\brief sets the name of the ith variable.
*/
void vdom_set_name(vdom_t dom, int i, char* name);
/**
\brief get the name of the ith variable.
*/
char* vdom_get_name(vdom_t dom, int i);
int _cache_diff();
/*
vset visitor api, with caching mechanism.
*/
/**
\brief Pre-order visit of a value.
\param terminal Whether or not this is a terminal.
\param val The value.
\param cached Whether or not there is a cached result available.
\param result The cached result (if available).
\param context The user context.
*/
typedef void (*vset_visit_pre_cb) (int terminal, int val, int cached, void* result, void* context);
/**
\brief Allocates a new user context on the stack.
\param context The context allocated on the stack.
\param parent The parent context.
\param succ Whether or not the context belongs to the same vector.
*/
typedef void (*vset_visit_init_context_cb) (void* context, void* parent, int succ);
/**
\brief Post-order visit of a value.
\param val The value.
\param context The user context.
\param cache Whether or not to add a result to the cache.
\param result The result to add to the cache.
*/
typedef void (*vset_visit_post_cb) (int val, void* context, int* cache, void** result);
/**
\brief Function that is called when something has been added to the cache.
\param context The user context.
\param result The data that has been added to the cache.
*/
typedef void (*vset_visit_cache_success_cb) (void* context, void* result);
typedef struct vset_visit_callbacks_s {
vset_visit_pre_cb vset_visit_pre;
vset_visit_init_context_cb vset_visit_init_context;
vset_visit_post_cb vset_visit_post;
vset_visit_cache_success_cb vset_visit_cache_success;
} vset_visit_callbacks_t;
/**
\brief Visit values in parallel.
\param set The set to run the visitor on.
\param cbs The callback functions that implement the visitor.
\param ctx_size The number of bytes to allocate on the stack for user context.
\param context The user context.
\param cache_op The operation number for operating the cache.
\see vdom_next_cache_op()
\see vdom_clear_cache()
*/
extern void vset_visit_par(vset_t set, vset_visit_callbacks_t* cbs, size_t ctx_size, void* context, int cache_op);
/**
\brief Visit values sequentially.
\param set The set to run the visitor on.
\param cbs The callback functions that implement the visitor.
\param ctx_size The number of bytes to allocate on the stack for user context.
\param context The user context.
\param cache_op The operation number for operating the cache.
\see vdom_next_cache_op()
\see vdom_clear_cache()
*/
extern void vset_visit_seq(vset_t set, vset_visit_callbacks_t* cbs, size_t ctx_size, void* context, int cache_op);
//@}
#endif
| {
"content_hash": "84fd81a194fae6de32958074a2ce5d0a",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 114,
"avg_line_length": 25.5030549898167,
"alnum_prop": 0.7115476760900814,
"repo_name": "vbloemen/ltsmin",
"id": "b43c5d66ae0438162de8b231b324235fe9219737",
"size": "12522",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/vset-lib/vector_set.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "3500960"
},
{
"name": "C++",
"bytes": "284832"
},
{
"name": "CSS",
"bytes": "1456"
},
{
"name": "HTML",
"bytes": "2853"
},
{
"name": "JavaScript",
"bytes": "1056"
},
{
"name": "Lex",
"bytes": "11597"
},
{
"name": "M4",
"bytes": "127694"
},
{
"name": "Makefile",
"bytes": "58217"
},
{
"name": "Objective-C",
"bytes": "4185"
},
{
"name": "Perl",
"bytes": "355"
},
{
"name": "Ruby",
"bytes": "73"
},
{
"name": "Shell",
"bytes": "12744"
},
{
"name": "Tcl",
"bytes": "12844"
},
{
"name": "Yacc",
"bytes": "5671"
}
],
"symlink_target": ""
} |
import unittest
from onnx import defs, checker, helper
class TestRelu(unittest.TestCase):
def test_elu(self): # type: () -> None
self.assertTrue(defs.has('Elu'))
node_def = helper.make_node(
'Elu', ['X'], ['Y'], alpha=1.0)
checker.check_node(node_def)
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "95e0ffefb424747f98ee9f6bfc6bdf9a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 43,
"avg_line_length": 21.625,
"alnum_prop": 0.5722543352601156,
"repo_name": "mlperf/training_results_v0.6",
"id": "ed79fe5d1aa1bebdc1248c9ceb3169e2b3208e9f",
"size": "346",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/test/elu_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1731"
},
{
"name": "Batchfile",
"bytes": "13941"
},
{
"name": "C",
"bytes": "208630"
},
{
"name": "C++",
"bytes": "10999411"
},
{
"name": "CMake",
"bytes": "129712"
},
{
"name": "CSS",
"bytes": "64767"
},
{
"name": "Clojure",
"bytes": "396764"
},
{
"name": "Cuda",
"bytes": "2272433"
},
{
"name": "Dockerfile",
"bytes": "67820"
},
{
"name": "Groovy",
"bytes": "62557"
},
{
"name": "HTML",
"bytes": "19753082"
},
{
"name": "Java",
"bytes": "166294"
},
{
"name": "JavaScript",
"bytes": "71846"
},
{
"name": "Julia",
"bytes": "408765"
},
{
"name": "Jupyter Notebook",
"bytes": "2713169"
},
{
"name": "Lua",
"bytes": "4430"
},
{
"name": "MATLAB",
"bytes": "34903"
},
{
"name": "Makefile",
"bytes": "115694"
},
{
"name": "Perl",
"bytes": "1535873"
},
{
"name": "Perl 6",
"bytes": "7280"
},
{
"name": "PowerShell",
"bytes": "6150"
},
{
"name": "Python",
"bytes": "24905683"
},
{
"name": "R",
"bytes": "351865"
},
{
"name": "Roff",
"bytes": "293052"
},
{
"name": "Scala",
"bytes": "1189019"
},
{
"name": "Shell",
"bytes": "794096"
},
{
"name": "Smalltalk",
"bytes": "3497"
},
{
"name": "TypeScript",
"bytes": "361164"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?><!DOCTYPE TS><TS language="lt" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+39"/>
<source><b>BeeCoinV2</b> version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Copyright © 2009-2014 The Bitcoin developers
Copyright © 2012-2014 The NovaCoin developers
Copyright © 2014 The BeeCoinV2 developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation>Tai eksperimentinė programa.
Platinama pagal MIT/X11 licenciją, kurią rasite faile COPYING arba http://www.opensource.org/licenses/mit-license.php.
Šiame produkte yra OpenSSL projekto kuriamas OpenSSL Toolkit (http://www.openssl.org/), Eric Young parašyta kriptografinė programinė įranga bei Thomas Bernard sukurta UPnP programinė įranga.</translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Double-click to edit address or label</source>
<translation>Spragtelėkite, kad pakeistumėte adresą arba žymę</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Sukurti naują adresą</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopijuoti esamą adresą į mainų atmintį</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-46"/>
<source>These are your BeeCoinV2 addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<source>&Copy Address</source>
<translation>&Kopijuoti adresą</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Verify a message to ensure it was signed with a specified BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>&Trinti</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Kopijuoti ž&ymę</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Keisti</translation>
</message>
<message>
<location line="+250"/>
<source>Export Address Book Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kableliais išskirtas failas (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Žymė</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(nėra žymės)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Slaptafrazės dialogas</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Įvesti slaptafrazę</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nauja slaptafrazė</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Pakartokite naują slaptafrazę</translation>
</message>
<message>
<location line="+33"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+35"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation>Įveskite naują piniginės slaptafrazę.<br/>Prašome naudoti slaptafrazę iš <b> 10 ar daugiau atsitiktinių simbolių</b> arba <b>aštuonių ar daugiau žodžių</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Užšifruoti piniginę</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Ši operacija reikalauja jūsų piniginės slaptafrazės jai atrakinti.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Atrakinti piniginę</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Ši operacija reikalauja jūsų piniginės slaptafrazės jai iššifruoti.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Iššifruoti piniginę</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Pakeisti slaptafrazę</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Įveskite seną ir naują piniginės slaptafrazes.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Patvirtinkite piniginės užšifravimą</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ar tikrai norite šifruoti savo piniginę?</translation>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+103"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Įspėjimas: įjungtas Caps Lock klavišas!</translation>
</message>
<message>
<location line="-133"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Piniginė užšifruota</translation>
</message>
<message>
<location line="-58"/>
<source>BeeCoinV2 will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Nepavyko užšifruoti piniginę</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Dėl vidinės klaidos nepavyko užšifruoti piniginę.Piniginė neužšifruota.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>Įvestos slaptafrazės nesutampa.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Nepavyko atrakinti piniginę</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Neteisingai įvestas slaptažodis piniginės iššifravimui.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Nepavyko iššifruoti piniginės</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Piniginės slaptažodis sėkmingai pakeistas.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+282"/>
<source>Sign &message...</source>
<translation>Pasirašyti ži&nutę...</translation>
</message>
<message>
<location line="+251"/>
<source>Synchronizing with network...</source>
<translation>Sinchronizavimas su tinklu ...</translation>
</message>
<message>
<location line="-319"/>
<source>&Overview</source>
<translation>&Apžvalga</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Rodyti piniginės bendrą apžvalgą</translation>
</message>
<message>
<location line="+17"/>
<source>&Transactions</source>
<translation>&Sandoriai</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Apžvelgti sandorių istoriją</translation>
</message>
<message>
<location line="+5"/>
<source>&Address Book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-13"/>
<source>&Receive coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-7"/>
<source>&Send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>E&xit</source>
<translation>&Išeiti</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Išjungti programą</translation>
</message>
<message>
<location line="+6"/>
<source>Show information about BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>Apie &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Rodyti informaciją apie Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Parinktys...</translation>
</message>
<message>
<location line="+4"/>
<source>&Encrypt Wallet...</source>
<translation>&Užšifruoti piniginę...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Backup piniginę...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Keisti slaptafrazę...</translation>
</message>
<message numerus="yes">
<location line="+259"/>
<source>~%n block(s) remaining</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Downloaded %1 of %2 blocks of transaction history (%3% done).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-256"/>
<source>&Export...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-64"/>
<source>Send coins to a BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Modify configuration options for BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Encrypt or decrypt wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup wallet to another location</source>
<translation>Daryti piniginės atsarginę kopiją</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Pakeisti slaptafrazę naudojamą piniginės užšifravimui</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>&Derinimo langas</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Atverti derinimo ir diagnostikos konsolę</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Tikrinti žinutę...</translation>
</message>
<message>
<location line="-202"/>
<source>BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet</source>
<translation>Piniginė</translation>
</message>
<message>
<location line="+180"/>
<source>&About BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation>&Rodyti / Slėpti</translation>
</message>
<message>
<location line="+9"/>
<source>Unlock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>&File</source>
<translation>&Failas</translation>
</message>
<message>
<location line="+8"/>
<source>&Settings</source>
<translation>&Nustatymai</translation>
</message>
<message>
<location line="+8"/>
<source>&Help</source>
<translation>&Pagalba</translation>
</message>
<message>
<location line="+12"/>
<source>Tabs toolbar</source>
<translation>Kortelių įrankinė</translation>
</message>
<message>
<location line="+8"/>
<source>Actions toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testavimotinklas]</translation>
</message>
<message>
<location line="+0"/>
<location line="+60"/>
<source>BeeCoinV2 client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+75"/>
<source>%n active connection(s) to BeeCoinV2 network</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+40"/>
<source>Downloaded %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+413"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br>Expected time to earn reward is %3</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Not staking because wallet is locked</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because wallet is syncing</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Not staking because you don't have mature coins</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-403"/>
<source>%n second(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="-312"/>
<source>About BeeCoinV2 card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about BeeCoinV2 card</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>&Unlock Wallet...</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+297"/>
<source>%n minute(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Atnaujinta</translation>
</message>
<message>
<location line="+7"/>
<source>Catching up...</source>
<translation>Vejamasi...</translation>
</message>
<message>
<location line="+10"/>
<source>Last received block was generated %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Sent transaction</source>
<translation>Sandoris nusiųstas</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Ateinantis sandoris</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Data: %1
Suma: %2
Tipas: %3
Adresas: %4</translation>
</message>
<message>
<location line="+100"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid BeeCoinV2 address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Piniginė <b>užšifruota</b> ir šiuo metu <b>atrakinta</b></translation>
</message>
<message>
<location line="+10"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Piniginė <b>užšifruota</b> ir šiuo metu <b>užrakinta</b></translation>
</message>
<message>
<location line="+25"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+76"/>
<source>%n second(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s)</source>
<translation><numerusform>%n valanda</numerusform><numerusform>%n valandos</numerusform><numerusform>%n valandų</numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation><numerusform>%n diena</numerusform><numerusform>%n dienos</numerusform><numerusform>%n dienų</numerusform></translation>
</message>
<message>
<location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+109"/>
<source>A fatal error occurred. BeeCoinV2 can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+90"/>
<source>Network Alert</source>
<translation>Tinklo įspėjimas</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<location line="+32"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+48"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+551"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/coincontroldialog.ui" line="+51"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+69"/>
<source>(un)select all</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Tree mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>List mode</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+45"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+5"/>
<source>Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+5"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Patvirtintas</translation>
</message>
<message>
<location line="+5"/>
<source>Priority</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="-515"/>
<source>Copy address</source>
<translation>Kopijuoti adresą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopijuoti žymę</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Kopijuoti sumą</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+155"/>
<source>DUST</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+66"/>
<source>(no label)</source>
<translation>(nėra žymės)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Keisti adresą</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>Ž&ymė</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresas</translation>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Naujas gavimo adresas</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Naujas siuntimo adresas</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Keisti gavimo adresą</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Keisti siuntimo adresą</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Įvestas adresas „%1“ jau yra adresų knygelėje.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid BeeCoinV2 address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Nepavyko atrakinti piniginės.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Naujo rakto generavimas nepavyko.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+420"/>
<location line="+12"/>
<source>BeeCoinV2-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Parinktys</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Pagrindinės</translation>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>&Mokėti sandorio mokestį</translation>
</message>
<message>
<location line="+31"/>
<source>Reserved amount does not participate in staking and is therefore spendable at any time.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Reserve</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start BeeCoinV2 after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start BeeCoinV2 on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Detach databases at shutdown</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Network</source>
<translation>&Tinklas</translation>
</message>
<message>
<location line="+6"/>
<source>Automatically open the BeeCoinV2 client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Persiųsti prievadą naudojant &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the BeeCoinV2 network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation>Tarpinio serverio &IP:</translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation>&Prievadas:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Tarpinio serverio preivadas (pvz, 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation>SOCKS &versija:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Tarpinio serverio SOCKS versija (pvz., 5)</translation>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation>&Langas</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Po programos lango sumažinimo rodyti tik programos ikoną.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&M sumažinti langą bet ne užduočių juostą</translation>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Uždarant langą neuždaryti programos. Kai ši parinktis įjungta, programa bus uždaryta tik pasirinkus meniu komandą Baigti.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>&Sumažinti uždarant</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Rodymas</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>Naudotojo sąsajos &kalba:</translation>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting BeeCoinV2.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Vienetai, kuriais rodyti sumas:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Rodomų ir siunčiamų monetų kiekio matavimo vienetai</translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show BeeCoinV2 addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Rodyti adresus sandorių sąraše</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (experts only!)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation>&Gerai</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Atšaukti</translation>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+55"/>
<source>default</source>
<translation>numatyta</translation>
</message>
<message>
<location line="+149"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting BeeCoinV2.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation>Nurodytas tarpinio serverio adresas negalioja.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+33"/>
<location line="+231"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the BeeCoinV2 network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-160"/>
<source>Stake:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-107"/>
<source>Wallet</source>
<translation>Piniginė</translation>
</message>
<message>
<location line="+49"/>
<source>Spendable:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Your current spendable balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>Immature:</source>
<translation>Nepribrendę:</translation>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Viso:</translation>
</message>
<message>
<location line="+16"/>
<source>Your current total balance</source>
<translation>Jūsų balansas</translation>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Naujausi sandoriai</b></translation>
</message>
<message>
<location line="-108"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Total of coins that was staked, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+113"/>
<location line="+1"/>
<source>out of sync</source>
<translation>nesinchronizuota</translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Kliento pavadinimas</translation>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+348"/>
<source>N/A</source>
<translation>nėra</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Kliento versija</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation>&Informacija</translation>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation>Naudojama OpenSSL versija</translation>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation>Paleidimo laikas</translation>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Tinklas</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Prisijungimų kiekis</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Blokų grandinė</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Dabartinis blokų skaičius</translation>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation>Paskutinio bloko laikas</translation>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation>&Atverti</translation>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the BeeCoinV2-Qt help message to get a list with possible BeeCoinV2 command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation>&Konsolė</translation>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation>Kompiliavimo data</translation>
</message>
<message>
<location line="-104"/>
<source>BeeCoinV2 - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>BeeCoinV2 Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation>Derinimo žurnalo failas</translation>
</message>
<message>
<location line="+7"/>
<source>Open the BeeCoinV2 debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation>Išvalyti konsolę</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-33"/>
<source>Welcome to the BeeCoinV2 RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+182"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Siųsti monetas</translation>
</message>
<message>
<location line="+76"/>
<source>Coin Control Features</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Insufficient funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Quantity:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<location line="+35"/>
<source>0</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-19"/>
<source>Bytes:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<location line="+22"/>
<location line="+86"/>
<location line="+86"/>
<location line="+32"/>
<source>0.00 BEE2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-191"/>
<source>Priority:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>medium</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Low Output:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>no</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+32"/>
<source>After Fee:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>custom change address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+106"/>
<source>Send to multiple recipients at once</source>
<translation>Siųsti keliems gavėjams vienu metu</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&A Pridėti gavėją</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Išvalyti &viską</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Balansas:</translation>
</message>
<message>
<location line="+16"/>
<source>123.456 BEE2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Patvirtinti siuntimo veiksmą</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Siųsti</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-173"/>
<source>Enter a BeeCoinV2 address (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Copy quantity</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopijuoti sumą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+86"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Patvirtinti monetų siuntimą</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Negaliojantis gavėjo adresas. Patikrinkite.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Apmokėjimo suma turi būti didesnė nei 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Suma viršija jūsų balansą.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Jei pridedame sandorio mokestį %1 bendra suma viršija jūsų balansą.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Rastas adreso dublikatas.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+251"/>
<source>WARNING: Invalid BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(nėra žymės)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Su&ma:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Mokėti &gavėjui:</translation>
</message>
<message>
<location line="+24"/>
<location filename="../sendcoinsentry.cpp" line="+25"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Įveskite žymę šiam adresui kad galėtumėte įtraukti ją į adresų knygelę</translation>
</message>
<message>
<location line="+9"/>
<source>&Label:</source>
<translation>Ž&ymė:</translation>
</message>
<message>
<location line="+18"/>
<source>The address to send the payment to (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Įvesti adresą iš mainų atminties</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a BeeCoinV2 address (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+124"/>
<source>&Sign Message</source>
<translation>&Pasirašyti žinutę</translation>
</message>
<message>
<location line="-118"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+203"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-193"/>
<location line="+203"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-193"/>
<source>Paste address from clipboard</source>
<translation>Įvesti adresą iš mainų atminties</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Įveskite pranešimą, kurį norite pasirašyti čia</translation>
</message>
<message>
<location line="+24"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Išvalyti &viską</translation>
</message>
<message>
<location line="-87"/>
<location line="+70"/>
<source>&Verify Message</source>
<translation>&Patikrinti žinutę</translation>
</message>
<message>
<location line="-64"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified BeeCoinV2 address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a BeeCoinV2 address (e.g. 3jz75uKHzUQJnSdzvpiigEGxseKkDhQToZ)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Spragtelėkite "Registruotis žinutę" tam, kad gauti parašą</translation>
</message>
<message>
<location line="+3"/>
<source>Enter BeeCoinV2 signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>Įvestas adresas negalioja.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Prašom patikrinti adresą ir bandyti iš naujo.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Piniginės atrakinimas atšauktas.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Žinutės pasirašymas nepavyko.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Žinutė pasirašyta.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>Nepavyko iškoduoti parašo.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Prašom patikrinti parašą ir bandyti iš naujo.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>Parašas neatitinka žinutės.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>Žinutės tikrinimas nepavyko.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Žinutė patikrinta.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+19"/>
<source>Open until %1</source>
<translation>Atidaryta iki %1</translation>
</message>
<message numerus="yes">
<location line="-2"/>
<source>Open for %n block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/offline</source>
<translation>%1/neprisijungęs</translation>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nepatvirtintas</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 patvirtinimų</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Būsena</translation>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation>Šaltinis</translation>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation>Sugeneruotas</translation>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>Nuo</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation>Kam</translation>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation>savo adresas</translation>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>žymė</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kreditas</translation>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation>nepriimta</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debitas</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Sandorio mokestis</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Neto suma</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Žinutė</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Komentaras</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>Sandorio ID</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 510 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation>Derinimo informacija</translation>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Sandoris</translation>
</message>
<message>
<location line="+5"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>tiesa</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>netiesa</translation>
</message>
<message>
<location line="-211"/>
<source>, has not been successfully broadcast yet</source>
<translation>, transliavimas dar nebuvo sėkmingas</translation>
</message>
<message>
<location line="+35"/>
<source>unknown</source>
<translation>nežinomas</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Sandorio detelės</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Šis langas sandorio detalų aprašymą</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+226"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tipas</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+60"/>
<source>Open until %1</source>
<translation>Atidaryta iki %1</translation>
</message>
<message>
<location line="+12"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Patvirtinta (%1 patvirtinimai)</translation>
</message>
<message numerus="yes">
<location line="-15"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+6"/>
<source>Offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Conflicted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Šis blokas negautas nė vienu iš mazgų ir matomai nepriimtas</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Išgauta bet nepriimta</translation>
</message>
<message>
<location line="+42"/>
<source>Received with</source>
<translation>Gauta su</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Gauta iš</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Siųsta </translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Mokėjimas sau</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Išgauta</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>nepasiekiama</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Sandorio būklė. Užvedus pelės žymeklį ant šios srities matysite patvirtinimų skaičių.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Sandorio gavimo data ir laikas</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Sandorio tipas.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Sandorio paskirties adresas</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Suma pridėta ar išskaičiuota iš balanso</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Visi</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Šiandien</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Šią savaitę</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Šį mėnesį</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Paskutinį mėnesį</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Šiais metais</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Intervalas...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Gauta su</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Išsiųsta</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Skirta sau</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Išgauta</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Kita</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Įveskite adresą ar žymę į paiešką</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Minimali suma</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopijuoti adresą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopijuoti žymę</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopijuoti sumą</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Taisyti žymę</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Rodyti sandėrio detales</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Kableliais atskirtų duomenų failas (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Patvirtintas</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipas</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Žymė</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresas</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Suma</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Grupė:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>skirta</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+206"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+33"/>
<source>BeeCoinV2 version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Usage:</source>
<translation>Naudojimas:</translation>
</message>
<message>
<location line="+1"/>
<source>Send command to -server or beecoinv2d</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>List commands</source>
<translation>Komandų sąrašas</translation>
</message>
<message>
<location line="+1"/>
<source>Get help for a command</source>
<translation>Suteikti pagalba komandai</translation>
</message>
<message>
<location line="+2"/>
<source>Options:</source>
<translation>Parinktys:</translation>
</message>
<message>
<location line="+2"/>
<source>Specify configuration file (default: beecoinv2.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify pid file (default: beecoinv2d.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify wallet file (within data directory)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Nustatyti duomenų aplanką</translation>
</message>
<message>
<location line="+2"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Listen for connections on <port> (default: 15714 or testnet: 25714)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Palaikyti ne daugiau <n> jungčių kolegoms (pagal nutylėjimą: 125)</translation>
</message>
<message>
<location line="+3"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Stake your coins to support network and gain reward (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Atjungimo dėl netinkamo kolegų elgesio riba (pagal nutylėjimą: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Sekundžių kiekis eikiamas palaikyti ryšį dėl lygiarangių nestabilumo (pagal nutylėjimą: 86.400)</translation>
</message>
<message>
<location line="-44"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Detach block and address databases. Increases shutdown time (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+109"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-11"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Priimti komandinę eilutę ir JSON-RPC komandas</translation>
</message>
<message>
<location line="+101"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"/>
</message>
<message>
<location line="-8"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-88"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Dirbti fone kaip šešėlyje ir priimti komandas</translation>
</message>
<message>
<location line="+1"/>
<source>Use the test network</source>
<translation>Naudoti testavimo tinklą</translation>
</message>
<message>
<location line="-24"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-38"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+117"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Įspėjimas: -paytxfee yra nustatytas per didelis. Tai sandorio mokestis, kurį turėsite mokėti, jei siųsite sandorį.</translation>
</message>
<message>
<location line="+61"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong BeeCoinV2 will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-18"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-30"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-62"/>
<source>Connect only to the specified node(s)</source>
<translation>Prisijungti tik prie nurodyto mazgo</translation>
</message>
<message>
<location line="+4"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+94"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-90"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync checkpoints policy (default: strict)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+83"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-82"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Maksimalus buferis priėmimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Maksimalus buferis siuntimo sujungimui <n>*1000 bitų (pagal nutylėjimą: 1000)</translation>
</message>
<message>
<location line="-16"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>SSL opcijos (žr.e Bitcoin Wiki for SSL setup instructions)</translation>
</message>
<message>
<location line="-74"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+41"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Siųsti atsekimo/derinimo info į konsolę vietoj debug.log failo</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-42"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Nustatyti sujungimo trukmę milisekundėmis (pagal nutylėjimą: 5000)</translation>
</message>
<message>
<location line="+109"/>
<source>Unable to sign checkpoint, wrong checkpointkey?
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Bandymas naudoti UPnP struktūra klausymosi prievadui (default: 1 when listening)</translation>
</message>
<message>
<location line="-25"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<source>Username for JSON-RPC connections</source>
<translation>Vartotojo vardas JSON-RPC jungimuisi</translation>
</message>
<message>
<location line="+47"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+57"/>
<source>WARNING: syncronized checkpoint violation detected, but skipped!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-54"/>
<source>Password for JSON-RPC connections</source>
<translation>Slaptažodis JSON-RPC sujungimams</translation>
</message>
<message>
<location line="-84"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=beecoinv2rpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "BeeCoinV2 Alert" [email protected]
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+51"/>
<source>Find peers using internet relay chat (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Leisti JSON-RPC tik iš nurodytų IP adresų</translation>
</message>
<message>
<location line="+1"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Siųsti komandą mazgui dirbančiam <ip> (pagal nutylėjimą: 127.0.0.1)</translation>
</message>
<message>
<location line="+1"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Upgrade wallet to latest format</source>
<translation>Atnaujinti piniginę į naujausią formatą</translation>
</message>
<message>
<location line="+1"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Nustatyti rakto apimties dydį <n> (pagal nutylėjimą: 100)</translation>
</message>
<message>
<location line="+1"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Ieškoti prarastų piniginės sandorių blokų grandinėje</translation>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Naudoti OpenSSL (https) jungimuisi JSON-RPC </translation>
</message>
<message>
<location line="+1"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Serverio sertifikato failas (pagal nutylėjimą: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Serverio privatus raktas (pagal nutylėjimą: server.pem)</translation>
</message>
<message>
<location line="+1"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+53"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>WARNING: Invalid checkpoint found! Displayed transactions may not be correct! You may need to upgrade, or notify developers.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-158"/>
<source>This help message</source>
<translation>Pagelbos žinutė</translation>
</message>
<message>
<location line="+95"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot obtain a lock on data directory %s. BeeCoinV2 is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-98"/>
<source>BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+140"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Nepavyko susieti šiame kompiuteryje prievado %s (bind returned error %d, %s)</translation>
</message>
<message>
<location line="-130"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Leisti DNS paiešką sujungimui ir mazgo pridėjimui</translation>
</message>
<message>
<location line="+122"/>
<source>Loading addresses...</source>
<translation>Užkraunami adresai...</translation>
</message>
<message>
<location line="-15"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation> wallet.dat pakrovimo klaida, wallet.dat sugadintas</translation>
</message>
<message>
<location line="+4"/>
<source>Error loading wallet.dat: Wallet requires newer version of BeeCoinV2</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Wallet needed to be rewritten: restart BeeCoinV2 to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat</source>
<translation> wallet.dat pakrovimo klaida</translation>
</message>
<message>
<location line="-16"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Neteisingas proxy adresas: '%s'</translation>
</message>
<message>
<location line="-1"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-24"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Neteisinga suma -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+44"/>
<source>Error: could not start node</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sending...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Invalid amount</source>
<translation>Neteisinga suma</translation>
</message>
<message>
<location line="+1"/>
<source>Insufficient funds</source>
<translation>Nepakanka lėšų</translation>
</message>
<message>
<location line="-34"/>
<source>Loading block index...</source>
<translation>Įkeliamas blokų indeksas...</translation>
</message>
<message>
<location line="-103"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Pridėti mazgą prie sujungti su and attempt to keep the connection open</translation>
</message>
<message>
<location line="+122"/>
<source>Unable to bind to %s on this computer. BeeCoinV2 is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-97"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Loading wallet...</source>
<translation>Užkraunama piniginė...</translation>
</message>
<message>
<location line="+8"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot initialize keypool</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Rescanning...</source>
<translation>Peržiūra</translation>
</message>
<message>
<location line="+5"/>
<source>Done loading</source>
<translation>Įkėlimas baigtas</translation>
</message>
<message>
<location line="-167"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Error</source>
<translation>Klaida</translation>
</message>
<message>
<location line="+6"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS> | {
"content_hash": "9986dd53ad30afc03d0c99da52b62fa5",
"timestamp": "",
"source": "github",
"line_count": 3292,
"max_line_length": 395,
"avg_line_length": 34.77521263669502,
"alnum_prop": 0.6028476589797345,
"repo_name": "sherlockcoin/beecoinv2",
"id": "2e96b3655217d3005dccef856611881028aae0be",
"size": "114975",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_lt.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "51312"
},
{
"name": "Batchfile",
"bytes": "7853"
},
{
"name": "C",
"bytes": "1380588"
},
{
"name": "C++",
"bytes": "2790418"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Groff",
"bytes": "12684"
},
{
"name": "HTML",
"bytes": "50615"
},
{
"name": "Makefile",
"bytes": "13614"
},
{
"name": "NSIS",
"bytes": "5914"
},
{
"name": "Objective-C",
"bytes": "858"
},
{
"name": "Objective-C++",
"bytes": "3537"
},
{
"name": "Python",
"bytes": "42659"
},
{
"name": "QMake",
"bytes": "14918"
},
{
"name": "Shell",
"bytes": "12052"
}
],
"symlink_target": ""
} |
<?php
namespace OPNsense\Base\Constraints;
/**
* Class AllOrNoneConstraint all selected fields (at the same level) should contain data or none of them.
* @package OPNsense\Base\Constraints
*/
class AllOrNoneConstraint extends BaseConstraint
{
/**
* Executes validation
*
* @param $validator
* @param string $attribute
* @return boolean
*/
public function validate($validator, $attribute): bool
{
$node = $this->getOption('node');
if ($node) {
$nodeName = $node->getInternalXMLTagName();
$parentNode = $node->getParentNode();
$Fields = array_unique(array_merge(array($nodeName), $this->getOptionValueList('addFields')));
$countEmpty = 0;
$countNotEmpty = 0;
foreach ($Fields as $fieldname) {
if (empty((string)$parentNode->$fieldname)) {
$countEmpty++;
} else {
$countNotEmpty++;
}
}
if ($countEmpty != 0 && $countNotEmpty != 0) {
$this->appendMessage($validator, $attribute);
return false;
}
}
return true;
}
}
| {
"content_hash": "386e75262fed782d866e0f023936fa07",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 106,
"avg_line_length": 28.46511627906977,
"alnum_prop": 0.5326797385620915,
"repo_name": "opnsense/core",
"id": "ea1d6ae2d7343b4cfa12db26acbda07c2c83c89a",
"size": "2591",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/opnsense/mvc/app/models/OPNsense/Base/Constraints/AllOrNoneConstraint.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "CSS",
"bytes": "216745"
},
{
"name": "D",
"bytes": "1595"
},
{
"name": "HTML",
"bytes": "55497"
},
{
"name": "JavaScript",
"bytes": "850781"
},
{
"name": "Less",
"bytes": "294"
},
{
"name": "Lua",
"bytes": "1891"
},
{
"name": "Makefile",
"bytes": "24423"
},
{
"name": "PHP",
"bytes": "6152163"
},
{
"name": "Perl",
"bytes": "3686"
},
{
"name": "Python",
"bytes": "667798"
},
{
"name": "Roff",
"bytes": "21355"
},
{
"name": "SCSS",
"bytes": "229905"
},
{
"name": "Shell",
"bytes": "187548"
},
{
"name": "Volt",
"bytes": "725894"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "0a4eaf187f592789ed388621d5922b79",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "e4fd340765f79d771c2212c4fca0ddc59f33de6c",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Myrtales/Melastomataceae/Calycogonium/Calycogonium bissei/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.pluralsight.demos;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Servlet implementation class SecuredServlet
*/
@WebServlet("/SecuredServlet")
public class SecuredServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public SecuredServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
response.getWriter().append("Served at: ").append(request.getContextPath());
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter out = response.getWriter();
response.setContentType("text/html");
out.println("<h1>Welcome to Secured Servlet Application</h1>");
}
}
| {
"content_hash": "433db0dd890f7bed22b486d1484ff847",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 119,
"avg_line_length": 30.266666666666666,
"alnum_prop": 0.7569750367107195,
"repo_name": "danillovinicius/java-ee-programming-servlets",
"id": "4423e122899a1e0a6d67f0c5899949922d137276",
"size": "1362",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/pluralsight/demos/SecuredServlet.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "6504"
},
{
"name": "Java",
"bytes": "58847"
}
],
"symlink_target": ""
} |
#include "Shape/Point.hh"
#include "Shape/PointUtilities.hh"
#include "TestFunction.hh"
int UnitTestPointUtilities(int /*argc*/,char** /*argv*/)
{
typedef Delaunay::Shape::Point Point;
Point p0(0.,0.);
Point p1(1.,1.);
Point p2(2.,1.);
Point p3(1.,2.);
Point p4(2.,2.);
test(Orientation(p0,p1,p2) == -1,
"Clockwise point orientation result expected.");
test(Orientation(p0,p1,p3) == 1,
"Counterclockwise point orientation result expected.");
test(Orientation(p0,p1,p4) == 0,
"Colinear point orientation result expected.");
test(std::abs(Dot(p1,p2) - 3.)<EPSILON,
"Dot product between two points returned unexpected result.");
test(std::abs(Cross(p2,p1) - 1.)<EPSILON,
"Cross product magnitude between two points returned unexpected result.");
test(std::abs(DistanceSquared(p0,p1) - 2.)<EPSILON,
"Distance squared between two points returned unexpected result.");
test(std::abs(Distance(p0,p1) - std::sqrt(2.))<EPSILON,
"Distance squared between two points returned unexpected result.");
test(std::abs(Angle(p2,p1,p3) - M_PI/2.)<EPSILON,
"Angle between three points returned unexpected result.");
test(std::abs(Angle(p3,p1,p2) - 3.*M_PI/2.)<EPSILON,
"Angle between three points returned unexpected result.");
return 0;
}
| {
"content_hash": "edd8e6ea8fed2d1a824524056c530909",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 81,
"avg_line_length": 31.571428571428573,
"alnum_prop": 0.667420814479638,
"repo_name": "tjcorona/Delaunay",
"id": "e92c663797150a40c968bbef9d20bae8e52e4083",
"size": "1957",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Shape/Tests/UnitTestPointUtilities.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "289964"
},
{
"name": "CMake",
"bytes": "14570"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_07) on Sun Aug 19 22:23:42 EDT 2007 -->
<TITLE>
Overview (Rhino)
</TITLE>
<META NAME="keywords" CONTENT="Overview">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TH ALIGN="left" NOWRAP><FONT size="+1" CLASS="FrameTitleFont">
<B></B></FONT></TH>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT>
<P>
<FONT size="+1" CLASS="FrameHeadingFont">
Packages</FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="org/mozilla/javascript/package-frame.html" target="packageFrame">org.mozilla.javascript</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="org/mozilla/javascript/debug/package-frame.html" target="packageFrame">org.mozilla.javascript.debug</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="org/mozilla/javascript/optimizer/package-frame.html" target="packageFrame">org.mozilla.javascript.optimizer</A></FONT>
<BR>
<FONT CLASS="FrameItemFont"><A HREF="org/mozilla/javascript/serialize/package-frame.html" target="packageFrame">org.mozilla.javascript.serialize</A></FONT>
<BR>
</TD>
</TR>
</TABLE>
<P>
</BODY>
</HTML>
| {
"content_hash": "1a07bcfe47ba82ba28d51ee942c215db",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 155,
"avg_line_length": 30.104166666666668,
"alnum_prop": 0.7031141868512111,
"repo_name": "thegreatape/slim",
"id": "d09ce3ed54a2b001b46c97ee7c6ccbc408d00c99",
"size": "1445",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "yuicompressor-2.4.2/rhino1_6R7/javadoc/overview-frame.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "2659"
}
],
"symlink_target": ""
} |
package com.canyinghao.canphotos.preview;
import android.content.Context;
import android.graphics.Canvas;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import com.facebook.drawee.generic.GenericDraweeHierarchy;
import com.facebook.drawee.view.SimpleDraweeView;
public class PhotoDraweeView extends SimpleDraweeView implements IAttacher {
private Attacher mAttacher;
public PhotoDraweeView(Context context, GenericDraweeHierarchy hierarchy) {
super(context, hierarchy);
init();
}
public PhotoDraweeView(Context context) {
super(context);
init();
}
public PhotoDraweeView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public PhotoDraweeView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
protected void init() {
if (mAttacher == null || mAttacher.getDraweeView() == null) {
mAttacher = new Attacher(this);
}
}
@Override public boolean onTouchEvent(MotionEvent event) {
return super.onTouchEvent(event);
}
@Override protected void onDraw(@NonNull Canvas canvas) {
int saveCount = canvas.save();
canvas.concat(mAttacher.getDrawMatrix());
super.onDraw(canvas);
canvas.restoreToCount(saveCount);
}
@Override protected void onAttachedToWindow() {
init();
super.onAttachedToWindow();
}
@Override protected void onDetachedFromWindow() {
mAttacher.onDetachedFromWindow();
super.onDetachedFromWindow();
}
@Override public float getMinimumScale() {
return mAttacher.getMinimumScale();
}
@Override public float getMediumScale() {
return mAttacher.getMediumScale();
}
@Override public float getMaximumScale() {
return mAttacher.getMaximumScale();
}
@Override public void setMinimumScale(float minimumScale) {
mAttacher.setMinimumScale(minimumScale);
}
@Override public void setMediumScale(float mediumScale) {
mAttacher.setMediumScale(mediumScale);
}
@Override public void setMaximumScale(float maximumScale) {
mAttacher.setMaximumScale(maximumScale);
}
@Override public float getScale() {
return mAttacher.getScale();
}
@Override public void setScale(float scale) {
mAttacher.setScale(scale);
}
@Override public void setScale(float scale, boolean animate) {
mAttacher.setScale(scale, animate);
}
@Override public void setScale(float scale, float focalX, float focalY, boolean animate) {
mAttacher.setScale(scale, focalX, focalY, animate);
}
@Override public void setZoomTransitionDuration(long duration) {
mAttacher.setZoomTransitionDuration(duration);
}
@Override public void setAllowParentInterceptOnEdge(boolean allow) {
mAttacher.setAllowParentInterceptOnEdge(allow);
}
@Override public void setOnDoubleTapListener(GestureDetector.OnDoubleTapListener listener) {
mAttacher.setOnDoubleTapListener(listener);
}
@Override public void setOnScaleChangeListener(OnScaleChangeListener listener) {
mAttacher.setOnScaleChangeListener(listener);
}
@Override public void setOnLongClickListener(View.OnLongClickListener listener) {
mAttacher.setOnLongClickListener(listener);
}
@Override public void setOnPhotoTapListener(OnPhotoTapListener listener) {
mAttacher.setOnPhotoTapListener(listener);
}
@Override public void setOnViewTapListener(OnViewTapListener listener) {
mAttacher.setOnViewTapListener(listener);
}
@Override public OnPhotoTapListener getOnPhotoTapListener() {
return mAttacher.getOnPhotoTapListener();
}
@Override public OnViewTapListener getOnViewTapListener() {
return mAttacher.getOnViewTapListener();
}
@Override public void update(int imageInfoWidth, int imageInfoHeight) {
mAttacher.update(imageInfoWidth, imageInfoHeight);
}
}
| {
"content_hash": "ee31281c11ba7f00ef0071e602e7cab7",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 96,
"avg_line_length": 29.144827586206898,
"alnum_prop": 0.7018457169900615,
"repo_name": "canyinghao/CanPhotos",
"id": "d99502b8c5a52fb9dc993a8059060859b9e08b89",
"size": "4226",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "canphotos/src/main/java/com/canyinghao/canphotos/preview/PhotoDraweeView.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "101548"
}
],
"symlink_target": ""
} |
import { WRITE_MSG, APPEND_MSG } from './type';
export const getInput = input => ({
type: WRITE_MSG,
input,
});
export const appendMsg = newMsg => ({
type: APPEND_MSG,
newMsg,
});
| {
"content_hash": "b8fd5632fbac58e6c56b4a8e984570ff",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 47,
"avg_line_length": 17.272727272727273,
"alnum_prop": 0.6157894736842106,
"repo_name": "Phongtlam/DeepSubs",
"id": "55d853ac9a8bc03ee9170f9317b36565f939e653",
"size": "190",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/src/redux/actions/chatterboxAction.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8355"
},
{
"name": "HTML",
"bytes": "6366"
},
{
"name": "JavaScript",
"bytes": "118705"
}
],
"symlink_target": ""
} |
/*
* These authors would like to acknowledge the Spanish Ministry of Industry,
* Tourism and Trade, for the support in the project TSI020301-2008-2
* "PIRAmIDE: Personalizable Interactions with Resources on AmI-enabled
* Mobile Dynamic Environments", led by Treelogic
* ( http://www.treelogic.com/ ):
*
* http://www.piramidepse.com/
*/
package com.aqnote.app.barcode.core.oned.rss.expanded.decoders;
import com.aqnote.app.barcode.core.NotFoundException;
import com.aqnote.app.barcode.core.common.BitArray;
/**
* @author Pablo Orduña, University of Deusto ([email protected])
*/
abstract class AI013x0xDecoder extends AI01weightDecoder {
private static final int HEADER_SIZE = 4 + 1;
private static final int WEIGHT_SIZE = 15;
AI013x0xDecoder(BitArray information) {
super(information);
}
@Override
public String parseInformation() throws NotFoundException {
if (this.getInformation().getSize() != HEADER_SIZE + GTIN_SIZE + WEIGHT_SIZE) {
throw NotFoundException.getNotFoundInstance();
}
StringBuilder buf = new StringBuilder();
encodeCompressedGtin(buf, HEADER_SIZE);
encodeCompressedWeight(buf, HEADER_SIZE + GTIN_SIZE, WEIGHT_SIZE);
return buf.toString();
}
}
| {
"content_hash": "39f53d0444bf6ceb7c570fb478527595",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 83,
"avg_line_length": 28.790697674418606,
"alnum_prop": 0.7334410339256866,
"repo_name": "aqnote/AndroidTest",
"id": "0b6ce9d43be94b542d6ef1302be452282e1dbcdc",
"size": "1840",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app-barcode/src/main/java/com/aqnote/app/barcode/core/oned/rss/expanded/decoders/AI013x0xDecoder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "340"
},
{
"name": "HTML",
"bytes": "82796"
},
{
"name": "Java",
"bytes": "1748797"
}
],
"symlink_target": ""
} |
title: "2020-10-19のJS: Babel 7.12.0、 Chrome 87 Beta、npm 7リリース"
author: "azu"
layout: post
date : 2020-10-19T12:35:28.894Z
category: JSer
tags:
- babel
- chrome
- npm
---
JSer.info #510 - Babel 7.12.0がリリースされました。
- [7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks · Babel](https://babeljs.io/blog/2020/10/15/7.12.0)
TypeScript 4.1のサポート、Stage 2 proposalのClass static blocksのサポートが追加されています。
import/export名の扱いをECMAScriptの変更に追従、Import assertionsのパースを`@babel/syntax-import-assertions`プラグインに切り出しなどが行われています。
----
Chrome 87 betaがリリースされました。
- [Chromium Blog: Chrome 87 Beta: WebAuthn in DevTools, Pan/Tilt/Zoom, Flow Relative Shorthands and More](https://blog.chromium.org/2020/10/chrome-87-beta-webauthn-in-devtools.html)
DevToolsにCSS GridのデバッグツールやWebAuthnタブの追加などが行われています。
DevToolsについては、次の記事で解説されています。
- [What's New In DevTools (Chrome 87) | Web | Google Developers](https://developers.google.com/web/updates/2020/10/devtools)
カメラのpan/tilt/zoomのサポート、Cookie Store APIをデフォルトで有効化、cross-origin isolationのサポート改善などが行われています。
また、入力中かを判定する`isInputPending()`、Service WorkerでRangeリクエストのサポート、`postMessage`で渡せるTransferable Streamsのサポートしています。
その他には、Chrome 86で非推奨化となったFTPサポートが、87ではデフォルトで無効化(15%のユーザーを対象)されています。
- [Deprecations and removals in Chrome 87 | Web | Google Developers](https://developers.google.com/web/updates/2020/10/chrome-87-deps-rems)
----
npm 7.0.0がリリースされました。
- [Presenting v7.0.0 of the npm CLI - The GitHub Blog](https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/)
- [Release v7.0.0 · npm/cli](https://github.com/npm/cli/releases/tag/v7.0.0)
- [npm v7の主な変更点まとめ | watilde's blog](https://blog.watilde.com/2020/10/14/npm-v7%E3%81%AE%E4%B8%BB%E3%81%AA%E5%A4%89%E6%9B%B4%E7%82%B9%E3%81%BE%E3%81%A8%E3%82%81/)
破壊的な変更として、`peerDependencies`の自動インストール、package-lock.jsonの形式変更とyarn.lockのサポート、`npm audit`の出力内容の変更などが行われています。
また、`npm exec`コマンドが追加され、`npx`コマンドは内部的に`npm exec`コマンドを使うように変更されています。
機能追加として、Workspacesのサポート、[yarnの`resolusions`](https://classic.yarnpkg.com/docs/selective-version-resolutions/)に相当する`acceptDependencies`のサポートなども追加されています。
----
<h1 class="site-genre">ヘッドライン</h1>
----
## Release v5.1.0 · webpack/webpack
[github.com/webpack/webpack/releases/tag/v5.1.0](https://github.com/webpack/webpack/releases/tag/v5.1.0 "Release v5.1.0 · webpack/webpack")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">webpack</span> <span class="jser-tag">ReleaseNote</span></p>
webpack 5.1.0リリース。
`cleverMerge`、`EntryOptionPlugin`、`DynamicEntryPlugin`をPublic APIに変更。
try-catch内で`require`を使ってモジュールの有無を判定する処理がエラーとなる問題の修正
- [\[5.0.0\] require() of a non-existing package in a try-catch block is broken · Issue #11639 · webpack/webpack](https://github.com/webpack/webpack/issues/11639 "\[5.0.0\] require() of a non-existing package in a try-catch block is broken · Issue #11639 · webpack/webpack")
----
## 7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks · Babel
[babeljs.io/blog/2020/10/15/7.12.0](https://babeljs.io/blog/2020/10/15/7.12.0 "7.12.0 Released: TypeScript 4.1, strings as import/export names, and class static blocks · Babel")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">babel</span> <span class="jser-tag">ReleaseNote</span></p>
Babel 7.12.0リリース。
TypeScript 4.1のサポート、
Stage 2 proposalのClass static blocksのサポート。
import/export名の扱いをECMAScriptの変更に追従、Import assertionsのパースをプラグインに切り出しなど
----
## Node v14.14.0 (Current) | Node.js
[nodejs.org/en/blog/release/v14.14.0/](https://nodejs.org/en/blog/release/v14.14.0/ "Node v14.14.0 (Current) | Node.js")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">node.js</span> <span class="jser-tag">ReleaseNote</span></p>
Node v14.14.0リリース。
`fs.rm`の追加、`res.setHeader`などでヘッダを配列として渡せるようになるなど
----
## Chromium Blog: Chrome 87 Beta: WebAuthn in DevTools, Pan/Tilt/Zoom, Flow Relative Shorthands and More
[blog.chromium.org/2020/10/chrome-87-beta-webauthn-in-devtools.html](https://blog.chromium.org/2020/10/chrome-87-beta-webauthn-in-devtools.html "Chromium Blog: Chrome 87 Beta: WebAuthn in DevTools, Pan/Tilt/Zoom, Flow Relative Shorthands and More")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">Chrome</span> <span class="jser-tag">ReleaseNote</span></p>
Chrome 87ベータリリース。
DevToolsにWebAuthnタブを追加、カメラのpan/tilt/zoomのサポート、cross-origin isolationのサポート改善。
また、`isInputPending`、Service WorkerでRangeリクエストのサポート、`postMessage`で渡せるTransferable Streamsのサポートなど
----
## Presenting v7.0.0 of the npm CLI - The GitHub Blog
[github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/](https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/ "Presenting v7.0.0 of the npm CLI - The GitHub Blog")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">npm</span> <span class="jser-tag">ReleaseNote</span></p>
npm 7リリース。
破壊的な変更として、peerDependenciesの自動インストール、package-lock.jsonの形式変更とyarn.lockのサポート、`npm audit`の出力内容の変更。
機能追加として、Workspacesのサポート、`npm exec`の追加など
- [Release v7.0.0 · npm/cli](https://github.com/npm/cli/releases/tag/v7.0.0 "Release v7.0.0 · npm/cli")
----
<h1 class="site-genre">アーティクル</h1>
----
## min(), max(), and clamp(): three logical CSS functions to use today
[web.dev/min-max-clamp/](https://web.dev/min-max-clamp/ "min(), max(), and clamp(): three logical CSS functions to use today")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">CSS</span> <span class="jser-tag">article</span></p>
CSSの`min()`、`max()`、`clamp()`関数についての記事。
----
## GraphQLの基礎の基礎 - Qiita
[qiita.com/shotashimura/items/3f9e04b93e79592030a4](https://qiita.com/shotashimura/items/3f9e04b93e79592030a4 "GraphQLの基礎の基礎 - Qiita")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">node.js</span> <span class="jser-tag">JavaScript</span> <span class="jser-tag">GraphQL</span> <span class="jser-tag">article</span></p>
Node.jsでのGraphQL APIサーバの実装についての記事
----
## Create TypeScript declarations from JavaScript and JSDoc - Human Who Codes
[humanwhocodes.com/snippets/2020/10/create-typescript-declarations-from-javascript-jsdoc/](https://humanwhocodes.com/snippets/2020/10/create-typescript-declarations-from-javascript-jsdoc/ "Create TypeScript declarations from JavaScript and JSDoc - Human Who Codes")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">TypeScript</span> <span class="jser-tag">JavaScript</span> <span class="jser-tag">article</span></p>
JSDocからTypeScriptの型定義ファイルを生成する方法について。
TypeScriptの出力オプションで`emitDeclarationOnly`と`allowJs`を組み合わせることでJSDocからd.tsファイルを作成できる
----
## Video processing with WebCodecs
[web.dev/webcodecs/](https://web.dev/webcodecs/ "Video processing with WebCodecs")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">WebPlatformAPI</span> <span class="jser-tag">Chrome</span> <span class="jser-tag">article</span></p>
Chrome 86でOrigin Trialとして導入されたWebCodecsについて。
動画と音声のエンコードとデコードができるAPI。
`VideoTrackReader`、`VideoEncoder`、`VideoDecoder`について
----
<h1 class="site-genre">ソフトウェア、ツール、ライブラリ関係</h1>
----
## Liaison – A love story between the frontend and the backend
[liaison.dev/](https://liaison.dev/ "Liaison – A love story between the frontend and the backend")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">node.js</span> <span class="jser-tag">library</span></p>
バックエンド、フロントエンドを含んだフルスタックなJavaScriptフレームワーク。
----
## samizdatco/skia-canvas: A canvas environment for Node.js
[github.com/samizdatco/skia-canvas](https://github.com/samizdatco/skia-canvas "samizdatco/skia-canvas: A canvas environment for Node.js")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">node.js</span> <span class="jser-tag">canvas</span> <span class="jser-tag">library</span></p>
Skiaを使ったNode.jsでのCanvas実装
----
## sciter – Multiplatform HTML/CSS UI Engine for Desktop and Mobile Application
[sciter.com/](https://sciter.com/ "sciter – Multiplatform HTML/CSS UI Engine for Desktop and Mobile Application")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">HTML</span> <span class="jser-tag">CSS</span> <span class="jser-tag">software</span></p>
アプリ組み込み向けのHTML/CSSエンジン。
バイナリサイズが小さいアプリを作るためのフレームワークで、HTML/CSSのサブセットとスクリプトエンジンをもっている。
- [Open Source Sciter Engine by Andrew Fedoniouk (a.k.a. c-smile) — Kickstarter](https://www.kickstarter.com/projects/c-smile/open-source-sciter-engine?ref=thanks-tweet "Open Source Sciter Engine by Andrew Fedoniouk (a.k.a. c-smile) — Kickstarter")
----
## MTG/essentia.js: JavaScript library for music/audio analysis and processing powered by WebAssembly
[github.com/MTG/essentia.js](https://github.com/MTG/essentia.js "MTG/essentia.js: JavaScript library for music/audio analysis and processing powered by WebAssembly")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">WebAssembly</span> <span class="jser-tag">C++</span> <span class="jser-tag">library</span></p>
C++で書かれた音声/音楽処理ライブラリであるEssentiaをWebAssemblyにコンパイルしたJavaScriptラッパーライブラリ。
- [Essentia](https://essentia.upf.edu/ "Essentia")
----
## TimvanScherpenzeel/detect-gpu: Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.
[github.com/TimvanScherpenzeel/detect-gpu](https://github.com/TimvanScherpenzeel/detect-gpu "TimvanScherpenzeel/detect-gpu: Classifies GPUs based on their 3D rendering benchmark score allowing the developer to provide sensible default settings for graphically intensive applications.")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">JavaScript</span> <span class="jser-tag">WebGL</span> <span class="jser-tag">library</span> <span class="jser-tag">performance</span></p>
WebGLを使った3DレンダリングのベンチマークからGPUの判定、クラス分けをするライブラリ
----
<h1 class="site-genre">書籍関係</h1>
----
## フロントエンド開発入門 プロフェッショナルな開発ツールと設計・実装 | 安達 稜, 武田 諭 |本 | 通販 | Amazon
[www.amazon.co.jp/dp/4798061778/](https://www.amazon.co.jp/dp/4798061778/ "フロントエンド開発入門 プロフェッショナルな開発ツールと設計・実装 | 安達 稜, 武田 諭 |本 | 通販 | Amazon")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">HTML</span> <span class="jser-tag">CSS</span> <span class="jser-tag">JavaScript</span> <span class="jser-tag">book</span> <span class="jser-tag">Tools</span></p>
2020年10月9日発売
ウェブフロントエンドとエコシステムについての書籍
----
## accrefs - Webアクセシビリティの参考資料まとめ
[accrefs.jp/](https://accrefs.jp/ "accrefs - Webアクセシビリティの参考資料まとめ")
<p class="jser-tags jser-tag-icon"><span class="jser-tag">accessibility</span> <span class="jser-tag">links</span></p>
ウェブアクセシビリティについての資料をまとめたページ
----
| {
"content_hash": "767397f35e840a174a12b3b48b104487",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 285,
"avg_line_length": 46.35964912280702,
"alnum_prop": 0.7541154210028382,
"repo_name": "UYEONG/jser.github.io",
"id": "dd088da2124f90829c2618c8cd2b297e08617a01",
"size": "12962",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "_i18n/ja/_posts/2020/2020-10-19-babel-7.12.0-chrome-87-beta-npm-7.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "60984"
},
{
"name": "HTML",
"bytes": "3310888"
},
{
"name": "JavaScript",
"bytes": "44331"
},
{
"name": "Ruby",
"bytes": "3349"
}
],
"symlink_target": ""
} |
import os
class Config(object):
FINKIT_HOST = os.environ['FNKT_HOST']
APP_TESTING = False
FINKIT_PORT = 4000
DEBUG_STATUS = True
SSL_STATUS = True
MAIL_SERVER = os.environ['FNKT_MAIL_SERVER']
MAILBOX_USERNAME = os.environ['FNKT_MAIL_USERNAME']
MAILBOX_PASSWORD = os.environ['FNKT_MAIL_PASSWORD']
if os.environ['FNKT_TEST'] == 'True':
TEST_MAILBOX_USERNAME = os.environ['FNKT_TEST_MAIL_USERNAME']
TEST_MAILBOX_PASSWORD = os.environ['FNKT_TEST_MAIL_PASSWORD']
TEST_SMTP_PORT = 587
else:
pass
SECRET_KEY = os.environ['FNKT_SECRET_KEY']
ATTACHMENT_DIR = './static/attachments' | {
"content_hash": "210140ed5df3ef672f50a8acee127eaa",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 33.3,
"alnum_prop": 0.6381381381381381,
"repo_name": "Fuchida/Archive",
"id": "5204145c81bfbd0e3afa742c5eddb0107b2f8b54",
"size": "666",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "finkit/src/settings.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1809"
},
{
"name": "HTML",
"bytes": "626592"
},
{
"name": "JavaScript",
"bytes": "1645"
},
{
"name": "Python",
"bytes": "33573"
},
{
"name": "Shell",
"bytes": "669"
}
],
"symlink_target": ""
} |
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_WALLET_H
#define BITCOIN_WALLET_H
#include "core.h"
#include "crypter.h"
#include "key.h"
#include "keystore.h"
#include "main.h"
#include "ui_interface.h"
#include "util.h"
#include "walletdb.h"
#include <algorithm>
#include <map>
#include <set>
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
// Settings
extern int64_t nTransactionFee;
extern bool bSpendZeroConfChange;
// -paytxfee default
static const int64_t DEFAULT_TRANSACTION_FEE = 0;
// -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB
static const int nHighTransactionFeeWarning = 0.01 * COIN;
class CAccountingEntry;
class CCoinControl;
class COutput;
class CReserveKey;
class CScript;
class CWalletTx;
/** (client) version numbers for particular wallet features */
enum WalletFeature
{
FEATURE_BASE = 10500, // the earliest version new wallets supports (only useful for getinfo's clientversion output)
FEATURE_WALLETCRYPT = 40000, // wallet encryption
FEATURE_COMPRPUBKEY = 60000, // compressed public keys
FEATURE_LATEST = 61000
};
enum AvailableCoinsType
{
ALL_COINS = 1,
ONLY_DENOMINATED = 2,
ONLY_NONDENOMINATED = 3,
ONLY_NONDENOMINATED_NOTMN = 4 // ONLY_NONDENOMINATED and not 1000 FLAX at the same time
};
/** A key pool entry */
class CKeyPool
{
public:
int64_t nTime;
CPubKey vchPubKey;
CKeyPool()
{
nTime = GetTime();
}
CKeyPool(const CPubKey& vchPubKeyIn)
{
nTime = GetTime();
vchPubKey = vchPubKeyIn;
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(nTime);
READWRITE(vchPubKey);
)
};
/** Address book data */
class CAddressBookData
{
public:
std::string name;
std::string purpose;
CAddressBookData()
{
purpose = "unknown";
}
typedef std::map<std::string, std::string> StringMap;
StringMap destdata;
};
/** A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,
* and provides the ability to create new transactions.
*/
class CWallet : public CCryptoKeyStore, public CWalletInterface
{
private:
CWalletDB *pwalletdbEncryption;
// the current wallet version: clients below this version are not able to load the wallet
int nWalletVersion;
// the maximum wallet format version: memory-only variable that specifies to what version this wallet may be upgraded
int nWalletMaxVersion;
int64_t nNextResend;
int64_t nLastResend;
// Used to keep track of spent outpoints, and
// detect and report conflicts (double-spends or
// mutated transactions where the mutant gets mined).
typedef std::multimap<COutPoint, uint256> TxSpends;
TxSpends mapTxSpends;
void AddToSpends(const COutPoint& outpoint, const uint256& wtxid);
void AddToSpends(const uint256& wtxid);
void SyncMetaData(std::pair<TxSpends::iterator, TxSpends::iterator>);
public:
bool SelectCoins(int64_t nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl = NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX = true) const;
bool SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const;
bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& vCoinsRet, std::vector<COutput>& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax);
bool SelectCoinsDarkDenominated(int64_t nTargetValue, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet) const;
bool HasCollateralInputs() const;
bool IsCollateralAmount(int64_t nInputAmount) const;
int CountInputsWithAmount(int64_t nInputAmount);
bool SelectCoinsCollateral(std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet) const ;
bool SelectCoinsWithoutDenomination(int64_t nTargetValue, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet) const;
bool GetTransaction(const uint256 &hashTx, CWalletTx& wtx);
/// Main wallet lock.
/// This lock protects all the fields added by CWallet
/// except for:
/// fFileBacked (immutable after instantiation)
/// strWalletFile (immutable after instantiation)
mutable CCriticalSection cs_wallet;
bool fFileBacked;
bool fWalletUnlockAnonymizeOnly;
std::string strWalletFile;
std::set<int64_t> setKeyPool;
std::map<CKeyID, CKeyMetadata> mapKeyMetadata;
typedef std::map<unsigned int, CMasterKey> MasterKeyMap;
MasterKeyMap mapMasterKeys;
unsigned int nMasterKeyMaxID;
CWallet()
{
SetNull();
}
CWallet(std::string strWalletFileIn)
{
SetNull();
strWalletFile = strWalletFileIn;
fFileBacked = true;
}
void SetNull()
{
nWalletVersion = FEATURE_BASE;
nWalletMaxVersion = FEATURE_BASE;
fFileBacked = false;
nMasterKeyMaxID = 0;
pwalletdbEncryption = NULL;
nOrderPosNext = 0;
nNextResend = 0;
nLastResend = 0;
nTimeFirstKey = 0;
fWalletUnlockAnonymizeOnly = false;
}
std::map<uint256, CWalletTx> mapWallet;
int64_t nOrderPosNext;
std::map<uint256, int> mapRequestCount;
std::map<CTxDestination, CAddressBookData> mapAddressBook;
CPubKey vchDefaultKey;
std::set<COutPoint> setLockedCoins;
int64_t nTimeFirstKey;
const CWalletTx* GetWalletTx(const uint256& hash) const;
// check whether we are allowed to upgrade (or already support) to the named feature
bool CanSupportFeature(enum WalletFeature wf) { AssertLockHeld(cs_wallet); return nWalletMaxVersion >= wf; }
void AvailableCoins(std::vector<COutput>& vCoins, bool fOnlyConfirmed=true, const CCoinControl *coinControl = NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX = false) const;
bool SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfTheirs, std::vector<COutput> vCoins, std::set<std::pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet) const;
bool IsSpent(const uint256& hash, unsigned int n) const;
bool IsLockedCoin(uint256 hash, unsigned int n) const;
void LockCoin(COutPoint& output);
void UnlockCoin(COutPoint& output);
void UnlockAllCoins();
void ListLockedCoins(std::vector<COutPoint>& vOutpts);
int64_t GetTotalValue(std::vector<CTxIn> vCoins);
// keystore implementation
// Generate a new key
CPubKey GenerateNewKey();
// Adds a key to the store, and saves it to disk.
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey);
// Adds a key to the store, without saving it to disk (used by LoadWallet)
bool LoadKey(const CKey& key, const CPubKey &pubkey) { return CCryptoKeyStore::AddKeyPubKey(key, pubkey); }
// Load metadata (used by LoadWallet)
bool LoadKeyMetadata(const CPubKey &pubkey, const CKeyMetadata &metadata);
bool LoadMinVersion(int nVersion) { AssertLockHeld(cs_wallet); nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; }
// Adds an encrypted key to the store, and saves it to disk.
bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
// Adds an encrypted key to the store, without saving it to disk (used by LoadWallet)
bool LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret);
bool AddCScript(const CScript& redeemScript);
bool LoadCScript(const CScript& redeemScript);
/// Adds a destination data tuple to the store, and saves it to disk
bool AddDestData(const CTxDestination &dest, const std::string &key, const std::string &value);
/// Erases a destination data tuple in the store and on disk
bool EraseDestData(const CTxDestination &dest, const std::string &key);
/// Adds a destination data tuple to the store, without saving it to disk
bool LoadDestData(const CTxDestination &dest, const std::string &key, const std::string &value);
/// Look up a destination data tuple in the store, return true if found false otherwise
bool GetDestData(const CTxDestination &dest, const std::string &key, std::string *value) const;
bool Unlock(const SecureString& strWalletPassphrase, bool anonimizeOnly = false);
bool ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase);
bool EncryptWallet(const SecureString& strWalletPassphrase);
void GetKeyBirthTimes(std::map<CKeyID, int64_t> &mapKeyBirth) const;
/** Increment the next transaction order id
@return next transaction order id
*/
int64_t IncOrderPosNext(CWalletDB *pwalletdb = NULL);
typedef std::pair<CWalletTx*, CAccountingEntry*> TxPair;
typedef std::multimap<int64_t, TxPair > TxItems;
/** Get the wallet's activity log
@return multimap of ordered transactions and accounting entries
@warning Returned pointers are *only* valid within the scope of passed acentries
*/
TxItems OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount = "");
void MarkDirty();
bool AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet=false);
void SyncTransaction(const uint256 &hash, const CTransaction& tx, const CBlock* pblock);
bool AddToWalletIfInvolvingMe(const uint256 &hash, const CTransaction& tx, const CBlock* pblock, bool fUpdate);
void EraseFromWallet(const uint256 &hash);
int ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate = false);
void ReacceptWalletTransactions();
void ResendWalletTransactions();
int64_t GetBalance() const;
int64_t GetUnconfirmedBalance() const;
int64_t GetImmatureBalance() const;
int64_t GetAnonymizedBalance() const;
double GetAverageAnonymizedRounds() const;
int64_t GetNormalizedAnonymizedBalance() const;
int64_t GetDenominatedBalance(bool onlyDenom=true, bool onlyUnconfirmed=false) const;
bool CreateTransaction(const std::vector<std::pair<CScript, int64_t> >& vecSend,
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX=false);
bool CreateTransaction(CScript scriptPubKey, int64_t nValue,
CWalletTx& wtxNew, CReserveKey& reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl *coinControl = NULL);
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, std::string strCommand="tx");
std::string SendMoney(CScript scriptPubKey, int64_t nValue, CWalletTx& wtxNew, AvailableCoinsType coin_type=ALL_COINS);
std::string SendMoneyToDestination(const CTxDestination &address, int64_t nValue, CWalletTx& wtxNew, AvailableCoinsType coin_type=ALL_COINS);
std::string PrepareDarksendDenominate(int minRounds, int maxRounds);
int GenerateDarksendOutputs(int nTotalValue, std::vector<CTxOut>& vout);
bool CreateCollateralTransaction(CTransaction& txCollateral, std::string strReason);
bool ConvertList(std::vector<CTxIn> vCoins, std::vector<int64_t>& vecAmounts);
bool NewKeyPool();
bool TopUpKeyPool(unsigned int kpSize = 0);
int64_t AddReserveKey(const CKeyPool& keypool);
void ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool);
void KeepKey(int64_t nIndex);
void ReturnKey(int64_t nIndex);
bool GetKeyFromPool(CPubKey &key);
int64_t GetOldestKeyPoolTime();
void GetAllReserveKeys(std::set<CKeyID>& setAddress) const;
std::set< std::set<CTxDestination> > GetAddressGroupings();
std::map<CTxDestination, int64_t> GetAddressBalances();
std::set<CTxDestination> GetAccountAddresses(std::string strAccount) const;
bool IsDenominated(const CTxIn &txin) const;
bool IsDenominated(const CTransaction& tx) const
{
/*
Return false if ANY inputs are non-denom
*/
bool ret = true;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
if(!IsDenominated(txin)) {
ret = false;
}
}
return ret;
}
bool IsDenominatedAmount(int64_t nInputAmount) const;
bool IsMine(const CTxIn& txin) const;
int64_t GetDebit(const CTxIn& txin) const;
bool IsMine(const CTxOut& txout) const
{
return ::IsMine(*this, txout.scriptPubKey);
}
int64_t GetCredit(const CTxOut& txout) const
{
if (!MoneyRange(txout.nValue))
throw std::runtime_error("CWallet::GetCredit() : value out of range");
return (IsMine(txout) ? txout.nValue : 0);
}
bool IsChange(const CTxOut& txout) const;
int64_t GetChange(const CTxOut& txout) const
{
if (!MoneyRange(txout.nValue))
throw std::runtime_error("CWallet::GetChange() : value out of range");
return (IsChange(txout) ? txout.nValue : 0);
}
bool IsMine(const CTransaction& tx) const
{
BOOST_FOREACH(const CTxOut& txout, tx.vout)
if (IsMine(txout))
return true;
return false;
}
bool IsFromMe(const CTransaction& tx) const
{
return (GetDebit(tx) > 0);
}
int64_t GetDebit(const CTransaction& tx) const
{
int64_t nDebit = 0;
BOOST_FOREACH(const CTxIn& txin, tx.vin)
{
nDebit += GetDebit(txin);
if (!MoneyRange(nDebit))
throw std::runtime_error("CWallet::GetDebit() : value out of range");
}
return nDebit;
}
int64_t GetCredit(const CTransaction& tx) const
{
int64_t nCredit = 0;
BOOST_FOREACH(const CTxOut& txout, tx.vout)
{
nCredit += GetCredit(txout);
if (!MoneyRange(nCredit))
throw std::runtime_error("CWallet::GetCredit() : value out of range");
}
return nCredit;
}
int64_t GetChange(const CTransaction& tx) const
{
int64_t nChange = 0;
BOOST_FOREACH(const CTxOut& txout, tx.vout)
{
nChange += GetChange(txout);
if (!MoneyRange(nChange))
throw std::runtime_error("CWallet::GetChange() : value out of range");
}
return nChange;
}
void SetBestChain(const CBlockLocator& loc);
DBErrors LoadWallet(bool& fFirstRunRet);
DBErrors ZapWalletTx();
bool SetAddressBook(const CTxDestination& address, const std::string& strName, const std::string& purpose);
bool DelAddressBook(const CTxDestination& address);
bool UpdatedTransaction(const uint256 &hashTx);
void Inventory(const uint256 &hash)
{
{
LOCK(cs_wallet);
std::map<uint256, int>::iterator mi = mapRequestCount.find(hash);
if (mi != mapRequestCount.end())
(*mi).second++;
}
}
unsigned int GetKeyPoolSize()
{
AssertLockHeld(cs_wallet); // setKeyPool
return setKeyPool.size();
}
bool SetDefaultKey(const CPubKey &vchPubKey);
// signify that a particular wallet feature is now used. this may change nWalletVersion and nWalletMaxVersion if those are lower
bool SetMinVersion(enum WalletFeature, CWalletDB* pwalletdbIn = NULL, bool fExplicit = false);
// change which version we're allowed to upgrade to (note that this does not immediately imply upgrading to that format)
bool SetMaxVersion(int nVersion);
// get the current wallet format (the oldest client version guaranteed to understand this wallet)
int GetVersion() { LOCK(cs_wallet); return nWalletVersion; }
// Get wallet transactions that conflict with given transaction (spend same outputs)
std::set<uint256> GetConflicts(const uint256& txid) const;
/** Address book entry changed.
* @note called with lock cs_wallet held.
*/
boost::signals2::signal<void (CWallet *wallet, const CTxDestination
&address, const std::string &label, bool isMine,
const std::string &purpose,
ChangeType status)> NotifyAddressBookChanged;
/** Wallet transaction added, removed or updated.
* @note called with lock cs_wallet held.
*/
boost::signals2::signal<void (CWallet *wallet, const uint256 &hashTx,
ChangeType status)> NotifyTransactionChanged;
/** Show progress e.g. for rescan */
boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
};
/** A key allocated from the key pool. */
class CReserveKey
{
protected:
CWallet* pwallet;
int64_t nIndex;
CPubKey vchPubKey;
public:
CReserveKey(CWallet* pwalletIn)
{
nIndex = -1;
pwallet = pwalletIn;
}
~CReserveKey()
{
ReturnKey();
}
void ReturnKey();
bool GetReservedKey(CPubKey &pubkey);
void KeepKey();
};
typedef std::map<std::string, std::string> mapValue_t;
static void ReadOrderPos(int64_t& nOrderPos, mapValue_t& mapValue)
{
if (!mapValue.count("n"))
{
nOrderPos = -1; // TODO: calculate elsewhere
return;
}
nOrderPos = atoi64(mapValue["n"].c_str());
}
static void WriteOrderPos(const int64_t& nOrderPos, mapValue_t& mapValue)
{
if (nOrderPos == -1)
return;
mapValue["n"] = i64tostr(nOrderPos);
}
/** A transaction with a bunch of additional info that only the owner cares about.
* It includes any unrecorded transactions needed to link it back to the block chain.
*/
class CWalletTx : public CMerkleTx
{
private:
const CWallet* pwallet;
public:
mapValue_t mapValue;
std::vector<std::pair<std::string, std::string> > vOrderForm;
unsigned int fTimeReceivedIsTxTime;
unsigned int nTimeReceived; // time received by this node
unsigned int nTimeSmart;
char fFromMe;
std::string strFromAccount;
int64_t nOrderPos; // position in ordered transaction list
// memory only
mutable bool fDebitCached;
mutable bool fCreditCached;
mutable bool fImmatureCreditCached;
mutable bool fAvailableCreditCached;
mutable bool fChangeCached;
mutable int64_t nDebitCached;
mutable int64_t nCreditCached;
mutable int64_t nImmatureCreditCached;
mutable int64_t nAvailableCreditCached;
mutable int64_t nChangeCached;
CWalletTx()
{
Init(NULL);
}
CWalletTx(const CWallet* pwalletIn)
{
Init(pwalletIn);
}
CWalletTx(const CWallet* pwalletIn, const CMerkleTx& txIn) : CMerkleTx(txIn)
{
Init(pwalletIn);
}
CWalletTx(const CWallet* pwalletIn, const CTransaction& txIn) : CMerkleTx(txIn)
{
Init(pwalletIn);
}
void Init(const CWallet* pwalletIn)
{
pwallet = pwalletIn;
mapValue.clear();
vOrderForm.clear();
fTimeReceivedIsTxTime = false;
nTimeReceived = 0;
nTimeSmart = 0;
fFromMe = false;
strFromAccount.clear();
fDebitCached = false;
fCreditCached = false;
fImmatureCreditCached = false;
fAvailableCreditCached = false;
fChangeCached = false;
nDebitCached = 0;
nCreditCached = 0;
nImmatureCreditCached = 0;
nAvailableCreditCached = 0;
nChangeCached = 0;
nOrderPos = -1;
}
IMPLEMENT_SERIALIZE
(
CWalletTx* pthis = const_cast<CWalletTx*>(this);
if (fRead)
pthis->Init(NULL);
char fSpent = false;
if (!fRead)
{
pthis->mapValue["fromaccount"] = pthis->strFromAccount;
WriteOrderPos(pthis->nOrderPos, pthis->mapValue);
if (nTimeSmart)
pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart);
}
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion,ser_action);
std::vector<CMerkleTx> vUnused; // Used to be vtxPrev
READWRITE(vUnused);
READWRITE(mapValue);
READWRITE(vOrderForm);
READWRITE(fTimeReceivedIsTxTime);
READWRITE(nTimeReceived);
READWRITE(fFromMe);
READWRITE(fSpent);
if (fRead)
{
pthis->strFromAccount = pthis->mapValue["fromaccount"];
ReadOrderPos(pthis->nOrderPos, pthis->mapValue);
pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0;
}
pthis->mapValue.erase("fromaccount");
pthis->mapValue.erase("version");
pthis->mapValue.erase("spent");
pthis->mapValue.erase("n");
pthis->mapValue.erase("timesmart");
)
// make sure balances are recalculated
void MarkDirty()
{
fCreditCached = false;
fAvailableCreditCached = false;
fDebitCached = false;
fChangeCached = false;
}
void BindWallet(CWallet *pwalletIn)
{
pwallet = pwalletIn;
MarkDirty();
}
int64_t GetDebit() const
{
if (vin.empty())
return 0;
if (fDebitCached)
return nDebitCached;
nDebitCached = pwallet->GetDebit(*this);
fDebitCached = true;
return nDebitCached;
}
int64_t IsDenominated() const
{
if (vin.empty())
return 0;
return pwallet->IsDenominated(*this);
}
int64_t GetCredit(bool fUseCache=true) const
{
// Must wait until coinbase is safely deep enough in the chain before valuing it
if (IsCoinBase() && GetBlocksToMaturity() > 0)
return 0;
// GetBalance can assume transactions in mapWallet won't change
if (fUseCache && fCreditCached)
return nCreditCached;
nCreditCached = pwallet->GetCredit(*this);
fCreditCached = true;
return nCreditCached;
}
int64_t GetImmatureCredit(bool fUseCache=true) const
{
if (IsCoinBase() && GetBlocksToMaturity() > 0 && IsInMainChain())
{
if (fUseCache && fImmatureCreditCached)
return nImmatureCreditCached;
nImmatureCreditCached = pwallet->GetCredit(*this);
fImmatureCreditCached = true;
return nImmatureCreditCached;
}
return 0;
}
int64_t GetAvailableCredit(bool fUseCache=true) const
{
if (pwallet == 0)
return 0;
// Must wait until coinbase is safely deep enough in the chain before valuing it
if (IsCoinBase() && GetBlocksToMaturity() > 0)
return 0;
if (fUseCache && fAvailableCreditCached)
return nAvailableCreditCached;
int64_t nCredit = 0;
uint256 hashTx = GetHash();
for (unsigned int i = 0; i < vout.size(); i++)
{
if (!pwallet->IsSpent(hashTx, i))
{
const CTxOut &txout = vout[i];
nCredit += pwallet->GetCredit(txout);
if (!MoneyRange(nCredit))
throw std::runtime_error("CWalletTx::GetAvailableCredit() : value out of range");
}
}
nAvailableCreditCached = nCredit;
fAvailableCreditCached = true;
return nCredit;
}
int64_t GetChange() const
{
if (fChangeCached)
return nChangeCached;
nChangeCached = pwallet->GetChange(*this);
fChangeCached = true;
return nChangeCached;
}
void GetAmounts(std::list<std::pair<CTxDestination, int64_t> >& listReceived,
std::list<std::pair<CTxDestination, int64_t> >& listSent, int64_t& nFee, std::string& strSentAccount) const;
void GetAccountAmounts(const std::string& strAccount, int64_t& nReceived,
int64_t& nSent, int64_t& nFee) const;
bool IsFromMe() const
{
return (GetDebit() > 0);
}
bool IsTrusted() const
{
// Quick answer in most cases
if (!IsFinalTx(*this))
return false;
int nDepth = GetDepthInMainChain();
if (nDepth >= 1)
return true;
if (nDepth < 0)
return false;
if (!bSpendZeroConfChange || !IsFromMe()) // using wtx's cached debit
return false;
// Trusted if all inputs are from us and are in the mempool:
BOOST_FOREACH(const CTxIn& txin, vin)
{
// Transactions not sent by us: not trusted
const CWalletTx* parent = pwallet->GetWalletTx(txin.prevout.hash);
if (parent == NULL)
return false;
const CTxOut& parentOut = parent->vout[txin.prevout.n];
if (!pwallet->IsMine(parentOut))
return false;
}
return true;
}
bool WriteToDisk();
int64_t GetTxTime() const;
int GetRequestCount() const;
void RelayWalletTransaction(std::string strCommand="tx");
std::set<uint256> GetConflicts() const;
};
class COutput
{
public:
const CWalletTx *tx;
int i;
int nDepth;
COutput(const CWalletTx *txIn, int iIn, int nDepthIn)
{
tx = txIn; i = iIn; nDepth = nDepthIn;
}
std::string ToString() const
{
return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString().c_str(), i, nDepth, FormatMoney(tx->vout[i].nValue).c_str());
}
//Used with Darksend. Will return largest nondenom, then denominations, then very small inputs
int Priority() const
{
BOOST_FOREACH(int64_t d, darkSendDenominations)
if(tx->vout[i].nValue == d) return 10000;
if(tx->vout[i].nValue < 1*COIN) return 20000;
//nondenom return largest first
return -(tx->vout[i].nValue/COIN);
}
void print() const
{
LogPrintf("%s\n", ToString().c_str());
}
};
/** Private key that includes an expiration date in case it never gets used. */
class CWalletKey
{
public:
CPrivKey vchPrivKey;
int64_t nTimeCreated;
int64_t nTimeExpires;
std::string strComment;
//// todo: add something to note what created it (user, getnewaddress, change)
//// maybe should have a map<string, string> property map
CWalletKey(int64_t nExpires=0)
{
nTimeCreated = (nExpires ? GetTime() : 0);
nTimeExpires = nExpires;
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(vchPrivKey);
READWRITE(nTimeCreated);
READWRITE(nTimeExpires);
READWRITE(LIMITED_STRING(strComment, 65536));
)
};
/** Account information.
* Stored in wallet with key "acc"+string account name.
*/
class CAccount
{
public:
CPubKey vchPubKey;
CAccount()
{
SetNull();
}
void SetNull()
{
vchPubKey = CPubKey();
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(vchPubKey);
)
};
/** Internal transfers.
* Database key is acentry<account><counter>.
*/
class CAccountingEntry
{
public:
std::string strAccount;
int64_t nCreditDebit;
int64_t nTime;
std::string strOtherAccount;
std::string strComment;
mapValue_t mapValue;
int64_t nOrderPos; // position in ordered transaction list
uint64_t nEntryNo;
CAccountingEntry()
{
SetNull();
}
void SetNull()
{
nCreditDebit = 0;
nTime = 0;
strAccount.clear();
strOtherAccount.clear();
strComment.clear();
nOrderPos = -1;
}
IMPLEMENT_SERIALIZE
(
CAccountingEntry& me = *const_cast<CAccountingEntry*>(this);
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
// Note: strAccount is serialized as part of the key, not here.
READWRITE(nCreditDebit);
READWRITE(nTime);
READWRITE(LIMITED_STRING(strOtherAccount, 65536));
if (!fRead)
{
WriteOrderPos(nOrderPos, me.mapValue);
if (!(mapValue.empty() && _ssExtra.empty()))
{
CDataStream ss(nType, nVersion);
ss.insert(ss.begin(), '\0');
ss << mapValue;
ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end());
me.strComment.append(ss.str());
}
}
READWRITE(LIMITED_STRING(strComment, 65536));
size_t nSepPos = strComment.find("\0", 0, 1);
if (fRead)
{
me.mapValue.clear();
if (std::string::npos != nSepPos)
{
CDataStream ss(std::vector<char>(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion);
ss >> me.mapValue;
me._ssExtra = std::vector<char>(ss.begin(), ss.end());
}
ReadOrderPos(me.nOrderPos, me.mapValue);
}
if (std::string::npos != nSepPos)
me.strComment.erase(nSepPos);
me.mapValue.erase("n");
)
private:
std::vector<char> _ssExtra;
};
#endif
| {
"content_hash": "2c4ebb9d5ad0e98251df0caabbf22f4f",
"timestamp": "",
"source": "github",
"line_count": 944,
"max_line_length": 234,
"avg_line_length": 31.322033898305083,
"alnum_prop": 0.646780303030303,
"repo_name": "northwoodlabs/flaxscript",
"id": "bf26db96278f85b5fc25f360186a4d1ad151b1e3",
"size": "29568",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/wallet.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "720712"
},
{
"name": "C++",
"bytes": "3508478"
},
{
"name": "CSS",
"bytes": "38232"
},
{
"name": "HTML",
"bytes": "50620"
},
{
"name": "M4",
"bytes": "145571"
},
{
"name": "Makefile",
"bytes": "784247"
},
{
"name": "Objective-C",
"bytes": "1052"
},
{
"name": "Objective-C++",
"bytes": "6330"
},
{
"name": "Python",
"bytes": "236475"
},
{
"name": "QMake",
"bytes": "24260"
},
{
"name": "Roff",
"bytes": "36098"
},
{
"name": "Shell",
"bytes": "94489"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.customerprofiles.model.transform;
import java.util.List;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.customerprofiles.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* AppflowIntegrationMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class AppflowIntegrationMarshaller {
private static final MarshallingInfo<StructuredPojo> FLOWDEFINITION_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("FlowDefinition").build();
private static final MarshallingInfo<List> BATCHES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("Batches").build();
private static final AppflowIntegrationMarshaller instance = new AppflowIntegrationMarshaller();
public static AppflowIntegrationMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(AppflowIntegration appflowIntegration, ProtocolMarshaller protocolMarshaller) {
if (appflowIntegration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(appflowIntegration.getFlowDefinition(), FLOWDEFINITION_BINDING);
protocolMarshaller.marshall(appflowIntegration.getBatches(), BATCHES_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "67d7362fcc0e05a792d7d822ae22b959",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 153,
"avg_line_length": 36.979166666666664,
"alnum_prop": 0.7459154929577465,
"repo_name": "aws/aws-sdk-java",
"id": "44057eabe5afffcdef7b2a1b3d8d769910a3e81a",
"size": "2355",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-customerprofiles/src/main/java/com/amazonaws/services/customerprofiles/model/transform/AppflowIntegrationMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Copyright 2006, 2007, 2008, 2009, 2011 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.apache.tapestry5.ioc.internal;
import org.apache.tapestry5.commons.*;
import org.apache.tapestry5.ioc.OperationTracker;
import org.apache.tapestry5.ioc.Registry;
import org.apache.tapestry5.ioc.ServiceAdvisor;
import org.apache.tapestry5.ioc.ServiceDecorator;
import org.apache.tapestry5.ioc.ServiceLifecycle2;
import org.apache.tapestry5.ioc.def.ServiceDef3;
import org.apache.tapestry5.ioc.services.RegistryShutdownHub;
import org.slf4j.Logger;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Internal view of the module registry, adding additional methods needed by modules.
*/
public interface InternalRegistry extends Registry, RegistryShutdownHub, OperationTracker
{
/**
* As with {@link org.apache.tapestry5.ioc.Registry#getObject(Class, org.apache.tapestry5.commons.AnnotationProvider)},
* but handles the {@link org.apache.tapestry5.ioc.annotations.Local} annotation.
*
* @param objectType type of object o be injected
* @param annotationProvider access to annotations at point of injection
* @param locator used to resolve any subsequent injections
* @param localModule module to limit services to, if Local annotaton present
* @return the service or object
*/
<T> T getObject(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator,
Module localModule);
/**
* Returns a service lifecycle by service scope name.
*
* @param scope the name of the service scope (case insensitive)
* @return the lifecycle corresponding to the scope
* @throws RuntimeException if the lifecycle name does not match a known lifecycle
*/
ServiceLifecycle2 getServiceLifecycle(String scope);
/**
* Searches for decorators for a particular service. The resulting {@link org.apache.tapestry5.ioc.def.DecoratorDef}
* s
* are ordered, then converted into {@link ServiceDecorator}s.
*/
List<ServiceDecorator> findDecoratorsForService(ServiceDef3 serviceDef);
/**
* Searches for advisors for a particular service, returning them in order of application.
*
* @since 5.1.0.0
*/
List<ServiceAdvisor> findAdvisorsForService(ServiceDef3 serviceDef);
/**
* Builds up an unordered collection by invoking service contributor methods that target the service (from any
* module, unless the service is private).
*
* @param <T>
* @param serviceDef defines the service for which configuration data is being assembled
* @param valueType identifies the type of object allowed into the collection
* @return the final collection
*/
<T> Collection<T> getUnorderedConfiguration(ServiceDef3 serviceDef, Class<T> valueType);
/**
* Builds up an ordered collection by invoking service contributor methods that target the service (from any module,
* unless the service is private). Once all values have been added (each with an id, and pre/post constraints), the
* values are ordered, null values dropped, and the final sorted list is returned.
*
* @param <T>
* @param serviceDef defines the service for which configuration data is being assembled
* @param valueType identifies the type of object allowed into the collection
* @return the final ordered list
*/
<T> List<T> getOrderedConfiguration(ServiceDef3 serviceDef, Class<T> valueType);
/**
* Builds up a map of key/value pairs by invoking service contribution methods that target the service (from any
* module, unless the service is private). Values and keys may not be null. Invalid values (keys or values that are
* the wrong type, or duplicate keys) result in warnings and are ignored.
*
* @param <K>
* @param <V>
* @param serviceDef defines the service for which configuration data is being assembled
* @param keyType identifies the type of key object allowed into the map
* @param valueType identifies the type of value object allowed into the map
* @return the final ordered list
*/
<K, V> Map<K, V> getMappedConfiguration(ServiceDef3 serviceDef, Class<K> keyType, Class<V> valueType);
/**
* Given an input string that <em>may</em> contain symbols, returns the string with any and all symbols fully
* expanded.
*
* @param input
* @return expanded input
*/
String expandSymbols(String input);
/**
* Returns a logger for the service, which consists of the Module's {@link Module#getLoggerName() log name} suffixed
* with a period and the service id.
*
* @param serviceId
* @return the logger for the service
*/
Logger getServiceLogger(String serviceId);
/**
* Creates a just-in-time (and possibly, live reloading) proxy for the indicated class and interface, using the
* provided locator to autobuild the implementationClass (when necessary).
*
* @since 5.2.0
*/
<T> T proxy(Class<T> interfaceClass, Class<? extends T> implementationClass, ObjectLocator locator);
/**
* Returns a Set of Annotation classes that are used as service markers.
*
* @since 5.2.0
*/
Set<Class> getMarkerAnnotations();
}
| {
"content_hash": "244140733a1ba48f2dfebad8a5fed60b",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 123,
"avg_line_length": 41.6013986013986,
"alnum_prop": 0.7107076819633552,
"repo_name": "apache/tapestry-5",
"id": "f03fa912df5e62cfe32316228c98db59be988a71",
"size": "5949",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/InternalRegistry.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "22899"
},
{
"name": "Clojure",
"bytes": "98"
},
{
"name": "CoffeeScript",
"bytes": "149570"
},
{
"name": "GAP",
"bytes": "5782"
},
{
"name": "Groovy",
"bytes": "621504"
},
{
"name": "HTML",
"bytes": "28932"
},
{
"name": "Java",
"bytes": "8807997"
},
{
"name": "JavaScript",
"bytes": "6504597"
},
{
"name": "Less",
"bytes": "203243"
},
{
"name": "Roff",
"bytes": "861144"
},
{
"name": "Shell",
"bytes": "818"
},
{
"name": "TypeScript",
"bytes": "412"
}
],
"symlink_target": ""
} |
"""2-by-2 contingency tables and scores"""
# Copyright (c) 2017 Aubrey Barnard. This is free software released
# under the MIT license. See LICENSE for details.
import math
class TwoByTwoTable(object):
"""Traditional 2-by-2 table as used in epidemiology, etc. to compare
exposures and outcomes
"""
_num_arg_types = (int, float)
def __init__(
self,
exp_out=None, exp_no_out=None,
out_no_exp=None, no_exp_out=None,
exp_tot=None, out_tot=None, total=None,
):
# Handle construction from 3-by-3 table corners
if (isinstance(exp_out, self._num_arg_types)
and isinstance(exp_tot, self._num_arg_types)
and isinstance(out_tot, self._num_arg_types)
and isinstance(total, self._num_arg_types)
):
self._exp_out = exp_out
self._exp_tot = exp_tot
self._out_tot = out_tot
self._total = total
# Handle construction from 2-by-2 table
elif (isinstance(exp_out, self._num_arg_types)
and isinstance(exp_no_out, self._num_arg_types)
and isinstance(out_no_exp, self._num_arg_types)
and isinstance(no_exp_out, self._num_arg_types)
):
self._exp_out = exp_out
self._exp_tot = exp_out + exp_no_out
self._out_tot = exp_out + out_no_exp
self._total = (
exp_out + exp_no_out + out_no_exp + no_exp_out)
# Construction modes are only the above, bad arguments otherwise
else:
raise ValueError(
'Insufficient {0} constructor arguments.'
.format(self.__class__.__name__))
@property
def exp_out(self):
return self._exp_out
@property
def exp_no_out(self):
return self._exp_tot - self._exp_out
@property
def out_no_exp(self):
return self._out_tot - self._exp_out
@property
def no_exp_out(self):
return self._total - self._exp_tot - self._out_tot + self._exp_out
@property
def exp_tot(self):
return self._exp_tot
@property
def no_exp_tot(self):
return self._total - self._exp_tot
@property
def out_tot(self):
return self._out_tot
@property
def no_out_tot(self):
return self._total - self._out_tot
@property
def total(self):
return self._total
def smoothed(self, pseudocount=1):
"""Return a smoothed version of this table by adding the given
pseudocount to each of the four cells.
"""
return TwoByTwoTable(
exp_out=self.exp_out + pseudocount,
exp_no_out=self.exp_no_out + pseudocount,
out_no_exp=self.out_no_exp + pseudocount,
no_exp_out=self.no_exp_out + pseudocount,
)
def table_2x2(self, pseudocount=None):
if isinstance(pseudocount, self._num_arg_types):
return ((self.exp_out + pseudocount,
self.exp_no_out + pseudocount),
(self.out_no_exp + pseudocount,
self.no_exp_out + pseudocount))
else:
return ((self.exp_out, self.exp_no_out),
(self.out_no_exp, self.no_exp_out))
def table_3x3(self, pseudocount=None):
if isinstance(pseudocount, self._num_arg_types):
return ((self.exp_out + pseudocount,
self.exp_no_out + pseudocount,
self.exp_tot + 2 * pseudocount),
(self.out_no_exp + pseudocount,
self.no_exp_out + pseudocount,
self.no_exp_tot + 2 * pseudocount),
(self.out_tot + 2 * pseudocount,
self.no_out_tot + 2 * pseudocount,
self.total + 4 * pseudocount))
else:
return ((self.exp_out, self.exp_no_out, self.exp_tot),
(self.out_no_exp, self.no_exp_out, self.no_exp_tot),
(self.out_tot, self.no_out_tot, self.total))
class TemporalTwoByTwoTable(TwoByTwoTable):
"""A temporal 2-by-2 table splits the first cell (exposure and outcome)
into two counts: exposure before outcome and exposure after outcome.
"""
def __init__(
self,
exp_bef_out=None, exp_aft_out=None, exp_out=None,
exp_no_out=None, out_no_exp=None, no_exp_out=None,
exp_tot=None, out_tot=None, total=None,
):
# Construct this class
if ((isinstance(exp_bef_out, self._num_arg_types)
and isinstance(exp_aft_out, self._num_arg_types))
or (isinstance(exp_out, self._num_arg_types)
and (isinstance(exp_bef_out, self._num_arg_types)
or isinstance(exp_aft_out, self._num_arg_types)))
):
self._exp_bef_out = (exp_bef_out
if exp_bef_out is not None
else exp_out - exp_aft_out)
self._exp_aft_out = (exp_aft_out
if exp_aft_out is not None
else exp_out - exp_bef_out)
exp_out = (exp_out
if exp_out is not None
else exp_bef_out + exp_aft_out)
# Construct superclass
super().__init__(
exp_out, exp_no_out,
out_no_exp, no_exp_out,
exp_tot, out_tot, total,
)
# Otherwise arguments don't completely define a 2-by-2 table
else:
raise ValueError(
'Insufficient {0} constructor arguments.'
.format(self.__class__.__name__))
@property
def exp_bef_out(self):
return self._exp_bef_out
@property
def exp_aft_out(self):
return self._exp_aft_out
def smoothed(self, pseudocount=1):
"""Return a smoothed version of this table by adding the given
pseudocount to each of the four cells.
"""
half_count = pseudocount / 2
return TemporalTwoByTwoTable(
exp_bef_out=self.exp_bef_out + half_count,
exp_aft_out=self.exp_aft_out + half_count,
exp_out=self.exp_out + pseudocount,
exp_no_out=self.exp_no_out + pseudocount,
out_no_exp=self.out_no_exp + pseudocount,
no_exp_out=self.no_exp_out + pseudocount,
)
def cohort_table(self):
"""Creates a copy of this table that treats the counts as in a cohort
study. That is, 'exp_aft_out' is counted as part of
'out_no_exp' rather than as part of 'exp_out'. These are the
counts a cohort study would use having followed subjects over
time: the outcome happened first, so the exposure does not
matter.
"""
return TwoByTwoTable(
exp_out=self.exp_bef_out,
exp_tot=(self.exp_tot - self.exp_aft_out),
out_tot=self.out_tot,
total=self.total,
)
def binary_mutual_information(table):
"""Return the mutual information between the two binary variables in the
given 2-by-2 table
"""
# Shortcut / Special-Case the zero distribution
if table.total == 0:
return 0.0
# Do the calculation in a way that handles zeros. (If the numerator
# in the log is greater than zero, the denominator cannot be zero.)
mi_sum = 0.0
if table.exp_out > 0:
mi_sum += (table.exp_out
* math.log((table.exp_out * table.total)
/ (table.exp_tot * table.out_tot)))
if table.exp_no_out > 0:
mi_sum += (table.exp_no_out
* math.log((table.exp_no_out * table.total)
/ (table.exp_tot * table.no_out_tot)))
if table.out_no_exp > 0:
mi_sum += (table.out_no_exp
* math.log((table.out_no_exp * table.total)
/ (table.out_tot * table.no_exp_tot)))
if table.no_exp_out > 0:
mi_sum += (table.no_exp_out
* math.log((table.no_exp_out * table.total)
/ (table.no_out_tot * table.no_exp_tot)))
return mi_sum / table.total
def relative_risk(table):
"""Return the relative risk for the given 2-by-2 table"""
# When all the cells are zero or both numerators are zero the rates
# are "equal" so the relative risk is one
if ((table.exp_tot == 0 and table.no_exp_tot == 0)
or (table.exp_out == 0 and table.out_no_exp == 0)
):
return 1.0
# If the numerator rate is zero, then the relative risk cannot get
# any less, so it is also zero
elif table.exp_tot == 0:
return 0.0
# If the denominator rate is zero, then the relative risk cannot get
# any larger, so it is infinity
elif table.no_exp_tot == 0:
return float('inf')
# (eo/et)/(one/net) -> (eo*net)/(one*et)
return ((table.exp_out * table.no_exp_tot)
/ (table.out_no_exp * table.exp_tot))
def odds_ratio(table):
"""Return the odds ratio for the given 2-by-2 table"""
# When all the cells are zero or both numerators are zero the odds
# are "equal" so the ratio is one
if ((table.exp_tot == 0 and table.no_exp_tot == 0)
or (table.exp_out == 0 and table.out_no_exp == 0)
):
return 1.0
# If the numerator odds are zero, then the ratio cannot get any
# less, so it is zero
elif table.exp_tot == 0:
return 0.0
# If the denominator odds are zero, then the ratio cannot get any
# larger, so it is infinity
elif table.no_exp_tot == 0:
return float('inf')
# (eo/eno)/(one/neo) -> (eo*neo)/(eno*one)
return ((table.exp_out * table.no_exp_out)
/ (table.exp_no_out * table.out_no_exp))
def absolute_risk_difference(table):
"""Return the absolute risk difference for the given 2-by-2 table"""
# Absolute risk difference: (eo/et)-(one/net)
# Define the risk as zero if the row totals are zero to avoid
# division by zero
risk_exp = ((table.exp_out / table.exp_tot)
if table.exp_tot > 0
else 0.0)
risk_no_exp = ((table.out_no_exp / table.no_exp_tot)
if table.no_exp_tot > 0
else 0.0)
# Return the difference of the risks of outcome in the exposed and
# unexposed
return risk_exp - risk_no_exp
| {
"content_hash": "8bc2144ca241ba7d2109ba5dfe9f400f",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 77,
"avg_line_length": 36.27835051546392,
"alnum_prop": 0.5489248839632471,
"repo_name": "afbarnard/barnapy",
"id": "32189d513b5c5296a78e5b31bffb9608ebee75f9",
"size": "10557",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "barnapy/contingency_table.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "131019"
}
],
"symlink_target": ""
} |
var inspect = require('util').inspect;
var dropbox = require('./cents.dropbox');
var getAccountsFileName = require('../server/utilities').getAccountsFileName;
function getAccounts(){
var jsonFile = require('path').join(getAccountsFileName());
var accountsJson = JSON.parse(require('fs').readFileSync(jsonFile,'utf8'));
return accountsJson;
}
var accounts = getAccounts();
function dataStoresRequest(error,response, body){
if(error){
console.log("FAIL BEFORE DATASTORES REQUEST");
}
// call drop lib here
dropbox.list_datastores(null, getDataStoresToAdd);
//getDataStoresToAdd(null,null,'{ "datastores" : ["default","superfantastic","test"] }');
}
// verify accounts main structure have data stores and relevant info is in each datastore
function getDataStoresToAdd(error, response, body){
var datastores = JSON.parse(body).datastores.map(function(value){ dropbox.handles[value.dsid]=value.handle; return value.dsid; });
console.log(inspect(datastores));
var accounts = getAccounts();
if(error || !datastores){
console.log("FAIL TO LIST DATASTORES");
return;
}
var toAdd = [];
for(var propertyName in accounts) {
// propertyName is what you want
// you can get the value like this: myObject[propertyName]
if (datastores.indexOf(propertyName) < 0){
toAdd.push(propertyName);
}
}
if (toAdd.length > 0){
// call function to add datastores here
//get_or_create_datastore(access_token, datastoreName,etc << callback for this calls dataStoresRequest and starts process again
dropbox.get_or_create_datastore(null,toAdd[0],dataStoresRequest);
console.log(inspect(toAdd));
} else {
// call function to kick off the following
console.log('--- ALL NEEDED DATASTORES EXIST');
//console.log(inspect(dropbox.handles));
getAccountRows(accounts);
}
}
// used for each account to get rows
function snapshotResponse(error, response, body){
if(error){
console.log("FAIL TO GET SNAPSHOT");
}
responseRows = JSON.parse(body).rows;
console.log(inspect(body));
accountsRows = (responseRows.length > 0) ? accountsRows.concat(responseRows) : accountsRows;
var handle = response.request.url.query.replace("handle=","");
var requestedDataStore;
for(var propName in dropbox.handles){
if (dropbox.handles[propName]==handle){
requestedDataStore = propName;
break;
}
}
console.log(inspect(requestedDataStore));
dropbox.revisions[requestedDataStore] = JSON.parse(body).rev;
// remove requestedDataStore
var index = accountsLeftToGetRows.indexOf(requestedDataStore);
accountsLeftToGetRows.splice(index, 1);
getAccountRows(accountsLeftToGetRows);
}
var accountsLeftToGetRows;
var accountsRows = [];
function getAccountRows(accounts){
// for all items in each account property (balance, assets, liabilities)
// either insert or update based on snapshot got from request (or from information in get_deltas), only if needed
accountsLeftToGetRows = (Object.prototype.toString.call(accounts).toLowerCase().indexOf("array") == -1)
? Object.getOwnPropertyNames(accounts).concat(["superfantastic"])
: accounts;
//console.log(inspect(accounts));
//console.log(dropbox.handles[accountsLeftToGetRows[0]]);
//var gettingAccount = accountsLeftToGetRows[0];
if (accountsLeftToGetRows.length > 0){
dropbox.get_snapshot(dropbox.handles[accountsLeftToGetRows[0]], null, snapshotResponse);
} else {
console.log("FINISHED GETTING ACCOUNT ROWS FROM SERVER");
var deltas = getDeltas(accountsRows);
if (!deltas || deltas.length <= 0) {
console.log("-- no changes to be made");
return;
}
var _accounts = getAccounts();
for(var section in _accounts) {
var handle = dropbox.handles[section];
var access_token = null;
var revision = dropbox.revisions[section];
var changes = deltas.filter(function(a){
return a[1].indexOf(section) == 0;
});
if (!!changes && changes.length > 0){
console.log(inspect(changes));
dropbox.put_delta(handle,access_token,revision,changes, function (error,response,body) {
console.log(body);
});
}
}
}
}
function getDeltas(accountsRows){
//console.log(accountsRows);
//console.log("-- TODO: look at what rows are on server and compare those with what needs added/updated from local, create a DELTA and push to server");
var accounts = getAccounts();
var deltas = [];
for(var section in accounts) {
var rows = accounts[section];
console.log("-- " + section);
for(var row in rows) {
var id = rows[row].title.toLowerCase().replace(/ /g,"_");
var existingMatches = accountsRows.filter(function(a){ return a.tid.indexOf(section)!=-1 && a.rowid.indexOf(id)!=-1; });
var change = [];
if(!existingMatches || existingMatches.length <= 0) {
//console.log("-- INSERT row in dropbox: " + section + "/" + id);
change = [
"I",
section,
id,
rows[row]
];
deltas.push(change);
}
if(!!existingMatches && existingMatches.length > 0){
console.log("-- TODO: if not equal, UPDATE row in dropbox: " + section + "/" + id);
}
//console.log("\t"+id);
}
console.log("-- TODO: delete rows that should not exist");
}
//console.log(inspect(deltas));
return deltas;
}
dataStoresRequest();
| {
"content_hash": "e0f87bfabe4b6ed06865b12a9a2b414d",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 153,
"avg_line_length": 33.075471698113205,
"alnum_prop": 0.6961399505609431,
"repo_name": "crosshj/cents",
"id": "71a88c183dad1dbb2e5384123cce22fbc85baaf4",
"size": "5259",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "misc/oldCode/jsonToDeltas.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "44028"
},
{
"name": "HTML",
"bytes": "44220"
},
{
"name": "JavaScript",
"bytes": "323777"
},
{
"name": "Shell",
"bytes": "1064"
}
],
"symlink_target": ""
} |
public class Zero {
public static void main(String[] args) {
int numerator = 10;
int denominator = 0;
try {
System.out.println(numerator / denominator);
} catch (NumberFormatException except) {
System.out.println("Caught!");
} finally {
System.out.println("Finally!");
}
System.out.println("This text will not be printed :(");
}
}
| {
"content_hash": "36b7dc8eed0604fcc4b05148301b2da5",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 63,
"avg_line_length": 28,
"alnum_prop": 0.5290178571428571,
"repo_name": "shasdemir/JavaBook-Projects",
"id": "f1ab736db5dd8d464fcf12ddd94dc06a5242363b",
"size": "448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Exceptions/The Uncaught/src/Zero.java",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Erlang",
"bytes": "402"
},
{
"name": "Java",
"bytes": "204484"
},
{
"name": "JavaScript",
"bytes": "535"
},
{
"name": "PHP",
"bytes": "407"
},
{
"name": "Perl",
"bytes": "48854"
},
{
"name": "R",
"bytes": "396"
},
{
"name": "Shell",
"bytes": "203"
}
],
"symlink_target": ""
} |
package main
import (
"os"
"github.com/codegangsta/cli"
)
func main() {
app := cli.NewApp()
app.Name = "surelock-homes"
app.Version = Version
app.Usage = "Home Lock Management"
app.Commands = Commands
app.Run(os.Args)
}
| {
"content_hash": "d9bd0ef1a113c7839b01e98c83da9988",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 35,
"avg_line_length": 13.647058823529411,
"alnum_prop": 0.6724137931034483,
"repo_name": "tknhs/Surelock-Homes",
"id": "e3e8f994addf650f7c8fdb338bb5cce678edd9f9",
"size": "232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "surelock-homes.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "10791"
}
],
"symlink_target": ""
} |
define([
'performer/transformers/wrap',
'performer/transformers/sibling'
],
function(Wrap, Sibling) {
return {
tag: [Sibling.label,Wrap.li],
set: [Wrap.ol,Sibling.legend,Wrap.fieldset]
};
});
| {
"content_hash": "677708be43017ce30f322ee78214cf04",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 47,
"avg_line_length": 15.142857142857142,
"alnum_prop": 0.6556603773584906,
"repo_name": "node-migrator-bot/performer",
"id": "01714190de5885c388a0aa047b435b42b4173a2a",
"size": "212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/performer/pipelines/semantic.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "48879"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_77) on Mon May 23 19:36:49 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>org.apache.lucene.queryparser.surround.parser (Lucene 6.0.1 API)</title>
<meta name="date" content="2016-05-23">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../../../../../../org/apache/lucene/queryparser/surround/parser/package-summary.html" target="classFrame">org.apache.lucene.queryparser.surround.parser</a></h1>
<div class="indexContainer">
<h2 title="Interfaces">Interfaces</h2>
<ul title="Interfaces">
<li><a href="CharStream.html" title="interface in org.apache.lucene.queryparser.surround.parser" target="classFrame"><span class="interfaceName">CharStream</span></a></li>
<li><a href="QueryParserConstants.html" title="interface in org.apache.lucene.queryparser.surround.parser" target="classFrame"><span class="interfaceName">QueryParserConstants</span></a></li>
</ul>
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="FastCharStream.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">FastCharStream</a></li>
<li><a href="QueryParser.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">QueryParser</a></li>
<li><a href="QueryParserTokenManager.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">QueryParserTokenManager</a></li>
<li><a href="Token.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">Token</a></li>
</ul>
<h2 title="Exceptions">Exceptions</h2>
<ul title="Exceptions">
<li><a href="ParseException.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">ParseException</a></li>
</ul>
<h2 title="Errors">Errors</h2>
<ul title="Errors">
<li><a href="TokenMgrError.html" title="class in org.apache.lucene.queryparser.surround.parser" target="classFrame">TokenMgrError</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "7bdcb6a4246dfd1684cd3d8d6047f551",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 191,
"avg_line_length": 61.729729729729726,
"alnum_prop": 0.7237302977232924,
"repo_name": "YorkUIRLab/irlab",
"id": "cd5d6bd68401d6f13236a8d74e9e41d6c7d50439",
"size": "2284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/lucene-6.0.1/docs/queryparser/org/apache/lucene/queryparser/surround/parser/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "433499"
},
{
"name": "Gnuplot",
"bytes": "2444"
},
{
"name": "HTML",
"bytes": "95820812"
},
{
"name": "Java",
"bytes": "303195"
},
{
"name": "JavaScript",
"bytes": "33538"
}
],
"symlink_target": ""
} |
import time
from jsonmodels import fields
from dragonflow import conf
import dragonflow.db.field_types as df_fields
import dragonflow.db.model_framework as mf
from dragonflow.db.models import mixins
@mf.register_model
@mf.construct_nb_db_model
class Chassis(mf.ModelBase, mixins.BasicEvents):
table_name = 'chassis'
ip = df_fields.IpAddressField(required=True)
external_host_ip = df_fields.IpAddressField()
tunnel_types = df_fields.EnumListField(conf.CONF.df.tunnel_types,
required=True)
@mf.register_model
@mf.construct_nb_db_model
class Publisher(mf.ModelBase, mixins.Name):
table_name = 'publisher'
uri = fields.StringField()
last_activity_timestamp = fields.FloatField()
def is_stale(self):
timeout = conf.CONF.df.publisher_timeout
return (time.time() - self.last_activity_timestamp) > timeout
@classmethod
def on_get_all_post(self, instances):
return [o for o in instances if not o.is_stale()]
@mf.register_model
@mf.construct_nb_db_model
class Listener(mf.ModelBase):
table_name = "listener"
timestamp = df_fields.TimestampField()
ppid = fields.IntField()
@property
def topic(self):
return 'listener_{id}'.format(id=self.id)
def update_timestamp(self):
self.timestamp = time.time()
def on_create_pre(self):
super(Listener, self).on_create_pre()
self.update_timestamp()
def on_update_pre(self, orig):
super(Listener, self).on_update_pre(orig)
self.update_timestamp()
| {
"content_hash": "6b00c314fe453cf0f026d08c62ee887f",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 69,
"avg_line_length": 26.694915254237287,
"alnum_prop": 0.6755555555555556,
"repo_name": "openstack/dragonflow",
"id": "0306fc784c6f283e715813887cc12d29660ad19b",
"size": "2147",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dragonflow/db/models/core.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "2386"
},
{
"name": "Dockerfile",
"bytes": "690"
},
{
"name": "Mako",
"bytes": "1053"
},
{
"name": "Python",
"bytes": "1740942"
},
{
"name": "Ruby",
"bytes": "4449"
},
{
"name": "Shell",
"bytes": "70410"
}
],
"symlink_target": ""
} |
angular
.module('pooler')
.directive('myTrip', myTrip);
function myTrip(){
var directive = {
link: link,
templateUrl: 'dash/templates/myTrip.html',
restrict: 'E'
};
return directive;
function link(scope, element, attrs) {
}
}
| {
"content_hash": "f7444ef4a56844d3c84c63658462fbdb",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 46,
"avg_line_length": 16.933333333333334,
"alnum_prop": 0.6338582677165354,
"repo_name": "Liampronan/pooler",
"id": "8e65a58bf32b08877ed76314f51716d63559154a",
"size": "254",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ionic/ionic/www/dash/myTrip.directive.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1132152"
},
{
"name": "JavaScript",
"bytes": "2201055"
}
],
"symlink_target": ""
} |
require("ember-handlebars/ext");
require("ember-views/views/view");
/**
@module ember
@submodule ember-handlebars
*/
var get = Ember.get, set = Ember.set;
/**
Shared mixin used by `Ember.TextField` and `Ember.TextArea`.
@class TextSupport
@namespace Ember
@extends Ember.Mixin
@private
*/
Ember.TextSupport = Ember.Mixin.create({
value: "",
attributeBindings: ['placeholder', 'disabled', 'maxlength', 'tabindex'],
placeholder: null,
disabled: false,
maxlength: null,
insertNewline: Ember.K,
cancel: Ember.K,
init: function() {
this._super();
this.on("focusOut", this, this._elementValueDidChange);
this.on("change", this, this._elementValueDidChange);
this.on("keyUp", this, this.interpretKeyEvents);
},
interpretKeyEvents: function(event) {
var map = Ember.TextSupport.KEY_EVENTS;
var method = map[event.keyCode];
this._elementValueDidChange();
if (method) { return this[method](event); }
},
_elementValueDidChange: function() {
set(this, 'value', this.$().val());
}
});
Ember.TextSupport.KEY_EVENTS = {
13: 'insertNewline',
27: 'cancel'
};
| {
"content_hash": "83076764f8e36e7c9a22d7b3cd61d5a4",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 74,
"avg_line_length": 20.925925925925927,
"alnum_prop": 0.6654867256637168,
"repo_name": "garth/ember.js",
"id": "f7c6f19add63552ab14de923703ee01083d71c8e",
"size": "1130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/ember-handlebars/lib/controls/text_support.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "967912"
},
{
"name": "Ruby",
"bytes": "15643"
}
],
"symlink_target": ""
} |
SET(CONFIG_PACKAGE_NAME "zorba-xqxq-module")
#If left commented uses zorba version
SET(CONFIG_PACKAGE_VERSION "3.1")
SET(CONFIG_CONTACT "Federico Cavalieri <[email protected]>")
SET(CONFIG_SOURCE_DEPENDENCIES "zorba")
SET(CONFIG_BINARY_DEPENDENCIES "zorba")
#Uncomment and set name of the file to be set as the changelog,
#if not set default template will be used.
#SET(CHANGELOG_FILE "ChangeLog")
SET(CONFIG_SHORT_DESCRIPTION "Zorba's xqxq module")
SET(CONFIG_DESCRIPTION
"The xqxq module gives access to several functions of Zorba's API."
)
| {
"content_hash": "181ecfa42bf8e9d5a0721fa22a7a1f3f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 67,
"avg_line_length": 29.88888888888889,
"alnum_prop": 0.7695167286245354,
"repo_name": "28msec/zorba-debian-control-files",
"id": "8e0b73abbe0113a1dc95bdeb66f51d5ffc13c74f",
"size": "606",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/xqxq_module_rules.cmake",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CMake",
"bytes": "40167"
},
{
"name": "Makefile",
"bytes": "72055"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>ro.cobinance</groupId>
<artifactId>cobinance</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>cobinance-money</artifactId>
<packaging>jar</packaging>
<name>Cobinance - Money</name>
<dependencies>
<dependency>
<groupId>ro.cobinance</groupId>
<artifactId>cobinance-storage-api</artifactId>
</dependency>
<dependency>
<groupId>org.javamoney</groupId>
<artifactId>moneta</artifactId>
</dependency>
<dependency> <!--TODO remove - to be added by an application which includes also impl dependencies -->
<groupId>ro.cobinance</groupId>
<artifactId>cobinance-storage-h2</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<version>0.12.3</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
<generateDirectory>${basedir}/src/main/java</generateDirectory>
<generatePackage>ro.cobinance.money.bnr.xml</generatePackage>
<episode>false</episode>
</configuration>
</plugin>
</plugins>
</build>
</project>
| {
"content_hash": "ac7eab486c268e8efb8076db68fadf67",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 110,
"avg_line_length": 35.63157894736842,
"alnum_prop": 0.5470211718365338,
"repo_name": "catalean/revenit-money",
"id": "314c27896e7a5b26a67478964c56d54175d05e1b",
"size": "2031",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "cobinance-money/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "68129"
}
],
"symlink_target": ""
} |
package com.azure.json.reflect;
import java.lang.invoke.LambdaMetafactory;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import static java.lang.invoke.MethodType.methodType;
final class MetaFactoryFactory {
private MetaFactoryFactory() {
throw new UnsupportedOperationException();
}
@SuppressWarnings("unchecked")
static <T> T createMetaFactory(String methodName, Class<?> implClass, MethodType implType, Class<T> invokedClass, MethodType invokedType, MethodHandles.Lookup lookup) throws Throwable {
MethodHandle handle = lookup.findVirtual(implClass, methodName, implType);
return (T) LambdaMetafactory.metafactory(lookup, methodName, methodType(invokedClass), invokedType, handle, handle.type()).getTarget().invoke();
}
}
| {
"content_hash": "caf2f704f43aaa2ffe817157789840cd",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 189,
"avg_line_length": 42,
"alnum_prop": 0.7714285714285715,
"repo_name": "Azure/azure-sdk-for-java",
"id": "869fa46fc26018bc3ef370593c3a10c2564c3b1d",
"size": "937",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/core/azure-json-reflect/src/main/java/com/azure/json/reflect/MetaFactoryFactory.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "8762"
},
{
"name": "Bicep",
"bytes": "15055"
},
{
"name": "CSS",
"bytes": "7676"
},
{
"name": "Dockerfile",
"bytes": "2028"
},
{
"name": "Groovy",
"bytes": "3237482"
},
{
"name": "HTML",
"bytes": "42090"
},
{
"name": "Java",
"bytes": "432409546"
},
{
"name": "JavaScript",
"bytes": "36557"
},
{
"name": "Jupyter Notebook",
"bytes": "95868"
},
{
"name": "PowerShell",
"bytes": "737517"
},
{
"name": "Python",
"bytes": "240542"
},
{
"name": "Scala",
"bytes": "1143898"
},
{
"name": "Shell",
"bytes": "18488"
},
{
"name": "XSLT",
"bytes": "755"
}
],
"symlink_target": ""
} |
@charset "utf-8";
/* CSS Document */
/*banner开始*/
#wrapper {
background:#fff;
position:relative;
}
a {
text-decoration:none;
-webkit-transition:color 0.2s linear;
-moz-transition:color 0.2s linear;
-o-transition:color 0.2s linear;
transition:color 0.2s linear;
}
a:focus , a:link, a:active {
outline:none;
}
a:hover {
color:#444;
}
.fullwidthbanner-container{
width:100% !important;
position:relative;
padding:0;
max-height:550px !important;
overflow:hidden;
}
.fullwidthbanner-container .fullwidthabnner {
width:100% !important;
max-height:550px !important;
position:relative;
}
@media only screen and (min-width: 768px) and (max-width: 959px) {
.banner, .bannercontainer { width:768px; height:309px;}
}
@media only screen and (min-width: 480px) and (max-width: 767px) {
.banner, .bannercontainer { width:480px; height:193px; }
}
@media only screen and (min-width: 320px) and (max-width: 479px) {
.banner, .bannercontainer { width:320px;height:129px; }
}
@media only screen and (max-width: 319px) {
.banner, .bannercontainer { width:240px;height:97px; }
}
.tp-bullets.simplebullets.round .bullet:hover,
.tp-bullets.simplebullets.round .bullet.selected,
.tp-bullets.simplebullets.navbar .bullet:hover,
.tp-bullets.simplebullets.navbar .bullet.selected {
background:#ff6600 !important;
}
.tp-leftarrow:hover,
.tp-rightarrow:hover {
background-color:#ff6600 !important;
}
/** BULLETS **/
.tp-bullets {
z-index: 1001;
position: absolute;
bottom: 0px;
}
.tp-bullets.simplebullets.round .bullet {
cursor: pointer;
position: relative;
background: #fff;
width: 188px;
height: 6px;
float: left;
-webkit-transition: background 0.1s linear;
-moz-transition: color, background 0.1s linear;
-o-transition: color, background 0.1s linear;
transition: color, background 0.1s linear;
}
.tp-leftarrow.large {
z-index: 100;
cursor: pointer;
position: relative;
background: #393939 url(../images/slider-left-arrow.png) no-Repeat;
width: 42px;
height: 43px;
margin-left: 0px;
margin-top: -21px;
-webkit-transition: background 0.1s linear;
-moz-transition: color, background 0.1s linear;
-o-transition: color, background 0.1s linear;
transition: color, background 0.1s linear;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);/*增加阴影*/
/*
**打开注释,按钮变成圆形的
border-radius: 20px; 所有角都使用半径为5px的圆角,此属性为CSS3标准属性
-moz-border-radius: 20px; Mozilla浏览器的私有属性
-webkit-border-radius: 20px; Webkit浏览器的私有属性
border-radius: 20px 20px 20px 20px; 四个半径值分别是左上角、右上角、右下角和左下角
*/
}
.tp-rightarrow.large {
z-index: 100;
cursor: pointer;
position: relative;
background: #393939 url(../images/slider-right-arrow.png) no-Repeat 0 0;
width: 42px;
height: 43px;
margin-left: 0;
margin-top: -21px;
-webkit-transition: background 0.1s linear;
-moz-transition: color, background 0.1s linear;
-o-transition: color, background 0.1s linear;
transition: color, background 0.1s linear;
box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.3);/*增加阴影*/
/*
**打开注释,按钮变成圆形的
border-radius: 20px; 所有角都使用半径为5px的圆角,此属性为CSS3标准属性
-moz-border-radius: 20px; Mozilla浏览器的私有属性
-webkit-border-radius: 20px; Webkit浏览器的私有属性
border-radius: 20px 20px 20px 20px; 四个半径值分别是左上角、右上角、右下角和左下角
*/
}
.tp-bullets.tp-thumbs {
z-index: 100;
position: absolute;
padding: 3px;
background-color: #fff;
width: 500px;
height: 50px;
margin-top: -50px;
}
.fullwidthbanner-container .tp-thumbs {
padding: 3px;
}
.tp-bullets.tp-thumbs .tp-mask {
width: 500px;
height: 50px;
overflow: hidden;
position: relative;
}
.tp-bullets.tp-thumbs .tp-mask .tp-thumbcontainer {
width: 5000px;
position: absolute;
}
.tp-bullets.tp-thumbs .bullet {
width: 100px;
height: 50px;
cursor: pointer;
overflow: hidden;
background: none;
margin: 0;
float: left;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/*filter: alpha(opacity=50); */
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
}
.tp-bullets.tp-thumbs .bullet:hover,
.tp-bullets.tp-thumbs .bullet.selected {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
-moz-opacity: 1;
-khtml-opacity: 1;
opacity: 1;
}
.tp-thumbs img {
width: 100%;
}
.tp-bannertimer {
width: 100%;
height: 10px;
position: absolute;
z-index: 200;
z-index: 5000;
}
.tp-bannertimer.tp-bottom {
bottom: 0px !important;
height: 5px;
}
@media only screen and (min-width: 768px) and (max-width: 959px) {;
}
@media only screen and (min-width: 480px) and (max-width: 767px) {
.responsive .tp-bullets.tp-thumbs {
width: 300px !important;
height: 30px !important;
}
.responsive .tp-bullets.tp-thumbs .tp-mask {
width: 300px !important;
height: 30px !important;
}
.responsive .tp-bullets.tp-thumbs .bullet {
width: 60px !important;
height: 30px !important;
}
}
@media only screen and (min-width: 0px) and (max-width: 479px) {
.responsive .tp-bullets {
display: none;
}
.responsive .tparrows {
display: none;
}
}
.tp-simpleresponsive img {
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
-o-user-select: none;
}
.tp-simpleresponsive a {
text-decoration: none;
}
.tp-simpleresponsive ul {
list-style: none;
padding: 0;
margin: 0;
}
.tp-simpleresponsive >ul >li {
list-stye: none;
position: absolute;
visibility: hidden;
}
.caption.slidelink a div,
.tp-caption.slidelink a div {
width: 10000px;
height: 10000px;
}
.tp-loader {
background: url(../images/loader.gif) no-repeat 10px 10px;
background-color: #fff;
margin: -22px -22px;
top: 50%;
left: 50%;
z-index: 10000;
position: absolute;
width: 44px;
height: 44px;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
/*为什么选择简扬*/
.why-choose{ height:150px;width:1198px; border:1px solid #e7e7e7; margin:26px 0 20px; background:#fff; font-size:16px;}
.why-choose img{padding-bottom:22px;}
.choose-tit{ height:150px;width:158px; background:#25bd55; text-align:center; color:#fff; line-height:24px; font-size:18px;}
.choose-tit img{ padding-top:18px; padding-bottom:8px;}
.choose01{height:150px; width:223px; border-right:1px solid #e7e7e7;text-align:center;}
.choose02{height:150px; width:216px; border-right:1px solid #e7e7e7;text-align:center;}
.choose03{height:150px; width:228px; border-right:1px solid #e7e7e7;text-align:center;}
.choose04{height:150px; width:182px; border-right:1px solid #e7e7e7;text-align:center;}
.choose05{height:150px; width:187px; text-align:center;}
/*主体内容*/
.wrapper-index-l{ width:842px; height:auto;}
/*精品课程*/
.excellent-course{ width:842px;}
.excellent-course-tit{ font-size:18px; height:40px; line-height:40px; background:url(../images/img_57.jpg) no-repeat left center; padding-left:30px;}
.excellent-course-nr{width:840px; min-height:400px; margin-bottom:33px; padding-top:24px; border:1px solid #e7e7e7; background:url(../images/img_01.jpg) no-repeat left top #fff;}
.excellent-course-nr ul{width:840px;}
.excellent-course-nr ul li{ float:left; width:254px; height:200px; margin-left:19px; text-align:center;}
.excellent-course-nr ul li img{ padding:3px;border:1px solid #e7e7e7; margin-bottom:15px; width:247px; height:139px;}
/*名师教案*/
.lesson-plans-tit{ font-size:18px; height:40px; line-height:40px; background:url(../images/img_69.jpg) no-repeat left center; padding-left:30px;}
.lesson-plans-tit a,.lesson-plans-tit a:hover{ color:#ff6600; float:right; font-size:14px;}
.lesson-plans-nr{width:840px; min-height:400px; margin-bottom:33px; padding-top:24px; border:1px solid #e7e7e7; background:url(../images/img_01.jpg) no-repeat left top #fff;}
.lesson-body{ border-bottom:1px solid #e7e7e7; width:820px; margin:0 10px; height:146px; margin-bottom:24px;}
.lesson-plans-nr .no-border{ border:none;margin-bottom:8px;}
.lesson-body img{ width:190px; height:123px; border:1px solid #e7e7e7; float:left;}
.lesson-body-r{ float:right; width:607px;}
.lesson-body-r-t{ height:45px; line-height:45px; font-weight:bold; font-size:18px; width:607px; overflow:hidden;}
.lesson-body-r-t img{ float:none; width:35px; height:13px; border:0;}
.lesson-body-r-c{ color:#9c9c9c; line-height:24px;width:607px; height:53px; overflow:hidden;}
.lesson-body-r-b{ height:40px; line-height:40px; width:607px;overflow:hidden;}
.lesson-body-r-b span.see{color:#9c9c9c; background:url(../images/img_100.jpg) no-repeat left center; padding-left:20px; margin-right:20px; float:left;}
.lesson-body-r-b span.down{color:#9c9c9c; background:url(../images/img_103.jpg) no-repeat left center;padding-left:20px;margin-right:20px; float:left;}
.lesson-body-r-b .star1{float:left; width:107px; height:20px; margin-top:8px; background:url(../images/star1.png) no-repeat left center;}
.lesson-body-r-b .star2{float:left; width:107px; height:20px; margin-top:8px;background:url(../images/star2.png) no-repeat left center;}
.lesson-body-r-b .star3{float:left; width:107px; height:20px; margin-top:8px; background:url(../images/star3.png) no-repeat left center;}
.lesson-body-r-b .star4{float:left; width:107px; height:20px; margin-top:8px; background:url(../images/star4.png) no-repeat left center;}
.lesson-body-r-b .star5{float:left; width:107px; height:20px; margin-top:8px; background:url(../images/star5.png) no-repeat left center;}
/*精品试题*/
.test-tit{ font-size:18px; height:40px; line-height:40px; background:url(../images/img_119.jpg)no-repeat left 4px; padding-left:30px;}
.test-tit a,.test-tit a:hover{ color:#ff6600; float:right; font-size:14px;}
.wrapper-index-r{width:335px;height:auto;}
/*学霸必备*/
.essential{width:335px; min-height:400px; }
.essential-tit{font-size:18px; height:40px; line-height:40px; background:url(../images/img_60.jpg) no-repeat left center; padding-left:30px;}
ul.essential-nr{ width:315px;border:1px solid #e7e7e7; background:url(../images/img_04.jpg) no-repeat 10px 18px #fff; padding:9px 10px 0;height:415px;}
ul.essential-nr li{ float:left; border-bottom:1px solid #e7e7e7; padding-left:35px; height:50px; line-height:50px; width:280px;}
ul.essential-nr li span{ float:right; color:#c1c1c1;}
ul.essential-nr li.no-border{ border:0;}
/*推荐下载*/
.recommend{width:335px; min-height:350px;}
.recommend-tit{font-size:18px; height:40px; line-height:40px; background:url(../images/img_72.jpg) no-repeat left center; padding-left:30px;}
.recommend-tit a,.recommend-tit a:hover{ color:#ff6600; font-size:14px; float:right;}
.recommend-body{width:313px;border:1px solid #e7e7e7; background:#fff; padding:12px 10px 0; height:353px;}
.recommend-img{ width:315px; text-align:center;}
.recommend-img img{ width:306px; height:116px;}
ul.recommend-nr{ padding:9px 10px 0;height:247px;}
ul.recommend-nr li{ float:left; padding-left:20px; height:36px; line-height:36px; width:295px; background:url(../images/img_93.jpg) no-repeat 5px center; overflow:hidden; font-size:12px; color:#acacac;}
ul.recommend-nr li a,ul.recommend-nr li a:hover{ font-size:14px; margin-right:15px;}
.ad-img{ width:335px; margin-top:15px;}
.ad-img img{ border:1px solid #e7e7e7; width:333px; height:138px;}
/*学员评价*/
.evaluate{width:295px;border:1px solid #e7e7e7; min-height:496px; background-color:#fff; padding:24px 20px 0;}
.evaluate-body{ width:295px;border-left:1px solid #e7e7e7; height:77px; border-top:1px dashed #e7e7e7; position:relative; }
.evaluate-body-l{ width:48px; position:absolute; height:77px; background:url(../images/img_06.jpg) no-repeat 10px 0px;top:-1px; left:-12px; padding-top:18px;}
.evaluate-body-l img{ width:40px; height:40px; border-radius:40px; padding:3px; border:1px solid #e7e7e7; background-color:#fff;}
.evaluate-body-r{ margin-left:50px; margin-top:13px; width:244px; overflow:hidden; height:77px;}
.evaluate-body-r-tit{height:30px; line-height:30px;}
.evaluate-body-r-nr{ color:#999999;}
.evaluate-body-r-nr span{ margin-left:20px;}
/*新闻公告*/
/*.news{width:335px;}*/
.news-tit{font-size:18px; height:40px; line-height:40px; background:url(../images/img_122.jpg) no-repeat left center; padding-left:30px;}
.news-tit a,.news-tit a:hover{ color:#ff6600; font-size:14px; float:right;}
.news{width:335px; margin-bottom:35px;}
ul.news-nr{ padding:0 10px; width:315px; border:1px solid #e7e7e7; background-color:#fff; min-height:424px;}
ul.news-nr li{ width:315px; height:109px; border-bottom:1px solid #e7e7e7; margin-top:30px;}
ul.essential-nr{ width:315px;border:1px solid #e7e7e7; background:url(../images/img_04.jpg) no-repeat 10px 18px #fff; padding:9px 10px 0;height:509px;}
ul.news-nr li.no-border{ border:0;}
ul.news-nr li img{border:1px solid #e7e7e7; float:left;}
.news-nr-r{ float:right; width:198px;}
.news-nr-r-tit{ height:35px; line-height:35px;width:198px; overflow:hidden;}
.news-nr-r-tit a,.news-nr-r-tit a:hover{ font-size:14px;}
.news-nr-r-nr{ line-height:24px; color:#9c9c9c;height:51px;overflow:hidden; font-size:12px;}
/*底部广告*/
.db-ad{ width:1200pxp; height:90px; background-color:#fff;}
.db-ad img{ width:1190px; height:80px; padding:4px; border:1px solid #e7e7e7;}
/*友情链接*/
.friendship{ width:1200px; min-height:160px;}
.friendship-tit{font-size:18px; height:40px; line-height:40px; background:url(../images/img_122.jpg) no-repeat left center; padding-left:30px; width:1170px;}
ul.friendship-nr{border:1px solid #e7e7e7; background:url(../images/img_01.jpg) no-repeat left top #fff; min-height:83px; height:83px; height:auto !important; padding:20px;}
ul.friendship-nr li{ float:left;width: 144px; height:30px; line-height:30px;} | {
"content_hash": "7682d8a7f90f05b0b3a3dcc7903e4faa",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 203,
"avg_line_length": 36.95733333333333,
"alnum_prop": 0.7095750054116459,
"repo_name": "James88/www.yii2.com",
"id": "2a14e263ab23bdb5f3eefdf997cc744fb48ef610",
"size": "14261",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "statics/css/index.css",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "228"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "71810"
},
{
"name": "HTML",
"bytes": "7917"
},
{
"name": "JavaScript",
"bytes": "241140"
},
{
"name": "PHP",
"bytes": "829626"
}
],
"symlink_target": ""
} |
require 'rails'
module Rogger
class Railtie < Rails::Railtie
initializer "rogger.load-config" do
config_file = Rails.root.join("config", "rogger.yml")
if config_file.file?
::Rogger.load!(config_file)
end
end
end
end | {
"content_hash": "c7dc9e97c95e53c998b179898d0a4431",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 21.166666666666668,
"alnum_prop": 0.6417322834645669,
"repo_name": "cubiclerebels/rogger",
"id": "10ecdfb45a9615c379c283fd42ba7ea2b21e01ec",
"size": "254",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/rogger/railtie.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "5297"
}
],
"symlink_target": ""
} |
//
// SA_LegacyCommandResponder.m
//
// Copyright (c) 2016 Said Achmiz.
//
// This software is licensed under the MIT license.
// See the file "LICENSE" for more information.
#import "SA_LegacyCommandResponder.h"
#import "SA_DiceParser.h"
#import "SA_DiceEvaluator.h"
#import "SA_DiceFormatter.h"
#import "SA_ErrorCatalog.h"
#import "SA_SettingsManager.h"
#import "NSString+SA_NSStringExtensions.h"
#import "SA_DiceExpressionStringConstants.h"
#import "SA_DiceComparators.h"
/*********************/
#pragma mark Constants
/*********************/
NSString * const SA_LCR_COMMAND_ROLL = @"roll";
NSString * const SA_LCR_COMMAND_TRY = @"try";
NSString * const SA_LCR_COMMAND_INIT = @"init";
NSString * const SA_LCR_COMMAND_CHAR = @"char";
static NSString * const settingsFileName = @"SA_LegacyCommandResponderSettings";
static NSString * const SA_LCR_SETTINGS_LABEL_DELIMITER = @"labelDelimiter";
static NSString * const SA_LCR_SETTINGS_INITIATIVE_FORMAT = @"initiativeFormat";
static NSString * const SA_LCR_SETTINGS_INITIATIVE_FORMAT_EXPANDED = @"EXPANDED";
static NSString * const SA_LCR_SETTINGS_INITIATIVE_FORMAT_COMPACT = @"COMPACT";
/************************************************************/
#pragma mark - SA_LegacyCommandResponder class implementation
/************************************************************/
@implementation SA_LegacyCommandResponder
{
NSDictionary <NSString *, CommandEvaluator> *_commandEvaluators;
}
/**************************/
#pragma mark - Initializers
/**************************/
- (instancetype)init
{
if(self = [super init])
{
self.parser = [SA_DiceParser defaultParser];
self.evaluator = [SA_DiceEvaluator new];
self.resultsFormatter = [SA_DiceFormatter defaultFormatter];
self.initiativeResultsFormatter = [SA_DiceFormatter formatterWithBehavior:SA_DiceFormatterBehaviorSimple];
self.characterResultsFormatter = [SA_DiceFormatter defaultFormatter];
NSString *settingsPath = [[NSBundle bundleForClass:[self class]] pathForResource:settingsFileName ofType:@"plist"];
self.settings = [[SA_SettingsManager alloc] initWithPath:settingsPath];
if(self.settings == nil)
{
NSLog(NSLocalizedString(@"Could not load settings!", nil));
}
_commandEvaluators = @{ SA_LCR_COMMAND_ROLL : [self repliesForCommandRoll],
SA_LCR_COMMAND_TRY : [self repliesForCommandTry],
SA_LCR_COMMAND_INIT : [self repliesForCommandInit]
};
}
return self;
}
/****************************/
#pragma mark - Public methods
/****************************/
- (NSArray <NSDictionary*> *)repliesForCommandString:(NSString *)commandString messageInfo:(NSDictionary *)messageInfo error:(NSError **)error
{
// Split the string into whitespace-delimited chunks. The first
// chunk is the command; the other chunks are parameter strings.
// We generally interpret multiple parameter strings as "execute
// this command several times, with each of these strings".
// (Some commands are exceptions to this.)
NSArray *commandStringComponents = [commandString componentsSplitByWhitespace];
// Separate out the command from the parameter strings.
NSString *command = [commandStringComponents[0] lowercaseString];
NSArray *params = [commandStringComponents subarrayWithRange:NSMakeRange(1, commandStringComponents.count - 1)];
// Check if the command is one of the recognized ones.
if(self.commandEvaluators[command] != nil)
{
// Get the appropriate evaluator block.
CommandEvaluator repliesForCommand = self.commandEvaluators[command];
return repliesForCommand(params, messageInfo, error);
}
else
{
[SA_ErrorCatalog setError:error
withCode:SA_DiceBotErrorUnknownCommand
inDomain:SA_DiceBotErrorDomain];
return @[];
}
}
/*********************************************************/
#pragma mark - Command evaluation methods & wrapper blocks
/*********************************************************/
/****** ROLL ***************************************************/
/* The "roll" command evaluates each provided die roll string. */
/***************************************************************/
- (CommandEvaluator)repliesForCommandRoll
{
return ^(NSArray <NSString *> *params, NSDictionary *messageInfo, NSError **error)
{
return [self repliesForCommandRoll:params messageInfo:messageInfo error:error];
};
}
- (NSMutableArray <NSDictionary *> *)repliesForCommandRoll:(NSArray <NSString *> *)params messageInfo:(NSDictionary *)messageInfo error:(NSError **)error
{
__block NSMutableArray <NSDictionary *> *replies = [NSMutableArray arrayWithCapacity:params.count];
if(params.count == 0)
{
[SA_ErrorCatalog setError:error
withCode:SA_DiceBotErrorNoParameters
inDomain:SA_DiceBotErrorDomain];
return replies;
}
[params enumerateObjectsUsingBlock:^(NSString *rollString, NSUInteger idx, BOOL *stop)
{
// Remove the label (if any).
NSRange labelDelimiterPosition = [rollString rangeOfString:[self.settings valueforSetting:SA_LCR_SETTINGS_LABEL_DELIMITER error:error]];
NSString *rollStringBody = (labelDelimiterPosition.location != NSNotFound) ? [rollString substringToIndex:labelDelimiterPosition.location] : rollString;
NSString *rollStringLabel = (labelDelimiterPosition.location != NSNotFound) ? [rollString substringFromIndex:labelDelimiterPosition.location + labelDelimiterPosition.length] : nil;
// Parse, evaluate, and format.
NSDictionary *expression = [self.parser expressionForString:rollStringBody];
NSDictionary *results = [self.evaluator resultOfExpression:expression];
NSString *formattedResultString = [self.resultsFormatter stringFromExpression:results];
// Attach the label (if any) to the result string.
NSString *replyMessageBody = (rollStringLabel != nil && [rollStringLabel isEqualToString:@""] == NO) ? [NSString stringWithFormat:@"(%@) %@", rollStringLabel, formattedResultString] : formattedResultString;
[replies addObject:@{ SA_DB_MESSAGE_BODY : replyMessageBody,
SA_DB_MESSAGE_INFO : messageInfo }];
}];
return replies;
}
/****** TRY ****************************************************************/
/* The "try" command prepends "1d20+" to each provided die roll string and */
/* evaluates it. */
/***************************************************************************/
- (CommandEvaluator)repliesForCommandTry
{
return ^(NSArray <NSString *> *params, NSDictionary *messageInfo, NSError **error)
{
return [self repliesForCommandTry:params messageInfo:messageInfo error:error];
};
}
- (NSMutableArray <NSDictionary *> *)repliesForCommandTry:(NSArray <NSString *> *)params messageInfo:(NSDictionary *)messageInfo error:(NSError **)error
{
__block NSMutableArray <NSDictionary *> *replies = [NSMutableArray arrayWithCapacity:params.count];
if(params.count == 0)
{
[SA_ErrorCatalog setError:error
withCode:SA_DiceBotErrorNoParameters
inDomain:SA_DiceBotErrorDomain];
return replies;
}
[params enumerateObjectsUsingBlock:^(NSString *tryString, NSUInteger idx, BOOL *stop)
{
// Remove the label (if any).
NSRange labelDelimiterPosition = [tryString rangeOfString:[self.settings valueforSetting:SA_LCR_SETTINGS_LABEL_DELIMITER error:error]];
NSString *tryStringBody = (labelDelimiterPosition.location != NSNotFound) ? [tryString substringToIndex:labelDelimiterPosition.location] : tryString;
NSString *tryStringLabel = (labelDelimiterPosition.location != NSNotFound) ? [tryString substringFromIndex:labelDelimiterPosition.location + labelDelimiterPosition.length] : nil;
// Parse the prefix ("1d20").
NSDictionary *prefixExpression = [self.parser expressionForString:@"1d20"];
// Parse the given try string.
NSDictionary *tryExpression = [self.parser expressionForString:tryStringBody];
// Join the prefix and try expressions into a combined expression.
NSDictionary *fullExpression = [self.parser expressionByJoiningExpression:prefixExpression toExpression:tryExpression withOperator:SA_DB_OPERATOR_PLUS];
// Evaluate and format.
NSDictionary *result = [self.evaluator resultOfExpression:fullExpression];
NSString *formattedResultString = [self.resultsFormatter stringFromExpression:result];
// Attach the label (if any) to the result string.
NSString *replyMessageBody = (tryStringLabel != nil && [tryStringLabel isEqualToString:@""] == NO) ? [NSString stringWithFormat:@"(%@) %@", tryStringLabel, formattedResultString] : formattedResultString;
[replies addObject:@{ SA_DB_MESSAGE_BODY : replyMessageBody,
SA_DB_MESSAGE_INFO : messageInfo }];
}];
return replies;
}
/****** INIT ****************************************************************/
/* The "init" command is like the "try" command, but shows the results in a */
/* simplified output form and sorts them from highest to lowest. */
/****************************************************************************/
- (CommandEvaluator)repliesForCommandInit
{
return ^(NSArray <NSString *> *params, NSDictionary *messageInfo, NSError **error)
{
return [self repliesForCommandInit:params messageInfo:messageInfo error:error];
};
}
- (NSMutableArray <NSDictionary *> *)repliesForCommandInit:(NSArray <NSString *> *)params messageInfo:(NSDictionary *)messageInfo error:(NSError **)error
{
__block NSMutableArray <NSDictionary *> *replies = [NSMutableArray arrayWithCapacity:params.count];
// If there are no arguments, set an error.
if(params.count == 0)
{
[SA_ErrorCatalog setError:error
withCode:SA_DiceBotErrorNoParameters
inDomain:SA_DiceBotErrorDomain];
return replies;
}
// Generate the set of raw (unformatted) results for every individual
// initiative roll.
__block NSMutableArray <NSDictionary *> *resultsAndLabels = [NSMutableArray arrayWithCapacity:params.count];
__block NSError *errorWhileEnumerating;
[params enumerateObjectsUsingBlock:^(NSString *initString, NSUInteger idx, BOOL *stop)
{
// Remove the label (if any).
NSRange labelDelimiterPosition = [initString rangeOfString:[self.settings valueforSetting:SA_LCR_SETTINGS_LABEL_DELIMITER error:error]];
NSString *initStringBody = (labelDelimiterPosition.location != NSNotFound) ? [initString substringToIndex:labelDelimiterPosition.location] : initString;
NSString *initStringLabel = (labelDelimiterPosition.location != NSNotFound) ? [initString substringFromIndex:labelDelimiterPosition.location + labelDelimiterPosition.length] : nil;
// Parse the prefix ("1d20").
NSDictionary *prefixExpression = [self.parser expressionForString:@"1d20"];
// Parse the given init string.
NSDictionary *initExpression = [self.parser expressionForString:initStringBody];
// Join the prefix and init expressions into a combined expression.
NSDictionary *fullExpression = [self.parser expressionByJoiningExpression:prefixExpression toExpression:initExpression withOperator:SA_DB_OPERATOR_PLUS];
// Evaluate and format.
NSDictionary *result = [self.evaluator resultOfExpression:fullExpression];
// Initiative strings MUST have a label. If even one label is missing,
// set an error and send no reply lines.
if(initStringLabel == nil || [initStringLabel isEqualToString:@""])
{
errorWhileEnumerating = [SA_ErrorCatalog errorWithCode:SA_DiceBotErrorMissingLabel
inDomain:SA_DiceBotErrorDomain];
*stop = YES;
}
else
{
[resultsAndLabels addObject:@{@"result" : result,
@"label" : initStringLabel
}];
}
}];
// If generating the init results didn't go well, set the error.
if(errorWhileEnumerating != nil && error != nil)
{
*error = errorWhileEnumerating;
}
// Otherwise, format the results and assemble the replies.
else
{
// Sort the init results.
[resultsAndLabels sortUsingComparator:^NSComparisonResult(NSDictionary *resultAndLabel1, NSDictionary *resultAndLabel2)
{
// These are flipped because we want to sort from highest to
// lowest.
NSComparisonResult compareByInitRollResult = compareEvaluatedExpressionsByResult(resultAndLabel2[@"result"], resultAndLabel1[@"result"]);
if(compareByInitRollResult == NSOrderedDescending || compareByInitRollResult == NSOrderedAscending)
{
return compareByInitRollResult;
}
else // if compareByInitRollResult == NSOrderedSame
{
// Again, these are flipped because we want to sort from
// highest to lowest.
NSComparisonResult compareByInitBonus = compareEvaluatedExpressionsByAttemptBonus(resultAndLabel2[@"result"], resultAndLabel1[@"result"]);
return compareByInitBonus;
}
}];
__block NSMutableArray <NSDictionary *> *replyComponents = [NSMutableArray arrayWithCapacity:params.count];
[resultsAndLabels enumerateObjectsUsingBlock:^(NSDictionary* resultAndLabel, NSUInteger idx, BOOL *stop)
{
// Format.
// (We use a separate formatter for initiative results, as the format
// should be simple and concise, regardless of what the format settings
// are in general.)
NSString *formattedResultString = [self.initiativeResultsFormatter stringFromExpression:resultAndLabel[@"result"]];
[replyComponents addObject:@{@"formattedResult" : formattedResultString,
@"label" : resultAndLabel[@"label"]
}];
}];
[replies addObject:@{ SA_DB_MESSAGE_BODY : NSLocalizedString(@"Initiative!", nil),
SA_DB_MESSAGE_INFO : messageInfo }];
// If EXPANDED format mode is set, add each reply.
if([[self.settings valueforSetting:SA_LCR_SETTINGS_INITIATIVE_FORMAT error:error] isEqualToString:SA_LCR_SETTINGS_INITIATIVE_FORMAT_EXPANDED])
{
[replyComponents enumerateObjectsUsingBlock:^(NSDictionary *replyComponent, NSUInteger idx, BOOL *stop){
NSString *replyMessageBody = [NSString stringWithFormat:@"%@ %@", replyComponent[@"label"], replyComponent[@"formattedResult"]];
[replies addObject:@{ SA_DB_MESSAGE_BODY : replyMessageBody,
SA_DB_MESSAGE_INFO : messageInfo }];
}];
}
// If COMPACT format mode is set, collapse all initiative results into
// a single reply line.
else if([[self.settings valueforSetting:SA_LCR_SETTINGS_INITIATIVE_FORMAT error:error] isEqualToString:SA_LCR_SETTINGS_INITIATIVE_FORMAT_COMPACT])
{
__block NSMutableString *replyLine = [NSMutableString string];
[replyComponents enumerateObjectsUsingBlock:^(NSDictionary *replyComponent, NSUInteger idx, BOOL *stop){
[replyLine appendFormat:@"%@ %@%@",
replyComponent[@"label"],
replyComponent[@"result"],
((idx != replyComponents.count - 1) ? @" " : @"")];
}];
[replies addObject:@{ SA_DB_MESSAGE_BODY : replyLine,
SA_DB_MESSAGE_INFO : messageInfo }];
}
// The format mode setting has become corrupted somehow.
else
{
NSLog(@"%@", [self.settings allSettings]);
[SA_ErrorCatalog setError:error
withCode:SA_DiceBotErrorConfigurationError
inDomain:SA_DiceBotErrorDomain];
}
}
return replies;
}
/****** CHAR ************************************************************/
/* The "char" command generates a set of D&D character stats, using the */
/* '4d6 drop lowest' rolling method. It takes no arguments. */
/************************************************************************/
- (CommandEvaluator)repliesForCommandChar
{
return ^(NSArray <NSString *> *params, NSDictionary *messageInfo, NSError **error)
{
return [self repliesForCommandChar:params messageInfo:messageInfo error:error];
};
}
- (NSMutableArray <NSDictionary *> *)repliesForCommandChar:(NSArray <NSString *> *)params messageInfo:(NSDictionary *)messageInfo error:(NSError **)error
{
return [NSMutableArray arrayWithCapacity:2];
}
@end
| {
"content_hash": "64c46725dfcb42a43cfe6bb9889c67dd",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 209,
"avg_line_length": 42.266666666666666,
"alnum_prop": 0.6888328075709779,
"repo_name": "achmizs/SA_DiceBot",
"id": "2a6c0109fba6ace25856008a7cd9dd7fa1d653cb",
"size": "15850",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SA_LegacyCommandResponder.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "48803"
}
],
"symlink_target": ""
} |
package com.jevetools.unmarshal.python.api.impl.internal;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* Copyright (c) 2013, jEVETools.
*
* All rights reserved.
*
* @version 0.0.1
* @since 0.0.1
*/
public class Activator
implements BundleActivator
{
@Override
public void start(final BundleContext context) throws Exception // NOPMD
{
// NOOP
}
@Override
public void stop(final BundleContext context) throws Exception // NOPMD
{
// NOOP
}
}
| {
"content_hash": "4f4dba0ad0c3d7423bc2ba79f17c8f65",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 17,
"alnum_prop": 0.6963946869070209,
"repo_name": "jevetools/unmarshal",
"id": "7ffdf3ac4911a2c52e04af6552536aeebc1b4a50",
"size": "2118",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "com.jevetools.unmarshal.python.api.impl/src/com/jevetools/unmarshal/python/api/impl/internal/Activator.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "573236"
}
],
"symlink_target": ""
} |
namespace LinqToDB.DataProvider.Access
{
using System.Data;
using System.Text;
using LinqToDB.Mapping;
using LinqToDB.SqlProvider;
class AccessODBCSqlBuilder : AccessSqlBuilderBase
{
private readonly AccessODBCDataProvider? _provider;
public AccessODBCSqlBuilder(
AccessODBCDataProvider? provider,
MappingSchema mappingSchema,
ISqlOptimizer sqlOptimizer,
SqlProviderFlags sqlProviderFlags)
: base(mappingSchema, sqlOptimizer, sqlProviderFlags)
{
_provider = provider;
}
// remote context
public AccessODBCSqlBuilder(
MappingSchema mappingSchema,
ISqlOptimizer sqlOptimizer,
SqlProviderFlags sqlProviderFlags)
: base(mappingSchema, sqlOptimizer, sqlProviderFlags)
{
}
public override StringBuilder Convert(StringBuilder sb, string value, ConvertType convertType)
{
switch (convertType)
{
case ConvertType.NameToQueryParameter:
case ConvertType.NameToCommandParameter:
case ConvertType.NameToSprocParameter:
return sb.Append('?');
}
return base.Convert(sb, value, convertType);
}
protected override ISqlBuilder CreateSqlBuilder()
{
return new AccessODBCSqlBuilder(_provider, MappingSchema, SqlOptimizer, SqlProviderFlags);
}
protected override string? GetProviderTypeName(IDbDataParameter parameter)
{
if (_provider != null)
{
var param = _provider.TryGetProviderParameter(parameter, MappingSchema);
if (param != null)
return _provider.Adapter.GetDbType(param).ToString();
}
return base.GetProviderTypeName(parameter);
}
}
}
| {
"content_hash": "51af42ab729f3cc52a2753925f988997",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 96,
"avg_line_length": 26.131147540983605,
"alnum_prop": 0.7383939774153074,
"repo_name": "MaceWindu/linq2db",
"id": "c97f1caf2b50354a8527e90e17561a9aab9faa24",
"size": "1596",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/LinqToDB/DataProvider/Access/AccessODBCSqlBuilder.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2828"
},
{
"name": "C#",
"bytes": "4122301"
},
{
"name": "F#",
"bytes": "9860"
},
{
"name": "PLSQL",
"bytes": "20348"
},
{
"name": "PLpgSQL",
"bytes": "24151"
},
{
"name": "PowerShell",
"bytes": "1170"
},
{
"name": "SQLPL",
"bytes": "5413"
},
{
"name": "Shell",
"bytes": "903"
},
{
"name": "Visual Basic",
"bytes": "1526"
}
],
"symlink_target": ""
} |
from django.contrib import admin
from storybase_badge.models import Badge
class BadgeAdmin(admin.ModelAdmin):
pass
admin.site.register(Badge, BadgeAdmin)
| {
"content_hash": "f3586647915ba9131f187c2987a4a79b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 40,
"avg_line_length": 18,
"alnum_prop": 0.7962962962962963,
"repo_name": "denverfoundation/storybase",
"id": "5259389358c47398a0480f18b815f6300d52ea3a",
"size": "163",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "apps/storybase_badge/admin.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "285649"
},
{
"name": "Cucumber",
"bytes": "176820"
},
{
"name": "HTML",
"bytes": "286197"
},
{
"name": "JavaScript",
"bytes": "1623541"
},
{
"name": "Makefile",
"bytes": "1006"
},
{
"name": "Python",
"bytes": "3020016"
},
{
"name": "Shell",
"bytes": "23932"
}
],
"symlink_target": ""
} |
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["react-syntax-highlighter_languages_highlight_delphi"],{
/***/ "./node_modules/highlight.js/lib/languages/delphi.js":
/*!***********************************************************!*\
!*** ./node_modules/highlight.js/lib/languages/delphi.js ***!
\***********************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = function(hljs) {
var KEYWORDS =
'exports register file shl array record property for mod while set ally label uses raise not ' +
'stored class safecall var interface or private static exit index inherited to else stdcall ' +
'override shr asm far resourcestring finalization packed virtual out and protected library do ' +
'xorwrite goto near function end div overload object unit begin string on inline repeat until ' +
'destructor write message program with read initialization except default nil if case cdecl in ' +
'downto threadvar of try pascal const external constructor type public then implementation ' +
'finally published procedure absolute reintroduce operator as is abstract alias assembler ' +
'bitpacked break continue cppdecl cvar enumerator experimental platform deprecated ' +
'unimplemented dynamic export far16 forward generic helper implements interrupt iochecks ' +
'local name nodefault noreturn nostackframe oldfpccall otherwise saveregisters softfloat ' +
'specialize strict unaligned varargs ';
var COMMENT_MODES = [
hljs.C_LINE_COMMENT_MODE,
hljs.COMMENT(/\{/, /\}/, {relevance: 0}),
hljs.COMMENT(/\(\*/, /\*\)/, {relevance: 10})
];
var DIRECTIVE = {
className: 'meta',
variants: [
{begin: /\{\$/, end: /\}/},
{begin: /\(\*\$/, end: /\*\)/}
]
};
var STRING = {
className: 'string',
begin: /'/, end: /'/,
contains: [{begin: /''/}]
};
var CHAR_STRING = {
className: 'string', begin: /(#\d+)+/
};
var CLASS = {
begin: hljs.IDENT_RE + '\\s*=\\s*class\\s*\\(', returnBegin: true,
contains: [
hljs.TITLE_MODE
]
};
var FUNCTION = {
className: 'function',
beginKeywords: 'function constructor destructor procedure', end: /[:;]/,
keywords: 'function constructor|10 destructor|10 procedure|10',
contains: [
hljs.TITLE_MODE,
{
className: 'params',
begin: /\(/, end: /\)/,
keywords: KEYWORDS,
contains: [STRING, CHAR_STRING, DIRECTIVE].concat(COMMENT_MODES)
},
DIRECTIVE
].concat(COMMENT_MODES)
};
return {
aliases: ['dpr', 'dfm', 'pas', 'pascal', 'freepascal', 'lazarus', 'lpr', 'lfm'],
case_insensitive: true,
keywords: KEYWORDS,
illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/,
contains: [
STRING, CHAR_STRING,
hljs.NUMBER_MODE,
CLASS,
FUNCTION,
DIRECTIVE
].concat(COMMENT_MODES)
};
};
/***/ })
}]);
//# sourceMappingURL=react-syntax-highlighter_languages_highlight_delphi.js.map | {
"content_hash": "f6a437f9d76786b4a4f48ca1534c42a5",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 119,
"avg_line_length": 36.853658536585364,
"alnum_prop": 0.6101919258769027,
"repo_name": "conorhastings/react-syntax-highlighter",
"id": "5bcedf40960296ebce56ee306ec151d2795130e8",
"size": "3022",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/build/react-syntax-highlighter_languages_highlight_delphi.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "459313"
}
],
"symlink_target": ""
} |
import * as debug_ from "debug";
import { ToastType } from "readium-desktop/common/models/toast";
import { importActions, toastActions } from "readium-desktop/common/redux/actions";
import { takeSpawnLeading } from "readium-desktop/common/redux/sagas/takeSpawnLeading";
import { apiSaga } from "readium-desktop/renderer/common/redux/sagas/api";
import { diLibraryGet } from "readium-desktop/renderer/library/di";
import { ILibraryRootState } from "readium-desktop/renderer/library/redux/states";
// eslint-disable-next-line local-rules/typed-redux-saga-use-typed-effects
import { all, put } from "redux-saga/effects";
import { select as selectTyped } from "typed-redux-saga/macro";
const REQUEST_ID = "SAME_FILE_IMPORT_REQUEST";
// Logger
const filename_ = "readium-desktop:renderer:redux:saga:same-file-import";
const debug = debug_(filename_);
function* sameFileImport(action: importActions.verify.TAction) {
const { link, pub } = action.payload;
const downloads = yield* selectTyped(
(state: ILibraryRootState) => state.download);
if (Array.isArray(downloads)
&& downloads.map(([{ downloadUrl }]) => downloadUrl).find((ln) => ln === link.url)) {
const translator = diLibraryGet("translator");
yield put(
toastActions.openRequest.build(
ToastType.Success,
translator.translate("message.import.alreadyImport",
{
title: pub.title || "",
},
),
),
);
} else {
yield apiSaga("publication/importFromLink",
REQUEST_ID,
link,
pub,
);
}
}
export function saga() {
return all([
takeSpawnLeading(
importActions.verify.ID,
sameFileImport,
(e) => debug(e),
),
]);
}
| {
"content_hash": "17019d82d8a958a3a05af0cb33ac08ec",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 93,
"avg_line_length": 31.76271186440678,
"alnum_prop": 0.6168623265741728,
"repo_name": "edrlab/readium-desktop",
"id": "989f995c03af0e92a942dcfd3a9a72526cdb1a1f",
"size": "2230",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/renderer/library/redux/sagas/sameFileImport.ts",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "6984"
},
{
"name": "HTML",
"bytes": "349"
},
{
"name": "JavaScript",
"bytes": "27067"
},
{
"name": "TypeScript",
"bytes": "361011"
}
],
"symlink_target": ""
} |
.class public final Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;
.super Ljava/lang/Object;
# interfaces
.implements Lcom/payu/android/sdk/internal/hn;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "a"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Object;Lcom/payu/android/sdk/internal/hn<Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;>;"
}
.end annotation
# instance fields
.field private a:Lcom/payu/android/sdk/internal/bf;
.field private b:Lcom/payu/android/sdk/internal/hx;
.field private c:Lcom/payu/android/sdk/internal/hq;
# direct methods
.method public constructor <init>(Lcom/payu/android/sdk/internal/hx;Lcom/payu/android/sdk/internal/bf;Lcom/payu/android/sdk/internal/hq;)V
.locals 0
.line 24
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 25
iput-object p2, p0, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->a:Lcom/payu/android/sdk/internal/bf;
.line 26
iput-object p1, p0, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->b:Lcom/payu/android/sdk/internal/hx;
.line 27
iput-object p3, p0, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->c:Lcom/payu/android/sdk/internal/hq;
.line 28
return-void
.end method
# virtual methods
.method public final bridge synthetic a(Lcom/payu/android/sdk/internal/rest/request/Request;)V
.locals 2
.line 17
move-object v0, p1
check-cast v0, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;
move-object v1, v0
move-object p1, p0
iget-object v0, p1, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->a:Lcom/payu/android/sdk/internal/bf;
invoke-static {v1, v0}, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;->a(Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;Lcom/payu/android/sdk/internal/bf;)Lcom/payu/android/sdk/internal/bf;
iget-object v0, p1, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->b:Lcom/payu/android/sdk/internal/hx;
invoke-static {v1, v0}, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;->a(Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;Lcom/payu/android/sdk/internal/hx;)Lcom/payu/android/sdk/internal/hx;
iget-object v0, p1, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a;->c:Lcom/payu/android/sdk/internal/hq;
invoke-static {v1, v0}, Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;->a(Lcom/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest;Lcom/payu/android/sdk/internal/hq;)Lcom/payu/android/sdk/internal/hq;
return-void
.end method
| {
"content_hash": "71488875e362265f370811453a1dbe74",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 279,
"avg_line_length": 41.95,
"alnum_prop": 0.7792014302741359,
"repo_name": "gelldur/jak_oni_to_robia_prezentacja",
"id": "b4a23fab21354d5d865e3b6330ce64c356c53113",
"size": "3356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Starbucks/output/smali/com/payu/android/sdk/internal/rest/request/payment/method/RetrievePaymentMethodsRequest$a.smali",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "8427"
},
{
"name": "Shell",
"bytes": "2303"
},
{
"name": "Smali",
"bytes": "57557982"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>DashingPlatforms: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">DashingPlatforms
 <span id="projectnumber">1.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
<li><a href="functions_type.html"><span>Typedefs</span></a></li>
<li><a href="functions_rela.html"><span>Related Functions</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_a"><span>a</span></a></li>
<li><a href="functions_b.html#index_b"><span>b</span></a></li>
<li><a href="functions_c.html#index_c"><span>c</span></a></li>
<li><a href="functions_d.html#index_d"><span>d</span></a></li>
<li><a href="functions_e.html#index_e"><span>e</span></a></li>
<li><a href="functions_f.html#index_f"><span>f</span></a></li>
<li><a href="functions_g.html#index_g"><span>g</span></a></li>
<li class="current"><a href="functions_h.html#index_h"><span>h</span></a></li>
<li><a href="functions_i.html#index_i"><span>i</span></a></li>
<li><a href="functions_l.html#index_l"><span>l</span></a></li>
<li><a href="functions_m.html#index_m"><span>m</span></a></li>
<li><a href="functions_n.html#index_n"><span>n</span></a></li>
<li><a href="functions_o.html#index_o"><span>o</span></a></li>
<li><a href="functions_p.html#index_p"><span>p</span></a></li>
<li><a href="functions_r.html#index_r"><span>r</span></a></li>
<li><a href="functions_s.html#index_s"><span>s</span></a></li>
<li><a href="functions_t.html#index_t"><span>t</span></a></li>
<li><a href="functions_u.html#index_u"><span>u</span></a></li>
<li><a href="functions_v.html#index_v"><span>v</span></a></li>
<li><a href="functions_w.html#index_w"><span>w</span></a></li>
<li><a href="functions_0x7e.html#index_0x7e"><span>~</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div>
<h3><a class="anchor" id="index_h"></a>- h -</h3><ul>
<li>handle_close()
: <a class="el" href="classProcessDeathHandler.html#a95b8cff8b5e593d3b79c1b7a88ac10d7">ProcessDeathHandler</a>
</li>
<li>handle_exit()
: <a class="el" href="classProcessDeathHandler.html#aee0b76ee7bd35f5b56c426cfb4c85391">ProcessDeathHandler</a>
</li>
<li>handle_input()
: <a class="el" href="classProcessDeathHandler.html#ae729c5d52820829ed606ca27970e9b03">ProcessDeathHandler</a>
</li>
<li>handle_signal()
: <a class="el" href="classProcessDeathHandler.html#a853a323df72c9938d3873b9a2a5a9930">ProcessDeathHandler</a>
</li>
<li>handle_timeout()
: <a class="el" href="classMailboxBase.html#aae49e212642ebf880bdb43755aa6107d">MailboxBase</a>
</li>
<li>hasBeenProcessed()
: <a class="el" href="classReusableMessageBase.html#abe90e18accfe8b2a4f54efa50714880c">ReusableMessageBase</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
| {
"content_hash": "1bdefbe1082fd90b1c58c1d3fb23e189",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 130,
"avg_line_length": 45.336363636363636,
"alnum_prop": 0.6376579105674754,
"repo_name": "shorton3/dashingplatforms",
"id": "e0de63cfdd226c903a3720cfc86c38d7594f0e4a",
"size": "4987",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/html/functions_h.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "28256"
},
{
"name": "C++",
"bytes": "2094215"
},
{
"name": "CSS",
"bytes": "2445"
},
{
"name": "HTML",
"bytes": "32772"
},
{
"name": "Java",
"bytes": "112848"
},
{
"name": "Makefile",
"bytes": "33095"
},
{
"name": "Shell",
"bytes": "8603"
}
],
"symlink_target": ""
} |
// Copyright 2014 The html5ever Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
/*!
Implements the `match_token!()` macro for use by the HTML tree builder
in `src/tree_builder/mod.rs`.
## Example
```rust
match_token!(token {
CommentToken(text) => 1,
tag @ <base> <link> <meta> => 2,
</head> => 3,
</body> </html> </br> => else,
tag @ </_> => 4,
token => 5,
})
```
## Syntax
The left-hand side of each match arm is an optional `name @` binding, followed by
- an ordinary Rust pattern that starts with an identifier or an underscore, or
- a sequence of HTML tag names as identifiers, each inside "<...>" or "</...>"
to match an open or close tag respectively, or
- a "wildcard tag" "<_>" or "</_>" to match all open tags or all close tags
respectively.
The right-hand side is either an expression or the keyword `else`.
Note that this syntax does not support guards or pattern alternation like
`Foo | Bar`. This is not a fundamental limitation; it's done for implementation
simplicity.
## Semantics
Ordinary Rust patterns match as usual. If present, the `name @` binding has
the usual meaning.
A sequence of named tags matches any of those tags. A single sequence can
contain both open and close tags. If present, the `name @` binding binds (by
move) the `Tag` struct, not the outer `Token`. That is, a match arm like
```rust
tag @ <html> <head> => ...
```
expands to something like
```rust
TagToken(tag @ Tag { name: atom!(html), kind: StartTag })
| TagToken(tag @ Tag { name: atom!(head), kind: StartTag }) => ...
```
A wildcard tag matches any tag of the appropriate kind, *unless* it was
previously matched with an `else` right-hand side (more on this below).
The expansion of this macro reorders code somewhat, to satisfy various
restrictions arising from moves. However it provides the semantics of in-order
matching, by enforcing the following restrictions on its input:
- The last pattern must be a variable or the wildcard "_". In other words
it must match everything.
- Otherwise, ordinary Rust patterns and specific-tag patterns cannot appear
after wildcard tag patterns.
- No tag name may appear more than once.
- A wildcard tag pattern may not occur in the same arm as any other tag.
"<_> <html> => ..." and "<_> </_> => ..." are both forbidden.
- The right-hand side "else" may only appear with specific-tag patterns.
It means that these specific tags should be handled by the last,
catch-all case arm, rather than by any wildcard tag arm. This situation
is common in the HTML5 syntax.
*/
#![allow(unused_imports)] // for quotes
use std::collections::{HashSet, HashMap};
use std::collections::hash_map::Entry::{Occupied, Vacant};
use syntax::ptr::P;
use syntax::codemap::{Span, Spanned, spanned};
use syntax::ast;
use syntax::parse::parser::Parser;
use syntax::parse::{token, parser, classify};
use syntax::parse;
use syntax::ext::base::{ExtCtxt, MacResult, MacExpr};
use self::TagKind::{StartTag, EndTag};
use self::LHS::{Pat, Tags};
use self::RHS::{Else, Expr};
type Tokens = Vec<ast::TokenTree>;
type TagName = ast::Ident;
// FIXME: duplicated in src/tokenizer/interface.rs
#[derive(PartialEq, Eq, Hash, Copy, Clone, Show)]
enum TagKind {
StartTag,
EndTag,
}
impl TagKind {
/// Turn this `TagKind` into syntax for a literal `tokenizer::TagKind`.
fn lift(self, cx: &mut ExtCtxt) -> Tokens {
match self {
StartTag => quote_tokens!(&mut *cx, ::tokenizer::StartTag),
EndTag => quote_tokens!(&mut *cx, ::tokenizer::EndTag),
}
}
}
/// A single tag, as may appear in an LHS.
///
/// `name` is `None` for wildcards.
#[derive(PartialEq, Eq, Hash, Clone)]
struct Tag {
kind: TagKind,
name: Option<TagName>,
}
/// Left-hand side of a pattern-match arm.
enum LHS {
Pat(P<ast::Pat>),
Tags(Vec<Spanned<Tag>>),
}
/// Right-hand side of a pattern-match arm.
enum RHS {
Else,
Expr(P<ast::Expr>),
}
/// A whole arm, including optional outer `name @` binding.
struct Arm {
binding: Option<ast::SpannedIdent>,
lhs: Spanned<LHS>,
rhs: Spanned<RHS>,
}
/// A parsed `match_token!` invocation.
struct Match {
discriminant: P<ast::Expr>,
arms: Vec<Arm>,
}
fn push_all<T>(lhs: &mut Vec<T>, rhs: Vec<T>) {
lhs.extend(rhs.into_iter());
}
fn parse_spanned_ident(parser: &mut Parser) -> ast::SpannedIdent {
let lo = parser.span.lo;
let ident = parser.parse_ident();
let hi = parser.last_span.hi;
spanned(lo, hi, ident)
}
fn parse_tag(parser: &mut Parser) -> Spanned<Tag> {
let lo = parser.span.lo;
parser.expect(&token::Lt);
let kind = match parser.eat(&token::BinOp(token::Slash)) {
true => EndTag,
false => StartTag,
};
let name = match parser.eat(&token::Underscore) {
true => None,
false => Some(parser.parse_ident()),
};
parser.expect(&token::Gt);
spanned(lo, parser.last_span.hi, Tag {
kind: kind,
name: name,
})
}
/// Parse a `match_token!` invocation into the little AST defined above.
fn parse(cx: &mut ExtCtxt, toks: &[ast::TokenTree]) -> Match {
let mut parser = parse::new_parser_from_tts(cx.parse_sess(), cx.cfg(), toks.to_vec());
let discriminant = parser.parse_expr_res(parser::RESTRICTION_NO_STRUCT_LITERAL);
parser.commit_expr_expecting(&*discriminant, token::OpenDelim(token::Brace));
let mut arms: Vec<Arm> = Vec::new();
while parser.token != token::CloseDelim(token::Brace) {
let mut binding = None;
if parser.look_ahead(1, |t| *t == token::At) {
binding = Some(parse_spanned_ident(&mut parser));
parser.bump(); // Consume the @
}
let lhs_lo = parser.span.lo;
let lhs = match parser.token {
token::Underscore | token::Ident(..) => Pat(parser.parse_pat()),
token::Lt => {
let mut tags = Vec::new();
while parser.token != token::FatArrow {
tags.push(parse_tag(&mut parser));
}
Tags(tags)
}
_ => parser.fatal("unrecognized pattern"),
};
let lhs_hi = parser.last_span.hi;
parser.expect(&token::FatArrow);
let rhs_lo = parser.span.lo;
let mut rhs_hi = parser.span.hi;
let rhs = if parser.eat_keyword(token::keywords::Else) {
parser.expect(&token::Comma);
Else
} else {
let expr = parser.parse_expr_res(parser::RESTRICTION_STMT_EXPR);
rhs_hi = parser.last_span.hi;
let require_comma =
!classify::expr_is_simple_block(&*expr)
&& parser.token != token::CloseDelim(token::Brace);
if require_comma {
parser.commit_expr(&*expr, &[token::Comma], &[token::CloseDelim(token::Brace)]);
} else {
parser.eat(&token::Comma);
}
Expr(expr)
};
arms.push(Arm {
binding: binding,
lhs: spanned(lhs_lo, lhs_hi, lhs),
rhs: spanned(rhs_lo, rhs_hi, rhs),
});
}
// Consume the closing brace
parser.bump();
Match {
discriminant: discriminant,
arms: arms,
}
}
/// Description of a wildcard match arm.
///
/// We defer generating code for these until we process the last, catch-all
/// arm. This isn't part of the AST produced by `parse()`; it's created
/// while processing that AST.
struct WildcardArm {
binding: Tokens,
kind: TagKind,
expr: P<ast::Expr>,
}
fn make_tag_pattern(cx: &mut ExtCtxt, binding: Tokens, tag: Tag) -> Tokens {
let kind = tag.kind.lift(cx);
let mut fields = quote_tokens!(&mut *cx, kind: $kind,);
match tag.name {
None => (),
Some(name) => push_all(&mut fields, quote_tokens!(&mut *cx, name: atom!($name),)),
}
quote_tokens!(&mut *cx,
::tree_builder::types::TagToken($binding ::tokenizer::Tag { $fields ..})
)
}
/// Expand the `match_token!` macro.
pub fn expand(cx: &mut ExtCtxt, span: Span, toks: &[ast::TokenTree]) -> Box<MacResult+'static> {
let Match { discriminant, mut arms } = parse(cx, toks);
// Handle the last arm specially at the end.
let last_arm = match arms.pop() {
Some(x) => x,
None => bail!(cx, span, "need at least one match arm"),
};
// Code for the arms other than the last one.
let mut arm_code: Tokens = vec!();
// Tags we've seen, used for detecting duplicates.
let mut seen_tags: HashSet<Tag> = HashSet::new();
// Case arms for wildcard matching. We collect these and
// emit them later.
let mut wildcards: Vec<WildcardArm> = vec!();
// Tags excluded (by an 'else' RHS) from wildcard matching.
let mut wild_excluded: HashMap<TagKind, Vec<Tag>> = HashMap::new();
for Arm { binding, lhs, rhs } in arms.into_iter() {
// Build Rust syntax for the `name @` binding, if any.
let binding = match binding {
Some(i) => quote_tokens!(&mut *cx, $i @),
None => vec!(),
};
match (lhs.node, rhs.node) {
(Pat(_), Else)
=> bail!(cx, rhs.span, "'else' may not appear with an ordinary pattern"),
// ordinary pattern => expression
(Pat(pat), Expr(expr)) => {
bail_if!(!wildcards.is_empty(), cx, lhs.span,
"ordinary patterns may not appear after wildcard tags");
push_all(&mut arm_code, quote_tokens!(&mut *cx, $binding $pat => $expr,));
}
// <tag> <tag> ... => else
(Tags(tags), Else) => {
for Spanned { span, node: tag } in tags.into_iter() {
bail_if!(!seen_tags.insert(tag.clone()), cx, span, "duplicate tag");
bail_if!(tag.name.is_none(), cx, rhs.span,
"'else' may not appear with a wildcard tag");
match wild_excluded.entry(tag.kind) {
Occupied(e) => { e.into_mut().push(tag.clone()); }
Vacant(e) => { e.insert(vec![tag.clone()]); }
}
}
}
// <_> => expression
// <tag> <tag> ... => expression
(Tags(tags), Expr(expr)) => {
// Is this arm a tag wildcard?
// `None` if we haven't processed the first tag yet.
let mut wildcard = None;
for Spanned { span, node: tag } in tags.into_iter() {
bail_if!(!seen_tags.insert(tag.clone()), cx, span, "duplicate tag");
match tag.name {
// <tag>
Some(_) => {
bail_if!(!wildcards.is_empty(), cx, lhs.span,
"specific tags may not appear after wildcard tags");
bail_if!(wildcard == Some(true), cx, span,
"wildcard tags must appear alone");
if wildcard.is_some() {
// Push the delimeter `|` if it's not the first tag.
push_all(&mut arm_code, quote_tokens!(&mut *cx, |));
}
push_all(&mut arm_code, make_tag_pattern(cx, binding.clone(), tag));
wildcard = Some(false);
}
// <_>
None => {
bail_if!(wildcard.is_some(), cx, span,
"wildcard tags must appear alone");
wildcard = Some(true);
wildcards.push(WildcardArm {
binding: binding.clone(),
kind: tag.kind,
expr: expr.clone(),
});
}
}
}
match wildcard {
None => bail!(cx, lhs.span, "[internal macro error] tag arm with no tags"),
Some(false) => {
push_all(&mut arm_code, quote_tokens!(&mut *cx, => $expr,));
}
Some(true) => () // codegen for wildcards is deferred
}
}
}
}
// Time to process the last, catch-all arm. We will generate something like
//
// last_arm_token => {
// let enable_wildcards = match last_arm_token {
// TagToken(Tag { kind: EndTag, name: atom!(body), .. }) => false,
// TagToken(Tag { kind: EndTag, name: atom!(html), .. }) => false,
// // ...
// _ => true,
// };
//
// match (enable_wildcards, last_arm_token) {
// (true, TagToken(name @ Tag { kind: StartTag, .. }))
// => ..., // wildcard action for start tags
//
// (true, TagToken(name @ Tag { kind: EndTag, .. }))
// => ..., // wildcard action for end tags
//
// (_, token) => ... // using the pattern from that last arm
// }
// }
let Arm { binding, lhs, rhs } = last_arm;
let last_arm_token = token::gensym_ident("last_arm_token");
let enable_wildcards = token::gensym_ident("enable_wildcards");
let (last_pat, last_expr) = match (binding, lhs.node, rhs.node) {
(Some(id), _, _) => bail!(cx, id.span, "the last arm cannot have an @-binding"),
(None, Tags(_), _) => bail!(cx, lhs.span, "the last arm cannot have tag patterns"),
(None, _, Else) => bail!(cx, rhs.span, "the last arm cannot use 'else'"),
(None, Pat(p), Expr(e)) => match p.node {
ast::PatWild(ast::PatWildSingle) | ast::PatIdent(..) => (p, e),
_ => bail!(cx, lhs.span, "the last arm must have a wildcard or ident pattern"),
},
};
// We can't actually tell if the last pattern is a variable or a nullary enum
// constructor, but in the latter case rustc will (probably?) give an error
// about non-exhaustive matching on the expanded `match` expression.
// Code for the `false` arms inside `let enable_wildcards = ...`.
let mut enable_wildcards_code = vec!();
for (_, tags) in wild_excluded.into_iter() {
for tag in tags.into_iter() {
push_all(&mut enable_wildcards_code, make_tag_pattern(cx, vec!(), tag));
push_all(&mut enable_wildcards_code, quote_tokens!(&mut *cx, => false,));
}
}
// Code for the wildcard actions.
let mut wildcard_code = vec!();
for WildcardArm { binding, kind, expr } in wildcards.into_iter() {
let pat = make_tag_pattern(cx, binding, Tag { kind: kind, name: None });
push_all(&mut wildcard_code, quote_tokens!(&mut *cx,
(true, $pat) => $expr,
));
}
// Put it all together!
MacExpr::new(quote_expr!(&mut *cx,
match $discriminant {
$arm_code
$last_arm_token => {
let $enable_wildcards = match $last_arm_token {
$enable_wildcards_code
_ => true,
};
match ($enable_wildcards, $last_arm_token) {
$wildcard_code
(_, $last_pat) => $last_expr,
}
},
}
))
}
| {
"content_hash": "e87b487fc4ae5029c9f0602b14ed76a4",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 96,
"avg_line_length": 33.687763713080166,
"alnum_prop": 0.5438376753507014,
"repo_name": "Manishearth/html5ever",
"id": "63129d91338b7041ebc851c60a62c4018aab1397",
"size": "15968",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "macros/src/match_token.rs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3380"
},
{
"name": "Python",
"bytes": "3809"
},
{
"name": "Rust",
"bytes": "299242"
}
],
"symlink_target": ""
} |
{% extends 'administration/templates/base_admin.html' %}
{% load format %}
{% block admin_content %}
<div class="split">
<dl>
<dt><h2>Site</h2></dt>
<dd class="no-margin">
<p>Change site name, update post colloquial name, update description for site.</p>
<ul>
<li><a href="admin/site">Site Settings</a></li>
</ul>
</dd>
</dl>
</div>
<div class="split">
<dl>
<dt><h2>Channels</h2></dt>
<dd class="no-margin">
<p>Manage channels options, create channels, manage channels</p>
<ul>
<li><a href="admin/channel">Channel Options</a></li>
<li><a href="admin/channel/new">Create Channel</a></li>
<li><a href="admin/channel/list">Manage Channels</a></li>
</ul>
</dd>
</dl>
</div>
{% endblock %} | {
"content_hash": "4b3396e135c8af2e8fecf091aebf292a",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 88,
"avg_line_length": 28,
"alnum_prop": 0.5714285714285714,
"repo_name": "CollabQ/CollabQ",
"id": "8ecdd11bf5423aca33a03d5d37b06ee489aef144",
"size": "784",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "administration/templates/admin.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "400472"
},
{
"name": "C++",
"bytes": "20"
},
{
"name": "JavaScript",
"bytes": "327809"
},
{
"name": "Python",
"bytes": "6590397"
},
{
"name": "R",
"bytes": "1277"
},
{
"name": "Shell",
"bytes": "5624"
}
],
"symlink_target": ""
} |
namespace {
// Forward declarations.
void SetList(CefRefPtr<CefV8Value> source, CefRefPtr<CefListValue> target);
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target);
// Transfer a V8 value to a List index.
void SetListValue(CefRefPtr<CefListValue> list, int index,
CefRefPtr<CefV8Value> value) {
if (value->IsArray()) {
CefRefPtr<CefListValue> new_list = CefListValue::Create();
SetList(value, new_list);
list->SetList(index, new_list);
} else if (value->IsString()) {
list->SetString(index, value->GetStringValue());
} else if (value->IsBool()) {
list->SetBool(index, value->GetBoolValue());
} else if (value->IsInt()) {
list->SetInt(index, value->GetIntValue());
} else if (value->IsDouble()) {
list->SetDouble(index, value->GetDoubleValue());
}
}
// Transfer a V8 array to a List.
void SetList(CefRefPtr<CefV8Value> source, CefRefPtr<CefListValue> target) {
ASSERT(source->IsArray());
int arg_length = source->GetArrayLength();
if (arg_length == 0)
return;
// Start with null types in all spaces.
target->SetSize(arg_length);
for (int i = 0; i < arg_length; ++i)
SetListValue(target, i, source->GetValue(i));
}
// Transfer a List value to a V8 array index.
void SetListValue(CefRefPtr<CefV8Value> list, int index,
CefRefPtr<CefListValue> value) {
CefRefPtr<CefV8Value> new_value;
CefValueType type = value->GetType(index);
switch (type) {
case VTYPE_LIST: {
CefRefPtr<CefListValue> list = value->GetList(index);
new_value = CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
SetList(list, new_value);
} break;
case VTYPE_BOOL:
new_value = CefV8Value::CreateBool(value->GetBool(index));
break;
case VTYPE_DOUBLE:
new_value = CefV8Value::CreateDouble(value->GetDouble(index));
break;
case VTYPE_INT:
new_value = CefV8Value::CreateInt(value->GetInt(index));
break;
case VTYPE_STRING:
new_value = CefV8Value::CreateString(value->GetString(index));
break;
default:
break;
}
if (new_value.get()) {
list->SetValue(index, new_value);
} else {
list->SetValue(index, CefV8Value::CreateNull());
}
}
// Transfer a List to a V8 array.
void SetList(CefRefPtr<CefListValue> source, CefRefPtr<CefV8Value> target) {
ASSERT(target->IsArray());
int arg_length = static_cast<int>(source->GetSize());
if (arg_length == 0)
return;
for (int i = 0; i < arg_length; ++i)
SetListValue(target, i, source);
}
// Handles the native implementation for the client_app extension.
class ClientAppExtensionHandler : public CefV8Handler {
public:
explicit ClientAppExtensionHandler(CefRefPtr<ClientApp> client_app)
: client_app_(client_app) {
}
virtual bool Execute(const CefString& name,
CefRefPtr<CefV8Value> object,
const CefV8ValueList& arguments,
CefRefPtr<CefV8Value>& retval,
CefString& exception) {
bool handled = false;
if (name == "sendMessage") {
// Send a message to the browser process.
if ((arguments.size() == 1 || arguments.size() == 2) &&
arguments[0]->IsString()) {
CefRefPtr<CefBrowser> browser =
CefV8Context::GetCurrentContext()->GetBrowser();
ASSERT(browser.get());
CefString name = arguments[0]->GetStringValue();
if (!name.empty()) {
CefRefPtr<CefProcessMessage> message =
CefProcessMessage::Create(name);
// Translate the arguments, if any.
if (arguments.size() == 2 && arguments[1]->IsArray())
SetList(arguments[1], message->GetArgumentList());
browser->SendProcessMessage(PID_BROWSER, message);
handled = true;
}
}
} else if (name == "setMessageCallback") {
// Set a message callback.
if (arguments.size() == 2 && arguments[0]->IsString() &&
arguments[1]->IsFunction()) {
std::string name = arguments[0]->GetStringValue();
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
int browser_id = context->GetBrowser()->GetIdentifier();
client_app_->SetMessageCallback(name, browser_id, context,
arguments[1]);
handled = true;
}
} else if (name == "removeMessageCallback") {
// Remove a message callback.
if (arguments.size() == 1 && arguments[0]->IsString()) {
std::string name = arguments[0]->GetStringValue();
CefRefPtr<CefV8Context> context = CefV8Context::GetCurrentContext();
int browser_id = context->GetBrowser()->GetIdentifier();
bool removed = client_app_->RemoveMessageCallback(name, browser_id);
retval = CefV8Value::CreateBool(removed);
handled = true;
}
}
if (!handled)
exception = "Invalid method arguments";
return true;
}
private:
CefRefPtr<ClientApp> client_app_;
IMPLEMENT_REFCOUNTING(ClientAppExtensionHandler);
};
} // namespace
ClientApp::ClientApp() {
CreateBrowserDelegates(browser_delegates_);
CreateRenderDelegates(render_delegates_);
// Default schemes that support cookies.
cookieable_schemes_.push_back("http");
cookieable_schemes_.push_back("https");
}
void ClientApp::SetMessageCallback(const std::string& message_name,
int browser_id,
CefRefPtr<CefV8Context> context,
CefRefPtr<CefV8Value> function) {
ASSERT(CefCurrentlyOn(TID_RENDERER));
callback_map_.insert(
std::make_pair(std::make_pair(message_name, browser_id),
std::make_pair(context, function)));
}
bool ClientApp::RemoveMessageCallback(const std::string& message_name,
int browser_id) {
ASSERT(CefCurrentlyOn(TID_RENDERER));
CallbackMap::iterator it =
callback_map_.find(std::make_pair(message_name, browser_id));
if (it != callback_map_.end()) {
callback_map_.erase(it);
return true;
}
return false;
}
void ClientApp::OnContextInitialized() {
// Register cookieable schemes with the global cookie manager.
CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager();
ASSERT(manager.get());
manager->SetSupportedSchemes(cookieable_schemes_);
BrowserDelegateSet::iterator it = browser_delegates_.begin();
for (; it != browser_delegates_.end(); ++it)
(*it)->OnContextInitialized(this);
}
void ClientApp::OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) {
BrowserDelegateSet::iterator it = browser_delegates_.begin();
for (; it != browser_delegates_.end(); ++it)
(*it)->OnBeforeChildProcessLaunch(this, command_line);
}
void ClientApp::OnRenderProcessThreadCreated(
CefRefPtr<CefListValue> extra_info) {
BrowserDelegateSet::iterator it = browser_delegates_.begin();
for (; it != browser_delegates_.end(); ++it)
(*it)->OnRenderProcessThreadCreated(this, extra_info);
}
void ClientApp::OnRenderThreadCreated(CefRefPtr<CefListValue> extra_info) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnRenderThreadCreated(this, extra_info);
}
void ClientApp::OnWebKitInitialized() {
// Register the client_app extension.
std::string app_code =
"var app;"
"if (!app)"
" app = {};"
"(function() {"
" app.sendMessage = function(name, arguments) {"
" native function sendMessage();"
" return sendMessage(name, arguments);"
" };"
" app.setMessageCallback = function(name, callback) {"
" native function setMessageCallback();"
" return setMessageCallback(name, callback);"
" };"
" app.removeMessageCallback = function(name) {"
" native function removeMessageCallback();"
" return removeMessageCallback(name);"
" };"
"})();";
CefRegisterExtension("v8/app", app_code,
new ClientAppExtensionHandler(this));
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnWebKitInitialized(this);
}
void ClientApp::OnBrowserCreated(CefRefPtr<CefBrowser> browser) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnBrowserCreated(this, browser);
}
void ClientApp::OnBrowserDestroyed(CefRefPtr<CefBrowser> browser) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnBrowserDestroyed(this, browser);
}
CefRefPtr<CefLoadHandler> ClientApp::GetLoadHandler() {
CefRefPtr<CefLoadHandler> load_handler;
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end() && !load_handler.get(); ++it)
load_handler = (*it)->GetLoadHandler(this);
return load_handler;
}
bool ClientApp::OnBeforeNavigation(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
NavigationType navigation_type,
bool is_redirect) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it) {
if ((*it)->OnBeforeNavigation(this, browser, frame, request,
navigation_type, is_redirect)) {
return true;
}
}
return false;
}
void ClientApp::OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnContextCreated(this, browser, frame, context);
}
void ClientApp::OnContextReleased(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnContextReleased(this, browser, frame, context);
// Remove any JavaScript callbacks registered for the context that has been
// released.
if (!callback_map_.empty()) {
CallbackMap::iterator it = callback_map_.begin();
for (; it != callback_map_.end();) {
if (it->second.first->IsSame(context))
callback_map_.erase(it++);
else
++it;
}
}
}
void ClientApp::OnUncaughtException(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context,
CefRefPtr<CefV8Exception> exception,
CefRefPtr<CefV8StackTrace> stackTrace) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it) {
(*it)->OnUncaughtException(this, browser, frame, context, exception,
stackTrace);
}
}
void ClientApp::OnFocusedNodeChanged(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefDOMNode> node) {
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end(); ++it)
(*it)->OnFocusedNodeChanged(this, browser, frame, node);
}
bool ClientApp::OnProcessMessageReceived(
CefRefPtr<CefBrowser> browser,
CefProcessId source_process,
CefRefPtr<CefProcessMessage> message) {
ASSERT(source_process == PID_BROWSER);
bool handled = false;
RenderDelegateSet::iterator it = render_delegates_.begin();
for (; it != render_delegates_.end() && !handled; ++it) {
handled = (*it)->OnProcessMessageReceived(this, browser, source_process,
message);
}
if (handled)
return true;
// Execute the registered JavaScript callback if any.
if (!callback_map_.empty()) {
CefString message_name = message->GetName();
CallbackMap::const_iterator it = callback_map_.find(
std::make_pair(message_name.ToString(),
browser->GetIdentifier()));
if (it != callback_map_.end()) {
// Keep a local reference to the objects. The callback may remove itself
// from the callback map.
CefRefPtr<CefV8Context> context = it->second.first;
CefRefPtr<CefV8Value> callback = it->second.second;
// Enter the context.
context->Enter();
CefV8ValueList arguments;
// First argument is the message name.
arguments.push_back(CefV8Value::CreateString(message_name));
// Second argument is the list of message arguments.
CefRefPtr<CefListValue> list = message->GetArgumentList();
CefRefPtr<CefV8Value> args =
CefV8Value::CreateArray(static_cast<int>(list->GetSize()));
SetList(list, args);
arguments.push_back(args);
// Execute the callback.
CefRefPtr<CefV8Value> retval = callback->ExecuteFunction(NULL, arguments);
if (retval.get()) {
if (retval->IsBool())
handled = retval->GetBoolValue();
}
// Exit the context.
context->Exit();
}
}
return handled;
}
| {
"content_hash": "d70b4bf6a7b73480bcc2d9ad5f4f6a79",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 80,
"avg_line_length": 34.032745591939545,
"alnum_prop": 0.6268966027681149,
"repo_name": "benbon/CryHTML5",
"id": "39f8a354f0a45b6aabb74bf979583bddc699c954",
"size": "14044",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cef/cefclient/client_app.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_45) on Thu Mar 26 16:48:37 UTC 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class com.hazelcast.topic.impl.TopicDataSerializerHook (Hazelcast Root 3.4.2 API)
</TITLE>
<META NAME="date" CONTENT="2015-03-26">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class com.hazelcast.topic.impl.TopicDataSerializerHook (Hazelcast Root 3.4.2 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/hazelcast/topic/impl/TopicDataSerializerHook.html" title="class in com.hazelcast.topic.impl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/hazelcast/topic/impl//class-useTopicDataSerializerHook.html" target="_top"><B>FRAMES</B></A>
<A HREF="TopicDataSerializerHook.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>com.hazelcast.topic.impl.TopicDataSerializerHook</B></H2>
</CENTER>
No usage of com.hazelcast.topic.impl.TopicDataSerializerHook
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../com/hazelcast/topic/impl/TopicDataSerializerHook.html" title="class in com.hazelcast.topic.impl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?com/hazelcast/topic/impl//class-useTopicDataSerializerHook.html" target="_top"><B>FRAMES</B></A>
<A HREF="TopicDataSerializerHook.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2015 <a href="http://www.hazelcast.com/">Hazelcast, Inc.</a>. All Rights Reserved.
</BODY>
</HTML>
| {
"content_hash": "0a3d34abdda75c4321bcaa5fdd009d88",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 229,
"avg_line_length": 42.93103448275862,
"alnum_prop": 0.6240963855421687,
"repo_name": "akiskip/KoDeMat-Collaboration-Platform-Application",
"id": "8c173aafd19a6fad31f1ab8a15f777680e3ddeb7",
"size": "6225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "KoDeMat_TouchScreen/lib/hazelcast-3.4.2/hazelcast-3.4.2/docs/javadoc/com/hazelcast/topic/impl/class-use/TopicDataSerializerHook.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1255"
},
{
"name": "CSS",
"bytes": "12362"
},
{
"name": "GLSL",
"bytes": "105719"
},
{
"name": "HTML",
"bytes": "17271482"
},
{
"name": "Java",
"bytes": "1388877"
},
{
"name": "JavaScript",
"bytes": "110983"
},
{
"name": "Shell",
"bytes": "1365"
}
],
"symlink_target": ""
} |
import django
from django.apps import AppConfig
from django_jinja import base
class DjangoJinjaAppConfig(AppConfig):
name = "django_jinja"
verbose_name = "Django Jinja"
def ready(self):
base.patch_django_for_autoescape()
if django.VERSION[:2] == (1, 7):
base.setup()
| {
"content_hash": "2baf14e5d5ad8698d1aabed25a32fb87",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 42,
"avg_line_length": 20.8,
"alnum_prop": 0.6538461538461539,
"repo_name": "glogiotatidis/django-jinja",
"id": "760b4fcb214a0205cc7500877e26fa0851ab8c08",
"size": "312",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "django_jinja/apps.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "26"
},
{
"name": "HTML",
"bytes": "3238"
},
{
"name": "JavaScript",
"bytes": "28"
},
{
"name": "Python",
"bytes": "74405"
},
{
"name": "Shell",
"bytes": "199"
}
],
"symlink_target": ""
} |
package nest.sparkle.loader.kafka
import scala.concurrent.duration._
import spray.http.StatusCodes._
import spray.http.MediaTypes.`application/json`
import spray.testkit.ScalatestRouteTest
import akka.actor.ActorRefFactory
import spray.json._
import nest.sparkle.measure.MeasurementToTsvFile
import nest.sparkle.util.kafka.{KafkaTestSuite, KafkaBroker, KafkaTopic, KafkaGroupOffsets}
import nest.sparkle.util.kafka.KafkaJsonProtocol._
class TestKafkaLoaderBaseAdminService
extends KafkaTestSuite
with ScalatestRouteTest
with KafkaTestConfig
with KafkaLoaderBaseAdminService
{
override def actorRefFactory: ActorRefFactory = system
implicit def executionContext = system.dispatcher
implicit override lazy val measurements =
new MeasurementToTsvFile("/tmp/kafka-loader-tests.tsv")(executionContext) // SCALA why doesn't implicit above catch this?
// Some of the requests currently take a very long time
implicit val routeTestTimeout = RouteTestTimeout(1.minute)
override def afterAll(): Unit = {
super.afterAll()
measurements.close()
}
/** validate the response is JSON and convert to T */
protected def convertJsonResponse[T: JsonFormat]: T = {
assert(handled, "request was not handled")
assert(status == OK, "response not OK")
mediaType shouldBe `application/json`
val json = body.asString
json.length > 0 shouldBe true
val ast = json.parseJson
ast.convertTo[T]
}
test("The list of brokers is correct") {
Get("/brokers") ~> allRoutes ~> check {
val brokers = convertJsonResponse[Seq[KafkaBroker]]
brokers.length shouldBe 1
val broker = brokers(0)
broker.id shouldBe 0
broker.host shouldBe "localhost"
broker.port shouldBe 9092
}
}
test("The list of topics includes the test topic") {
Get("/topics") ~> allRoutes ~> check {
val topics = convertJsonResponse[Map[String,KafkaTopic]]
topics should contain key TopicName
val topic = topics(TopicName)
topic.partitions.length shouldBe NumPartitions
topic.partitions.zipWithIndex foreach { case (partition, i) =>
partition.id shouldBe i
partition.leader shouldBe 0
partition.brokerIds.length shouldBe 1
partition.brokerIds(0) shouldBe 0
partition.earliest should contain (0)
partition.latest should contain (5)
}
}
}
test("The list of consumer groups includes the test group") {
Get("/groups") ~> allRoutes ~> check {
val groups = convertJsonResponse[Seq[String]]
assert(groups.contains(ConsumerGroup),s"$ConsumerGroup not found in $groups")
}
}
test("The list of consumer group topic offsets is correct") {
Get("/offsets") ~> allRoutes ~> check {
val groups = convertJsonResponse[Seq[KafkaGroupOffsets]]
assert(groups.length > 1, "no consumer groups found")
val optGroup = groups.find(_.group.contentEquals(ConsumerGroup))
optGroup match {
case Some(group) =>
assert(group.topics.size == 1, "not one topic in the consumer group")
assert(group.topics.contains(TopicName), "topic not in the consumer group")
val topic = group.topics(TopicName)
assert(topic.partitions.length == NumPartitions, s"${topic.topic} does not have $NumPartitions partitions")
topic.partitions.zipWithIndex foreach { case (offset,i) =>
assert(offset.partition == i, s"${topic.topic}:$i partition id doesn't equal index")
assert(offset.offset == Some(2), s"${topic.topic}:$i partition offset doesn't equal 2")
}
case _ => fail(s"consumer group $ConsumerGroup not found")
}
}
}
}
| {
"content_hash": "7672e525dbca99f2bff62665db0d28ca",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 125,
"avg_line_length": 36.14563106796116,
"alnum_prop": 0.6916465216223475,
"repo_name": "mighdoll/sparkle",
"id": "a644abbcbffbab20014c756e6dd57ff2ba81d727",
"size": "3723",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "kafka/src/it/scala/nest/sparkle/loader/kafka/TestKafkaLoaderBaseAdminService.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1347"
},
{
"name": "CSS",
"bytes": "1256191"
},
{
"name": "HTML",
"bytes": "123161"
},
{
"name": "JavaScript",
"bytes": "4467636"
},
{
"name": "Scala",
"bytes": "1016366"
},
{
"name": "Shell",
"bytes": "11999"
}
],
"symlink_target": ""
} |
<?php
namespace Mldic\ApiBundle\Tests\Functional\Orm;
use Mldic\ApiBundle\Tests\Functional\TestCase;
use Mldic\ApiBundle\Orm\PDO\DataAccess;
use Mldic\ApiBundle\Orm\UserBuilder;
use Mldic\ApiBundle\Orm\PDO\UserQueryFactory;
use Mldic\ApiBundle\Orm\UserMapper;
class UserMapperTest extends TestCase
{
private $userMapper;
public function setUp()
{
parent::setUp();
$dbConnection = $this->getDatabaseConnection();
$this->userMapper = new UserMapper(new DataAccess($dbConnection),
new UserBuilder(),
new UserQueryFactory());
}
public function testShouldFindUserById()
{
// Given
$userId = 1;
// When
$result = $this->userMapper->findById($userId);
// Then
$this->assertInstanceOf('Mldic\ApiBundle\Model\User', $result);
$this->assertEquals($userId, $result->getId());
}
public function testShouldNotFindUserById()
{
// Given
$userId = 999999;
// When
$result = $this->userMapper->findById($userId);
// Then
$this->assertNull($result);
}
}
| {
"content_hash": "57a926a53a71268590a9b29e0742c909",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 26.4468085106383,
"alnum_prop": 0.5711987127916331,
"repo_name": "polad/mldic",
"id": "ddee5d2d65756a3e090944aab978322d335f1553",
"size": "1243",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Mldic/ApiBundle/Tests/Functional/Orm/UserMapperTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "100791"
}
],
"symlink_target": ""
} |
//
// IURequest.m
// IUKitDemo
//
// Created by admin on 2017/2/14.
// Copyright © 2017年 刘海文. All rights reserved.
//
#import "IURequest.h"
#import "AFNetworking.h"
#import "MJExtension.h"
#import "IURequestorRegistrar.h"
@interface NSObject (IUNetworkRequestingCount)
@property (nonatomic, assign) NSInteger requestingCount;
@end
@interface IURequest ()
@property (nonatomic, strong) NSURLSessionDataTask *task;
@property (nonatomic, strong) NSArray <IUNetworkWeakRequestor> *requestors;
@property (nonatomic, strong) IURequestResult *result;
@end
@implementation IURequest
- (void)setTask:(NSURLSessionDataTask *)task {
if (_task) {
[self cancel];
}
_task = task;
}
- (void)cancel {
[self.task cancel];
_task = nil;
}
- (void)dealloc {
[self cancel];
}
- (IURequestTaskState)state {
if (self.task) {
return (IURequestTaskState)self.task.state;
}
return IURequestTaskStateUnknown;
}
- (instancetype)init {
if (self = [super init]) {
self->_config = [IURequestConfig config];
}
return self;
}
+ (instancetype)request:(IUNetworkingConfiguration)configuration {
IURequest *request = [[self alloc] init];
configuration(request.config);
[request start];
return request;
}
+ (instancetype)requestWithConfig:(IURequestConfig *)config {
IURequest *request = [[self alloc] init];
request->_config = config;
[request start];
return request;
}
// fast api
+ (instancetype)post:(NSString *)api parameters:(id)parameters success:(IUNetworkingSuccess)success {
return [self request:^(IURequestConfig *config) {
config.api = api;
config.method = IUNetworkingRequestMethod_POST;
config.parameters = parameters;
config.success = success;
}];
}
+ (instancetype)get:(NSString *)api success:(IUNetworkingSuccess)success {
return [self request:^(IURequestConfig *config) {
config.api = api;
config.method = IUNetworkingRequestMethod_GET;
config.success = success;
}];
}
+ (instancetype)upload:(NSString *)api parameters:(id)parameters files:(NSArray <IURequestUploadFile *> *)files success:(IUNetworkingSuccess)success {
return [self request:^(IURequestConfig *config) {
config.api = api;
config.method = IUNetworkingRequestMethod_FORM_DATA;
config.parameters = parameters;
config.files = files;
config.success = success;
}];
}
+ (instancetype)upload:(NSString *)api files:(NSArray <IURequestUploadFile *> *)files success:(IUNetworkingSuccess)success {
return [self upload:api parameters:nil files:files success:success];
}
- (void)startIfNeeded {
if (self.state != IURequestTaskStateRunning) [self start];
}
#define IUNLog(FORMAT, ...) printf("\n========\n%s\n========\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);
- (void)start {
if ([[IURequestorRegistrar sharedInstance].requestors count]) {
self.requestors = [IURequestorRegistrar sharedInstance].requestors;
[[IURequestorRegistrar sharedInstance] clear];
}
/* requestors */
NSArray <IUNetworkWeakRequestor> *requestors = self.requestors;
IURequestConfig *config = [self.config deepCopy];
/* request serializer */
AFHTTPRequestSerializer *requestSerializer = (config.serializerType == IUNetworkingRequestSerializerType_URL ? [AFHTTPRequestSerializer serializer] : [AFJSONRequestSerializer serializer]);
// set timeout interval
requestSerializer.timeoutInterval = config.timeoutInterval;
// set headers
[config.headers enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) {
[requestSerializer setValue:obj forHTTPHeaderField:key];
}];
/* session manager */
NSURLSessionConfiguration *sessionConfiguration = [NSURLSessionConfiguration defaultSessionConfiguration];
// set timeout interval
sessionConfiguration.timeoutIntervalForResource = config.timeoutInterval;
AFHTTPSessionManager *sessionManager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:sessionConfiguration];
// set security policy
if (config.certificates) {
AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModePublicKey withPinnedCertificates:config.certificates];
securityPolicy.allowInvalidCertificates = config.allowInvalidCertificates;
securityPolicy.validatesDomainName = config.validatesDomainName;
[sessionManager setSecurityPolicy:securityPolicy];
}
// set request serializer
sessionManager.requestSerializer = requestSerializer;
// set response serializer
[sessionManager.responseSerializer setAcceptableContentTypes:[NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html",@"text/plain", @"charset=UTF-8", @"image/*", nil]];
/* setup blocks */
__weak typeof(self) ws = self;
// completion
void(^comletion)(void) = ^{
if (config.completion) config.completion();
[self _endRequestors:requestors];
self.task = nil;
};
// success
void(^success)(NSURLSessionDataTask *, id) = ^(NSURLSessionDataTask *task, id responseObject) {
IURequestResult *result = [config.resultClass resultWithConfig:config task:task responseObject:responseObject error:nil request:ws];
ws.result = result;
if (config.enableRequestLog) {
IUNLog(@"✅request success\n➡️request url : %@\n➡️request method : %@\n➡️request headers : %@\n➡️request parameters : %@\n➡️response headers : %@\n➡️response object : %@", [config absoluteUrl], [config methodNameString], [config headers], [config parameters], result.responseHeaders, result.responseObject);
}
[IURequestorRegistrar sharedInstance].requestors = self.requestors;
if (config.fakeRequest) {
@try {
if ((!config.globalSuccess || config.globalSuccess(result)) && config.success) config.success(result);
} @catch (NSException *exception) {
[result fakeDataTypeWrong];
if ((!config.globalSuccess || config.globalSuccess(result)) && config.success) config.success(result);
}
} else {
if ((!config.globalSuccess || config.globalSuccess(result)) && config.success) config.success(result);
}
[[IURequestorRegistrar sharedInstance] clear];
comletion();
};
// failure
void(^failure)(NSURLSessionDataTask *, NSError *) = ^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
IURequestResult *result = [config.resultClass resultWithConfig:config task:task responseObject:nil error:error request:ws];
ws.result = result;
if (task.state == NSURLSessionTaskStateCanceling) {
if (config.enableRequestLog) {
IUNLog(@"❎request cancelled\n➡️request url : %@\n➡️request method : %@\n➡️request headers : %@\n➡️request parameters : %@", [config absoluteUrl], [config methodNameString], [config headers], [config parameters]);
}
} else {
if (config.enableRequestLog) {
IUNLog(@"⚠️request failure\n➡️request url : %@\n➡️request method : %@\n➡️request headers : %@\n➡️request parameters : %@\n➡️request error : %@", [config absoluteUrl], [config methodNameString], [config headers], [config parameters], error);
}
if (!config.globalFailure || config.globalFailure(result)) {
if (config.failure) config.failure(result);
[requestors enumerateObjectsUsingBlock:^(IUNetworkWeakRequestor _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
id<IUNetworkingRequestDelegate> weakRequestor = obj();
if ([weakRequestor respondsToSelector:@selector(request:didFailWithError:)]) {
[weakRequestor request:self didFailWithError:error];
}
}];
}
}
comletion();
};
/* begin request */
[self _startRequestors:requestors];
if (config.enableRequestLog) {
IUNLog(@"🕑request start\n➡️request url : %@\n➡️request method : %@\n➡️request headers : %@\n➡️request parameters : %@", [config absoluteUrl], [config methodNameString], [config headers], [config parameters]);
}
if (config.fakeRequest) {
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(config.fakeRequestDelay * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
success(nil, nil);
});
} else {
switch (config.methodName) {
case IUNetworkingRequestMethodName_GET:
{
self.task = [sessionManager GET:[config absoluteUrl]
parameters:[config parameters]
progress:[config downloadProgress]
success:success
failure:failure];
} break;
case IUNetworkingRequestMethodName_POST:
{
self.task = [sessionManager POST:[config absoluteUrl]
parameters:[config parameters]
progress:[config uploadProgress]
success:success
failure:failure];
} break;
case IUNetworkingRequestMethodName_PUT:
{
self.task = [sessionManager PUT:[config absoluteUrl]
parameters:[config parameters]
success:success
failure:failure];
} break;
case IUNetworkingRequestMethodName_DELETE:
{
self.task = [sessionManager DELETE:[config absoluteUrl]
parameters:[config parameters]
success:success
failure:failure];
} break;
case IUNetworkingRequestMethodName_HEAD:
{
self.task = [sessionManager HEAD:[config absoluteUrl]
parameters:[config parameters]
success:^(NSURLSessionDataTask * _Nonnull task) {
success(task, nil);
} failure:failure];
} break;
case IUNetworkingRequestMethodName_FORM_DATA:
{
void(^block)(id<AFMultipartFormData>) = ^(id<AFMultipartFormData> _Nonnull formData) {
[config.files enumerateObjectsUsingBlock:^(IURequestUploadFile * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[formData appendPartWithFileData:obj.data
name:obj.name
fileName:obj.fileName
mimeType:obj.mimeType];
}];
};
self.task = [sessionManager POST:[config absoluteUrl]
parameters:[config parameters]
constructingBodyWithBlock:block
progress:[config uploadProgress]
success:success
failure:failure];
} break;
default:
self.task = nil;
comletion();
break;
}
}
}
- (void)_startRequestors:(NSArray <IUNetworkWeakRequestor> *)requestors {
[requestors enumerateObjectsUsingBlock:^(IUNetworkWeakRequestor _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSObject *requestor = (NSObject *)obj();
if ([requestor respondsToSelector:@selector(request:didStart:)]) {
[requestor request:self didStart:++requestor.requestingCount];
}
}];
}
- (void)_endRequestors:(NSArray <IUNetworkWeakRequestor> *)requestors {
[requestors enumerateObjectsUsingBlock:^(IUNetworkWeakRequestor _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSObject *requestor = (NSObject *)obj();
if ([requestor respondsToSelector:@selector(request:didComplete:)]) {
[requestor request:self didComplete:--requestor.requestingCount];
}
}];
}
@end
static char TAG_REQUEST_COUNT;
@implementation NSObject (IUNetworkRequestingCount)
- (void)setRequestingCount:(NSInteger)requestingCount {
objc_setAssociatedObject(self, &TAG_REQUEST_COUNT, @(requestingCount), OBJC_ASSOCIATION_RETAIN);
}
- (NSInteger)requestingCount {
return [objc_getAssociatedObject(self, &TAG_REQUEST_COUNT) integerValue];
}
@end
| {
"content_hash": "4bdba2098376228d75fa6074e8fb0a1e",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 318,
"avg_line_length": 41.97106109324759,
"alnum_prop": 0.6076763962307515,
"repo_name": "wengames/IUKit",
"id": "427de01fd220ae49618b11ee39983950114eccd2",
"size": "13149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IUKit/IUNetworking/IURequest.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1139108"
}
],
"symlink_target": ""
} |
require 'ffi-cairo'
module Cairo
module_function
def cairo_opengl_texture_size_ok?(width, height) # :nodoc
GL.glGetIntegerv(GL::GL_MAX_TEXTURE_SIZE, ID_CACHE.put_uint(0, 0))
max_size = ID_CACHE.read_uint
return true if (width < max_size) && (height < max_size)
GL.glGetTexLevelParameteriv(GL::GL_PROXY_TEXTURE_2D, 0, GL::GL_TEXTURE_WIDTH, ID_CACHE.put_uint(0, 0))
width = ID_CACHE.read_uint
return true if width > 0
p ['TEXTURE TOO LARGE for OpenGL!', width, height]
false
end
# un-optimized cairo_opengl_texture.
# cairo context -> callback -> opengl texture and cleanup -> texture id
#
# cairo_opengl_texture(256, 256){|cr,w,h,c|
# Cairo.cairo_move_to(cr, w/10, h/2);
# Cairo.cairo_set_font_size(cr, 10);
#
# Cairo.cairo_select_font_face(cr, "sans",
# Cairo::CAIRO_FONT_SLANT_NORMAL,
# Cairo::CAIRO_FONT_WEIGHT_NORMAL)
#
# Cairo.cairo_set_source_rgb(cr, 0, 0, 0)
# Cairo.cairo_show_text(cr, `uptime`.chomp);
# }
#
def cairo_opengl_texture(width, height, &block)
return 0 unless cairo_opengl_texture_size_ok?(width, height)
surface = Cairo.cairo_image_surface_create(
Cairo::CAIRO_FORMAT_ARGB32, width, height)
buf = Cairo.cairo_image_surface_get_data(surface)
cr = Cairo.cairo_create(surface)
return nil if Cairo.cairo_surface_status(surface) != 0
return nil if Cairo.cairo_status(cr) != 0
cr_h = Cairo::ContextHelper.new(cr)
block.call(cr, width, height, cr_h)
GL.glGenTextures(1, ID_CACHE.put_uint(0, 0))
tex_id = ID_CACHE.read_uint
GL.glEnable(GL::GL_TEXTURE_2D)
GL.glBindTexture(GL::GL_TEXTURE_2D, tex_id)
GL.glTexParameteri(GL::GL_TEXTURE_2D, GL::GL_TEXTURE_WRAP_S, GL::GL_REPEAT)
GL.glTexParameteri(GL::GL_TEXTURE_2D, GL::GL_TEXTURE_WRAP_T, GL::GL_REPEAT)
GL.glTexParameteri(GL::GL_TEXTURE_2D, GL::GL_TEXTURE_MIN_FILTER, GL::GL_LINEAR)
GL.glTexParameteri(GL::GL_TEXTURE_2D, GL::GL_TEXTURE_MAG_FILTER, GL::GL_LINEAR)
#GL.glTexParameteri(GL::GL_TEXTURE_2D, GL::GL_TEXTURE_MAG_FILTER, GL::GL_LINEAR_MIPMAP_LINEAR)
#GL.glTexEnvf(GL::GL_TEXTURE_ENV, GL::GL_TEXTURE_ENV_MODE, GL::GL_DECAL)
GL.glTexImage2D(GL::GL_TEXTURE_2D, 0, GL::GL_RGBA, width, height, 0, GL::GL_BGRA,
GL::GL_UNSIGNED_BYTE, buf)
#GL.glGenerateMipmap(GL::GL_TEXTURE_2D)
GL.glBindTexture(GL::GL_TEXTURE_2D, 0)
GL.glDisable(GL::GL_TEXTURE_2D)
Cairo.cairo_surface_destroy(surface)
Cairo.cairo_destroy(cr)
return tex_id
end
# un-optimized opengl cairo surface texture.
class OpenGL_Texture
attr_reader :width, :height
def initialize(width, height, &blk)
@width, @height = width, height
_w, _h = width.to_f, height.to_f
@verts = FFI::MemoryPointer.new(:float, 8).put_array_of_float(0, [0.0, _h, _w, _h, _w, 0.0, 0.0, 0.0]) # flipped
@tex_coords = FFI::MemoryPointer.new(:float, 8).put_array_of_float(0, [0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0])
@cb = blk
create_texture(@width, @height, &blk)
end
def recompile(w=nil, h=nil, &blk)
create_texture(w||@width, h||@height, &(blk || @cb))
end
alias :render :recompile
def clear!
GL.glDeleteTextures(1, Cairo::ID_CACHE.put_uint(0, @tex_id)) if @tex_id
end
def create_texture(w,h, &blk)
clear!; @tex_id = Cairo.cairo_opengl_texture(w, h, &blk)
end
def draw_at(x,y); draw(@width, @height, x, y); end
def draw(w=nil, h=nil, x=nil, y=nil) # old opengl api
return unless @tex_id
@verts.put_array_of_float(0, [0.0, h, w, h, w, 0.0, 0.0, 0.0]) if w && h
GL.glTranslatef(x, y, 0.0) if x && y
draw_texture_verts(@tex_id, @verts, @tex_coords)
end
def draw_texture_verts(texture_id, verts, texture_coords) # old opengl api
GL.glEnable(GL::GL_TEXTURE_2D)
GL.glBindTexture(GL::GL_TEXTURE_2D, texture_id)
GL.glEnableClientState(GL::GL_TEXTURE_COORD_ARRAY)
GL.glTexCoordPointer(2, GL::GL_FLOAT, 0, texture_coords)
GL.glEnableClientState(GL::GL_VERTEX_ARRAY)
GL.glVertexPointer(2, GL::GL_FLOAT, 0, verts)
GL.glDrawArrays(GL::GL_TRIANGLE_FAN, 0, 4)
GL.glDisableClientState(GL::GL_TEXTURE_COORD_ARRAY)
GL.glDisable(GL::GL_TEXTURE_2D)
end
end
class OpenGL_Surface
attr_accessor :callback
def initialize(width, height)
@texture = OpenGL_Texture.new(width, height){|cr,w,h,c|
@callback.call(cr,w,h,c) if @callback
}
end
def draw(cairo_parent_ctx=nil, x=0, y=0)
render
redraw(cairo_parent_ctx, x, y)
end
def surface; @texture; end
def render; @texture.recompile; end
def redraw(_=nil, x=0, y=0); @texture.draw_at(x, y); end
def destroy; @texture.clear!; end
end
end
| {
"content_hash": "0e6539707e47e9e9d7268f9e3fdb1f15",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 123,
"avg_line_length": 33.859154929577464,
"alnum_prop": 0.6329034941763727,
"repo_name": "lian/ffi-cairo",
"id": "f92e5a4551337c79fe034a2150891c4f92f00645",
"size": "4808",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/ffi-cairo/opengl-texture.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "75391"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using Zhua.Domain;
namespace Zhua.Website.Models
{
public class DroppointOrderViewModel
{
public int ShippedOrderCount { get; set; }
public int DpOrderCount { get; set; }
public int ReadyOrderCount { get; set; }
public int CarrierPickedUpCount { get; set; }
public List<Domain.Parcel> Parcels { get; set; }
public List<Guid> SelectedPrcelIds { get; set; }
public Domain.Parcel FilterObject { get; set; }
}
} | {
"content_hash": "a13e4ad0511f429ec749710a06055ab3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 30.88235294117647,
"alnum_prop": 0.659047619047619,
"repo_name": "kma14/Zhua",
"id": "3917d7d0702b58e82fe784ddda4d5449fda74dc3",
"size": "527",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Zhua.Website/Models/DroppointOrderViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "103"
},
{
"name": "C#",
"bytes": "314133"
},
{
"name": "CSS",
"bytes": "1805567"
},
{
"name": "HTML",
"bytes": "455306"
},
{
"name": "JavaScript",
"bytes": "13182890"
},
{
"name": "PHP",
"bytes": "4717"
},
{
"name": "PowerShell",
"bytes": "471"
},
{
"name": "Ruby",
"bytes": "1030"
},
{
"name": "Shell",
"bytes": "1490"
},
{
"name": "TSQL",
"bytes": "5734"
}
],
"symlink_target": ""
} |
from django.db.models import Q
from airmozilla.main.models import (
Approval,
Event,
SuggestedEvent,
EventTweet
)
def badges(request):
if not request.path.startswith('/manage/'):
return {}
context = {'badges': {}}
# Event manager badge for unprocessed events
if request.user.has_perm('main.change_event_others'):
events = Event.objects.filter(
Q(status=Event.STATUS_SUBMITTED) |
Q(approval__approved=False) |
Q(approval__processed=False)
).exclude(
status=Event.STATUS_INITIATED
).distinct().count()
if events > 0:
context['badges']['events'] = events
# Approval inbox badge
if request.user.has_perm('main.change_approval'):
approvals = (Approval.objects.filter(
group__in=request.user.groups.all(),
processed=False)
.exclude(event__status=Event.STATUS_REMOVED)
.count()
)
if approvals > 0:
context['badges']['approvals'] = approvals
# Unsent tweets
if request.user.has_perm('main.change'):
tweets = (
EventTweet.objects.filter(
Q(sent_date__isnull=True) | Q(error__isnull=False)
)
.count()
)
if tweets:
context['badges']['tweets'] = tweets
if request.user.has_perm('main.add_event'):
suggestions = (
SuggestedEvent.objects
.filter(accepted=None)
.exclude(submitted=None)
.count()
)
if suggestions > 0:
context['badges']['suggestions'] = suggestions
context['is_superuser'] = request.user.is_superuser
return context
| {
"content_hash": "a6cebe4dc5c84b8912537c8c6d8e0364",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 66,
"avg_line_length": 30.473684210526315,
"alnum_prop": 0.5630397236614854,
"repo_name": "tannishk/airmozilla",
"id": "47693a6e26052398901dc4a3fa7f94ab37a222e1",
"size": "1737",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "airmozilla/manage/context_processors.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "4527"
},
{
"name": "Brightscript",
"bytes": "67473"
},
{
"name": "CSS",
"bytes": "1713593"
},
{
"name": "HTML",
"bytes": "2398503"
},
{
"name": "JavaScript",
"bytes": "3164743"
},
{
"name": "Makefile",
"bytes": "13548"
},
{
"name": "Puppet",
"bytes": "6677"
},
{
"name": "Python",
"bytes": "3414215"
},
{
"name": "Ruby",
"bytes": "4978"
},
{
"name": "Shell",
"bytes": "3536"
},
{
"name": "Smarty",
"bytes": "2081"
}
],
"symlink_target": ""
} |
import classNames from "classnames";
import * as React from "react";
import { UserOnboardingTask as Task } from "../../../hooks/useUserOnboardingTasks";
import AccessibleButton from "../../views/elements/AccessibleButton";
import Heading from "../../views/typography/Heading";
interface Props {
task: Task;
completed?: boolean;
}
export function UserOnboardingTask({ task, completed = false }: Props) {
const title = typeof task.title === "function" ? task.title() : task.title;
const description = typeof task.description === "function" ? task.description() : task.description;
return (
<li className={classNames("mx_UserOnboardingTask", {
"mx_UserOnboardingTask_completed": completed,
})}>
<div
className="mx_UserOnboardingTask_number"
role="checkbox"
aria-disabled="true"
aria-checked={completed}
aria-labelledby={`mx_UserOnboardingTask_${task.id}`}
/>
<div
id={`mx_UserOnboardingTask_${task.id}`}
className="mx_UserOnboardingTask_content">
<Heading size="h4" className="mx_UserOnboardingTask_title">
{ title }
</Heading>
<div className="mx_UserOnboardingTask_description">
{ description }
</div>
</div>
{ task.action && (!task.action.hideOnComplete || !completed) && (
<AccessibleButton
element="a"
className="mx_UserOnboardingTask_action"
kind="primary_outline"
href={task.action.href}
target="_blank"
onClick={task.action.onClick}>
{ task.action.label }
</AccessibleButton>
) }
</li>
);
}
| {
"content_hash": "75772287c1505819afa82878b9914288",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 103,
"avg_line_length": 36.24528301886792,
"alnum_prop": 0.5356585111920874,
"repo_name": "matrix-org/matrix-react-sdk",
"id": "72c6617ff16616fead1917d7f11972501db1d03e",
"size": "2499",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/components/views/user-onboarding/UserOnboardingTask.tsx",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "984691"
},
{
"name": "Dockerfile",
"bytes": "1550"
},
{
"name": "HTML",
"bytes": "1043"
},
{
"name": "JavaScript",
"bytes": "33429"
},
{
"name": "Perl",
"bytes": "10945"
},
{
"name": "Python",
"bytes": "5019"
},
{
"name": "Shell",
"bytes": "5451"
},
{
"name": "TypeScript",
"bytes": "9543345"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
A manual of materia medica ed. 2, 414. 1853
#### Original name
null
### Remarks
null | {
"content_hash": "a21354e0830a99abac14ebdb6e40df04",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 13.23076923076923,
"alnum_prop": 0.6976744186046512,
"repo_name": "mdoering/backbone",
"id": "d17807db557637ee9a5693bb0d41daefdcc9e0ba",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fabales/Fabaceae/Myroxylon/Myroxylon balsamum/ Syn. Myrospermum pereirae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>schroeder: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.13.1 / schroeder - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
schroeder
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-10-11 10:42:07 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-11 10:42:07 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.13.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.2 Official release 4.10.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/schroeder"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Schroeder"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: Schroeder-Bernstein"
"keyword: set theory"
"category: Mathematics/Logic/Set theory"
]
authors: [ "Hugo herbelin" ]
bug-reports: "https://github.com/coq-contribs/schroeder/issues"
dev-repo: "git+https://github.com/coq-contribs/schroeder.git"
synopsis: "The Theorem of Schroeder-Bernstein"
description: """
Fraenkel's proof of Schroeder-Bernstein theorem on decidable sets
is formalized in a constructive variant of set theory based on
stratified universes (the one defined in the Ensemble library).
The informal proof can be found for instance in "Axiomatic Set Theory"
from P. Suppes."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/schroeder/archive/v8.7.0.tar.gz"
checksum: "md5=e45808e361e73cfd09dfad9ed47a47a6"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-schroeder.8.7.0 coq.8.13.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.13.1).
The following dependencies couldn't be met:
- coq-schroeder -> coq < 8.8~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-schroeder.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "75d444aae6f48a5dba705467621f7936",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 159,
"avg_line_length": 41.33918128654971,
"alnum_prop": 0.5480265949922195,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "e828f3d4d45c4a035b12dd453d7475f58640a917",
"size": "7094",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.10.2-2.0.6/released/8.13.1/schroeder/8.7.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
@protocol LocationWeatherUpdaterDelegate <NSObject>
- (void)startedRefreshing;
- (void)locationAndWeatherWereUpdated;
- (void)weatherForecastUpdated:(NSDictionary *)weatherForecast;
- (void)finishedRefreshWithError;
@end
@interface LocationWeatherUpdater : NSObject
@property (weak, nonatomic) id <LocationWeatherUpdaterDelegate> delegate;
// designated initializer
+ (instancetype)sharedInstance;
- (void)checkLocationAvailabilityAndStart;
- (void)getForecast;
- (void)refreshWeatherForecastForLocation:(NSDictionary *)location;
- (void)requestForGeneticForecastWithGeneticFile:(NSDictionary *)file withCompletion:(void (^)(NSString *geneticForecast))completion;
// - (void)fetchWeatherAndGeneticForecastsInBackgroundWithCompletion:(void (^)(UIBackgroundFetchResult fetchResult))completion;
@end
| {
"content_hash": "648693e4e901bc9d88b3506053f00f5a",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 133,
"avg_line_length": 31.03846153846154,
"alnum_prop": 0.8215613382899628,
"repo_name": "SequencingDOTcom/Weather-My-Way-RTP-App",
"id": "a6200cf0af96116dfd9d0a4f81a46e3335d52372",
"size": "959",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iOS/Weather-My-Way/LocationWeatherUpdater.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "104"
},
{
"name": "C#",
"bytes": "202203"
},
{
"name": "CSS",
"bytes": "178334"
},
{
"name": "JavaScript",
"bytes": "491882"
}
],
"symlink_target": ""
} |
import React, { PropTypes } from 'react';
import styles from './PlayerCard.scss';
const PlayerCard = ({
playerName,
ready = false,
button = null,
showReady = true,
}) => (
<section className={styles.PlayerCard}>
<div className={styles.PlayerCardAvatar} />
<h1 className={styles.PlayerCardName}>{ playerName }</h1>
<div>{ showReady && (ready ? 'Ready' : 'Not ready') }</div>
{ button && button }
</section>
);
PlayerCard.propTypes = {
playerName: PropTypes.string.isRequired,
ready: PropTypes.bool,
button: PropTypes.node,
showReady: PropTypes.bool,
};
export default PlayerCard;
| {
"content_hash": "808aa7baab429edc3ae8783555de9153",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 63,
"avg_line_length": 24.72,
"alnum_prop": 0.6699029126213593,
"repo_name": "inooid/react-redux-card-game",
"id": "0946aa43db063c35a2eb37697be5fc72952370c3",
"size": "618",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/PlayerCard/PlayerCard.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6855"
},
{
"name": "HTML",
"bytes": "185"
},
{
"name": "JavaScript",
"bytes": "80059"
}
],
"symlink_target": ""
} |
<readable><title>312427606_defa0dfaa8</title><content>
A blond-hair girl is eating a peach .
A girl eating a peach .
A girl eats a peach .
A little blond-haired girl enjoys eating a peach .
A young girl with blonde hair eating a peach .
</content></readable> | {
"content_hash": "07c432b962e797002acfbb407f363268",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 36.857142857142854,
"alnum_prop": 0.7558139534883721,
"repo_name": "kevint2u/audio-collector",
"id": "02064bc165748ae9815a0732ee186e0d4d2c3872",
"size": "258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "captions/xml/312427606_defa0dfaa8.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1015"
},
{
"name": "HTML",
"bytes": "18349"
},
{
"name": "JavaScript",
"bytes": "109819"
},
{
"name": "Python",
"bytes": "3260"
},
{
"name": "Shell",
"bytes": "4319"
}
],
"symlink_target": ""
} |
#include "renderer/CCRenderer.h"
#include <algorithm>
#include "renderer/CCTrianglesCommand.h"
#include "renderer/CCBatchCommand.h"
#include "renderer/CCCustomCommand.h"
#include "renderer/CCGroupCommand.h"
#include "renderer/CCPrimitiveCommand.h"
#include "renderer/CCMeshCommand.h"
#include "renderer/CCGLProgramCache.h"
#include "renderer/CCMaterial.h"
#include "renderer/CCTechnique.h"
#include "renderer/CCPass.h"
#include "renderer/CCRenderState.h"
#include "renderer/ccGLStateCache.h"
#include "base/CCConfiguration.h"
#include "base/CCDirector.h"
#include "base/CCEventDispatcher.h"
#include "base/CCEventListenerCustom.h"
#include "base/CCEventType.h"
#include "2d/CCScene.h"
NS_CC_BEGIN
// helper
static bool compareRenderCommand(RenderCommand* a, RenderCommand* b)
{
return a->getGlobalOrder() < b->getGlobalOrder();
}
// queue
RenderQueue::RenderQueue()
{
}
void RenderQueue::push_back(RenderCommand* command)
{
float z = command->getGlobalOrder();
if(z < 0)
{
_commands[QUEUE_GROUP::GLOBALZ_NEG].push_back(command);
}
else if(z > 0)
{
_commands[QUEUE_GROUP::GLOBALZ_POS].push_back(command);
}
else
{
_commands[QUEUE_GROUP::GLOBALZ_ZERO].push_back(command);
}
}
ssize_t RenderQueue::size() const
{
ssize_t result(0);
for(int index = 0; index < QUEUE_GROUP::QUEUE_COUNT; ++index)
{
result += _commands[index].size();
}
return result;
}
void RenderQueue::sort()
{
// Don't sort _queue0, it already comes sorted
std::sort(std::begin(_commands[QUEUE_GROUP::GLOBALZ_NEG]), std::end(_commands[QUEUE_GROUP::GLOBALZ_NEG]), compareRenderCommand);
std::sort(std::begin(_commands[QUEUE_GROUP::GLOBALZ_POS]), std::end(_commands[QUEUE_GROUP::GLOBALZ_POS]), compareRenderCommand);
}
RenderCommand* RenderQueue::operator[](ssize_t index) const
{
for(int queIndex = 0; queIndex < QUEUE_GROUP::QUEUE_COUNT; ++queIndex)
{
if(index < static_cast<ssize_t>(_commands[queIndex].size()))
return _commands[queIndex][index];
else
{
index -= _commands[queIndex].size();
}
}
CCASSERT(false, "invalid index");
return nullptr;
}
void RenderQueue::clear()
{
for(int i = 0; i < QUEUE_COUNT; ++i)
{
_commands[i].clear();
}
}
void RenderQueue::realloc(size_t reserveSize)
{
for(int i = 0; i < QUEUE_COUNT; ++i)
{
_commands[i] = std::vector<RenderCommand*>();
_commands[i].reserve(reserveSize);
}
}
void RenderQueue::saveRenderState()
{
_isDepthEnabled = glIsEnabled(GL_DEPTH_TEST) != GL_FALSE;
_isCullEnabled = glIsEnabled(GL_CULL_FACE) != GL_FALSE;
glGetBooleanv(GL_DEPTH_WRITEMASK, &_isDepthWrite);
CHECK_GL_ERROR_DEBUG();
}
void RenderQueue::restoreRenderState()
{
if (_isCullEnabled)
{
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(true);
}
else
{
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
}
if (_isDepthEnabled)
{
glEnable(GL_DEPTH_TEST);
RenderState::StateBlock::_defaultState->setDepthTest(true);
}
else
{
glDisable(GL_DEPTH_TEST);
RenderState::StateBlock::_defaultState->setDepthTest(false);
}
glDepthMask(_isDepthWrite);
RenderState::StateBlock::_defaultState->setDepthWrite(_isDepthEnabled);
CHECK_GL_ERROR_DEBUG();
}
//
//
//
static const int DEFAULT_RENDER_QUEUE = 0;
//
// constructors, destructor, init
//
Renderer::Renderer()
:_lastBatchedMeshCommand(nullptr)
,_filledVertex(0)
,_filledIndex(0)
,_glViewAssigned(false)
,_isRendering(false)
,_isDepthTestFor2D(false)
,_triBatchesToDraw(nullptr)
,_triBatchesToDrawCapacity(-1)
#if CC_ENABLE_CACHE_TEXTURE_DATA
,_cacheTextureListener(nullptr)
#endif
{
_groupCommandManager = new (std::nothrow) GroupCommandManager();
_commandGroupStack.push(DEFAULT_RENDER_QUEUE);
RenderQueue defaultRenderQueue;
_renderGroups.push_back(defaultRenderQueue);
_queuedTriangleCommands.reserve(BATCH_TRIAGCOMMAND_RESERVED_SIZE);
// default clear color
_clearColor = Color4F::BLACK;
// for the batched TriangleCommand
_triBatchesToDrawCapacity = 500;
_triBatchesToDraw = (TriBatchToDraw*) malloc(sizeof(_triBatchesToDraw[0]) * _triBatchesToDrawCapacity);
}
Renderer::~Renderer()
{
_renderGroups.clear();
_groupCommandManager->release();
glDeleteBuffers(2, _buffersVBO);
free(_triBatchesToDraw);
if (Configuration::getInstance()->supportsShareableVAO())
{
glDeleteVertexArrays(1, &_buffersVAO);
GL::bindVAO(0);
}
#if CC_ENABLE_CACHE_TEXTURE_DATA
Director::getInstance()->getEventDispatcher()->removeEventListener(_cacheTextureListener);
#endif
}
void Renderer::initGLView()
{
#if CC_ENABLE_CACHE_TEXTURE_DATA
_cacheTextureListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom* event){
/** listen the event that renderer was recreated on Android/WP8 */
this->setupBuffer();
});
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_cacheTextureListener, -1);
#endif
setupBuffer();
_glViewAssigned = true;
}
void Renderer::setupBuffer()
{
if(Configuration::getInstance()->supportsShareableVAO())
{
setupVBOAndVAO();
}
else
{
setupVBO();
}
}
void Renderer::setupVBOAndVAO()
{
//generate vbo and vao for trianglesCommand
glGenVertexArrays(1, &_buffersVAO);
GL::bindVAO(_buffersVAO);
glGenBuffers(2, &_buffersVBO[0]);
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * VBO_SIZE, _verts, GL_DYNAMIC_DRAW);
// vertices
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, vertices));
// colors
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, colors));
// tex coords
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V3F_C4B_T2F), (GLvoid*) offsetof( V3F_C4B_T2F, texCoords));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * INDEX_VBO_SIZE, _indices, GL_STATIC_DRAW);
// Must unbind the VAO before changing the element buffer.
GL::bindVAO(0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
CHECK_GL_ERROR_DEBUG();
}
void Renderer::setupVBO()
{
glGenBuffers(2, &_buffersVBO[0]);
// Issue #15652
// Should not initialzie VBO with a large size (VBO_SIZE=65536),
// it may cause low FPS on some Android devices like LG G4 & Nexus 5X.
// It's probably because some implementations of OpenGLES driver will
// copy the whole memory of VBO which initialzied at the first time
// once glBufferData/glBufferSubData is invoked.
// For more discussion, please refer to https://github.com/cocos2d/cocos2d-x/issues/15652
// mapBuffers();
}
void Renderer::mapBuffers()
{
// Avoid changing the element buffer for whatever VAO might be bound.
GL::bindVAO(0);
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * VBO_SIZE, _verts, GL_DYNAMIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * INDEX_VBO_SIZE, _indices, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
CHECK_GL_ERROR_DEBUG();
}
void Renderer::addCommand(RenderCommand* command)
{
int renderQueue =_commandGroupStack.top();
addCommand(command, renderQueue);
}
void Renderer::addCommand(RenderCommand* command, int renderQueue)
{
CCASSERT(!_isRendering, "Cannot add command while rendering");
CCASSERT(renderQueue >=0, "Invalid render queue");
CCASSERT(command->getType() != RenderCommand::Type::UNKNOWN_COMMAND, "Invalid Command Type");
_renderGroups[renderQueue].push_back(command);
}
void Renderer::pushGroup(int renderQueueID)
{
CCASSERT(!_isRendering, "Cannot change render queue while rendering");
_commandGroupStack.push(renderQueueID);
}
void Renderer::popGroup()
{
CCASSERT(!_isRendering, "Cannot change render queue while rendering");
_commandGroupStack.pop();
}
int Renderer::createRenderQueue()
{
RenderQueue newRenderQueue;
_renderGroups.push_back(newRenderQueue);
return (int)_renderGroups.size() - 1;
}
void Renderer::processRenderCommand(RenderCommand* command)
{
CCASSERT(command, "Renderer::processRenderCommand:command should not null");
if(command == nullptr)
{
return;
}
auto commandType = command->getType();
if( RenderCommand::Type::TRIANGLES_COMMAND == commandType)
{
// flush other queues
flush3D();
auto cmd = static_cast<TrianglesCommand*>(command);
// flush own queue when buffer is full
if(_filledVertex + cmd->getVertexCount() > VBO_SIZE || _filledIndex + cmd->getIndexCount() > INDEX_VBO_SIZE)
{
CCASSERT(cmd->getVertexCount()>= 0 && cmd->getVertexCount() < VBO_SIZE, "VBO for vertex is not big enough, please break the data down or use customized render command");
CCASSERT(cmd->getIndexCount()>= 0 && cmd->getIndexCount() < INDEX_VBO_SIZE, "VBO for index is not big enough, please break the data down or use customized render command");
drawBatchedTriangles();
}
// queue it
_queuedTriangleCommands.push_back(cmd);
_filledIndex += cmd->getIndexCount();
_filledVertex += cmd->getVertexCount();
}
else if (RenderCommand::Type::MESH_COMMAND == commandType)
{
flush2D();
auto cmd = static_cast<MeshCommand*>(command);
if (cmd->isSkipBatching() || _lastBatchedMeshCommand == nullptr || _lastBatchedMeshCommand->getMaterialID() != cmd->getMaterialID())
{
flush3D();
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_MESH_COMMAND");
if(cmd->isSkipBatching())
{
// XXX: execute() will call bind() and unbind()
// but unbind() shouldn't be call if the next command is a MESH_COMMAND with Material.
// Once most of cocos2d-x moves to Pass/StateBlock, only bind() should be used.
cmd->execute();
}
else
{
cmd->preBatchDraw();
cmd->batchDraw();
_lastBatchedMeshCommand = cmd;
}
}
else
{
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_MESH_COMMAND");
cmd->batchDraw();
}
}
else if(RenderCommand::Type::GROUP_COMMAND == commandType)
{
flush();
int renderQueueID = ((GroupCommand*) command)->getRenderQueueID();
CCGL_DEBUG_PUSH_GROUP_MARKER("RENDERER_GROUP_COMMAND");
visitRenderQueue(_renderGroups[renderQueueID]);
CCGL_DEBUG_POP_GROUP_MARKER();
}
else if(RenderCommand::Type::CUSTOM_COMMAND == commandType)
{
flush();
auto cmd = static_cast<CustomCommand*>(command);
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_CUSTOM_COMMAND");
cmd->execute();
}
else if(RenderCommand::Type::BATCH_COMMAND == commandType)
{
flush();
auto cmd = static_cast<BatchCommand*>(command);
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_BATCH_COMMAND");
cmd->execute();
}
else if(RenderCommand::Type::PRIMITIVE_COMMAND == commandType)
{
flush();
auto cmd = static_cast<PrimitiveCommand*>(command);
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_PRIMITIVE_COMMAND");
cmd->execute();
}
else
{
CCLOGERROR("Unknown commands in renderQueue");
}
}
void Renderer::visitRenderQueue(RenderQueue& queue)
{
queue.saveRenderState();
//
//Process Global-Z < 0 Objects
//
const auto& zNegQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::GLOBALZ_NEG);
if (zNegQueue.size() > 0)
{
if(_isDepthTestFor2D)
{
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(true);
}
else
{
glDisable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(false);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zNegQueue.cbegin(); it != zNegQueue.cend(); ++it)
{
processRenderCommand(*it);
}
flush();
}
//
//Process Opaque Object
//
const auto& opaqueQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::OPAQUE_3D);
if (opaqueQueue.size() > 0)
{
//Clear depth to achieve layered rendering
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glDisable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(false);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = opaqueQueue.cbegin(); it != opaqueQueue.cend(); ++it)
{
processRenderCommand(*it);
}
flush();
}
//
//Process 3D Transparent object
//
const auto& transQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::TRANSPARENT_3D);
if (transQueue.size() > 0)
{
glEnable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
glEnable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
RenderState::StateBlock::_defaultState->setCullFace(true);
for (auto it = transQueue.cbegin(); it != transQueue.cend(); ++it)
{
processRenderCommand(*it);
}
flush();
}
//
//Process Global-Z = 0 Queue
//
const auto& zZeroQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::GLOBALZ_ZERO);
if (zZeroQueue.size() > 0)
{
if(_isDepthTestFor2D)
{
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(true);
}
else
{
glDisable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(false);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zZeroQueue.cbegin(); it != zZeroQueue.cend(); ++it)
{
processRenderCommand(*it);
}
flush();
}
//
//Process Global-Z > 0 Queue
//
const auto& zPosQueue = queue.getSubQueue(RenderQueue::QUEUE_GROUP::GLOBALZ_POS);
if (zPosQueue.size() > 0)
{
if(_isDepthTestFor2D)
{
glEnable(GL_DEPTH_TEST);
glDepthMask(true);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthWrite(true);
RenderState::StateBlock::_defaultState->setBlend(true);
}
else
{
glDisable(GL_DEPTH_TEST);
glDepthMask(false);
glEnable(GL_BLEND);
RenderState::StateBlock::_defaultState->setDepthTest(false);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
RenderState::StateBlock::_defaultState->setBlend(true);
}
glDisable(GL_CULL_FACE);
RenderState::StateBlock::_defaultState->setCullFace(false);
for (auto it = zPosQueue.cbegin(); it != zPosQueue.cend(); ++it)
{
processRenderCommand(*it);
}
flush();
}
queue.restoreRenderState();
}
void Renderer::render()
{
//Uncomment this once everything is rendered by new renderer
//glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//TODO: setup MVP
_isRendering = true;
if (_glViewAssigned)
{
//Process render commands
//1. Sort render commands based on ID
for (auto &renderqueue : _renderGroups)
{
renderqueue.sort();
}
visitRenderQueue(_renderGroups[0]);
}
clean();
_isRendering = false;
}
void Renderer::clean()
{
// Clear render group
for (size_t j = 0 ; j < _renderGroups.size(); j++)
{
//commands are owned by nodes
// for (const auto &cmd : _renderGroups[j])
// {
// cmd->releaseToCommandPool();
// }
_renderGroups[j].clear();
}
// Clear batch commands
_queuedTriangleCommands.clear();
_filledVertex = 0;
_filledIndex = 0;
_lastBatchedMeshCommand = nullptr;
}
void Renderer::clear()
{
//Enable Depth mask to make sure glClear clear the depth buffer correctly
glDepthMask(true);
glClearColor(_clearColor.r, _clearColor.g, _clearColor.b, _clearColor.a);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDepthMask(false);
RenderState::StateBlock::_defaultState->setDepthWrite(false);
}
void Renderer::setDepthTest(bool enable)
{
if (enable)
{
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
RenderState::StateBlock::_defaultState->setDepthTest(true);
RenderState::StateBlock::_defaultState->setDepthFunction(RenderState::DEPTH_LEQUAL);
// glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
}
else
{
glDisable(GL_DEPTH_TEST);
RenderState::StateBlock::_defaultState->setDepthTest(false);
}
_isDepthTestFor2D = enable;
CHECK_GL_ERROR_DEBUG();
}
void Renderer::fillVerticesAndIndices(const TrianglesCommand* cmd)
{
memcpy(&_verts[_filledVertex], cmd->getVertices(), sizeof(V3F_C4B_T2F) * cmd->getVertexCount());
// fill vertex, and convert them to world coordinates
const Mat4& modelView = cmd->getModelView();
for(ssize_t i=0; i < cmd->getVertexCount(); ++i)
{
modelView.transformPoint(&(_verts[i + _filledVertex].vertices));
}
// fill index
const unsigned short* indices = cmd->getIndices();
for(ssize_t i=0; i< cmd->getIndexCount(); ++i)
{
_indices[_filledIndex + i] = _filledVertex + indices[i];
}
_filledVertex += cmd->getVertexCount();
_filledIndex += cmd->getIndexCount();
}
void Renderer::drawBatchedTriangles()
{
if(_queuedTriangleCommands.empty())
return;
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_BATCH_TRIANGLES");
_filledVertex = 0;
_filledIndex = 0;
/************** 1: Setup up vertices/indices *************/
_triBatchesToDraw[0].offset = 0;
_triBatchesToDraw[0].indicesToDraw = 0;
_triBatchesToDraw[0].cmd = nullptr;
int batchesTotal = 0;
int prevMaterialID = -1;
bool firstCommand = true;
for(auto it = std::begin(_queuedTriangleCommands); it != std::end(_queuedTriangleCommands); ++it)
{
const auto& cmd = *it;
auto currentMaterialID = cmd->getMaterialID();
const bool batchable = !cmd->isSkipBatching();
fillVerticesAndIndices(cmd);
// in the same batch ?
if (batchable && (prevMaterialID == currentMaterialID || firstCommand))
{
CC_ASSERT(firstCommand || _triBatchesToDraw[batchesTotal].cmd->getMaterialID() == cmd->getMaterialID() && "argh... error in logic");
_triBatchesToDraw[batchesTotal].indicesToDraw += cmd->getIndexCount();
_triBatchesToDraw[batchesTotal].cmd = cmd;
}
else
{
// is this the first one?
if (!firstCommand) {
batchesTotal++;
_triBatchesToDraw[batchesTotal].offset = _triBatchesToDraw[batchesTotal-1].offset + _triBatchesToDraw[batchesTotal-1].indicesToDraw;
}
_triBatchesToDraw[batchesTotal].cmd = cmd;
_triBatchesToDraw[batchesTotal].indicesToDraw = (int) cmd->getIndexCount();
// is this a single batch ? Prevent creating a batch group then
if (!batchable)
currentMaterialID = -1;
}
// capacity full ?
if (batchesTotal + 1 >= _triBatchesToDrawCapacity) {
_triBatchesToDrawCapacity *= 1.4;
_triBatchesToDraw = (TriBatchToDraw*) realloc(_triBatchesToDraw, sizeof(_triBatchesToDraw[0]) * _triBatchesToDrawCapacity);
}
prevMaterialID = currentMaterialID;
firstCommand = false;
}
batchesTotal++;
/************** 2: Copy vertices/indices to GL objects *************/
auto conf = Configuration::getInstance();
if (conf->supportsShareableVAO() && conf->supportsMapBuffer())
{
//Bind VAO
GL::bindVAO(_buffersVAO);
//Set VBO data
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
// option 1: subdata
// glBufferSubData(GL_ARRAY_BUFFER, sizeof(_quads[0])*start, sizeof(_quads[0]) * n , &_quads[start] );
// option 2: data
// glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex, _verts, GL_STATIC_DRAW);
// option 3: orphaning + glMapBuffer
// FIXME: in order to work as fast as possible, it must "and the exact same size and usage hints it had before."
// source: https://www.opengl.org/wiki/Buffer_Object_Streaming#Explicit_multiple_buffering
// so most probably we won't have any benefit of using it
glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex, nullptr, GL_STATIC_DRAW);
void *buf = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
memcpy(buf, _verts, sizeof(_verts[0])* _filledVertex);
glUnmapBuffer(GL_ARRAY_BUFFER);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _filledIndex, _indices, GL_STATIC_DRAW);
}
else
{
// Client Side Arrays
#define kQuadSize sizeof(_verts[0])
glBindBuffer(GL_ARRAY_BUFFER, _buffersVBO[0]);
glBufferData(GL_ARRAY_BUFFER, sizeof(_verts[0]) * _filledVertex , _verts, GL_DYNAMIC_DRAW);
GL::enableVertexAttribs(GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
// vertices
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, vertices));
// colors
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, colors));
// tex coords
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, kQuadSize, (GLvoid*) offsetof(V3F_C4B_T2F, texCoords));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _buffersVBO[1]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(_indices[0]) * _filledIndex, _indices, GL_STATIC_DRAW);
}
/************** 3: Draw *************/
for (int i=0; i<batchesTotal; ++i)
{
CC_ASSERT(_triBatchesToDraw[i].cmd && "Invalid batch");
_triBatchesToDraw[i].cmd->useMaterial();
glDrawElements(GL_TRIANGLES, (GLsizei) _triBatchesToDraw[i].indicesToDraw, GL_UNSIGNED_SHORT, (GLvoid*) (_triBatchesToDraw[i].offset*sizeof(_indices[0])) );
_drawnBatches++;
_drawnVertices += _triBatchesToDraw[i].indicesToDraw;
}
/************** 4: Cleanup *************/
if (Configuration::getInstance()->supportsShareableVAO())
{
//Unbind VAO
GL::bindVAO(0);
}
else
{
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
_queuedTriangleCommands.clear();
_filledVertex = 0;
_filledIndex = 0;
}
void Renderer::flush()
{
flush2D();
flush3D();
}
void Renderer::flush2D()
{
flushTriangles();
}
void Renderer::flush3D()
{
if (_lastBatchedMeshCommand)
{
CCGL_DEBUG_INSERT_EVENT_MARKER("RENDERER_BATCH_MESH");
_lastBatchedMeshCommand->postBatchDraw();
_lastBatchedMeshCommand = nullptr;
}
}
void Renderer::flushTriangles()
{
drawBatchedTriangles();
}
// helpers
bool Renderer::checkVisibility(const Mat4 &transform, const Size &size)
{
auto scene = Director::getInstance()->getRunningScene();
//If draw to Rendertexture, return true directly.
// only cull the default camera. The culling algorithm is valid for default camera.
if (!scene)
return true;
auto director = Director::getInstance();
Rect visiableRect(director->getVisibleOrigin(), director->getVisibleSize());
// transform center point to screen space
float hSizeX = size.width/2;
float hSizeY = size.height/2;
Vec3 v3p(hSizeX, hSizeY, 0);
transform.transformPoint(&v3p);
// Vec2 v2p = Camera::getVisitingCamera()->projectGL(v3p);
// convert content size to world coordinates
float wshw = std::max(fabsf(hSizeX * transform.m[0] + hSizeY * transform.m[4]), fabsf(hSizeX * transform.m[0] - hSizeY * transform.m[4]));
float wshh = std::max(fabsf(hSizeX * transform.m[1] + hSizeY * transform.m[5]), fabsf(hSizeX * transform.m[1] - hSizeY * transform.m[5]));
// enlarge visible rect half size in screen coord
visiableRect.origin.x -= wshw;
visiableRect.origin.y -= wshh;
visiableRect.size.width += wshw * 2;
visiableRect.size.height += wshh * 2;
// bool ret = visiableRect.containsPoint(v2p);
return true;
}
void Renderer::setClearColor(const Color4F &clearColor)
{
_clearColor = clearColor;
}
NS_CC_END
| {
"content_hash": "1b6e0a142414af606d5a812b5572429f",
"timestamp": "",
"source": "github",
"line_count": 897,
"max_line_length": 184,
"avg_line_length": 30.360089186176143,
"alnum_prop": 0.6329453236881725,
"repo_name": "MaiyaT/cocosStudy",
"id": "e1ca74f46c1ef45400eb30d90ff5bb615a68bae7",
"size": "28506",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Eliminate/builds/jsb-default/frameworks/cocos2d-x/cocos/renderer/CCRenderer.cpp",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2671"
},
{
"name": "C",
"bytes": "1177770"
},
{
"name": "C++",
"bytes": "16818706"
},
{
"name": "CMake",
"bytes": "1514"
},
{
"name": "CSS",
"bytes": "5360"
},
{
"name": "GLSL",
"bytes": "39609"
},
{
"name": "HTML",
"bytes": "3052"
},
{
"name": "Java",
"bytes": "363578"
},
{
"name": "JavaScript",
"bytes": "3068209"
},
{
"name": "Makefile",
"bytes": "34618"
},
{
"name": "Objective-C",
"bytes": "460328"
},
{
"name": "Objective-C++",
"bytes": "426350"
},
{
"name": "PLSQL",
"bytes": "44813"
},
{
"name": "Python",
"bytes": "293153"
},
{
"name": "Shell",
"bytes": "3166"
}
],
"symlink_target": ""
} |
import unittest
from osrf_pycommon.terminal_color import ansi_re
class TestTerminalColorAnsiRe(unittest.TestCase):
test_str = "\x1b[31mred \033[1mbold red \x1b[0mnormal \x1b[41mred bg"
def test_split_by_ansi_escape_sequence(self):
split_ansi = ansi_re.split_by_ansi_escape_sequence
expected = [
"", "\x1b[31m", "red ", "\x1b[1m", "bold red ", "\x1b[0m",
"normal ", "\x1b[41m", "red bg"
]
self.assertEqual(expected, split_ansi(self.test_str, True))
expected = ["", "red ", "bold red ", "normal ", "red bg"]
self.assertEqual(expected, split_ansi(self.test_str, False))
def test_remove_ansi_escape_senquences(self):
remove_ansi = ansi_re.remove_ansi_escape_senquences
expected = "red bold red normal red bg"
self.assertEqual(expected, remove_ansi(self.test_str))
def test_remove_ansi_escape_senquences_false_positives(self):
remove_ansi = ansi_re.remove_ansi_escape_senquences
false_positive = "Should not match: \1xb[1234m \033[m \1xb[3Om"
self.assertEqual(false_positive, remove_ansi(false_positive))
| {
"content_hash": "a2c07e52d8c3d05fb896cdb40a4f25b1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 73,
"avg_line_length": 42.2962962962963,
"alnum_prop": 0.648861646234676,
"repo_name": "ros2/ci",
"id": "4e722cc9b8bd12033e90e3504b80087702f6b140",
"size": "1142",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ros2_batch_job/vendor/osrf_pycommon/tests/unit/test_terminal_color/test_ansi_re.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "12508"
},
{
"name": "EmberScript",
"bytes": "63174"
},
{
"name": "Python",
"bytes": "104879"
},
{
"name": "Ruby",
"bytes": "1942"
},
{
"name": "Shell",
"bytes": "4846"
}
],
"symlink_target": ""
} |
namespace Google.Cloud.Domains.V1Beta1.Snippets
{
// [START domains_v1beta1_generated_Domains_DeleteRegistration_async]
using Google.Cloud.Domains.V1Beta1;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System.Threading.Tasks;
public sealed partial class GeneratedDomainsClientSnippets
{
/// <summary>Snippet for DeleteRegistrationAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task DeleteRegistrationRequestObjectAsync()
{
// Create client
DomainsClient domainsClient = await DomainsClient.CreateAsync();
// Initialize request argument(s)
DeleteRegistrationRequest request = new DeleteRegistrationRequest
{
RegistrationName = RegistrationName.FromProjectLocationRegistration("[PROJECT]", "[LOCATION]", "[REGISTRATION]"),
};
// Make the request
Operation<Empty, OperationMetadata> response = await domainsClient.DeleteRegistrationAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, OperationMetadata> retrievedResponse = await domainsClient.PollOnceDeleteRegistrationAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
}
}
// [END domains_v1beta1_generated_Domains_DeleteRegistration_async]
}
| {
"content_hash": "139f41ea643e06a4b1da7938cd7afd42",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 135,
"avg_line_length": 50.673469387755105,
"alnum_prop": 0.6737817156665324,
"repo_name": "googleapis/google-cloud-dotnet",
"id": "9c457a323b8514a21121cb23b6ab5d7a58ab2438",
"size": "3105",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "apis/Google.Cloud.Domains.V1Beta1/Google.Cloud.Domains.V1Beta1.GeneratedSnippets/DomainsClient.DeleteRegistrationRequestObjectAsyncSnippet.g.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "767"
},
{
"name": "C#",
"bytes": "319820004"
},
{
"name": "Dockerfile",
"bytes": "3415"
},
{
"name": "PowerShell",
"bytes": "3303"
},
{
"name": "Python",
"bytes": "2744"
},
{
"name": "Shell",
"bytes": "65881"
}
],
"symlink_target": ""
} |
<?php
//http://www.wpbeginner.com/wp-tutorials/how-to-set-default-admin-color-scheme-for-new-users-in-wordpress/
if (!defined('ABSPATH'))
exit; // Exit if accessed directly
if (!class_exists('Ultimate_Color_Schemes')) {
class Ultimate_Color_Schemes {
var $version = '1.0';
var $name = 'Ultimate Color Schemes';
var $dir_name = 'ultimate-color-schemes';
function WP_Constructor() {
$this->__construct();
}
function __construct() {
$this->name = __('Ultimate Color Schemes', 'ub');
//Custom header actions
add_action('admin_enqueue_scripts', array(&$this, 'admin_header_actions'));
add_action('admin_init', array(&$this, 'admin_custom_color_scheme_option'), 0);
// Admin interface
add_action('ultimatebranding_settings_menu_ultimate_color_schemes', array(&$this, 'manage_output'));
add_filter('ultimatebranding_settings_menu_ultimate_color_schemes_process', array(&$this, 'process'));
add_action('admin_head', array(&$this, 'wp_color_scheme_settings'), 0);
add_filter('get_user_option_admin_color', array(&$this, 'force_admin_scheme_color'), 5, 3);
add_action('user_register', array(&$this, 'set_default_admin_color'));
add_action('wpmu_new_user', array(&$this, 'set_default_admin_color'));
}
function set_default_admin_color($user_id) {
$default_color = ub_get_option('ucs_default_color_scheme', false);
if ($default_color && $default_color !== 'false') {
$args = array(
'ID' => $user_id,
'admin_color' => $default_color
);
wp_update_user($args);
}
}
function force_admin_scheme_color($result, $option, $user) {
global $_wp_admin_css_colors;
$force_color = ub_get_option('ucs_force_color_scheme', false);
if ($force_color && $force_color !== 'false') {
return $force_color;
} else {
return $result;
}
}
function wp_color_scheme_settings() {
global $_wp_admin_css_colors;
$screen = get_current_screen();
if ($screen->base == 'profile' || $screen->base == 'profile-network') {//remove color schemes only on Profile page
$visible_colors = ub_get_option('ucs_visible_color_schemes', false);
foreach ($_wp_admin_css_colors as $color => $color_info) {
if ($visible_colors == false) {
//do not remove colors
} else {
if (is_array($visible_colors)) {
if (!in_array($color, $visible_colors)) {
unset($_wp_admin_css_colors[$color]);
}
}
}
}
}
}
function admin_custom_color_scheme_option() {
if (isset($_GET['custom-color-scheme'])) {
$this->set_custom_color_scheme();
exit;
}
/* Custom scheme */
wp_admin_css_color('wpi_custom_scheme', ub_get_option('ucs_color_scheme_name', 'Ultimate'), admin_url('?custom-color-scheme', __FILE__), array(ub_get_option('ucs_admin_menu_background_color', '#45B29D'), ub_get_option('ucs_admin_menu_submenu_background_color', '#334D5C'), ub_get_option('ucs_admin_menu_current_background_color', '#EFC94C'), ub_get_option('ucs_table_view_switch_icon_color', '#45B29D'), ub_get_option('ucs_table_alternate_row_color', '#E5ECF0')));
}
function set_custom_color_scheme() {
header("Content-type: text/css");
require_once(plugin_dir_path(__FILE__) . '/' . $this->dir_name . '-files/custom-color-scheme.php');
}
function admin_header_actions() {
global $wp_version;
wp_enqueue_style('wp-color-picker');
wp_enqueue_script( 'wp-color-picker');
wp_enqueue_script('ucs-admin', plugins_url('/' . $this->dir_name . '-files/js/admin.js', __FILE__), array('wp-color-picker'), false, true);
}
function process() {
global $plugin_page;
if (isset($_GET['reset']) && isset($_GET['page']) && $_GET['page'] == 'branding') {
$colors = $this->colors();
foreach ($colors as $color_section => $color_array) {
foreach ($color_array as $property => $value) {
ub_update_option($property, $color_array[$property]['default']);
}
}
wp_redirect('admin.php?page=branding&tab=ultimate-color-schemes');
} elseif (isset($_POST['ucs_color_scheme_name'])) {
foreach ($_POST as $key => $value) {
if (preg_match('/^ucs_/', $key)) {
ub_update_option($key, $value);
}
}
}
return true;
}
function colors() {
$colors = array(
'General' => array(
'ucs_background_color' => array(
'title' => 'Background',
'default' => '#f1f1f1',
'value' => ub_get_option('ucs_background_color', '#f1f1f1')
),
),
'Links' => array(
'ucs_default_link_color' => array(
'title' => 'Default Link',
'default' => '#45B29D',
'value' => ub_get_option('ucs_default_link_color', '#45B29D')
),
'ucs_default_link_hover_color' => array(
'title' => 'Default Link Hover',
'default' => '#E27A3F',
'value' => ub_get_option('ucs_default_link_hover_color', '#E27A3F')
),
'ucs_delete_trash_spam_link_color' => array(
'title' => 'Delete / Trash / Spam Link',
'default' => '#DF5A49',
'value' => ub_get_option('ucs_delete_trash_spam_link_color', '#DF5A49')
),
'ucs_delete_trash_spam_link_hover_color' => array(
'title' => 'Delete / Trash / Spam Link Hover',
'default' => '#DF5A49',
'value' => ub_get_option('ucs_delete_trash_spam_link_hover_color', '#E27A3F')
),
'ucs_inactive_plugins_color' => array(
'title' => 'Inactive Plugin Link',
'default' => '#888',
'value' => ub_get_option('ucs_inactive_plugins_color', '#888')
),
),
'Forms' => array(
'ucs_checkbox_radio_color' => array(
'title' => 'Checkbox / Radio Button',
'default' => '#45B29D',
'value' => ub_get_option('ucs_checkbox_radio_color', '#45B29D')
),
),
'Core UI' => array(
'ucs_primary_button_background_color' => array(
'title' => 'Primary Button Background',
'default' => '#334D5C',
'value' => ub_get_option('ucs_primary_button_background_color', '#334D5C')
),
'ucs_primary_button_text_color' => array(
'title' => 'Primary Button Text',
'default' => '#ffffff',
'value' => ub_get_option('ucs_primary_button_text_color', '#ffffff')
),
'ucs_primary_button_hover_background_color' => array(
'title' => 'Primary Button Hover Background',
'default' => '#EFC94C',
'value' => ub_get_option('ucs_primary_button_hover_background_color', '#EFC94C')
),
'ucs_primary_button_hover_text_color' => array(
'title' => 'Primary Button Hover Text',
'default' => '#ffffff',
'value' => ub_get_option('ucs_primary_button_hover_text_color', '#ffffff')
),
'ucs_disabled_button_background_color' => array(
'title' => 'Disabled Button Background',
'default' => '#cccccc',
'value' => ub_get_option('ucs_disabled_button_background_color', '#cccccc')
),
'ucs_disabled_button_text_color' => array(
'title' => 'Disabled Button Text',
'default' => '#000',
'value' => ub_get_option('ucs_disabled_button_text_color', '#000')
),
),
'List Tables' => array(
'ucs_table_list_hover_color' => array(
'title' => 'Pagination / Button / Icon Hover',
'default' => '#45B29D',
'value' => ub_get_option('ucs_table_list_hover_color', '#45B29D')
),
'ucs_table_view_switch_icon_color' => array(
'title' => 'View Switch Icon',
'default' => '#45B29D',
'value' => ub_get_option('ucs_table_view_switch_icon_color', '#45B29D')
),
'ucs_table_view_switch_icon_hover_color' => array(
'title' => 'View Switch Icon',
'default' => '#d46f15',
'value' => ub_get_option('ucs_table_view_switch_icon_color', '#d46f15')
),
'ucs_table_post_comment_icon_color' => array(
'title' => 'Post Comment Icon Hover',
'default' => '#45B29D',
'value' => ub_get_option('ucs_table_post_comment_icon_color', '#45B29D')
),
'ucs_table_post_comment_strong_icon_color' => array(
'title' => 'Post Comment Strong Icon',
'default' => '#d46f15',
'value' => ub_get_option('ucs_table_post_comment_strong_icon_color', '#d46f15')
),
'ucs_table_alternate_row_color' => array(
'title' => 'Alternate row',
'default' => '#E5ECF0',
'value' => ub_get_option('ucs_table_alternate_row_color', '#E5ECF0')
),
),
'Admin Menu' => array(
'ucs_admin_menu_background_color' => array(
'title' => 'Admin Menu Background',
'default' => '#45B29D',
'value' => ub_get_option('ucs_admin_menu_background_color', '#45B29D')
),
'ucs_admin_menu_link_color' => array(
'title' => 'Admin Menu Links',
'default' => '#FFFFFF',
'value' => ub_get_option('ucs_admin_menu_link_color', '#FFFFFF')
),
'ucs_admin_menu_link_hover_color' => array(
'title' => 'Admin Menu Links Hover',
'default' => '#FFFFFF',
'value' => ub_get_option('ucs_admin_menu_link_hover_color', '#FFFFFF')
),
'ucs_admin_menu_link_hover_background_color' => array(
'title' => 'Admin Menu Links Hover Background',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_menu_link_hover_background_color', '#334D5C')
),
'ucs_admin_menu_current_link_color' => array(
'title' => 'Admin Menu Link (Currently Selected)',
'default' => '#FFFFFF',
'value' => ub_get_option('ucs_admin_menu_current_link_color', '#FFFFFF')
),
'ucs_admin_menu_current_link_hover_color' => array(
'title' => 'Admin Menu Link Hover (Currently Selected)',
'default' => '#FFFFFF',
'value' => ub_get_option('ucs_admin_menu_current_link_hover_color', '#FFFFFF')
),
'ucs_admin_menu_current_background_color' => array(
'title' => 'Admin Menu Background (Currently Selected)',
'default' => '#EFC94C',
'value' => ub_get_option('ucs_admin_menu_current_background_color', '#EFC94C')
),
'ucs_admin_menu_current_icons_color' => array(
'title' => 'Admin Menu Icons (Currently Selected)',
'default' => '#FFF',
'value' => ub_get_option('ucs_admin_menu_current_icons_color', '#FFF')
),
'ucs_admin_menu_icons_color' => array(
'title' => 'Admin Menu Icons',
'default' => '#FFF',
'value' => ub_get_option('ucs_admin_menu_icons_color', '#FFF')
),
'ucs_admin_menu_submenu_background_color' => array(
'title' => 'Admin Submenu',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_menu_submenu_background_color', '#334D5C')
),
'ucs_admin_menu_submenu_link_color' => array(
'title' => 'Admin Submenu Links',
'default' => '#cbc5d3',
'value' => ub_get_option('ucs_admin_menu_submenu_link_color', '#cbc5d3')
),
'ucs_admin_menu_submenu_link_hover_color' => array(
'title' => 'Admin Submenu Links Hover',
'default' => '#fff',
'value' => ub_get_option('ucs_admin_menu_submenu_link_hover_color', '#fff')
),
'ucs_admin_menu_bubble_text_color' => array(
'title' => 'Admin Bubble Text',
'default' => '#fff',
'value' => ub_get_option('ucs_admin_menu_bubble_text_color', '#fff')
),
'ucs_admin_menu_bubble_background_color' => array(
'title' => 'Admin Bubble Background',
'default' => '#EFC94C',
'value' => ub_get_option('ucs_admin_menu_bubble_background_color', '#EFC94C')
),
),
'Admin Bar' => array(
'ucs_admin_bar_background_color' => array(
'title' => 'Admin Bar Background',
'default' => '#45B29D',
'value' => ub_get_option('ucs_admin_bar_background_color', '#45B29D')
),
'ucs_admin_bar_text_color' => array(
'title' => 'Admin Bar Text',
'default' => '#FFF',
'value' => ub_get_option('ucs_admin_bar_text_color', '#FFF')
),
'ucs_admin_bar_icon_color' => array(
'title' => 'Admin Bar Icon',
'default' => '#FFF',
'value' => ub_get_option('ucs_admin_bar_icon_color', '#FFF')
),
'ucs_admin_bar_item_hover_background_color' => array(
'title' => 'Admin Bar Item Hover Background',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_bar_item_hover_background_color', '#334D5C')
),
'ucs_admin_bar_submenu_icon_color' => array(
'title' => 'Admin Bar Submenu Icon and Links',
'default' => '#ece6f6',
'value' => ub_get_option('ucs_admin_bar_submenu_icon_color', '#ece6f6')
),
'ucs_admin_bar_item_hover_text_color' => array(
'title' => 'Admin Bar Item Hover Text and Icon',
'default' => '#FFF',
'value' => ub_get_option('ucs_admin_bar_item_hover_text_color', '#FFF')
),
),
'Media Uploader' => array(
'ucs_admin_media_progress_bar_color' => array(
'title' => 'Progress Bar',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_media_progress_bar_color', '#334D5C')
),
'ucs_admin_media_selected_attachment_color' => array(
'title' => 'Selected Attachment',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_media_selected_attachment_color', '#334D5C')
),
),
'Themes' => array(
'ucs_admin_active_theme_background_color' => array(
'title' => 'Active Theme Background',
'default' => '#334D5C',
'value' => ub_get_option('ucs_admin_active_theme_background_color', '#334D5C')
),
'ucs_admin_active_theme_actions_background_color' => array(
'title' => 'Active Theme Actions Background',
'default' => '#45B29D',
'value' => ub_get_option('ucs_admin_active_theme_actions_background_color', '#45B29D')
),
'ucs_admin_active_theme_details_background_color' => array(
'title' => 'Active Theme Details Background',
'default' => '#45B29D',
'value' => ub_get_option('ucs_admin_active_theme_details_background_color', '#45B29D')
),
),
'Plugins' => array(
'ucs_admin_active_plugin_border_color' => array(
'title' => 'Active Plugin Border',
'default' => '#EFC94C',
'value' => ub_get_option('ucs_admin_active_plugin_border_color', '#EFC94C')
),
),
);
return $colors;
}
function manage_output() {
global $wpdb, $current_site, $page;
$colors = $this->colors();
$page = $_GET['page'];
if (isset($_GET['error']))
echo '<div id="message" class="error fade"><p>' . __('There was an error during the saving operation, please try again.', 'ub') . '</p></div>';
elseif (isset($_GET['updated']))
echo '<div id="message" class="updated fade"><p>' . __('Changes saved.', 'ub') . '</p></div>';
?>
<div class='wrap nosubsub'>
<div class="icon32" id="icon-themes"><br /></div>
<?php include_once(plugin_dir_path(__FILE__) . '/' . $this->dir_name . '-files/global-options.php'); ?>
<p class='description'><?php printf(__('Here you can customize "%s" color scheme which use can set within your <a href="%s">user profile page</a>', 'ub'), ub_get_option('ucs_color_scheme_name', 'Ultimate'), get_edit_user_link(get_current_user_id())); ?></p>
<h2><?php _e('Color Scheme Name', 'ub'); ?></h2>
<div class="postbox">
<div class="inside">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row"><label for="ucs_color_scheme_name"><?php _e('Name', 'ub'); ?></label></th>
<td><input type="text" value="<?php esc_attr_e(ub_get_option('ucs_color_scheme_name', 'Ultimate')); ?>" name="ucs_color_scheme_name" /></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php
foreach ($colors as $color_section => $color_array) {
?>
<h2><?php echo $color_section; ?></h2>
<div class="postbox">
<div class="inside">
<table class="form-table">
<tbody>
<?php
foreach ($color_array as $property => $value) {
?>
<tr valign="top">
<th scope="row"><label for="<?php esc_attr_e($property); ?>"><?php esc_attr_e($color_array[$property]['title']); ?></label></th>
<td><input type="text" value="<?php esc_attr_e($color_array[$property]['value']); ?>" class="ultimate-color-field" name="<?php echo esc_attr_e($property); ?>" /></td>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
}
wp_nonce_field('ultimatebranding_settings_ultimate_color_schemes');
?>
<p class='description'><a href='<?php echo wp_nonce_url("admin.php?page=" . $page . "&tab=ultimate-color-schemes&reset=yes&action=process", 'ultimatebranding_settings_ultimate_color_schemes') ?>'><?php _e('Reset Scheme Colors', 'ub') ?></a></p>
</div>
<?php
}
}
}
$ultimate_color_schemes = new Ultimate_Color_Schemes(); | {
"content_hash": "a46439d6c07a902e4c67ce6334f04cee",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 476,
"avg_line_length": 49.77362637362637,
"alnum_prop": 0.42897514019516936,
"repo_name": "creative2020/kelley",
"id": "121e5150ac6c5af77010eb4f4c79c6712a2c23e6",
"size": "23713",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "wp-content/plugins/ultimate-branding/ultimate-branding-files/modules/ultimate-color-schemes.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "112690"
},
{
"name": "CSS",
"bytes": "3595183"
},
{
"name": "HTML",
"bytes": "41876"
},
{
"name": "JavaScript",
"bytes": "4722153"
},
{
"name": "Modelica",
"bytes": "10338"
},
{
"name": "PHP",
"bytes": "26895470"
},
{
"name": "Perl",
"bytes": "2554"
},
{
"name": "Smarty",
"bytes": "33"
}
],
"symlink_target": ""
} |
<?xml version='1.0'?>
<!DOCTYPE PISI SYSTEM 'http://www.pardus.org.tr/projeler/pisi/pisi-spec.dtd'>
<PISI>
<Source>
<Name>qlandkarte-gt</Name>
<Homepage>http://www.qlandkarte.org/</Homepage>
<Packager>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Packager>
<License>GPLv2</License>
<Icon>qlandkarte</Icon>
<IsA>app:gui</IsA>
<PartOf>desktop.misc</PartOf>
<Summary>GPS device mapping tool</Summary>
<Description>QLandkarte GT is the ultimate outdoor aficionado's tool for GPS maps in GeoTiff format as well as Garmin's img vector map format. Additional it is the PC side frontend to QLandkarte M, a moving map application for mobile devices. And it fills the gap Garmin leaves in refusing to support Linux. QLandkarte GT is the proof that writing portable applications for Unix, Windows and OSX is feasible with a minimum of overhead. No excuses!</Description>
<Archive sha1sum="68107e1865ff1328f93caf1f18b10777ecc3195d" type="targz">mirrors://sourceforge/qlandkartegt/qlandkartegt-1.2.4.tar.gz</Archive>
<BuildDependencies>
<Dependency>qt-devel</Dependency>
<Dependency>proj-devel</Dependency>
<Dependency>jpeg-devel</Dependency>
<Dependency>gdal-devel</Dependency>
<Dependency>gpsd-devel</Dependency>
<Dependency>qt-webkit-devel</Dependency>
</BuildDependencies>
</Source>
<Package>
<Name>qlandkarte-gt</Name>
<RuntimeDependencies>
<Dependency>qt</Dependency>
<Dependency>proj</Dependency>
<Dependency>jpeg</Dependency>
<Dependency>gdal</Dependency>
<Dependency>gpsd</Dependency>
<Dependency>qt-webkit</Dependency>
</RuntimeDependencies>
<Replaces>
<Package>qlandkarte</Package>
</Replaces>
<Files>
<Path fileType="executable">/usr/bin</Path>
<Path fileType="library">/usr/lib</Path>
<Path fileType="data">/usr/share</Path>
</Files>
</Package>
<History>
<Update release="5">
<Date>2011-09-30</Date>
<Version>1.2.4</Version>
<Comment>
Bug #321: Fixed: Diary does not save comments on waypoints and tracks
Bug #322: Fixed: Bad coordinates for georef. pics on big endian systems
Request #323: Add stages of a track to track edit dialog
Request #324: Add tool button for filter dialog to track edit dialog
Request #325: Convert checkboxes for reset and delete trackpoints to toolbuttons
Request #326: Add support for mime links on OS X
Request #327: Automatically move map while drawing distance polyline
</Comment>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Update>
<Update release="4">
<Date>2011-09-04</Date>
<Version>1.2.3</Version>
<Comment>
Request #310: Preserve track color on split operations
Request #311: Optimize map creation dialogs for small screens.
Request #312: Add option to save workspace every X seconds
Request #313: Change edit mode for track name (edit and return will take over the change)
Request #314: Ask before closing edited diary.
Request #315: Make map an option in diary printout
Request #316: Add elevation median filter to track filter dialog.
Request #317: Add time on the move to track info.
Request #318: Change average speed in graph from linear averaging filter to median filter.
Request #319: Show trackpoint information on large profile plots, too.
Request #320: Remove some abundant entries from waypoint and track menu.
</Comment>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Update>
<Update release="3">
<Date>2011-07-13</Date>
<Version>1.2.2</Version>
<Comment>
Request #297: Add import/export for OZI data.
Request #298: Add track profiles to diary
Request #299: Add import of WBT201 data
Bug #300: Diary: comments do not match their items
Request #301: Add option for southern hemisphere in projection wizzard
Request #302: Enhance coordinate / pixel query on canvas
Request #303: Iterate over reference points with n and b key for finetunig
Request #304: Add overview levels to reference process
Request #305: Add on-the-fly quadratic zoom option to qmap
Request #306: Add cachename to geocaches on the map
Request #307: Add selection of multiple waypoints via checkboxes
Request #308: Enhance delete, icon and proximity funtions for new waypoint selection
Request #309: Show track point under cursor in profile preview and vice versa
</Comment>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Update>
<Update release="2">
<Date>2011-06-16</Date>
<Version>1.2.0</Version>
<Comment>Update.</Comment>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Update>
<Update release="1">
<Date>2011-05-24</Date>
<Version>1.1.2</Version>
<Comment>First release.</Comment>
<Name>Alexey Ivanov</Name>
<Email>[email protected]</Email>
</Update>
</History>
</PISI>
| {
"content_hash": "9fdba702d6ff15b15aeedda3602d93dc",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 469,
"avg_line_length": 46.495726495726494,
"alnum_prop": 0.6544117647058824,
"repo_name": "aydemir/pardus-magic",
"id": "69cabf85801b021630bb0992f6d6f8e509d82994",
"size": "5440",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "qlandkarte-gt/pspec.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<md-content ng-controller="AddCtrl" layout="column" flex layout-padding>
<h3>Depositar na sua conta</h3>
<md-input-container class="md-block">
<label>Valor</label>
<input type="text" ng-model="valor" ui-number-mask="2">
</md-input-container>
<div layout="column">
<md-button class="md-raised md-primary" aria-label="confirmar" ng-click="confirmar()" ng-disabled="!valor">
Confirmar
</md-button>
</div>
</md-content> | {
"content_hash": "1aab8d8f863eab4d540bd81f7a4517ac",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 109,
"avg_line_length": 36.833333333333336,
"alnum_prop": 0.6787330316742082,
"repo_name": "everton-ongit/wepay",
"id": "377b57089d3575f186bd82a37a67ff4ffde7704f",
"size": "442",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/app/add/add.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "10372"
},
{
"name": "JavaScript",
"bytes": "19489"
}
],
"symlink_target": ""
} |
package com.inmobi.databus.files;
import org.apache.hadoop.io.Writable;
public interface StreamFile extends Comparable<Object>, Writable {
}
| {
"content_hash": "415e42dc2f63a8111a888e019963080b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 66,
"avg_line_length": 16.22222222222222,
"alnum_prop": 0.7876712328767124,
"repo_name": "InMobi/pintail",
"id": "387ff9b3944299dfb2b8b0fae19650a6989617cb",
"size": "800",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "messaging-client-databus/src/main/java/com/inmobi/databus/files/StreamFile.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1380244"
},
{
"name": "Shell",
"bytes": "9235"
},
{
"name": "Thrift",
"bytes": "5091"
}
],
"symlink_target": ""
} |
package game
// This file mainly deals with the way data is
// handled and passed between objects
/*UseData is a data structure that should contain
all the information the usage of an item should return */
type UseData struct {
effect Effect
ability Ability
}
| {
"content_hash": "9b5229e5246ac5cd1916457fa51fe983",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 57,
"avg_line_length": 24.09090909090909,
"alnum_prop": 0.769811320754717,
"repo_name": "xenoryt/gork",
"id": "4c66c9a828659383a5715f66814a54831b7386ca",
"size": "265",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "game/data.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "37087"
},
{
"name": "HTML",
"bytes": "156739"
}
],
"symlink_target": ""
} |
<!-- $Id$ -->
<h2>Project History</h2>
<p>
The Canary Database project is a result of collaboration between human
health and animal health professionals to explore the linkages between
animal disease events and human environmental health risks.
</p>
<p>
The project began in 2000, in response to a number of
developments, including a <a
href="http://www.nap.edu/catalog/1351.html">1991 National Academy
of Sciences report</a>
recommending the use of animal sentinel data for human environmental
risk assessment, reports of "endocrine disruption" in wildlife
populations possibly due to chemical exposures, and the outbreak of West
Nile Virus in the Western Hemisphere showing the relationship between
wild bird mortality and human risk.
</p>
<p>
These developments pointed out the need for greater communication between
human health professionals and animal health experts. Discussions between
the <a href="http://info.med.yale.edu/intmed/occmed/">Yale
Occupational and Environmental Medicine Program</a>,
a veterinarian also trained in public health, and
the <a href="http://www.nwhc.usgs.gov/">USGS National Wildlife Health
Center</a>
led to a pilot effort to search the biomedical literature and find
evidence of successful animal sentinel models (see Rabinowitz PM,
Cullen MR, Lake HR. 1999. "Wildlife as sentinels for human health
hazards: A review of study designs." J Environ Med 1:217-23).
As useful studies were located, they were added to a database and
to be made available to the
scientific community. Staff from the
<a href="http://ycmi.med.yale.edu/">Yale Center for Medical
Informatics</a> helped with the creation of the website and database
structure. A systematic review of the medical literature highlighted the
need for an evidence-based approach to animal sentinel data.
</p>
<p>
With support from the National Library of Medicine's Information System
Grant program in 2003, the project has been able to expand and
accelerate activities, thanks to work by veterinarians, librarians,
public health professionals and students, and many
others. A national advisory board has guided the efforts, including a
recent strategic planning meeting in June, 2005. The project has been
presented at local, regional and national meetings. Current activities
include evidence-based reviews of
animals as sentinels of biological and chemical terrorism agents.
</p>
<p>
For more information about the people behind the Canary Database,
see the <a href='/about/project_team'>Project Team</a> page.
</p>
| {
"content_hash": "c622444bb2e86e31c28d9ecf0ab32080",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 74,
"avg_line_length": 42.94915254237288,
"alnum_prop": 0.7896606156274665,
"repo_name": "dchud/sentinel",
"id": "ec93a32ce49ba9a04dbc8dcc94e059849a3210c3",
"size": "2534",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "canary/ui/html/project_history.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "151729"
},
{
"name": "Python",
"bytes": "345235"
},
{
"name": "Shell",
"bytes": "775"
}
],
"symlink_target": ""
} |
// Generated by CoffeeScript 1.8.0
(function() {
var CouchDB, cradle, validations, views,
__slice = [].slice;
cradle = require("cradle");
views = require("./views");
validations = require("./validations");
module.exports = CouchDB = (function() {
function CouchDB(config) {
this.couch = new cradle.Connection(config.host, config.port);
this.db = this.couch.database(config.db);
this.ensureDbExists((function(_this) {
return function() {
return _this.installDesignDoc();
};
})(this));
}
CouchDB.prototype.ensureDbExists = function(cb) {
console.log("Ensuring DB Exists...");
return this.db.exists((function(_this) {
return function(err, exists) {
if (exists) {
return cb();
}
console.log("Creating DB...");
return _this.db.create(cb);
};
})(this));
};
CouchDB.prototype.installDesignDoc = function(cb) {
console.log("Creating Design Doc...");
return this.db.save("_design/gscreen", {
views: views,
validate_doc_update: validations
});
};
CouchDB.prototype.allWithType = function(type, cb) {
return this.db.view("gscreen/byType", {
key: type,
include_docs: true
}, function(err, rows) {
if (err) {
return cb(err);
}
return cb(null, rows.map(function(doc) {
return doc;
}));
});
};
CouchDB.prototype.get = function() {
var args, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref = this.db).get.apply(_ref, args);
};
CouchDB.prototype.save = function() {
var args, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref = this.db).save.apply(_ref, args);
};
CouchDB.prototype.remove = function() {
var args, _ref;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return (_ref = this.db).remove.apply(_ref, args);
};
return CouchDB;
})();
}).call(this);
| {
"content_hash": "b41454bec40436fac28d7b5e6d4c2949",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 69,
"avg_line_length": 25.626506024096386,
"alnum_prop": 0.5486600846262342,
"repo_name": "vitorismart/ChromeCast",
"id": "c9b907a0d151f67f63c322f47a8d1dbb28cb6e2a",
"size": "3611",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "target/server/couchdb/index.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "14339"
},
{
"name": "CoffeeScript",
"bytes": "744"
},
{
"name": "Gnuplot",
"bytes": "5822"
},
{
"name": "JavaScript",
"bytes": "123435"
},
{
"name": "Perl",
"bytes": "21591"
},
{
"name": "Python",
"bytes": "1347"
},
{
"name": "Shell",
"bytes": "3465"
}
],
"symlink_target": ""
} |
<?php
/**
* @package The_SEO_Framework\Views\Inpost
*/
defined( 'ABSPATH' ) and $_this = the_seo_framework_class() and $this instanceof $_this or die;
//* Fetch the required instance within this file.
$instance = $this->get_view_instance( 'the_seo_framework_settings_type', $instance );
//* Get the language the Google page should assume.
$language = $this->google_language();
switch ( $instance ) :
case 'the_seo_framework_settings_type_singular' :
$post_id = $this->get_the_real_ID();
$is_static_frontpage = $this->is_static_frontpage( $post_id );
$title = $this->get_custom_field( '_genesis_title', $post_id );
/**
* Generate static placeholder
*/
if ( $is_static_frontpage ) {
//* Front page.
$generated_doctitle_args = array(
'page_on_front' => true,
'placeholder' => true,
'meta' => true,
'get_custom_field' => false,
);
$generated_description_args = array(
'id' => $post_id,
'is_home' => true,
'get_custom_field' => true,
);
} elseif ( $this->is_blog_page( $post_id ) ) {
//* Page for posts.
$generated_doctitle_args = array(
'placeholder' => true,
'meta' => true,
'get_custom_field' => false,
);
$generated_description_args = array(
'id' => $post_id,
'page_for_posts' => true,
);
} else {
$generated_doctitle_args = array(
'placeholder' => true,
'meta' => true,
'get_custom_field' => false,
);
$generated_description_args = array(
'id' => $post_id,
);
}
$generated_doctitle = $this->title( '', '', '', $generated_doctitle_args );
$generated_description = $this->generate_description_from_id( $generated_description_args );
/**
* Special check for home page.
*
* @since 2.3.4
*/
if ( $is_static_frontpage ) {
if ( $this->get_option( 'homepage_tagline' ) ) {
$tit_len_pre = $title ? $title . ' | ' . $this->get_blogdescription() : $generated_doctitle;
} else {
$tit_len_pre = $title ?: $generated_doctitle;
}
} else {
/**
* Separator doesn't matter. Since html_entity_decode is used.
* Order doesn't matter either. Since it's just used for length calculation.
*
* @since 2.3.4
*/
if ( $this->add_title_additions() ) {
$tit_len_pre = $title ? $title . ' | ' . $this->get_blogname() : $generated_doctitle;
} else {
$tit_len_pre = $title ?: $generated_doctitle;
}
}
//* Fetch description from option.
$description = $this->get_custom_field( '_genesis_description' );
/**
* Calculate current description length
*
* Reworked.
* @since 2.3.4
*/
if ( $is_static_frontpage ) {
//* The homepage description takes precedence.
if ( $description ) {
$desc_len_pre = $this->get_option( 'homepage_description' ) ?: $description;
} else {
$desc_len_pre = $this->get_option( 'homepage_description' ) ?: $generated_description;
}
} else {
$desc_len_pre = $description ?: $generated_description;
}
/**
* Convert to what Google outputs.
*
* This will convert e.g. » to a single length character.
* @since 2.3.4
*/
$tit_len_parsed = html_entity_decode( $tit_len_pre );
$desc_len_parsed = html_entity_decode( $desc_len_pre );
/**
* Generate static placeholder for when title or description is emptied
*
* Now within aptly named vars.
* @since 2.3.4
*/
$doctitle_placeholder = $generated_doctitle;
$description_placeholder = $generated_description;
//* Fetch Canonical URL.
$canonical = $this->get_custom_field( '_genesis_canonical_uri' );
//* Fetch Canonical URL Placeholder.
$canonical_placeholder = $this->the_url_from_cache( '', $post_id, false, false );
//* Fetch image placeholder.
$image_placeholder = $this->get_image( $post_id, array( 'disallowed' => array( 'postmeta' ) ), false );
?>
<?php if ( 'above' === $this->inpost_seo_bar || $this->is_option_checked( 'display_seo_bar_metabox' ) ) : ?>
<p>
<strong><?php esc_html_e( 'Doing it Right', 'autodescription' ); ?></strong>
<div>
<?php $this->post_status( $post_id, 'inpost', true ); ?>
</div>
</p>
<?php endif; ?>
<p>
<label for="autodescription_title"><strong><?php printf( esc_html__( 'Custom %s Title', 'autodescription' ), esc_html( $type ) ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#3' ); ?>" target="_blank" title="<?php esc_attr_e( 'Recommended Length: 50 to 55 characters', 'autodescription' ); ?>">[?]</a>
<span class="description tsf-counter">
<?php printf( esc_html__( 'Characters Used: %s', 'autodescription' ), '<span id="autodescription_title_chars">' . (int) mb_strlen( $tit_len_parsed ) . '</span>' ); ?>
<span class="hide-if-no-js tsf-ajax"></span>
</span>
</label>
</p>
<p>
<div id="tsf-title-wrap">
<input class="large-text" type="text" name="autodescription[_genesis_title]" id="autodescription_title" placeholder="<?php echo esc_attr( $doctitle_placeholder ); ?>" value="<?php echo esc_attr( $this->get_custom_field( '_genesis_title' ) ); ?>" />
<span id="tsf-title-offset" class="hide-if-no-js"></span><span id="tsf-title-placeholder" class="hide-if-no-js"></span>
</div>
</p>
<p>
<label for="autodescription_description">
<strong><?php printf( esc_html__( 'Custom %s Description', 'autodescription' ), esc_html( $type ) ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#1' ); ?>" target="_blank" title="<?php esc_attr_e( 'Recommended Length: 145 to 155 characters', 'autodescription' ); ?>">[?]</a>
<span class="description tsf-counter">
<?php printf( esc_html__( 'Characters Used: %s', 'autodescription' ), '<span id="autodescription_description_chars">' . (int) mb_strlen( $desc_len_parsed ) . '</span>' ); ?>
<span class="hide-if-no-js tsf-ajax"></span>
</span>
</label>
</p>
<p>
<textarea class="large-text" name="autodescription[_genesis_description]" id="autodescription_description" placeholder="<?php echo esc_attr( $description_placeholder ); ?>" rows="4" cols="4"><?php echo esc_attr( $this->get_custom_field( '_genesis_description' ) ); ?></textarea>
</p>
<p>
<label for="autodescription_socialimage">
<strong><?php esc_html_e( 'Custom Social Image URL', 'autodescription' ); ?></strong>
<a href="<?php echo esc_url( 'https://developers.facebook.com/docs/sharing/best-practices#images' ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Preferred %s Social Image URL location', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</a>
</label>
</p>
<p class="hide-if-no-js">
<?php
//* Already escaped.
echo $this->get_social_image_uploader_form( 'autodescription_socialimage' );
?>
</p>
<p>
<input class="large-text" type="text" name="autodescription[_social_image_url]" id="autodescription_socialimage-url" placeholder="<?php echo esc_url( $image_placeholder ); ?>" value="<?php echo esc_url( $this->get_custom_field( '_social_image_url' ) ); ?>" />
<?php
/**
* Insert form element only if JS is active. If JS is inactive, then this will cause it to be emptied on $_POST
* @TODO use disabled and jQuery.removeprop( 'disabled' )?
*/
?>
<script>
document.getElementById( 'autodescription_socialimage-url' ).insertAdjacentHTML( 'afterend', '<input type="hidden" name="autodescription[_social_image_id]" id="autodescription_socialimage-id" value="<?php echo absint( $this->get_custom_field( '_social_image_id' ) ); ?>" />' );
</script>
</p>
<p>
<label for="autodescription_canonical">
<strong><?php esc_html_e( 'Custom Canonical URL', 'autodescription' ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/139066?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Preferred %s URL location', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</a>
</label>
</p>
<p>
<input class="large-text" type="text" name="autodescription[_genesis_canonical_uri]" id="autodescription_canonical" placeholder="<?php echo esc_url( $canonical_placeholder ); ?>" value="<?php echo esc_url( $this->get_custom_field( '_genesis_canonical_uri' ) ); ?>" />
</p>
<p><strong><?php esc_html_e( 'Robots Meta Settings', 'autodescription' ); ?></strong></p>
<p>
<label for="autodescription_noindex"><input type="checkbox" name="autodescription[_genesis_noindex]" id="autodescription_noindex" value="1" <?php checked( $this->get_custom_field( '_genesis_noindex' ) ); ?> />
<?php
/* translators: 1: Option, 2: Post or Page */
printf( esc_html__( 'Apply %1$s to this %2$s', 'autodescription' ), $this->code_wrap( 'noindex' ), esc_html( $type ) );
?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/93710?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to show this %s in their search results', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</a>
</label>
<br>
<label for="autodescription_nofollow"><input type="checkbox" name="autodescription[_genesis_nofollow]" id="autodescription_nofollow" value="1" <?php checked( $this->get_custom_field( '_genesis_nofollow' ) ); ?> />
<?php
/* translators: 1: Option, 2: Post or Page */
printf( esc_html__( 'Apply %1$s to this %2$s', 'autodescription' ), $this->code_wrap( 'nofollow' ), esc_html( $type ) );
?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/96569?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to follow links on this %s', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</a>
</label>
<br>
<label for="autodescription_noarchive"><input type="checkbox" name="autodescription[_genesis_noarchive]" id="autodescription_noarchive" value="1" <?php checked( $this->get_custom_field( '_genesis_noarchive' ) ); ?> />
<?php
/* translators: 1: Option, 2: Post or Page */
printf( esc_html__( 'Apply %1$s to this %2$s', 'autodescription' ), $this->code_wrap( 'noarchive' ), esc_html( $type ) );
?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/79812?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to save a cached copy of this %s', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</a>
</label>
</p>
<p><strong><?php esc_html_e( 'Local Search Settings', 'autodescription' ); ?></strong></p>
<p>
<label for="autodescription_exclude_local_search"><input type="checkbox" name="autodescription[exclude_local_search]" id="autodescription_exclude_local_search" value="1" <?php checked( $this->get_custom_field( 'exclude_local_search' ) ); ?> />
<?php printf( esc_html__( 'Exclude this %s from local search', 'autodescription' ), esc_html( $type ) ); ?>
<span title="<?php printf( esc_attr__( 'This excludes this %s from local on-site search results', 'autodescription' ), esc_attr( $type ) ); ?>">[?]</span>
</label>
</p>
<p>
<label for="autodescription_redirect">
<strong><?php esc_html_e( 'Custom 301 Redirect URL', 'autodescription' ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/93633?hl=' . $language ); ?>" target="_blank" title="<?php esc_attr_e( 'This will force visitors to go to another URL', 'autodescription' ); ?>">[?]</a>
</label>
</p>
<p>
<input class="large-text" type="text" name="autodescription[redirect]" id="genesis_redirect" value="<?php echo esc_url( $this->get_custom_field( 'redirect' ) ); ?>" />
</p>
<?php if ( 'below' === $this->inpost_seo_bar ) : ?>
<p>
<strong><?php esc_html_e( 'Doing it Right', 'autodescription' ); ?></strong>
<div>
<?php $this->post_status( $post_id, 'inpost', true ); ?>
</div>
</p>
<?php endif;
break;
case 'the_seo_framework_settings_type_term' :
//* Fetch Term ID and taxonomy.
$term_id = $object->term_id;
$taxonomy = $object->taxonomy;
$data = $this->get_term_data( $object, $term_id );
$title = isset( $data['doctitle'] ) ? $data['doctitle'] : '';
$description = isset( $data['description'] ) ? $data['description'] : '';
$noindex = isset( $data['noindex'] ) ? $data['noindex'] : '';
$nofollow = isset( $data['nofollow'] ) ? $data['nofollow'] : '';
$noarchive = isset( $data['noarchive'] ) ? $data['noarchive'] : '';
$generated_doctitle_args = array(
'term_id' => $term_id,
'taxonomy' => $taxonomy,
'placeholder' => true,
'get_custom_field' => false,
);
$generated_description_args = array(
'id' => $term_id,
'taxonomy' => $taxonomy,
'get_custom_field' => false,
);
//* Generate title and description.
$generated_doctitle = $this->title( '', '', '', $generated_doctitle_args );
$generated_description = $this->generate_description( '', $generated_description_args );
$blog_name = $this->get_blogname();
$add_additions = $this->add_title_additions();
/**
* Separator doesn't matter. Since html_entity_decode is used.
* Order doesn't matter either. Since it's just used for length calculation.
*
* @since 2.3.4
*/
$doc_pre_rem = $add_additions ? $title . ' | ' . $blog_name : $title;
$title_len = $title ? $doc_pre_rem : $generated_doctitle;
$description_len = $description ?: $generated_description;
/**
* Convert to what Google outputs.
*
* This will convert e.g. » to a single length character.
* @since 2.3.4
*/
$tit_len_parsed = html_entity_decode( $title_len );
$desc_len_parsed = html_entity_decode( $description_len );
/**
* Generate static placeholder for when title or description is emptied
*
* @since 2.2.4
*/
$title_placeholder = $generated_doctitle;
$description_placeholder = $generated_description;
?>
<h3><?php printf( esc_html__( '%s SEO Settings', 'autodescription' ), esc_html( $type ) ); ?></h3>
<table class="form-table">
<tbody>
<?php if ( 'above' === $this->inpost_seo_bar || $this->is_option_checked( 'display_seo_bar_metabox' ) ) : ?>
<tr>
<th scope="row" valign="top"><?php esc_html_e( 'Doing it Right', 'autodescription' ); ?></th>
<td>
<?php $this->post_status( $term_id, $taxonomy, true ); ?>
</td>
</tr>
<?php endif; ?>
<tr class="form-field">
<th scope="row" valign="top">
<label for="autodescription-meta[doctitle]">
<strong><?php printf( esc_html__( '%s Title', 'autodescription' ), esc_html( $type ) ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#3' ); ?>" target="_blank" title="<?php esc_attr_e( 'Recommended Length: 50 to 55 characters', 'autodescription' ); ?>">[?]</a>
</label>
</th>
<td>
<div id="tsf-title-wrap">
<input name="autodescription-meta[doctitle]" id="autodescription-meta[doctitle]" type="text" placeholder="<?php echo esc_attr( $title_placeholder ) ?>" value="<?php echo esc_attr( $title ); ?>" size="40" />
<span id="tsf-title-offset" class="hide-if-no-js"></span><span id="tsf-title-placeholder" class="hide-if-no-js"></span>
</div>
<p class="description tsf-counter">
<?php printf( esc_html__( 'Characters Used: %s', 'autodescription' ), '<span id="autodescription-meta[doctitle]_chars">' . esc_html( mb_strlen( $tit_len_parsed ) ) . '</span>' ); ?>
<span class="hide-if-no-js tsf-ajax"></span>
</p>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top">
<label for="autodescription-meta[description]">
<strong><?php printf( esc_html__( '%s Meta Description', 'autodescription' ), esc_html( $type ) ); ?></strong>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/35624?hl=' . $language . '#1' ); ?>" target="_blank" title="<?php esc_attr_e( 'Recommended Length: 145 to 155 characters', 'autodescription' ); ?>">[?]</a>
</label>
</th>
<td>
<textarea name="autodescription-meta[description]" id="autodescription-meta[description]" placeholder="<?php echo esc_attr( $description_placeholder ); ?>" rows="5" cols="50" class="large-text"><?php echo esc_html( $description ); ?></textarea>
<p class="description tsf-counter">
<?php printf( esc_html__( 'Characters Used: %s', 'autodescription' ), '<span id="autodescription-meta[description]_chars">' . esc_html( mb_strlen( $desc_len_parsed ) ) . '</span>' ); ?>
<span class="hide-if-no-js tsf-ajax"></span>
</p>
</td>
</tr>
<tr>
<th scope="row" valign="top"><?php esc_html_e( 'Robots Meta Settings', 'autodescription' ); ?></th>
<td>
<label for="autodescription-meta[noindex]"><input name="autodescription-meta[noindex]" id="autodescription-meta[noindex]" type="checkbox" value="1" <?php checked( $noindex ); ?> />
<?php printf( esc_html__( 'Apply %s to this term?', 'autodescription' ), $this->code_wrap( 'noindex' ) ); ?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/93710?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to show this page in their search results', 'autodescription' ) ); ?>">[?]</a>
</label>
<br>
<label for="autodescription-meta[nofollow]"><input name="autodescription-meta[nofollow]" id="autodescription-meta[nofollow]" type="checkbox" value="1" <?php checked( $nofollow ); ?> />
<?php printf( esc_html__( 'Apply %s to this term?', 'autodescription' ), $this->code_wrap( 'nofollow' ) ); ?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/96569?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to follow links on this page', 'autodescription' ) ); ?>">[?]</a>
</label>
<br>
<label for="autodescription-meta[noarchive]"><input name="autodescription-meta[noarchive]" id="autodescription-meta[noarchive]" type="checkbox" value="1" <?php checked( $noarchive ); ?> />
<?php printf( esc_html__( 'Apply %s to this term?', 'autodescription' ), $this->code_wrap( 'noarchive' ) ); ?>
<a href="<?php echo esc_url( 'https://support.google.com/webmasters/answer/79812?hl=' . $language ); ?>" target="_blank" title="<?php printf( esc_attr__( 'Tell Search Engines not to save a cached copy of this page', 'autodescription' ) ); ?>">[?]</a>
</label>
<?php // Saved flag, if set then it won't fetch for Genesis meta anymore ?>
<label class="hidden" for="autodescription-meta[saved_flag]">
<input name="autodescription-meta[saved_flag]" id="autodescription-meta[saved_flag]" type="checkbox" value="1" checked='checked' />
</label>
</td>
</tr>
<?php if ( 'below' === $this->inpost_seo_bar ) : ?>
<tr>
<th scope="row" valign="top"><?php esc_html_e( 'Doing it Right', 'autodescription' ); ?></th>
<td>
<?php $this->post_status( $term_id, $taxonomy, true ); ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php
break;
default :
break;
endswitch;
| {
"content_hash": "94e9ce8a977c24232b10943ef9470521",
"timestamp": "",
"source": "github",
"line_count": 423,
"max_line_length": 281,
"avg_line_length": 45.470449172576835,
"alnum_prop": 0.6171363210980555,
"repo_name": "Kilbourne/biosphaera",
"id": "5a0ec8a1e1905c8f96b510a2abde7dd645bf5ccd",
"size": "19234",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/app/plugins/autodescription/inc/views/inpost/seo-settings.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "223361"
},
{
"name": "HTML",
"bytes": "40850"
},
{
"name": "JavaScript",
"bytes": "44809"
},
{
"name": "PHP",
"bytes": "173651"
}
],
"symlink_target": ""
} |
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace InteropServices
{
namespace ComTypes
{
class IMoniker;
}
}
}
}
}
namespace mscorlib
{
namespace System
{
namespace Runtime
{
namespace InteropServices
{
namespace ComTypes
{
class IEnumMoniker
{
public:
IEnumMoniker(MonoObject *nativeObject)
{
__mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker = nativeObject;
};
~IEnumMoniker()
{
};
IEnumMoniker & operator=(IEnumMoniker &value) { __mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker = value.__mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker; return value; };
operator MonoObject*() { return __mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker; };
MonoObject* operator=(MonoObject* value) { __mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker = value; return value; };
virtual mscorlib::System::Int32 Next(mscorlib::System::Int32 celt, std::vector<mscorlib::System::Runtime::InteropServices::ComTypes::IMoniker*> rgelt, mscorlib::System::IntPtr pceltFetched);
virtual mscorlib::System::Int32 Skip(mscorlib::System::Int32 celt);
virtual void Reset();
virtual void Clone(mscorlib::System::Runtime::InteropServices::ComTypes::IEnumMoniker ppenum);
protected:
MonoObject *__mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker;
private:
};
}
}
}
}
}
#endif
| {
"content_hash": "0c6d29c7550b8f9d7e60d5ca2b11655c",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 207,
"avg_line_length": 23.25,
"alnum_prop": 0.67235926628716,
"repo_name": "brunolauze/MonoNative",
"id": "9620abc902f78e9699c06c7682049fbc52fddb70",
"size": "1775",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MonoNative/mscorlib/System/Runtime/InteropServices/ComTypes/mscorlib_System_Runtime_InteropServices_ComTypes_IEnumMoniker.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "137243"
},
{
"name": "C#",
"bytes": "104880"
},
{
"name": "C++",
"bytes": "18404064"
},
{
"name": "CSS",
"bytes": "1754"
},
{
"name": "HTML",
"bytes": "16925"
},
{
"name": "Shell",
"bytes": "132"
}
],
"symlink_target": ""
} |
=====================
agate-numpy |release|
=====================
About
=====
.. include:: ../README
Install
=======
To install:
.. code-block:: bash
pip install agatenumpy
For details on development or supported platforms see the `agate documentation <http://agate.readthedocs.org>`_.
Usage
=====
agate-numpy uses agate's monkeypatching pattern to automatically add numpy support to all :class:`agate.Table <agate.table.Table>` instances.
.. code-block:: python
import agate
import agatenumpy
Once imported, you'll be able to use :meth:`.TableSQL.from_numpy` and :meth:`.TableSQL.to_numpy` as though they are members of :class:`agate.Table <agate.table.Table>`.
TKTK
===
API
===
.. autoclass:: agatenumpy.table.TableNumpy
:members:
Authors
=======
.. include:: ../AUTHORS
License
=======
.. include:: ../COPYING
Changelog
=========
.. include:: ../CHANGELOG
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
| {
"content_hash": "8af061aecc3ded59ed57c44335e76920",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 168,
"avg_line_length": 15.935483870967742,
"alnum_prop": 0.6305668016194332,
"repo_name": "onyxfish/agate-numpy",
"id": "09c85b01e7a8ff5b796e922b135d7b914ce954b7",
"size": "988",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/index.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "8064"
}
],
"symlink_target": ""
} |
package org.kordamp.ikonli;
import java.io.InputStream;
import java.net.URL;
/**
* @author Andres Almiray
*/
public interface IkonHandler {
boolean supports(String description);
Ikon resolve(String description);
URL getFontResource();
InputStream getFontResourceAsStream();
String getFontFamily();
Object getFont();
void setFont(Object font);
} | {
"content_hash": "a41ecec0940bdb3b3a138a38c1bb6cfb",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 42,
"avg_line_length": 15.958333333333334,
"alnum_prop": 0.7101827676240209,
"repo_name": "aalmiray/ikonli",
"id": "c811a41229142696355c23a067c19c3f5b2f22ad",
"size": "1027",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/ikonli-core/src/main/java/org/kordamp/ikonli/IkonHandler.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "747068"
},
{
"name": "HTML",
"bytes": "2588"
},
{
"name": "Java",
"bytes": "825098"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "e10a864077a3cfa7a725154c580c4bd7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "0e60982d5cbcf32198e4084fba81e6324ea24f13",
"size": "176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Cycadophyta/Cycadopsida/Cycadales/Zamiaceae/Encephalartos/Encephalartos vromii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
'use strict';
module.exports = {
db: 'mongodb://localhost/mean-test',
port: 3001,
app: {
name: 'MPIEventLogger - Dashboard - Test'
},
facebook: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/facebook/callback'
},
twitter: {
clientID: 'CONSUMER_KEY',
clientSecret: 'CONSUMER_SECRET',
callbackURL: 'http://localhost:3000/auth/twitter/callback'
},
github: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/github/callback'
},
google: {
clientID: 'APP_ID',
clientSecret: 'APP_SECRET',
callbackURL: 'http://localhost:3000/auth/google/callback'
},
linkedin: {
clientID: 'API_KEY',
clientSecret: 'SECRET_KEY',
callbackURL: 'http://localhost:3000/auth/linkedin/callback'
}
};
| {
"content_hash": "aac5aa005c401c81a97ba09324d50470",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 67,
"avg_line_length": 27.58823529411765,
"alnum_prop": 0.5778251599147122,
"repo_name": "kbeyer/K6BEventLoggerDashboard",
"id": "85547486d5dd8ae6552ef266bb2c7ff66d980d30",
"size": "938",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/config/env/test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3721"
},
{
"name": "JavaScript",
"bytes": "83734"
},
{
"name": "Perl",
"bytes": "48"
}
],
"symlink_target": ""
} |
/**************************************************
* Source Code for the Original Compiler for the
* Programming Language Wake
*
* ImportParseTreeTraverser.cpp
*
* Licensed under the MIT license
* See LICENSE.TXT for details
*
* Author: Michael Fairhurst
* Revised By:
*
**************************************************/
#include "ImportParseTreeTraverser.h"
#include "CompilationExceptions.h"
#include "SemanticError.h"
#include "TempPropertySymbolTable.h"
void ImportParseTreeTraverser::traverse(Node* tree, ClassSpaceSymbolTable& classes, LibraryLoader& l, ErrorTracker& errors, std::string importpath, vector<ClassSpaceSymbolTable*> otherSources) {
switch(tree->node_type) {
case NT_PROGRAM:
case NT_IMPORTSET:
for(int i = 0; i < tree->subnodes; i++) {
traverse(tree->node_data.nodes[i], classes, l, errors, importpath, otherSources);
}
break;
case NT_IMPORT:
{
std::string modulename = tree->node_data.nodes[0]->node_data.string;
std::string importname = tree->node_data.nodes[1]->node_data.string;
for(vector<ClassSpaceSymbolTable*>::iterator it = otherSources.begin(); it != otherSources.end(); ++it) {
try {
PropertySymbolTable* table = (*it)->findFullyQualifiedModifiable(modulename == "" ? importname : modulename + "." + importname);
classes.importClass(new TempPropertySymbolTable(*table));
return;
} catch(SymbolNotFoundException* e) {
delete e;
}
}
std::string moduledirectory = "";
if(modulename != "") {
moduledirectory = modulename + string("/");
}
// TODO use actual path
try {
if(!l.loadImport(moduledirectory + importname, importpath, classes)) {
errors.addError(new SemanticError(BAD_IMPORT, "Could not import class by name " + moduledirectory + importname, tree));
}
} catch(string errormsg) {
errors.addError(new SemanticError(BAD_IMPORT, "Error importing class by name " + moduledirectory + importname + ": " + errormsg, tree));
}
}
break;
}
}
void ImportParseTreeTraverser::prepImports(Node* tree, ClassSpaceSymbolTable& classes) {
switch(tree->node_type) {
case NT_PROGRAM:
case NT_IMPORTSET:
for(int i = 0; i < tree->subnodes; i++) {
prepImports(tree->node_data.nodes[i], classes);
}
break;
case NT_IMPORT:
{
std::string modulename = tree->node_data.nodes[0]->node_data.string;
std::string classname = tree->node_data.nodes[1]->node_data.string;
classes.prepImport(modulename, classname);
}
break;
}
}
std::vector<std::pair<std::string, std::string> > ImportParseTreeTraverser::gatherImports(Node* tree) {
switch(tree->node_type) {
case NT_PROGRAM:
case NT_IMPORTSET:
{
std::vector<std::pair<std::string, std::string> > res;
for(int i = 0; i < tree->subnodes; i++) {
std::vector<std::pair<std::string, std::string> > res2 = gatherImports(tree->node_data.nodes[i]);
for(std::vector<std::pair<std::string, std::string> >::iterator it = res2.begin(); it != res2.end(); ++it) {
res.push_back(*it);
}
}
return res;
}
case NT_IMPORT:
{
std::vector<std::pair<std::string, std::string> > res;
std::string module = "";
std::string importname = tree->node_data.nodes[1]->node_data.string;
if(strlen(tree->node_data.nodes[0]->node_data.string)) {
module = tree->node_data.nodes[0]->node_data.string;
}
res.push_back(std::pair<std::string, std::string>(module, importname));
return res;
}
default:
return std::vector<std::pair<std::string, std::string> >();
}
}
| {
"content_hash": "69aa37aca7b98ce7d127f4a01dfc8644",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 194,
"avg_line_length": 30.389830508474578,
"alnum_prop": 0.6405465699944227,
"repo_name": "MichaelRFairhurst/wake-compiler",
"id": "b01f224cd700767057540a0012cdba6a4cbf290a",
"size": "3586",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/cpp/ImportParseTreeTraverser.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "25919"
},
{
"name": "C++",
"bytes": "726981"
},
{
"name": "Lex",
"bytes": "7286"
},
{
"name": "Makefile",
"bytes": "7243"
},
{
"name": "Ruby",
"bytes": "388"
},
{
"name": "Shell",
"bytes": "2371"
},
{
"name": "VimL",
"bytes": "2511"
},
{
"name": "Yacc",
"bytes": "43472"
}
],
"symlink_target": ""
} |
import React, { Component, PropTypes } from 'react';
// TODO: this shouldn't live with the redux constants
import { ItemTypes } from 'redux/modules/constants';
import { DragSource } from 'react-dnd';
import { immutableRenderDecorator } from 'react-immutable-render-mixin';
import TrafficLights from 'components/Window/TrafficLights';
const windowSource = {
beginDrag({ id, x, y }) {
// console.log(id, x, y);
return { id, x, y };
},
};
function collect(connect, monitor) {
return {
connectDragSource: connect.dragSource(),
isDragging: monitor.isDragging(),
};
}
@DragSource(ItemTypes.WINDOW, windowSource, collect)
@immutableRenderDecorator
class Window extends Component {
static propTypes = {
title: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
x: PropTypes.number,
y: PropTypes.number,
z: PropTypes.number,
children: PropTypes.node,
height: PropTypes.number,
width: PropTypes.number,
onSelect: PropTypes.func,
onClickClose: PropTypes.func,
connectDragSource: PropTypes.func,
isDragging: PropTypes.bool,
};
render() {
console.log('render window', this.props.title);
const { connectDragSource, isDragging } = this.props;
const contentStyle = {
minHeight: this.props.height || 480,
width: this.props.width || 640,
};
const wrapperStyle = {
opacity: isDragging ? 0.5 : 1,
top: this.props.y,
left: this.props.x,
zIndex: this.props.z * 100,
};
const onSelect = (e) => {
this.props.onSelect(this.props.title);
};
return connectDragSource(
<div
style={wrapperStyle}
className="bg-white absolute rounded-2 border border-gold-dark gold"
onClick={onSelect}
>
<WindowTitle
{...this.props}
onClickClose={this.props.onClickClose}
onSelect={this.props.onSelect}
/>
<div className="flex flex-column" style={contentStyle}>
{ this.props.children }
</div>
</div>
);
}
}
export default Window;
function WindowTitle({ title, onClickClose, id }) {
const cx = 'flex flex-center border-bottom border-gold px1 py1 js-handle';
const fn = (e) => {
e.stopPropagation();
onClickClose(id);
};
return (
<div
className={cx}
style={{ height: 20 }}
>
<TrafficLights onClick={fn} />
<span
className="flex-grow center bold h6"
style={{ marginRight: 41 }}
>
{title}
</span>
</div>
);
}
| {
"content_hash": "aa9c3cd0e1e728554249cd6d71e3d90c",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 76,
"avg_line_length": 24.728155339805824,
"alnum_prop": 0.6238712210443659,
"repo_name": "jongold/goldOS",
"id": "b250dc9994ff8582e3f550d336d3b15cb4bb473d",
"size": "2547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/Window/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5253"
},
{
"name": "JavaScript",
"bytes": "99063"
},
{
"name": "Shell",
"bytes": "95"
}
],
"symlink_target": ""
} |
package engine;
import java.util.*;
public class Frame {
double frameSize;
int [] slots;
double successfullSlots;
double collisionSlots;
double emptySlots;
double competingTags; //estimative
public Frame(double frameSize, double competingTags) {
this.frameSize = frameSize;
this.slots = new int [(int)Math.ceil(frameSize)];
this.successfullSlots = 0;
this.collisionSlots = 0;
this.emptySlots = 0;
this.competingTags = 0;
}
void execute (double tagsNum) {
buildSlots(tagsNum);
for (int x : slots) {
if (x==0)
emptySlots++;
else if (x == 1)
successfullSlots++;
else
collisionSlots++;
}
}
void buildSlots (double tagsNum) {
for (int i = 0; i < tagsNum; i++) {
int slotToTransmit = new Random().nextInt((int)Math.ceil(frameSize));
slots[slotToTransmit]++;
}
}
}
| {
"content_hash": "e70ddc40118a65f7e75e2f542462c967",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 72,
"avg_line_length": 19.41860465116279,
"alnum_prop": 0.6622754491017964,
"repo_name": "vinniemoreira/dfsa-simulator",
"id": "a8607d2005a24ffd9f4939b34ca03117566cbbeb",
"size": "835",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/engine/Frame.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "7815"
}
],
"symlink_target": ""
} |
"""Unit tests for coders that must be consistent across all Beam SDKs.
"""
import json
import logging
import os.path
import sys
import unittest
import yaml
from apache_beam import coders
from apache_beam.coders import coder_impl
from apache_beam.utils import windowed_value
from apache_beam.utils.timestamp import Timestamp
from apache_beam.transforms.window import IntervalWindow
from apache_beam.transforms import window
STANDARD_CODERS_YAML = os.path.join(
os.path.dirname(__file__), '..', 'tests', 'data', 'standard_coders.yaml')
def _load_test_cases(test_yaml):
"""Load test data from yaml file and return an iterable of test cases.
See ``standard_coders.yaml`` for more details.
"""
if not os.path.exists(test_yaml):
raise ValueError('Could not find the test spec: %s' % test_yaml)
for ix, spec in enumerate(yaml.load_all(open(test_yaml))):
spec['index'] = ix
name = spec.get('name', spec['coder']['urn'].split(':')[-2])
yield [name, spec]
class StandardCodersTest(unittest.TestCase):
_urn_to_coder_class = {
'urn:beam:coders:bytes:0.1': coders.BytesCoder,
'urn:beam:coders:varint:0.1': coders.VarIntCoder,
'urn:beam:coders:kv:0.1': lambda k, v: coders.TupleCoder((k, v)),
'urn:beam:coders:interval_window:0.1': coders.IntervalWindowCoder,
'urn:beam:coders:stream:0.1': lambda t: coders.IterableCoder(t),
'urn:beam:coders:global_window:0.1': coders.GlobalWindowCoder,
'urn:beam:coders:windowed_value:0.1':
lambda v, w: coders.WindowedValueCoder(v, w)
}
_urn_to_json_value_parser = {
'urn:beam:coders:bytes:0.1': lambda x: x,
'urn:beam:coders:varint:0.1': lambda x: x,
'urn:beam:coders:kv:0.1':
lambda x, key_parser, value_parser: (key_parser(x['key']),
value_parser(x['value'])),
'urn:beam:coders:interval_window:0.1':
lambda x: IntervalWindow(
start=Timestamp(micros=(x['end'] - x['span']) * 1000),
end=Timestamp(micros=x['end'] * 1000)),
'urn:beam:coders:stream:0.1': lambda x, parser: map(parser, x),
'urn:beam:coders:global_window:0.1': lambda x: window.GlobalWindow(),
'urn:beam:coders:windowed_value:0.1':
lambda x, value_parser, window_parser: windowed_value.create(
value_parser(x['value']), x['timestamp'] * 1000,
tuple([window_parser(w) for w in x['windows']]))
}
def test_standard_coders(self):
for name, spec in _load_test_cases(STANDARD_CODERS_YAML):
logging.info('Executing %s test.', name)
self._run_standard_coder(name, spec)
def _run_standard_coder(self, name, spec):
coder = self.parse_coder(spec['coder'])
parse_value = self.json_value_parser(spec['coder'])
nested_list = [spec['nested']] if 'nested' in spec else [True, False]
for nested in nested_list:
for expected_encoded, json_value in spec['examples'].items():
value = parse_value(json_value)
expected_encoded = expected_encoded.encode('latin1')
actual_encoded = encode_nested(coder, value, nested)
if self.fix and actual_encoded != expected_encoded:
self.to_fix[spec['index'], expected_encoded] = actual_encoded
else:
self.assertEqual(decode_nested(coder, expected_encoded, nested),
value)
self.assertEqual(expected_encoded, actual_encoded)
def parse_coder(self, spec):
return self._urn_to_coder_class[spec['urn']](
*[self.parse_coder(c) for c in spec.get('components', ())])
def json_value_parser(self, coder_spec):
component_parsers = [
self.json_value_parser(c) for c in coder_spec.get('components', ())]
return lambda x: self._urn_to_json_value_parser[coder_spec['urn']](
x, *component_parsers)
# Used when --fix is passed.
fix = False
to_fix = {}
@classmethod
def tearDownClass(cls):
if cls.fix and cls.to_fix:
print "FIXING", len(cls.to_fix), "TESTS"
doc_sep = '\n---\n'
docs = open(STANDARD_CODERS_YAML).read().split(doc_sep)
def quote(s):
return json.dumps(s.decode('latin1')).replace(r'\u0000', r'\0')
for (doc_ix, expected_encoded), actual_encoded in cls.to_fix.items():
print quote(expected_encoded), "->", quote(actual_encoded)
docs[doc_ix] = docs[doc_ix].replace(
quote(expected_encoded) + ':', quote(actual_encoded) + ':')
open(STANDARD_CODERS_YAML, 'w').write(doc_sep.join(docs))
def encode_nested(coder, value, nested=True):
out = coder_impl.create_OutputStream()
coder.get_impl().encode_to_stream(value, out, nested)
return out.get()
def decode_nested(coder, encoded, nested=True):
return coder.get_impl().decode_from_stream(
coder_impl.create_InputStream(encoded), nested)
if __name__ == '__main__':
if '--fix' in sys.argv:
StandardCodersTest.fix = True
sys.argv.remove('--fix')
unittest.main()
| {
"content_hash": "2409bc6bf564aaacae8d6da15fa321d4",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 77,
"avg_line_length": 37.134328358208954,
"alnum_prop": 0.6406752411575563,
"repo_name": "ravwojdyla/incubator-beam",
"id": "e26d2c8a481a515014353bb8dffd76d8e3c4c840",
"size": "5761",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sdks/python/apache_beam/coders/standard_coders_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "31657"
},
{
"name": "Java",
"bytes": "10775983"
},
{
"name": "Protocol Buffer",
"bytes": "51645"
},
{
"name": "Python",
"bytes": "2311293"
},
{
"name": "Shell",
"bytes": "19427"
}
],
"symlink_target": ""
} |
In the previous chapters, we learned that in Leaf everything is build by
layers and that the constructed thing is again a layer, which means it can
function as a new building block for something bigger. This is possible, because
a `Layer` can implement any behavior as long as it takes an input and produces
an output.
In [2.1 Layer Lifecycle](./layer-lifecycle.html)
we have seen, that only one `LayerConfig` can be used to turn it via
`Layer::from_config` into an actual `Layer`. But as Deep Learning relies on
chaining multiple layers together, we need a `Layer`, who implements this
behavior for us.
Enter the container layers.
### Networks via the `Sequential` layer
A `Sequential` Layer is a layer of type container layer. The config of a
container layer has a special method called,
`.add_layer` which takes one `LayerConfig` and adds it to an ordered list in the
`SequentialConfig`.
When turning a `SequentialConfig` into a `Layer` by passing the config to
`Layer::from_config`, the behavior of the `Sequential` is to initialize all the
layers which were added via `.add_layer` and connect the layers with each other.
This means, the output of one layer becomes the input of the next layer in the
list.
The input of a sequential `Layer` becomes the input of the
first layer in the sequential worker, the sequential worker then takes care
of passing the input through all the layers and the output of the last layer
then becomes the output of the `Layer` with the sequential worker. Therefore
a sequential `Layer` fulfills the requirements of a `Layer` - take an input,
return an output.
```rust
// short form for: &LayerConfig::new("net", LayerType::Sequential(cfg))
let mut net_cfg = SequentialConfig::default();
net_cfg.add_input("data", &vec![batch_size, 28, 28]);
net_cfg.add_layer(LayerConfig::new("reshape", ReshapeConfig::of_shape(&vec![batch_size, 1, 28, 28])));
net_cfg.add_layer(LayerConfig::new("conv", ConvolutionConfig { num_output: 20, filter_shape: vec![5], stride: vec![1], padding: vec![0] }));
net_cfg.add_layer(LayerConfig::new("pooling", PoolingConfig { mode: PoolingMode::Max, filter_shape: vec![2], stride: vec![2], padding: vec![0] }));
net_cfg.add_layer(LayerConfig::new("linear1", LinearConfig { output_size: 500 }));
net_cfg.add_layer(LayerConfig::new("sigmoid", LayerType::Sigmoid));
net_cfg.add_layer(LayerConfig::new("linear2", LinearConfig { output_size: 10 }));
net_cfg.add_layer(LayerConfig::new("log_softmax", LayerType::LogSoftmax));
// set up the sequential layer aka. a deep, convolutional network
let mut net = Layer::from_config(backend.clone(), &net_cfg);
```
As a sequential layer is like any other layer, we can use sequential layers as
building blocks for larger networks. Important building blocks of a network can
be grouped into a sequential layer and published as a crate for others to use.
```rust
// short form for: &LayerConfig::new("net", LayerType::Sequential(cfg))
let mut conv_net = SequentialConfig::default();
conv_net.add_input("data", &vec![batch_size, 28, 28]);
conv_net.add_layer(LayerConfig::new("reshape", ReshapeConfig::of_shape(&vec![batch_size, 1, 28, 28])));
conv_net.add_layer(LayerConfig::new("conv", ConvolutionConfig { num_output: 20, filter_shape: vec![5], stride: vec![1], padding: vec![0] }));
conv_net.add_layer(LayerConfig::new("pooling", PoolingConfig { mode: PoolingMode::Max, filter_shape: vec![2], stride: vec![2], padding: vec![0] }));
conv_net.add_layer(LayerConfig::new("linear1", LinearConfig { output_size: 500 }));
conv_net.add_layer(LayerConfig::new("sigmoid", LayerType::Sigmoid));
conv_net.add_layer(LayerConfig::new("linear2", LinearConfig { output_size: 10 }));
let mut net_cfg = SequentialConfig::default();
net_cfg.add_layer(conv_net);
net_cfg.add_layer(LayerConfig::new("linear", LinearConfig { output_size: 500 }));
net_cfg.add_layer(LayerConfig::new("log_softmax", LayerType::LogSoftmax));
// set up the 'big' network
let mut net = Layer::from_config(backend.clone(), &net_cfg);
```
### Networks via other container layers
So far, there is only the sequential layer, but other container layers, with
slightly different behaviors are conceivable. For example a parallel or
concat layer in addition to the sequential layer.
How to 'train' or optimize the constructed network is topic of chapter [3.
Solvers](./solvers.html)
| {
"content_hash": "15651159c7ef45f04e4f819d58a01610",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 148,
"avg_line_length": 51.082352941176474,
"alnum_prop": 0.7434362045140488,
"repo_name": "autumnai/leaf",
"id": "7c9d6aa8a3ef3d4566872bd4a0a7b9dc789ea972",
"size": "4362",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/src/building-networks.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Cap'n Proto",
"bytes": "1920"
},
{
"name": "Rust",
"bytes": "241801"
},
{
"name": "Shell",
"bytes": "515"
}
],
"symlink_target": ""
} |
require_relative "../lib/address_verifier.rb"
include AddressVerifier
describe AddressVerifier do
describe ".verify_address" do
context "given a verifiable address no secondary address" do
before(:each) do
stub_request(:get, "http://www.yaddress.net/api/Address?AddressLine1=46%20Dogwood%20Drive&AddressLine2=Plainsboro%20New%20Jersey%2008536&UserKey=").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Faraday v0.9.2'}).
to_return(:status => 200, :body =>
'{
"ErrorCode": 0,
"ErrorMessage": "",
"AddressLine1": "46 DOGWOOD DR",
"AddressLine2": "PLAINSBORO, NJ 08536-1963",
"Number": "46",
"PreDir": "",
"Street": "DOGWOOD",
"Suffix": "DR",
"PostDir": "",
"Sec": "",
"SecNumber": "",
"City": "PLAINSBORO",
"State": "NJ",
"Zip": "08536",
"Zip4": "1963",
"County": "MIDDLESEX",
"StateFP": "34",
"CountyFP": "023",
"CensusTract": "86.01",
"CensusBlock": "2070",
"Latitude": 40.328282,
"Longitude": -74.611678,
"GeoPrecision": 5
}',
:headers => {})
end
it "returns a verified address" do
address = AddressVerifier.verify_address "46 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.verified?).to eq(true)
end
it "returns the proper address line 1" do
address = AddressVerifier.verify_address "46 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.address_line_1).to eq('46 DOGWOOD DR')
end
it "returns the proper address line 2" do
address = AddressVerifier.verify_address "46 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.address_line_2).to eq('PLAINSBORO, NJ 08536-1963')
end
it "returns the proper latitude" do
address = AddressVerifier.verify_address "46 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.latitude).to eq(40.328282)
end
it "returns the proper longitude" do
address = AddressVerifier.verify_address "46 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.longitude).to eq(-74.611678)
end
end
context "given a verifiable address with a secondary address" do
before(:each) do
stub_request(:get, "http://www.yaddress.net/api/Address?AddressLine1=321+E+48+Street+Apartment+4D&AddressLine2=New+York+City%2C+NY&UserKey=").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Faraday v0.9.2'}).
to_return(:status => 200, :body =>
'{
"ErrorCode": 0,
"ErrorMessage": "",
"AddressLine1": "321 E 48TH ST APT 4D",
"AddressLine2": "NEW YORK, NY 10017-1731",
"Number": "321",
"PreDir": "E",
"Street": "48TH",
"Suffix": "ST",
"PostDir": "",
"Sec": "APT",
"SecNumber": "4D",
"City": "NEW YORK",
"State": "NY",
"Zip": "10017",
"Zip4": "1731",
"County": "NEW YORK",
"StateFP": "36",
"CountyFP": "061",
"CensusTract": "90.00",
"CensusBlock": "4000",
"Latitude": 40.753525,
"Longitude": -73.968901,
"GeoPrecision": 5
}',
:headers => {})
end
it "returns the correct Address Line 1" do
address = AddressVerifier.verify_address "321 E 48 Street", "Apartment 4D", "New York City,", "NY", ""
expect(address.address_line_1).to eq("321 E 48TH ST APT 4D")
end
it "returns the correct Address Line 2" do
address = AddressVerifier.verify_address "321 E 48 Street", "Apartment 4D", "New York City,", "NY", ""
expect(address.address_line_2).to eq("NEW YORK, NY 10017-1731")
end
end
context "given an unverifiable address (number doesn't exist)" do
before(:each) do
stub_request(:get, "http://www.yaddress.net/api/Address?AddressLine1=5000%20Dogwood%20Drive&AddressLine2=Plainsboro%20New%20Jersey%2008536&UserKey=").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Faraday v0.9.2'}).
to_return(:status => 200, :body =>
'{
"ErrorCode": 8,
"ErrorMessage": "No such house number in the street",
"AddressLine1": "5000 DOGWOOD DR",
"AddressLine2": "PLAINSBORO, NJ 08536",
"Number": "5000",
"PreDir": "",
"Street": "DOGWOOD",
"Suffix": "DR",
"PostDir": "",
"Sec": "",
"SecNumber": "",
"City": "PLAINSBORO",
"State": "NJ",
"Zip": "08536",
"Zip4": "",
"County": "MIDDLESEX",
"StateFP": "34",
"CountyFP": "023",
"CensusTract": "86.01",
"CensusBlock": "2070",
"Latitude": 40.328498,
"Longitude": -74.610901,
"GeoPrecision": 4
}',
:headers => {})
end
it "returns an unverified address" do
address = AddressVerifier.verify_address "5000 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.verified?).to eq(false)
end
it "returns the proper error code" do
address = AddressVerifier.verify_address "5000 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.error_code).to eq(8)
end
it "returns the proper error message" do
address = AddressVerifier.verify_address "5000 Dogwood Drive", "", "Plainsboro", "New Jersey", "08536"
expect(address.error_message).to eq('No such house number in the street')
end
end
context "given a faulty usercode" do
before(:each) do
stub_request(:get, "http://www.yaddress.net/api/Address?AddressLine1=46+Dogwood+Dr&AddressLine2=Plainsboro+NJ+08536&UserKey=45").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Faraday v0.9.2'}).
to_return(:status => 200, :body =>
'{
"ErrorCode": 1,
"ErrorMessage": "Invalid user key. Leave blank for testing or visit www.YAddress.net to open an account.",
"AddressLine1": null,
"AddressLine2": null,
"Number": null,
"PreDir": null,
"Street": null,
"Suffix": null,
"PostDir": null,
"Sec": null,
"SecNumber": null,
"City": null,
"State": null,
"Zip": null,
"Zip4": null,
"County": null,
"StateFP": null,
"CountyFP": null,
"CensusTract": null,
"CensusBlock": null,
"Latitude": 0.0,
"Longitude": 0.0,
"GeoPrecision": 0
}',
:headers => {})
end
it "returns an unverified address" do
address = AddressVerifier.verify_address "46 Dogwood Dr", "", "Plainsboro", "NJ", "08536", "45"
expect(address.verified?).to eq(false)
end
it "returns the proper error code" do
address = AddressVerifier.verify_address "46 Dogwood Dr", "", "Plainsboro", "NJ", "08536", "45"
expect(address.error_code).to eq(1)
end
it "returns the proper error message" do
address = AddressVerifier.verify_address "46 Dogwood Dr", "", "Plainsboro", "NJ", "08536", "45"
expect(address.error_message).to eq('Invalid user key. Leave blank for testing or visit www.YAddress.net to open an account.')
end
end
end
end
| {
"content_hash": "29fa0fec3387e0ebc7554e4b27f55db6",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 158,
"avg_line_length": 40.1588785046729,
"alnum_prop": 0.5061670933209216,
"repo_name": "shopkeep/address_verifier",
"id": "2fe78442e07c2aed90bf03b9524987f8951bfb19",
"size": "8594",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/address_verifier_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "17205"
}
],
"symlink_target": ""
} |
Blesses css files using [blesscss](http://blesscss.com/)
Options for bless can be setup in your `Brocfile.js`
```js
var app = new EmberApp({
bless: {
enabled: true,
cacheBuster: true,
compress: false,
force: false,
imports: true
// log: true }
});
```
## Use in broccoli
```js
var bless = require('ember-cli-bless').blessCss;
tree = bless(inputTree, options);
```
## Installation
`ember install:npm ember-cli-bless`
## Running Tests
* `npm test`
[travis-badge]: https://travis-ci.org/jschilli/ember-cli-bless.svg?branch=master
[travis-badge-url]: https://travis-ci.org/jschilli/ember-cli-bless
| {
"content_hash": "3bee5e36ec5441908c2fb1d3c86bb168",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 17.16216216216216,
"alnum_prop": 0.6677165354330709,
"repo_name": "jschilli/ember-cli-bless",
"id": "a08ad0db7528e1aaf15dd42fe6a4006ebeaf25d9",
"size": "704",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "57418"
},
{
"name": "HTML",
"bytes": "1574"
},
{
"name": "Handlebars",
"bytes": "52"
},
{
"name": "JavaScript",
"bytes": "13388"
}
],
"symlink_target": ""
} |
// Autorun.cpp : Defines the entry point for the application.
#include "stdafx.h"
#include "shellapi.h"
#include "Autorun.h"
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
HINSTANCE result;
LPCTSTR lpDefCmd = L"start.hta";
//try to get the startup path and set it as the working directory
int nArgs;
LPWSTR *lpFullCmdLineArray = CommandLineToArgvW(GetCommandLine(), &nArgs);
wchar_t lpStartupPath[_MAX_PATH];
wchar_t drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
if (nArgs > 0)
{
_wsplitpath(lpFullCmdLineArray[0], drive, dir, fname, ext);
_wmakepath(lpStartupPath, drive, dir, NULL, NULL);
_wchdir(lpStartupPath);
}
//use the default cmd line
if (wcslen(lpCmdLine) == 0)
{
wcscpy(lpCmdLine, lpDefCmd);
}
// Launch the file specified on the command-line
result = ShellExecute(NULL, L"open", lpCmdLine, NULL, NULL, SW_SHOWNORMAL);
// Check the result
if ((int)result <= 32)
{
// An error was encountered launching
// the .HTA, probably because the computer
// doesn't have IE5 or greater
// Open windows explorer, showing the CD contents
ShellExecute(NULL, L"explore", lpStartupPath, NULL, NULL, SW_SHOWNORMAL);
return 1;
}
else
{
// Launched OK
return 0;
}
}
| {
"content_hash": "155ebf12ef6f083ae8d88d24442a10d6",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 76,
"avg_line_length": 25.653846153846153,
"alnum_prop": 0.6836581709145427,
"repo_name": "hmehr/OSS",
"id": "4024fe63173114016e9a15b25fcc9b48ec307b1a",
"size": "2604",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MemoryLifter/Development/Current/Autorun/Autorun.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "4736"
},
{
"name": "C",
"bytes": "3934"
},
{
"name": "C#",
"bytes": "18626395"
},
{
"name": "C++",
"bytes": "13730"
},
{
"name": "CSS",
"bytes": "230096"
},
{
"name": "JavaScript",
"bytes": "1428988"
},
{
"name": "Objective-C",
"bytes": "2616"
},
{
"name": "Python",
"bytes": "119032"
},
{
"name": "Shell",
"bytes": "812"
},
{
"name": "Visual Basic",
"bytes": "4448"
},
{
"name": "XSLT",
"bytes": "1422370"
}
],
"symlink_target": ""
} |
using blink::WebCompositorAnimation;
using blink::WebCompositorAnimationCurve;
using blink::WebFloatAnimationCurve;
namespace cc_blink {
namespace {
TEST(WebCompositorAnimationTest, DefaultSettings) {
scoped_ptr<WebCompositorAnimationCurve> curve(
new WebFloatAnimationCurveImpl());
scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimationImpl(
*curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
// Ensure that the defaults are correct.
EXPECT_EQ(1, animation->iterations());
EXPECT_EQ(0, animation->startTime());
EXPECT_EQ(0, animation->timeOffset());
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
EXPECT_EQ(WebCompositorAnimation::DirectionNormal, animation->direction());
#else
EXPECT_FALSE(animation->alternatesDirection());
#endif
}
TEST(WebCompositorAnimationTest, ModifiedSettings) {
scoped_ptr<WebFloatAnimationCurve> curve(new WebFloatAnimationCurveImpl());
scoped_ptr<WebCompositorAnimation> animation(new WebCompositorAnimationImpl(
*curve, WebCompositorAnimation::TargetPropertyOpacity, 1, 0));
animation->setIterations(2);
animation->setStartTime(2);
animation->setTimeOffset(2);
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
animation->setDirection(WebCompositorAnimation::DirectionReverse);
#else
animation->setAlternatesDirection(true);
#endif
EXPECT_EQ(2, animation->iterations());
EXPECT_EQ(2, animation->startTime());
EXPECT_EQ(2, animation->timeOffset());
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
EXPECT_EQ(WebCompositorAnimation::DirectionReverse, animation->direction());
#else
EXPECT_TRUE(animation->alternatesDirection());
animation->setAlternatesDirection(false);
EXPECT_FALSE(animation->alternatesDirection());
#endif
}
} // namespace
} // namespace cc_blink
| {
"content_hash": "f8641681cddf785e3e6b03e04d70ec25",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 78,
"avg_line_length": 34.80392156862745,
"alnum_prop": 0.780281690140845,
"repo_name": "7kbird/chrome",
"id": "cf9e05c782c9460d2f64e2fae7e689aed0a4387e",
"size": "2119",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "cc/blink/web_animation_unittest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "AppleScript",
"bytes": "6973"
},
{
"name": "Arduino",
"bytes": "464"
},
{
"name": "Assembly",
"bytes": "35318"
},
{
"name": "Batchfile",
"bytes": "7198"
},
{
"name": "C",
"bytes": "3677808"
},
{
"name": "C++",
"bytes": "212205607"
},
{
"name": "CSS",
"bytes": "871288"
},
{
"name": "HTML",
"bytes": "24532775"
},
{
"name": "Java",
"bytes": "5466890"
},
{
"name": "JavaScript",
"bytes": "17937570"
},
{
"name": "Makefile",
"bytes": "37731"
},
{
"name": "Objective-C",
"bytes": "1120421"
},
{
"name": "Objective-C++",
"bytes": "7054476"
},
{
"name": "PHP",
"bytes": "97817"
},
{
"name": "PLpgSQL",
"bytes": "218361"
},
{
"name": "Perl",
"bytes": "69392"
},
{
"name": "Protocol Buffer",
"bytes": "388742"
},
{
"name": "Python",
"bytes": "6953688"
},
{
"name": "Shell",
"bytes": "465194"
},
{
"name": "Standard ML",
"bytes": "4131"
},
{
"name": "XSLT",
"bytes": "418"
},
{
"name": "nesC",
"bytes": "15206"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Fri Apr 06 09:47:26 MST 2018 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.wildfly.swarm.microprofile.openapi.deployment (BOM: * : All 2018.4.2 API)</title>
<meta name="date" content="2018-04-06">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../../../../../../org/wildfly/swarm/microprofile/openapi/deployment/package-summary.html" target="classFrame">org.wildfly.swarm.microprofile.openapi.deployment</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="OpenApiServletContextListener.html" title="class in org.wildfly.swarm.microprofile.openapi.deployment" target="classFrame">OpenApiServletContextListener</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "454ab993e63245c8a3cda5b40caca5e0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 193,
"avg_line_length": 51.666666666666664,
"alnum_prop": 0.6866359447004609,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "359721d592bf8ca4433f16f0a4bcbd7fa6c5aaee",
"size": "1085",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2018.4.2/apidocs/org/wildfly/swarm/microprofile/openapi/deployment/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<div class="testimonials" ng-app="app" ng-controller="AppCtrl" >
<material-tabs selected="selected" nobar tabs-align="bottom" >
<material-tab>
<p ng-class="{active:selected==0}">
I'm thrilled by the depth of thought behind Material Design's
specification for responsive application development.
Drifty's implementation for AngularJS makes it instantly
usable in your existing applications.
</p>
<material-tab-label>
<footer style="background-image: url(/img/testimonials/[email protected])"
ng-mouseenter="enableAutoScroll(false);"
ng-mouseleave="enableAutoScroll(true);" >
<cite>Brad Green</cite>
<div>
Director, <a href="https://plus.google.com/+BradGreen/about">Google</a>
</div>
</footer>
</material-tab-label>
</material-tab>
<material-tab>
<p ng-class="{active:selected==1}">
I am so inspired with Angular Material. It fills a gap that's
missing when building for mobile and solves many complexities
that otherwise require multiple libraries, keeping your code
cleaner. Overall, it just makes mobile development fun and
fast, so you can build more!
</p>
<material-tab-label>
<footer style="background-image: url(/img/testimonials/[email protected])"
ng-mouseenter="enableAutoScroll(false);"
ng-mouseleave="enableAutoScroll(true);" >
<cite>Max Lynch</cite>
<div>
Co-Founder,
<a href="http://ionicframework.com/">Drifty</a>
</div>
</footer>
</material-tab-label>
</material-tab>
<material-tab>
<p ng-class="{active:selected==2}">
Using the Material Design specifications and lessons learned
from Angular & Polymer component development, our team has
created Angular Material. Implemented with advanced CSS and
Directives, Angular Material delivers an amazing UI SDK for
Angular SPA(s).
</p>
<material-tab-label>
<footer style="background-image: url(/img/testimonials/[email protected])"
ng-mouseenter="enableAutoScroll(false);"
ng-mouseleave="enableAutoScroll(true);" >
<cite>Thomas Burleson</cite>
<div>
i-Architect,
<a href="http://solutionOptimist.com/">Mindspace</a>
</div>
</footer>
</material-tab-label>
</material-tab>
</material-tabs>
</div>
| {
"content_hash": "62b8db6412b85c8efa9a042f4c73fc50",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 99,
"avg_line_length": 46.03030303030303,
"alnum_prop": 0.5187623436471362,
"repo_name": "11th/material",
"id": "4c18905219a0aa18adef11c5171d0bce911ed3b0",
"size": "3038",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/tabs/demos/demo1/index.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package winapi
import (
"syscall"
"unsafe"
)
// LISTVIEW parts
const (
LVP_LISTITEM = 1
LVP_LISTGROUP = 2
LVP_LISTDETAIL = 3
LVP_LISTSORTEDDETAIL = 4
LVP_EMPTYTEXT = 5
LVP_GROUPHEADER = 6
LVP_GROUPHEADERLINE = 7
LVP_EXPANDBUTTON = 8
LVP_COLLAPSEBUTTON = 9
LVP_COLUMNDETAIL = 10
)
// LVP_LISTITEM states
const (
LISS_NORMAL = 1
LISS_HOT = 2
LISS_SELECTED = 3
LISS_DISABLED = 4
LISS_SELECTEDNOTFOCUS = 5
LISS_HOTSELECTED = 6
)
// TREEVIEW parts
const (
TVP_TREEITEM = 1
TVP_GLYPH = 2
TVP_BRANCH = 3
TVP_HOTGLYPH = 4
)
// TVP_TREEITEM states
const (
TREIS_NORMAL = 1
TREIS_HOT = 2
TREIS_SELECTED = 3
TREIS_DISABLED = 4
TREIS_SELECTEDNOTFOCUS = 5
TREIS_HOTSELECTED = 6
)
type HTHEME HANDLE
var (
// Library
libuxtheme uintptr
// Functions
closeThemeData uintptr
drawThemeBackground uintptr
drawThemeText uintptr
getThemeTextExtent uintptr
openThemeData uintptr
setWindowTheme uintptr
)
func init() {
// Library
libuxtheme = MustLoadLibrary("uxtheme.dll")
// Functions
closeThemeData = MustGetProcAddress(libuxtheme, "CloseThemeData")
drawThemeBackground = MustGetProcAddress(libuxtheme, "DrawThemeBackground")
drawThemeText = MustGetProcAddress(libuxtheme, "DrawThemeText")
getThemeTextExtent = MustGetProcAddress(libuxtheme, "GetThemeTextExtent")
openThemeData = MustGetProcAddress(libuxtheme, "OpenThemeData")
setWindowTheme = MustGetProcAddress(libuxtheme, "SetWindowTheme")
}
func CloseThemeData(hTheme HTHEME) HRESULT {
ret, _, _ := syscall.Syscall(closeThemeData, 1,
uintptr(hTheme),
0,
0)
return HRESULT(ret)
}
func DrawThemeBackground(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pRect, pClipRect *RECT) HRESULT {
ret, _, _ := syscall.Syscall6(drawThemeBackground, 6,
uintptr(hTheme),
uintptr(hdc),
uintptr(iPartId),
uintptr(iStateId),
uintptr(unsafe.Pointer(pRect)),
uintptr(unsafe.Pointer(pClipRect)))
return HRESULT(ret)
}
func DrawThemeText(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText *uint16, iCharCount int32, dwTextFlags, dwTextFlags2 uint32, pRect *RECT) HRESULT {
ret, _, _ := syscall.Syscall9(drawThemeText, 9,
uintptr(hTheme),
uintptr(hdc),
uintptr(iPartId),
uintptr(iStateId),
uintptr(unsafe.Pointer(pszText)),
uintptr(iCharCount),
uintptr(dwTextFlags),
uintptr(dwTextFlags2),
uintptr(unsafe.Pointer(pRect)))
return HRESULT(ret)
}
func GetThemeTextExtent(hTheme HTHEME, hdc HDC, iPartId, iStateId int32, pszText *uint16, iCharCount int32, dwTextFlags uint32, pBoundingRect, pExtentRect *RECT) HRESULT {
ret, _, _ := syscall.Syscall9(getThemeTextExtent, 9,
uintptr(hTheme),
uintptr(hdc),
uintptr(iPartId),
uintptr(iStateId),
uintptr(unsafe.Pointer(pszText)),
uintptr(iCharCount),
uintptr(dwTextFlags),
uintptr(unsafe.Pointer(pBoundingRect)),
uintptr(unsafe.Pointer(pExtentRect)))
return HRESULT(ret)
}
func OpenThemeData(hwnd HWND, pszClassList *uint16) HTHEME {
ret, _, _ := syscall.Syscall(openThemeData, 2,
uintptr(hwnd),
uintptr(unsafe.Pointer(pszClassList)),
0)
return HTHEME(ret)
}
func SetWindowTheme(hwnd HWND, pszSubAppName, pszSubIdList *uint16) HRESULT {
ret, _, _ := syscall.Syscall(setWindowTheme, 3,
uintptr(hwnd),
uintptr(unsafe.Pointer(pszSubAppName)),
uintptr(unsafe.Pointer(pszSubIdList)))
return HRESULT(ret)
}
| {
"content_hash": "2d67fad9ac418138ab8d674c7608d4d5",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 171,
"avg_line_length": 23.917241379310344,
"alnum_prop": 0.7076124567474048,
"repo_name": "ssoor/winapi",
"id": "c58922ff438597ffc926033f05c896e2e4696108",
"size": "3648",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "uxtheme.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Go",
"bytes": "266585"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "094d5c6127f2a0d379977ca60a7771a7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "880b9e61fe142ffb1dcf6585fd8a60266ce72a42",
"size": "172",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/Althaea/Althaea caribaea/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.epam.ta.reportportal.ws.model.item;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.io.Serializable;
import java.util.List;
/**
* @author <a href="mailto:[email protected]">Ivan Budayeu</a>
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PathNameResource implements Serializable {
@JsonProperty(value = "launchPathName")
private LaunchPathName launchPathName;
@JsonProperty(value = "itemPaths")
private List<ItemPathName> itemPaths;
public PathNameResource() {
}
public PathNameResource(LaunchPathName launchPathName, List<ItemPathName> itemPaths) {
this.launchPathName = launchPathName;
this.itemPaths = itemPaths;
}
public LaunchPathName getLaunchPathName() {
return launchPathName;
}
public void setLaunchPathName(LaunchPathName launchPathName) {
this.launchPathName = launchPathName;
}
public List<ItemPathName> getItemPaths() {
return itemPaths;
}
public void setItemPaths(List<ItemPathName> itemPaths) {
this.itemPaths = itemPaths;
}
}
| {
"content_hash": "e7e75e4ffc383d2300e09d8f399c29b6",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 87,
"avg_line_length": 23.543478260869566,
"alnum_prop": 0.778393351800554,
"repo_name": "reportportal/commons-model",
"id": "8b633cf959c9019594e28e6bd077e21de821e79c",
"size": "1678",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/main/java/com/epam/ta/reportportal/ws/model/item/PathNameResource.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "453186"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.