text
stringlengths 2
1.04M
| meta
dict |
|---|---|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jiahaoliuliu.abtestwithapptimize">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:name=".MainApplication"
>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".ItemDetailsActivity"
android:label="@string/title_activity_item_details"
android:theme="@style/AppTheme.NoActionBar">
</activity>
</application>
</manifest>
|
{
"content_hash": "2b434da6e2835d750d5930f4d17320b3",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 68,
"avg_line_length": 31.79310344827586,
"alnum_prop": 0.6735357917570499,
"repo_name": "jiahaoliuliu/ABTestWithApptimize",
"id": "6e9dba007ed0066fd975e5a28448f9a9f8934405",
"size": "922",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/AndroidManifest.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "6617"
}
],
"symlink_target": ""
}
|
var baseCreate = require('./baseCreate'),
isObject = require('../objects/isObject'),
setBindData = require('./setBindData');
/**
* Used for `Array` method references.
*
* Normally `Array.prototype` would suffice, however, using an array literal
* avoids issues in Narwhal.
*/
var arrayRef = [];
/** Native method shortcuts */
var push = arrayRef.push;
/**
* The base implementation of `_.bind` that creates the bound function and
* sets its meta data.
*
* @private
* @param {Array} bindData The bind data array.
* @returns {Function} Returns the new bound function.
*/
function baseBind(bindData) {
var func = bindData[0],
partialArgs = bindData[2],
thisArg = bindData[4];
function bound() {
// `Function#bind` spec
// http://es5.github.io/#x15.3.4.5
if (partialArgs) {
var args = partialArgs.slice();
push.apply(args, arguments);
}
// mimic the constructor's `return` behavior
// http://es5.github.io/#x13.2.2
if (this instanceof bound) {
// ensure `new bound` is an instance of `func`
var thisBinding = baseCreate(func.prototype),
result = func.apply(thisBinding, args || arguments);
return isObject(result) ? result : thisBinding;
}
return func.apply(thisArg, args || arguments);
}
setBindData(bound, bindData);
return bound;
}
module.exports = baseBind;
|
{
"content_hash": "840346e052712f560de708b47f83ab97",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 76,
"avg_line_length": 27.098039215686274,
"alnum_prop": 0.6497829232995659,
"repo_name": "stanxii/ngb",
"id": "2ff8e97607ed83aaacae3dac60a639f10499bf9e",
"size": "1796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node.js/node_modules/elasticsearch/node_modules/lodash-node/modern/internals/baseBind.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "117595"
},
{
"name": "Groovy",
"bytes": "1232"
},
{
"name": "Java",
"bytes": "75018"
},
{
"name": "JavaScript",
"bytes": "306729"
},
{
"name": "Shell",
"bytes": "2366"
}
],
"symlink_target": ""
}
|
import { omit, pick } from 'lodash';
import * as React from 'react';
import { render } from 'react-dom';
import { Store } from 'redux';
import ComponentWrapper from '../../components/ComponentWrapper';
import { IAppState } from '../../types';
import { camelizeKeys } from '../../util/util';
import Plugin from '../plugin';
import EmailPensionView from './EmailPensionView';
import EmailRepresentativeView from './EmailRepresentativeView';
interface IEmailPensionOptions {
el: HTMLElement;
namespace: string;
config: any; // todo
store: Store<IAppState>;
}
export const init = options => {
if (!options.el) {
options.el = document.getElementById('email-pension-component');
}
const { el, config, store } = options;
const member = window.champaign.personalization.member;
const memberData = pick(member, 'name', 'email', 'country', 'postal');
const formValues = window.champaign.personalization.formValues;
return new EmailPension({
config: {
...config,
...memberData,
...formValues,
},
el,
namespace: 'emailpension',
store,
});
};
class EmailPension extends Plugin<any> {
public store: Store<IAppState>;
public customRenderer: (instance: EmailPension) => any | undefined;
public wrappedReactComponent?: React.Component;
public props: { [key: string]: any };
constructor(options: IEmailPensionOptions) {
super(options);
this.store = options.store;
this.props = omit(camelizeKeys(this.config), 'id', 'ref');
this.store.dispatch({
type: 'email_target:initialize',
payload: omit(camelizeKeys(this.config), 'id', 'ref'),
});
this.render();
}
public render() {
if (this.customRenderer) {
return this.customRenderer(this);
}
return render(
<ComponentWrapper store={this.store} locale={window.I18n.locale}>
{this.props.targetEndpoint && (
<EmailRepresentativeView {...this.props} />
)}
{!this.props.targetEndpoint && <EmailPensionView {...this.props} />}
</ComponentWrapper>,
this.el
);
}
}
|
{
"content_hash": "b7e5943e579ed114d913506030f3b0c3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 76,
"avg_line_length": 29.7,
"alnum_prop": 0.6584896584896585,
"repo_name": "SumOfUs/Champaign",
"id": "1c46cb1dc9982537800a2b52b5b65ed3bcf86753",
"size": "2079",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "app/javascript/plugins/email_pension/index.tsx",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9404"
},
{
"name": "Dockerfile",
"bytes": "254"
},
{
"name": "HTML",
"bytes": "584586"
},
{
"name": "JavaScript",
"bytes": "467169"
},
{
"name": "Liquid",
"bytes": "42808"
},
{
"name": "Procfile",
"bytes": "87"
},
{
"name": "Ruby",
"bytes": "1656000"
},
{
"name": "SCSS",
"bytes": "87041"
},
{
"name": "Shell",
"bytes": "5335"
},
{
"name": "Slim",
"bytes": "141763"
},
{
"name": "TypeScript",
"bytes": "68833"
}
],
"symlink_target": ""
}
|
"""
====================================================================
K-means clustering and vector quantization (:mod:`scipy.cluster.vq`)
====================================================================
Provides routines for k-means clustering, generating code books
from k-means models, and quantizing vectors by comparing them with
centroids in a code book.
.. autosummary::
:toctree: generated/
whiten -- Normalize a group of observations so each feature has unit variance
vq -- Calculate code book membership of a set of observation vectors
kmeans -- Performs k-means on a set of observation vectors forming k clusters
kmeans2 -- A different implementation of k-means with more methods
-- for initializing centroids
Background information
======================
The k-means algorithm takes as input the number of clusters to
generate, k, and a set of observation vectors to cluster. It
returns a set of centroids, one for each of the k clusters. An
observation vector is classified with the cluster number or
centroid index of the centroid closest to it.
A vector v belongs to cluster i if it is closer to centroid i than
any other centroids. If v belongs to i, we say centroid i is the
dominating centroid of v. The k-means algorithm tries to
minimize distortion, which is defined as the sum of the squared distances
between each observation vector and its dominating centroid. Each
step of the k-means algorithm refines the choices of centroids to
reduce distortion. The change in distortion is used as a
stopping criterion: when the change is lower than a threshold, the
k-means algorithm is not making sufficient progress and
terminates. One can also define a maximum number of iterations.
Since vector quantization is a natural application for k-means,
information theory terminology is often used. The centroid index
or cluster index is also referred to as a "code" and the table
mapping codes to centroids and vice versa is often referred as a
"code book". The result of k-means, a set of centroids, can be
used to quantize vectors. Quantization aims to find an encoding of
vectors that reduces the expected distortion.
All routines expect obs to be a M by N array where the rows are
the observation vectors. The codebook is a k by N array where the
i'th row is the centroid of code word i. The observation vectors
and centroids have the same feature dimension.
As an example, suppose we wish to compress a 24-bit color image
(each pixel is represented by one byte for red, one for blue, and
one for green) before sending it over the web. By using a smaller
8-bit encoding, we can reduce the amount of data by two
thirds. Ideally, the colors for each of the 256 possible 8-bit
encoding values should be chosen to minimize distortion of the
color. Running k-means with k=256 generates a code book of 256
codes, which fills up all possible 8-bit sequences. Instead of
sending a 3-byte value for each pixel, the 8-bit centroid index
(or code word) of the dominating centroid is transmitted. The code
book is also sent over the wire so each 8-bit code can be
translated back to a 24-bit pixel value representation. If the
image of interest was of an ocean, we would expect many 24-bit
blues to be represented by 8-bit codes. If it was an image of a
human face, more flesh tone colors would be represented in the
code book.
"""
from __future__ import division, print_function, absolute_import
__docformat__ = 'restructuredtext'
__all__ = ['whiten', 'vq', 'kmeans', 'kmeans2']
# TODO:
# - implements high level method for running several times k-means with
# different initialialization
# - warning: what happens if different number of clusters ? For now, emit a
# warning, but it is not great, because I am not sure it really make sense to
# succeed in this case (maybe an exception is better ?)
import warnings
from numpy.random import randint
from numpy import shape, zeros, sqrt, argmin, minimum, array, \
newaxis, arange, compress, equal, common_type, single, double, take, \
std, mean
import numpy as np
class ClusterError(Exception):
pass
def whiten(obs):
"""
Normalize a group of observations on a per feature basis.
Before running k-means, it is beneficial to rescale each feature
dimension of the observation set with whitening. Each feature is
divided by its standard deviation across all observations to give
it unit variance.
Parameters
----------
obs : ndarray
Each row of the array is an observation. The
columns are the features seen during each observation.
>>> # f0 f1 f2
>>> obs = [[ 1., 1., 1.], #o0
... [ 2., 2., 2.], #o1
... [ 3., 3., 3.], #o2
... [ 4., 4., 4.]]) #o3
Returns
-------
result : ndarray
Contains the values in `obs` scaled by the standard deviation
of each column.
Examples
--------
>>> from scipy.cluster.vq import whiten
>>> features = np.array([[1.9, 2.3, 1.7],
... [1.5, 2.5, 2.2],
... [0.8, 0.6, 1.7,]])
>>> whiten(features)
array([[ 4.17944278, 2.69811351, 7.21248917],
[ 3.29956009, 2.93273208, 9.33380951],
[ 1.75976538, 0.7038557 , 7.21248917]])
"""
std_dev = std(obs, axis=0)
return obs / std_dev
def vq(obs, code_book):
"""
Assign codes from a code book to observations.
Assigns a code from a code book to each observation. Each
observation vector in the 'M' by 'N' `obs` array is compared with the
centroids in the code book and assigned the code of the closest
centroid.
The features in `obs` should have unit variance, which can be
acheived by passing them through the whiten function. The code
book can be created with the k-means algorithm or a different
encoding algorithm.
Parameters
----------
obs : ndarray
Each row of the 'N' x 'M' array is an observation. The columns are
the "features" seen during each observation. The features must be
whitened first using the whiten function or something equivalent.
code_book : ndarray
The code book is usually generated using the k-means algorithm.
Each row of the array holds a different code, and the columns are
the features of the code.
>>> # f0 f1 f2 f3
>>> code_book = [
... [ 1., 2., 3., 4.], #c0
... [ 1., 2., 3., 4.], #c1
... [ 1., 2., 3., 4.]]) #c2
Returns
-------
code : ndarray
A length N array holding the code book index for each observation.
dist : ndarray
The distortion (distance) between the observation and its nearest
code.
Notes
-----
This currently forces 32-bit math precision for speed. Anyone know
of a situation where this undermines the accuracy of the algorithm?
Examples
--------
>>> from numpy import array
>>> from scipy.cluster.vq import vq
>>> code_book = array([[1.,1.,1.],
... [2.,2.,2.]])
>>> features = array([[ 1.9,2.3,1.7],
... [ 1.5,2.5,2.2],
... [ 0.8,0.6,1.7]])
>>> vq(features,code_book)
(array([1, 1, 0],'i'), array([ 0.43588989, 0.73484692, 0.83066239]))
"""
try:
from . import _vq
ct = common_type(obs, code_book)
c_obs = obs.astype(ct)
c_code_book = code_book.astype(ct)
if ct is single:
results = _vq.vq(c_obs, c_code_book)
elif ct is double:
results = _vq.vq(c_obs, c_code_book)
else:
results = py_vq(obs, code_book)
except ImportError:
results = py_vq(obs, code_book)
return results
def py_vq(obs, code_book):
""" Python version of vq algorithm.
The algorithm computes the euclidian distance between each
observation and every frame in the code_book.
Parameters
----------
obs : ndarray
Expects a rank 2 array. Each row is one observation.
code_book : ndarray
Code book to use. Same format than obs. Should have same number of
features (eg columns) than obs.
Returns
-------
code : ndarray
code[i] gives the label of the ith obversation, that its code is
code_book[code[i]].
mind_dist : ndarray
min_dist[i] gives the distance between the ith observation and its
corresponding code.
Notes
-----
This function is slower than the C version but works for
all input types. If the inputs have the wrong types for the
C versions of the function, this one is called as a last resort.
It is about 20 times slower than the C version.
"""
# n = number of observations
# d = number of features
if np.ndim(obs) == 1:
if not np.ndim(obs) == np.ndim(code_book):
raise ValueError(
"Observation and code_book should have the same rank")
else:
return _py_vq_1d(obs, code_book)
else:
(n, d) = shape(obs)
# code books and observations should have same number of features and same
# shape
if not np.ndim(obs) == np.ndim(code_book):
raise ValueError("Observation and code_book should have the same rank")
elif not d == code_book.shape[1]:
raise ValueError("Code book(%d) and obs(%d) should have the same " \
"number of features (eg columns)""" %
(code_book.shape[1], d))
code = zeros(n, dtype=int)
min_dist = zeros(n)
for i in range(n):
dist = np.sum((obs[i] - code_book) ** 2, 1)
code[i] = argmin(dist)
min_dist[i] = dist[code[i]]
return code, sqrt(min_dist)
def _py_vq_1d(obs, code_book):
""" Python version of vq algorithm for rank 1 only.
Parameters
----------
obs : ndarray
Expects a rank 1 array. Each item is one observation.
code_book : ndarray
Code book to use. Same format than obs. Should rank 1 too.
Returns
-------
code : ndarray
code[i] gives the label of the ith obversation, that its code is
code_book[code[i]].
mind_dist : ndarray
min_dist[i] gives the distance between the ith observation and its
corresponding code.
"""
raise RuntimeError("_py_vq_1d buggy, do not use rank 1 arrays for now")
n = obs.size
nc = code_book.size
dist = np.zeros((n, nc))
for i in range(nc):
dist[:, i] = np.sum(obs - code_book[i])
print(dist)
code = argmin(dist)
min_dist = dist[code]
return code, sqrt(min_dist)
def py_vq2(obs, code_book):
"""2nd Python version of vq algorithm.
The algorithm simply computes the euclidian distance between each
observation and every frame in the code_book/
Parameters
----------
obs : ndarray
Expect a rank 2 array. Each row is one observation.
code_book : ndarray
Code book to use. Same format than obs. Should have same number of
features (eg columns) than obs.
Returns
-------
code : ndarray
code[i] gives the label of the ith obversation, that its code is
code_book[code[i]].
mind_dist : ndarray
min_dist[i] gives the distance between the ith observation and its
corresponding code.
Notes
-----
This could be faster when number of codebooks is small, but it
becomes a real memory hog when codebook is large. It requires
N by M by O storage where N=number of obs, M = number of
features, and O = number of codes.
"""
d = shape(obs)[1]
# code books and observations should have same number of features
if not d == code_book.shape[1]:
raise ValueError("""
code book(%d) and obs(%d) should have the same
number of features (eg columns)""" % (code_book.shape[1], d))
diff = obs[newaxis, :, :] - code_book[:,newaxis,:]
dist = sqrt(np.sum(diff * diff, -1))
code = argmin(dist, 0)
min_dist = minimum.reduce(dist, 0) #the next line I think is equivalent
# - and should be faster
#min_dist = choose(code,dist) # but in practice, didn't seem to make
# much difference.
return code, min_dist
def _kmeans(obs, guess, thresh=1e-5):
""" "raw" version of k-means.
Returns
-------
code_book :
the lowest distortion codebook found.
avg_dist :
the average distance a observation is from a code in the book.
Lower means the code_book matches the data better.
See Also
--------
kmeans : wrapper around k-means
XXX should have an axis variable here.
Examples
--------
Note: not whitened in this example.
>>> from numpy import array
>>> from scipy.cluster.vq import _kmeans
>>> features = array([[ 1.9,2.3],
... [ 1.5,2.5],
... [ 0.8,0.6],
... [ 0.4,1.8],
... [ 1.0,1.0]])
>>> book = array((features[0],features[2]))
>>> _kmeans(features,book)
(array([[ 1.7 , 2.4 ],
[ 0.73333333, 1.13333333]]), 0.40563916697728591)
"""
code_book = array(guess, copy = True)
avg_dist = []
diff = thresh+1.
while diff > thresh:
nc = code_book.shape[0]
#compute membership and distances between obs and code_book
obs_code, distort = vq(obs, code_book)
avg_dist.append(mean(distort, axis=-1))
#recalc code_book as centroids of associated obs
if(diff > thresh):
has_members = []
for i in arange(nc):
cell_members = compress(equal(obs_code, i), obs, 0)
if cell_members.shape[0] > 0:
code_book[i] = mean(cell_members, 0)
has_members.append(i)
#remove code_books that didn't have any members
code_book = take(code_book, has_members, 0)
if len(avg_dist) > 1:
diff = avg_dist[-2] - avg_dist[-1]
#print avg_dist
return code_book, avg_dist[-1]
def kmeans(obs, k_or_guess, iter=20, thresh=1e-5):
"""
Performs k-means on a set of observation vectors forming k clusters.
The k-means algorithm adjusts the centroids until sufficient
progress cannot be made, i.e. the change in distortion since
the last iteration is less than some threshold. This yields
a code book mapping centroids to codes and vice versa.
Distortion is defined as the sum of the squared differences
between the observations and the corresponding centroid.
Parameters
----------
obs : ndarray
Each row of the M by N array is an observation vector. The
columns are the features seen during each observation.
The features must be whitened first with the `whiten` function.
k_or_guess : int or ndarray
The number of centroids to generate. A code is assigned to
each centroid, which is also the row index of the centroid
in the code_book matrix generated.
The initial k centroids are chosen by randomly selecting
observations from the observation matrix. Alternatively,
passing a k by N array specifies the initial k centroids.
iter : int, optional
The number of times to run k-means, returning the codebook
with the lowest distortion. This argument is ignored if
initial centroids are specified with an array for the
``k_or_guess`` parameter. This parameter does not represent the
number of iterations of the k-means algorithm.
thresh : float, optional
Terminates the k-means algorithm if the change in
distortion since the last k-means iteration is less than
or equal to thresh.
Returns
-------
codebook : ndarray
A k by N array of k centroids. The i'th centroid
codebook[i] is represented with the code i. The centroids
and codes generated represent the lowest distortion seen,
not necessarily the globally minimal distortion.
distortion : float
The distortion between the observations passed and the
centroids generated.
See Also
--------
kmeans2 : a different implementation of k-means clustering
with more methods for generating initial centroids but without
using a distortion change threshold as a stopping criterion.
whiten : must be called prior to passing an observation matrix
to kmeans.
Examples
--------
>>> from numpy import array
>>> from scipy.cluster.vq import vq, kmeans, whiten
>>> features = array([[ 1.9,2.3],
... [ 1.5,2.5],
... [ 0.8,0.6],
... [ 0.4,1.8],
... [ 0.1,0.1],
... [ 0.2,1.8],
... [ 2.0,0.5],
... [ 0.3,1.5],
... [ 1.0,1.0]])
>>> whitened = whiten(features)
>>> book = array((whitened[0],whitened[2]))
>>> kmeans(whitened,book)
(array([[ 2.3110306 , 2.86287398],
[ 0.93218041, 1.24398691]]), 0.85684700941625547)
>>> from numpy import random
>>> random.seed((1000,2000))
>>> codes = 3
>>> kmeans(whitened,codes)
(array([[ 2.3110306 , 2.86287398],
[ 1.32544402, 0.65607529],
[ 0.40782893, 2.02786907]]), 0.5196582527686241)
"""
if int(iter) < 1:
raise ValueError('iter must be at least 1.')
if type(k_or_guess) == type(array([])):
guess = k_or_guess
if guess.size < 1:
raise ValueError("Asked for 0 cluster ? initial book was %s" % \
guess)
result = _kmeans(obs, guess, thresh = thresh)
else:
#initialize best distance value to a large value
best_dist = np.inf
No = obs.shape[0]
k = k_or_guess
if k < 1:
raise ValueError("Asked for 0 cluster ? ")
for i in range(iter):
#the intial code book is randomly selected from observations
guess = take(obs, randint(0, No, k), 0)
book, dist = _kmeans(obs, guess, thresh = thresh)
if dist < best_dist:
best_book = book
best_dist = dist
result = best_book, best_dist
return result
def _kpoints(data, k):
"""Pick k points at random in data (one row = one observation).
This is done by taking the k first values of a random permutation of 1..N
where N is the number of observation.
Parameters
----------
data : ndarray
Expect a rank 1 or 2 array. Rank 1 are assumed to describe one
dimensional data, rank 2 multidimensional data, in which case one
row is one observation.
k : int
Number of samples to generate.
"""
if data.ndim > 1:
n = data.shape[0]
else:
n = data.size
p = np.random.permutation(n)
x = data[p[:k], :].copy()
return x
def _krandinit(data, k):
"""Returns k samples of a random variable which parameters depend on data.
More precisely, it returns k observations sampled from a Gaussian random
variable which mean and covariances are the one estimated from data.
Parameters
----------
data : ndarray
Expect a rank 1 or 2 array. Rank 1 are assumed to describe one
dimensional data, rank 2 multidimensional data, in which case one
row is one observation.
k : int
Number of samples to generate.
"""
def init_rank1(data):
mu = np.mean(data)
cov = np.cov(data)
x = np.random.randn(k)
x *= np.sqrt(cov)
x += mu
return x
def init_rankn(data):
mu = np.mean(data, 0)
cov = np.atleast_2d(np.cov(data, rowvar = 0))
# k rows, d cols (one row = one obs)
# Generate k sample of a random variable ~ Gaussian(mu, cov)
x = np.random.randn(k, mu.size)
x = np.dot(x, np.linalg.cholesky(cov).T) + mu
return x
nd = np.ndim(data)
if nd == 1:
return init_rank1(data)
else:
return init_rankn(data)
_valid_init_meth = {'random': _krandinit, 'points': _kpoints}
def _missing_warn():
"""Print a warning when called."""
warnings.warn("One of the clusters is empty. "
"Re-run kmean with a different initialization.")
def _missing_raise():
"""raise a ClusterError when called."""
raise ClusterError("One of the clusters is empty. "
"Re-run kmean with a different initialization.")
_valid_miss_meth = {'warn': _missing_warn, 'raise': _missing_raise}
def kmeans2(data, k, iter = 10, thresh = 1e-5, minit = 'random',
missing = 'warn'):
"""
Classify a set of observations into k clusters using the k-means algorithm.
The algorithm attempts to minimize the Euclidian distance between
observations and centroids. Several initialization methods are
included.
Parameters
----------
data : ndarray
A 'M' by 'N' array of 'M' observations in 'N' dimensions or a length
'M' array of 'M' one-dimensional observations.
k : int or ndarray
The number of clusters to form as well as the number of
centroids to generate. If `minit` initialization string is
'matrix', or if a ndarray is given instead, it is
interpreted as initial cluster to use instead.
iter : int
Number of iterations of the k-means algrithm to run. Note
that this differs in meaning from the iters parameter to
the kmeans function.
thresh : float
(not used yet)
minit : string
Method for initialization. Available methods are 'random',
'points', 'uniform', and 'matrix':
'random': generate k centroids from a Gaussian with mean and
variance estimated from the data.
'points': choose k observations (rows) at random from data for
the initial centroids.
'uniform': generate k observations from the data from a uniform
distribution defined by the data set (unsupported).
'matrix': interpret the k parameter as a k by M (or length k
array for one-dimensional data) array of initial centroids.
Returns
-------
centroid : ndarray
A 'k' by 'N' array of centroids found at the last iteration of
k-means.
label : ndarray
label[i] is the code or index of the centroid the
i'th observation is closest to.
"""
if missing not in _valid_miss_meth:
raise ValueError("Unkown missing method: %s" % str(missing))
# If data is rank 1, then we have 1 dimension problem.
nd = np.ndim(data)
if nd == 1:
d = 1
#raise ValueError("Input of rank 1 not supported yet")
elif nd == 2:
d = data.shape[1]
else:
raise ValueError("Input of rank > 2 not supported")
if np.size(data) < 1:
raise ValueError("Input has 0 items.")
# If k is not a single value, then it should be compatible with data's
# shape
if np.size(k) > 1 or minit == 'matrix':
if not nd == np.ndim(k):
raise ValueError("k is not an int and has not same rank than data")
if d == 1:
nc = len(k)
else:
(nc, dc) = k.shape
if not dc == d:
raise ValueError("k is not an int and has not same rank than\
data")
clusters = k.copy()
else:
try:
nc = int(k)
except TypeError:
raise ValueError("k (%s) could not be converted to an integer " % str(k))
if nc < 1:
raise ValueError("kmeans2 for 0 clusters ? (k was %s)" % str(k))
if not nc == k:
warnings.warn("k was not an integer, was converted.")
try:
init = _valid_init_meth[minit]
except KeyError:
raise ValueError("unknown init method %s" % str(minit))
clusters = init(data, k)
if int(iter) < 1:
raise ValueError("iter = %s is not valid. iter must be a positive integer." % iter)
return _kmeans2(data, clusters, iter, nc, _valid_miss_meth[missing])
def _kmeans2(data, code, niter, nc, missing):
""" "raw" version of kmeans2. Do not use directly.
Run k-means with a given initial codebook.
"""
for i in range(niter):
# Compute the nearest neighbour for each obs
# using the current code book
label = vq(data, code)[0]
# Update the code by computing centroids using the new code book
for j in range(nc):
mbs = np.where(label==j)
if mbs[0].size > 0:
code[j] = np.mean(data[mbs], axis=0)
else:
missing()
return code, label
if __name__ == '__main__':
pass
#import _vq
#a = np.random.randn(4, 2)
#b = np.random.randn(2, 2)
#print _vq.vq(a, b)
#print _vq.vq(np.array([[1], [2], [3], [4], [5], [6.]]),
# np.array([[2.], [5.]]))
#print _vq.vq(np.array([1, 2, 3, 4, 5, 6.]), np.array([2., 5.]))
#_vq.vq(a.astype(np.float32), b.astype(np.float32))
#_vq.vq(a, b.astype(np.float32))
#_vq.vq([0], b)
|
{
"content_hash": "e1c1233f908bdcca789355890b0fb0bc",
"timestamp": "",
"source": "github",
"line_count": 731,
"max_line_length": 92,
"avg_line_length": 34.96306429548564,
"alnum_prop": 0.6014946396431645,
"repo_name": "sargas/scipy",
"id": "cb11b7735a16f91553796c5ddb9b91ffc958e1ac",
"size": "25558",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scipy/cluster/vq.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "4420309"
},
{
"name": "C++",
"bytes": "7675576"
},
{
"name": "FORTRAN",
"bytes": "5900194"
},
{
"name": "Matlab",
"bytes": "4346"
},
{
"name": "Objective-C",
"bytes": "25240"
},
{
"name": "Python",
"bytes": "6611452"
},
{
"name": "Shell",
"bytes": "1793"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery测试学习</title>
<link rel="stylesheet" href="css/custom.css">
<script src="jquery-1.11.2.js"></script>
<script src="js/jquery.plugin.js"></script>
<script src="js/custom.js"></script>
</head>
<body>
<!-- markup -->
<div class="hilight { background: 'red', foreground: 'white' }">
Have a nice day!
</div>
<div class="hilight { foreground: 'orange' }">
Have a nice day!
</div>
<div class="hilight { background: 'green' }">
Have a nice day!
</div>
<div class="submitA">
<a id="testA" href="http://www.baidu.com"><span>http://www.baidu.com</span></a>
<button id="btn">Test a:href</button>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#btn').click(function(event) {
$('#testA').attr('href', 'https://www.baidu.com/s?wd=L430').find('span').trigger('click');
});
});
</script>
</body>
</html>
|
{
"content_hash": "9f0cfc628c131f762b12afeff083935c",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 102,
"avg_line_length": 30.102564102564102,
"alnum_prop": 0.5698466780238501,
"repo_name": "czs/jquery.test",
"id": "0ecf5ad69813f5b7bce7941d7c9bdaf29e6e198f",
"size": "1182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "129"
},
{
"name": "HTML",
"bytes": "5420"
},
{
"name": "JavaScript",
"bytes": "292705"
}
],
"symlink_target": ""
}
|
function joint = xyzankur2joint(pos)
% XYZANKUR2JOINT Converts data to xyz positions for each joint.
% FORMAT
% DESC takes in a vector of values and returns a matrix with points in
% rows and coordinate positions in columns.
% ARG pos : the vector of values.
% ARG joint : the matrix of values with points in rows and x,y,z
% positions in columns.
%
%
% COPYRIGHT : Carl Henrik Ek and Neil Lawrence, 2008
% GPMAT
joint(:,1) = pos(3:3:end);
joint(:,2) = -pos(1:3:end);
joint(:,3) = -pos(2:3:end);
return
|
{
"content_hash": "9a4b8e81ec4bbd2993c6a39574163737",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 70,
"avg_line_length": 24.19047619047619,
"alnum_prop": 0.7066929133858267,
"repo_name": "lawrennd/GPmat",
"id": "b52cf3816772bd252d7a77dba71c5623b5fbf915",
"size": "508",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "matlab/xyzankur2joint.m",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "12748"
},
{
"name": "HTML",
"bytes": "73506"
},
{
"name": "M",
"bytes": "1415"
},
{
"name": "Matlab",
"bytes": "6289181"
},
{
"name": "TeX",
"bytes": "49872"
}
],
"symlink_target": ""
}
|
elmahviewer
===========
A central viewer for elmah
This is a viewer for ELMAH. It reuses and modifies some code from the ELMAH project i.e. it is a derivative work.
This is built to fit a specific use case where many apps share a common sql error log and you want an internal web app to view it.
If you want to view the logs without being on the server and without having to secure the handler in every app this might be useful, otherwise not.
This has been knocked up pretty quickly and has no tests.
Just set your connection string in the web config.
http://code.google.com/p/elmah/
//
// ELMAH - Error Logging Modules and Handlers for ASP.NET
// Copyright (c) 2004-9 Atif Aziz. All rights reserved.
//
// Author(s):
//
// Atif Aziz, http://www.raboof.com
//
// 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.
//
|
{
"content_hash": "963c4894e464e0e0a3fb0e63e8341c64",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 147,
"avg_line_length": 37.97222222222222,
"alnum_prop": 0.7183613752743233,
"repo_name": "caevyn/elmahviewer",
"id": "558df2f2806ec41b26dbc18ca61a1ae7225a6515",
"size": "1367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "103"
},
{
"name": "C#",
"bytes": "57358"
},
{
"name": "CSS",
"bytes": "133"
}
],
"symlink_target": ""
}
|
<hr />
<ul class="fa-ul main-list">
<li class="main-list-item">
<span class="fa fa-laptop fa-lg main-list-item-icon"></span>
<a href="https://iasi.hackandtell.ro">Hack and Tell @Iași</a>
</li>
<li class="main-list-item">
<span class="fa fa-laptop fa-lg main-list-item-icon"></span>
<a href="https://tm.hackandtell.ro">Hack and Tell @Timișoara</a>
</li>
<li class="main-list-item">
<span class="fa fa-github fa-lg main-list-item-icon"></span>
<a href="https://github.com/hackandtell-ro">GitHub</a>
</li>
</ul>
|
{
"content_hash": "eedea4098f479e4964ec6d6615aef02e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 34.0625,
"alnum_prop": 0.6293577981651376,
"repo_name": "hackandtell-ro/hackandtell.ro",
"id": "fba8d1ccf957bd0ac9957eac35cea4f2c7cd8c84",
"size": "547",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_includes/content.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2555"
},
{
"name": "HTML",
"bytes": "3812"
},
{
"name": "Ruby",
"bytes": "2340"
}
],
"symlink_target": ""
}
|
import json
import os
import logging
import logging.config
"""Order 15: Use logging with generate log files.
In this sample:
Logging config: dependency/logging.json
Info logging file: dependency/logs/info.log
Error logging file: dependency/logs/error.log
"""
class LoggingSystem(object):
logging_config_file = 'dependency/logging.json'
def __init__(self):
if os.path.exists(self.logging_config_file):
with open(self.logging_config_file, 'rt') as f:
config = json.load(f)
logging.config.dictConfig(config)
else:
logging.basicConfig(level=logging.INFO)
# LoggingSystem()
# logger = logging.getLogger(__name__)
# logger.info('this is info')
# logger.error('this is error')
|
{
"content_hash": "23f64c2982e4382008c6842c17a6038c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 59,
"avg_line_length": 24.451612903225808,
"alnum_prop": 0.6754617414248021,
"repo_name": "flyingSprite/spinelle",
"id": "5c8aacbd887a49c2c13e17ddeb5eb2bd4390fd3f",
"size": "760",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "task_inventory/order_1_to_30/order_15_logging_system.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "119255"
}
],
"symlink_target": ""
}
|
data LocalizedData
{
# culture="en-US"
ConvertFrom-StringData -StringData @'
SetTargetResourceInstallwhatIfMessage=Trying to create website "{0}".
SetTargetResourceUnInstallwhatIfMessage=Trying to remove website "{0}".
WebsiteNotFoundError=The requested website "{0}" is not found on the target machine.
WebsiteDiscoveryFailureError=Failure to get the requested website "{0}" information from the target machine.
WebsiteCreationFailureError=Failure to successfully create the website "{0}".
WebsiteRemovalFailureError=Failure to successfully remove the website "{0}".
WebsiteUpdateFailureError=Failure to successfully update the properties for website "{0}".
WebsiteBindingUpdateFailureError=Failure to successfully update the bindings for website "{0}".
WebsiteBindingInputInvalidationError=Desired website bindings not valid for website "{0}".
WebsiteCompareFailureError=Failure to successfully compare properties for website "{0}".
WebBindingCertifcateError=Failure to add certificate to web binding. Please make sure that the certificate thumbprint "{0}" is valid.
WebsiteStateFailureError=Failure to successfully set the state of the website {0}.
WebsiteBindingConflictOnStartError = Website "{0}" could not be started due to binding conflict. Ensure that the binding information for this website does not conflict with any existing website's bindings before trying to start it.
'@
}
# The Get-TargetResource cmdlet is used to fetch the status of role or Website on the target machine.
# It gives the Website info of the requested role/feature on the target machine.
function Get-TargetResource
{
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Name,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$PhysicalPath
)
# Check if WebAdministration module is present for IIS cmdlets
if(!(Get-Module -ListAvailable -Name WebAdministration))
{
Throw 'Please ensure that WebAdministration module is installed.'
}
$Website = Get-Website | Where-Object -FilterScript {
$_.Name -eq $Name
}
if ($Website.count -eq 0) # No Website exists with this name.
{
$ensureResult = 'Absent'
}
elseif ($Website.count -eq 1) # A single Website exists with this name.
{
$ensureResult = 'Present'
[PSObject[]] $Bindings
$Bindings = (Get-ItemProperty -Path IIS:\Sites\$Name -Name Bindings).collection
$CimBindings = foreach ($binding in $Bindings)
{
$BindingObject = Get-WebBindingObject -BindingInfo $binding
New-CimInstance -ClassName MSFT_xWebBindingInformation -Namespace root/microsoft/Windows/DesiredStateConfiguration -Property @{
Port = [System.UInt16]$BindingObject.Port
Protocol = $BindingObject.Protocol
IPAddress = $BindingObject.IPaddress
HostName = $BindingObject.Hostname
CertificateThumbprint = $BindingObject.CertificateThumbprint
CertificateStoreName = $BindingObject.CertificateStoreName
SSLFlags = $BindingObject.SSLFlags
} -ClientOnly
}
$allDefaultPage = @(Get-WebConfiguration //defaultDocument/files/* -PSPath (Join-Path -Path 'IIS:\sites\' -ChildPath $Name) | ForEach-Object -Process {
Write-Output -InputObject $_.value
})
}
else # Multiple websites with the same name exist. This is not supported and is an error
{
$errorId = 'WebsiteDiscoveryFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidResult
$errorMessage = $($LocalizedData.WebsiteDiscoveryFailureError) -f ${Name}
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
# Add all Website properties to the hash table
return @{
Name = $Website.Name
Ensure = $ensureResult
PhysicalPath = $Website.PhysicalPath
State = $Website.State
ID = $Website.ID
ApplicationPool = $Website.ApplicationPool
BindingInfo = $CimBindings
DefaultPage = $allDefaultPage
}
}
# The Set-TargetResource cmdlet is used to create, delete or configure a website on the target machine.
function Set-TargetResource
{
[CmdletBinding(SupportsShouldProcess = $true)]
param
(
[ValidateSet('Present', 'Absent')]
[string]$Ensure = 'Present',
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Name,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$PhysicalPath,
[ValidateSet('Started', 'Stopped')]
[string]$State = 'Started',
[string]$ApplicationPool,
[Microsoft.Management.Infrastructure.CimInstance[]]$BindingInfo,
[string[]]$DefaultPage
)
$getTargetResourceResult = $null
if($Ensure -eq 'Present')
{
#Remove Ensure from parameters as it is not needed to create new website
$Result = $psboundparameters.Remove('Ensure')
#Remove State parameter form website. Will start the website after configuration is complete
$Result = $psboundparameters.Remove('State')
#Remove bindings from parameters if they exist
#Bindings will be added to site using separate cmdlet
$Result = $psboundparameters.Remove('BindingInfo')
#Remove default pages from parameters if they exist
#Default Pages will be added to site using separate cmdlet
$Result = $psboundparameters.Remove('DefaultPage')
# Check if WebAdministration module is present for IIS cmdlets
if(!(Get-Module -ListAvailable -Name WebAdministration))
{
Throw 'Please ensure that WebAdministration module is installed.'
}
$Website = Get-Website | Where-Object -FilterScript {
$_.Name -eq $Name
}
if($Website -ne $null)
{
#update parameters as required
$UpdateNotRequired = $true
#Update Physical Path if required
if(Test-WebsitePath -Name $Name -PhysicalPath $PhysicalPath)
{
$UpdateNotRequired = $false
Set-ItemProperty -Path "IIS:\Sites\$Name" -Name physicalPath -Value $PhysicalPath -ErrorAction Stop
Write-Verbose -Message ("Physical path for website $Name has been updated to $PhysicalPath")
}
#Update Bindings if required
if ($BindingInfo -ne $null)
{
if(Test-WebsiteBindings -Name $Name -BindingInfo $BindingInfo)
{
$UpdateNotRequired = $false
#Update Bindings
Update-WebsiteBinding -Name $Name -BindingInfo $BindingInfo -ErrorAction Stop
Write-Verbose -Message ("Bindings for website $Name have been updated.")
}
}
#Update Application Pool if required
if(($Website.applicationPool -ne $ApplicationPool) -and ($ApplicationPool -ne ''))
{
$UpdateNotRequired = $false
Set-ItemProperty -Path IIS:\Sites\$Name -Name applicationPool -Value $ApplicationPool -ErrorAction Stop
Write-Verbose -Message ("Application Pool for website $Name has been updated to $ApplicationPool")
}
#Update Default pages if required
if($DefaultPage -ne $null)
{
Update-DefaultPages $Name -DefaultPage $DefaultPage
}
#Update State if required
if($Website.state -ne $State -and $State -ne '')
{
$UpdateNotRequired = $false
if($State -eq 'Started')
{
# Ensure that there are no other websites with binding information that will conflict with this site before starting
$existingSites = Get-Website | Where-Object -Property Name -NE -Value $Name
foreach($site in $existingSites)
{
$siteInfo = Get-TargetResource -Name $site.Name -PhysicalPath $site.PhysicalPath
foreach ($binding in $BindingInfo)
{
#Normalize empty IPAddress to "*"
if($binding.IPAddress -eq '' -or $binding.IPAddress -eq $null)
{
$NormalizedIPAddress = '*'
}
else
{
$NormalizedIPAddress = $binding.IPAddress
}
if( !(Confirm-PortIPHostisUnique -Port $binding.Port -IPAddress $NormalizedIPAddress -HostName $binding.HostName -BindingInfo $siteInfo.BindingInfo -UniqueInstances 1))
{
#return error & Do not start Website
$errorId = 'WebsiteBindingConflictOnStart'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidResult
$errorMessage = $($LocalizedData.WebsiteBindingConflictOnStartError) -f ${Name}
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
}
try
{
Start-Website -Name $Name
}
catch
{
$errorId = 'WebsiteStateFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation
$errorMessage = $($LocalizedData.WebsiteStateFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
else
{
try
{
Stop-Website -Name $Name
}
catch
{
$errorId = 'WebsiteStateFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation
$errorMessage = $($LocalizedData.WebsiteStateFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
Write-Verbose -Message ("State for website $Name has been updated to $State")
}
if($UpdateNotRequired)
{
Write-Verbose -Message ("Website $Name already exists and properties do not need to be updated.")
}
}
else #Website doesn't exist so create new one
{
try
{
$Websites = Get-Website
if ($Websites -eq $null)
{
# We do not have any sites this will cause an exception in 2008R2 if we don't specify an ID
$Website = New-Website @psboundparameters -ID 1
}
else
{
$Website = New-Website @psboundparameters
}
$Result = Stop-Website $Website.name -ErrorAction Stop
#Clear default bindings if new bindings defined and are different
if($BindingInfo -ne $null)
{
if(Test-WebsiteBindings -Name $Name -BindingInfo $BindingInfo)
{
Update-WebsiteBinding -Name $Name -BindingInfo $BindingInfo
}
}
#Add Default pages for new created website
if($DefaultPage -ne $null)
{
Update-DefaultPages -Name $Name -DefaultPage $DefaultPage
}
Write-Verbose -Message ("successfully created website $Name")
#Start site if required
if($State -eq 'Started')
{
#Wait 1 sec for bindings to take effect
#I have found that starting the website results in an error if it happens to quickly
Start-Sleep -Seconds 1
Start-Website -Name $Name -ErrorAction Stop
}
Write-Verbose -Message ("successfully started website $Name")
}
catch
{
$errorId = 'WebsiteCreationFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation
$errorMessage = $($LocalizedData.WebsiteCreationFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
}
else #Ensure is set to "Absent" so remove website
{
try
{
$Website = Get-Website | Where-Object -FilterScript {
$_.Name -eq $Name
}
if($Website -ne $null)
{
Remove-Website -name $Name
Write-Verbose -Message ("Successfully removed Website $Name.")
}
else
{
Write-Verbose -Message ("Website $Name does not exist.")
}
}
catch
{
$errorId = 'WebsiteRemovalFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation
$errorMessage = $($LocalizedData.WebsiteRemovalFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
}
# The Test-TargetResource cmdlet is used to validate if the role or feature is in a state as expected in the instance document.
function Test-TargetResource
{
[OutputType([System.Boolean])]
param
(
[ValidateSet('Present', 'Absent')]
[string]$Ensure = 'Present',
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Name,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$PhysicalPath,
[ValidateSet('Started', 'Stopped')]
[string]$State = 'Started',
[string]$ApplicationPool,
[Microsoft.Management.Infrastructure.CimInstance[]]$BindingInfo,
[string[]]$DefaultPage
)
$DesiredConfigurationMatch = $true
# Check if WebAdministration module is present for IIS cmdlets
if(!(Get-Module -ListAvailable -Name WebAdministration))
{
Throw 'Please ensure that WebAdministration module is installed.'
}
$Website = Get-Website | Where-Object -FilterScript {
$_.Name -eq $Name
}
$Stop = $true
Do
{
#Check Ensure
if(($Ensure -eq 'Present' -and $Website -eq $null) -or ($Ensure -eq 'Absent' -and $Website -ne $null))
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("The Ensure state for website $Name does not match the desired state.")
break
}
# Only check properties if $website exists
if ($Website -ne $null)
{
#Check Physical Path property
if(Test-WebsitePath -Name $Name -PhysicalPath $PhysicalPath)
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("Physical Path of Website $Name does not match the desired state.")
break
}
#Check State
if($Website.state -ne $State -and $State -ne $null)
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("The state of Website $Name does not match the desired state.")
break
}
#Check Application Pool property
if(($ApplicationPool -ne '') -and ($Website.applicationPool -ne $ApplicationPool))
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("Application Pool for Website $Name does not match the desired state.")
break
}
#Check Binding properties
if($BindingInfo -ne $null)
{
if(Test-WebsiteBindings -Name $Name -BindingInfo $BindingInfo)
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("Bindings for website $Name do not match the desired state.")
break
}
}
}
#Check Default Pages
if($DefaultPage -ne $null)
{
$allDefaultPage = @(Get-WebConfiguration //defaultDocument/files/* -PSPath (Join-Path -Path 'IIS:\sites\' -ChildPath $Name) | ForEach-Object -Process {
Write-Output -InputObject $_.value
})
$allDefaultPagesPresent = $true
foreach($page in $DefaultPage)
{
if(-not ($allDefaultPage -icontains $page))
{
$DesiredConfigurationMatch = $false
Write-Verbose -Message ("Default Page for website $Name do not match the desired state.")
$allDefaultPagesPresent = $false
break
}
}
if($allDefaultPagesPresent -eq $false)
{
# This is to break out from Test
break
}
}
$Stop = $false
}
While($Stop)
$DesiredConfigurationMatch
}
#region HelperFunctions
# Helper function used to validate website path
function Test-WebsitePath
{
param
(
[string] $Name,
[string] $PhysicalPath
)
if((Get-ItemProperty -Path "IIS:\Sites\$Name" -Name physicalPath) -ne $PhysicalPath)
{
return $true
}
return $false
}
# Helper function used to validate website bindings
# Returns true if bindings are valid (ie. port, IPAddress & Hostname combinations are unique).
function Confirm-PortIPHostisUnique
{
param
(
[parameter()]
[System.UInt16]
$Port,
[parameter()]
[string]
$IPAddress,
[parameter()]
[string]
$HostName,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Management.Infrastructure.CimInstance[]]
$BindingInfo,
[parameter()]
$UniqueInstances = 0
)
foreach ($binding in $BindingInfo)
{
if($binding.Port -eq $Port -and [string]$binding.IPAddress -eq $IPAddress -and [string]$binding.HostName -eq $HostName)
{
$UniqueInstances += 1
}
}
if($UniqueInstances -gt 1)
{
return $false
}
else
{
return $true
}
}
# Helper function used to compare website bindings of actual to desired
# Returns true if bindings need to be updated and false if not.
function Test-WebsiteBindings
{
param
(
[parameter()]
[string]
$Name,
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Microsoft.Management.Infrastructure.CimInstance[]]
$BindingInfo
)
foreach($binding in $BindingInfo)
{
# First ensure that desired binding information is valid ie. No duplicate IPAddres, Port, Host name combinations.
if (!(Confirm-PortIPHostisUnique -Port $binding.Port -IPAddress $binding.IPAddress -HostName $binding.Hostname -BindingInfo $BindingInfo) )
{
$errorId = 'WebsiteBindingInputInvalidation'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidResult
$errorMessage = $($LocalizedData.WebsiteBindingInputInvalidationError) -f ${Name}
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
# Assume bindings do not need updating
$BindingNeedsUpdating = $false
<#
Currently there is a problem in the LCM where Get-WebBinding short circuts the verbose stream
Write-Log can be changed to add the -File switch to log to a directory for troubleshooting.
However it's pretty noisy so it's being left in but commented out.
#>
$ActualBindings = Get-WebBinding -Name $Name
# Format Binding information: Split BindingInfo into individual Properties (IPAddress:Port:HostName)
$ActualBindingObjects = @()
foreach ($ActualBinding in $ActualBindings)
{
$ActualBindingObjects += Get-WebBindingObject -BindingInfo $ActualBinding
}
#Compare Actual Binding info ($FormatActualBindingInfo) to Desired($BindingInfo)
try
{
if($BindingInfo.Count -le $ActualBindingObjects.Count)
{
foreach($binding in $BindingInfo)
{
$ActualBinding = $ActualBindingObjects | Where-Object -FilterScript {
$_.Port -eq $binding.CimInstanceProperties['Port'].Value
}
if ($ActualBinding -ne $null)
{
if([string]$ActualBinding.Protocol -ne [string]$binding.CimInstanceProperties['Protocol'].Value)
{
Write-Log "Protocol is Incorrect" -File
$BindingNeedsUpdating = $true
break
}
if([string]$ActualBinding.IPAddress -ne [string]$binding.CimInstanceProperties['IPAddress'].Value)
{
# Special case where blank IPAddress is saved as "*" in the binding information.
if([string]$ActualBinding.IPAddress -eq '*' -AND [string]$binding.CimInstanceProperties['IPAddress'].Value -eq '')
{
#Do nothing
}
else
{
Write-Log "IP Address Incorrect" -File
$BindingNeedsUpdating = $true
break
}
}
if([string]$ActualBinding.HostName -ne [string]$binding.CimInstanceProperties['HostName'].Value)
{
Write-Log "HostName is incorrect" -File
$BindingNeedsUpdating = $true
break
}
if([string]$ActualBinding.CertificateThumbprint -ne [string]$binding.CimInstanceProperties['CertificateThumbprint'].Value)
{
Write-Log "CertificateThumbprint is incorrect" -File
Write-Log "Actual Binding: $($ActualBinding.CertificateThumbprint )" -File
Write-Log "Binding Value: $($binding.CimInstanceProperties['CertificateThumbprint'].Value)" -File
$BindingNeedsUpdating = $true
break
}
if(-not [string]::IsNullOrWhiteSpace([string]$ActualBinding.CertificateThumbprint) -and [string]$ActualBinding.CertificateStoreName -ne [string]$binding.CimInstanceProperties['CertificateStoreName'].Value)
{
Write-Log "Thumbprint is incorrect" -File
$BindingNeedsUpdating = $true
break
}
if(-not [string]::IsNullOrWhiteSpace([string]$binding.CimInstanceProperties['SSLFlags'].Value) -and [string]$ActualBinding.SSLFlags -ne [string]$binding.CimInstanceProperties['SSLFlags'].Value)
{
Write-Log "SSLFlags is incorrect" -File
$BindingNeedsUpdating = $true
break
}
}
else
{
Write-Log "No bindings returned" -File
$BindingNeedsUpdating = $true
break
}
}
}
else
{
Write-Log "Binding Count is incorrect"
$BindingNeedsUpdating = $true
}
return $BindingNeedsUpdating
}
catch
{
$errorId = 'WebsiteCompareFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidResult
$errorMessage = $($LocalizedData.WebsiteCompareFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
function Update-WebsiteBinding
{
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$Name,
[parameter()]
[Microsoft.Management.Infrastructure.CimInstance[]]
$BindingInfo
)
#Need to clear the bindings before we can create new ones
Clear-ItemProperty -Path IIS:\Sites\$Name -Name bindings -ErrorAction Stop
foreach($binding in $BindingInfo)
{
$Protocol = $binding.CimInstanceProperties['Protocol'].Value
$IPAddress = $binding.CimInstanceProperties['IPAddress'].Value
$Port = $binding.CimInstanceProperties['Port'].Value
$HostHeader = $binding.CimInstanceProperties['HostName'].Value
$CertificateThumbprint = $binding.CimInstanceProperties['CertificateThumbprint'].Value
$CertificateStoreName = $binding.CimInstanceProperties['CertificateStoreName'].Value
$SSLFlags = $binding.CimInstanceProperties['SSLFlags'].Value
$bindingParams = @{}
$bindingParams.Add('-Name', $Name)
$bindingParams.Add('-Port', $Port)
#Set IP Address parameter
if($IPAddress -ne $null)
{
$bindingParams.Add('-IPAddress', $IPAddress)
}
else # Default to any/all IP Addresses
{
$bindingParams.Add('-IPAddress', '*')
}
#Set protocol parameter
if($Protocol -ne $null)
{
$bindingParams.Add('-Protocol', $Protocol)
}
else #Default to Http
{
$bindingParams.Add('-Protocol', 'http')
}
#Set Host parameter if it exists
if($HostHeader -ne $null)
{
$bindingParams.Add('-HostHeader', $HostHeader)
}
if(-not [string]::IsNullOrWhiteSpace($SSLFlags))
{
$bindingParams.Add('-SSLFlags', $SSLFlags)
}
try
{
New-WebBinding @bindingParams -ErrorAction Stop
}
catch
{
$errorId = 'WebsiteBindingUpdateFailure'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidResult
$errorMessage = $($LocalizedData.WebsiteBindingUpdateFailureError) -f ${Name}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
try
{
if ( -not [string]::IsNullOrWhiteSpace($CertificateThumbprint) )
{
$NewWebbinding = Get-WebBinding -Name $Name -Port $Port
$NewWebbinding.AddSslCertificate($CertificateThumbprint, $CertificateStoreName)
}
}
catch
{
$errorId = 'WebBindingCertifcateError'
$errorCategory = [System.Management.Automation.ErrorCategory]::InvalidOperation
$errorMessage = $($LocalizedData.WebBindingCertifcateError) -f ${CertificateThumbprint}
$errorMessage += $_.Exception.Message
$exception = New-Object -TypeName System.InvalidOperationException -ArgumentList $errorMessage
$errorRecord = New-Object -TypeName System.Management.Automation.ErrorRecord -ArgumentList $exception, $errorId, $errorCategory, $null
$PSCmdlet.ThrowTerminatingError($errorRecord)
}
}
}
function Get-WebBindingObject
{
param
(
$BindingInfo
)
#First split properties by ']:'. This will get IPv6 address split from port and host name
$Split = $BindingInfo.BindingInformation.split('[]')
if($Split.count -gt 1)
{
$IPAddress = $Split.item(1)
$Port = $Split.item(2).split(':').item(1)
$HostName = $Split.item(2).split(':').item(2)
}
else
{
$SplitProps = $BindingInfo.BindingInformation.split(':')
$IPAddress = $SplitProps.item(0)
$Port = $SplitProps.item(1)
$HostName = $SplitProps.item(2)
}
return New-Object -TypeName PSObject -Property @{
Protocol = $BindingInfo.protocol
IPAddress = $IPAddress
Port = $Port
HostName = $HostName
CertificateThumbprint = $BindingInfo.CertificateHash
CertificateStoreName = $BindingInfo.CertificateStoreName
sslFlags = $BindingInfo.sslFlags
}
}
# Helper function used to Update default pages of website
function Update-DefaultPages
{
param
(
[string] $Name,
[string[]] $DefaultPage
)
$allDefaultPage = @(Get-WebConfiguration //defaultDocument/files/* -PSPath (Join-Path -Path 'IIS:\sites\' -ChildPath $Name) | ForEach-Object -Process {
Write-Output -InputObject $_.value
})
foreach($page in $DefaultPage)
{
if(-not ($allDefaultPage -icontains $page))
{
Write-Verbose -Message ("Deafult page for website $Name has been updated to $page")
Add-WebConfiguration //defaultDocument/files -PSPath (Join-Path -Path 'IIS:\sites\' -ChildPath $Name) -Value @{
value = $page
}
}
}
}
function Write-Log
{
param
(
[parameter(Position=1)]
[string]
$Message,
[switch] $File
)
$filename = "$env:tmp\xWebSite.log"
Write-Verbose -Verbose -Message $message
if ($File)
{
$date = Get-Date
"${date}: $message" | Out-File -Append -FilePath $filename
}
}
#endregion
|
{
"content_hash": "cbb501e3c528e2f28d7adc7f76e3bbd8",
"timestamp": "",
"source": "github",
"line_count": 885,
"max_line_length": 231,
"avg_line_length": 37.24632768361582,
"alnum_prop": 0.5767678912720323,
"repo_name": "jwainwright/xWebAdministration",
"id": "d9fe4c13d94b943038a6a9b80b7437b08cfe2a67",
"size": "33004",
"binary": false,
"copies": "2",
"ref": "refs/heads/dev",
"path": "DSCResources/MSFT_xWebsite/MSFT_xWebsite.psm1",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PowerShell",
"bytes": "204183"
}
],
"symlink_target": ""
}
|
package org.onosproject.yms.app.ydt;
import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.onosproject.yms.app.ydt.YdtAppNodeOperationType.DELETE_ONLY;
import static org.onosproject.yms.app.ydt.YdtTestUtils.foodArenaYdt;
import static org.onosproject.yms.app.ydt.YdtTestUtils.getYdtBuilder;
import static org.onosproject.yms.app.ydt.YdtTestUtils.validateLeafContents;
import static org.onosproject.yms.app.ydt.YdtTestUtils.validateNodeContents;
import static org.onosproject.yms.app.ydt.YdtTestUtils.walkINTree;
import static org.onosproject.yms.ydt.YdtContextOperationType.DELETE;
import static org.onosproject.yms.ydt.YdtContextOperationType.MERGE;
import static org.onosproject.yms.ydt.YdtContextOperationType.NONE;
public class FoodArenaTest {
// Logger list is used for walker testing.
private final List<String> logger = new ArrayList<>();
private static final String[] EXPECTED = {
"Entry Node is foodarena.",
"Entry Node is food.",
"Entry Node is food.",
"Entry Node is chocolate.",
"Exit Node is chocolate.",
"Exit Node is food.",
"Exit Node is food.",
"Exit Node is foodarena."
};
/**
* Creates and validates food arena ydt.
*/
@Test
public void foodArenaTest() throws IOException {
YangRequestWorkBench ydtBuilder = foodArenaYdt();
validateTree(ydtBuilder);
walkINTree(ydtBuilder, EXPECTED);
}
/**
* Creates and validates food arena ydt.
*/
@Test
public void foodArenaDeleteOperationTest() throws IOException {
YangRequestWorkBench ydtBuilder;
ydtBuilder = getYdtBuilder("foodarena", "food", "ydt.food", NONE);
ydtBuilder.addChild("food", "ydt.food", DELETE);
YdtAppContext appRootNode = ydtBuilder.getAppRootNode();
assertEquals(DELETE_ONLY, appRootNode.getFirstChild().getOperationType());
}
/**
* Validates the given built ydt.
*/
private void validateTree(YangRequestWorkBench ydtBuilder) {
// Assign root node to ydtNode for validating purpose.
YdtNode ydtNode = (YdtNode) ydtBuilder.getRootNode();
// Logical root node does not have operation type
validateNodeContents(ydtNode, "foodarena", null);
ydtNode = ydtNode.getFirstChild();
validateNodeContents(ydtNode, "food", MERGE);
ydtNode = ydtNode.getFirstChild();
validateNodeContents(ydtNode, "food", MERGE);
ydtNode = ydtNode.getFirstChild();
validateLeafContents(ydtNode, "chocolate", "dark");
}
}
|
{
"content_hash": "d9fb582661c78e9548bb5b9d1e897057",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 82,
"avg_line_length": 35.35064935064935,
"alnum_prop": 0.6928728875826599,
"repo_name": "LorenzReinhart/ONOSnew",
"id": "9efbc7751dd1c8392d845d0187cacd44f4051965",
"size": "3339",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "apps/yms/ut/src/test/java/org/onosproject/yms/app/ydt/FoodArenaTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "224030"
},
{
"name": "HTML",
"bytes": "108368"
},
{
"name": "Java",
"bytes": "34148438"
},
{
"name": "JavaScript",
"bytes": "3833411"
},
{
"name": "Protocol Buffer",
"bytes": "13730"
},
{
"name": "Python",
"bytes": "185205"
},
{
"name": "Shell",
"bytes": "2594"
}
],
"symlink_target": ""
}
|
<span class="wiki-builder">This page was generated with Wiki Builder. Do not change the format!</span>
## Info
* **URI:** [[/Forum/UnmarkReplyAsAnswer/{param1}/|https://www.bungie.net/Platform/Forum/UnmarkReplyAsAnswer/{param1}/]]
* **Basepath:** https://www.bungie.net/Platform
* **Method:** POST
* **Service:** [[Forum|Endpoints#Forum]]
* **Permissions:** None
* **Officially Supported:** No
## Parameters
### Path Parameters
Name | Schema | Required | Description
---- | ------ | -------- | -----------
param1 | string | Yes |
### Query String Parameters
None
## Example
### Request
POST https://www.bungie.net/Platform/Forum/UnmarkReplyAsAnswer/{param1}/
```javascript
{
// Type: object
}
```
### Response
PlatformErrorCode: 200
```javascript
{
// Type: [#/components/schemas/Forum.UnmarkReplyAsAnswer]
"Response": null,
// Type: [[PlatformErrorCodes|Exceptions-PlatformErrorCodes]]:Enum
"ErrorCode": 0,
// Type: integer:int32
"ThrottleSeconds": 0,
// Type: string
"ErrorStatus": "",
// Type: string
"Message": "",
// Type: Dictionary<string,string>
"MessageData": {
"{string}": ""
},
// Type: object
}
```
## References
|
{
"content_hash": "488d0cdacba5f0eb4b04a91b1294b8f7",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 119,
"avg_line_length": 22,
"alnum_prop": 0.6264462809917355,
"repo_name": "DestinyDevs/BungieNetPlatform",
"id": "70a5a06832a70b0a39a8f7227e3c8ddd62c4dae5",
"size": "1210",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "wiki-docs/v2/services/Forum/Forum-UnmarkReplyAsAnswer.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "GLSL",
"bytes": "7007"
},
{
"name": "HTML",
"bytes": "4966"
},
{
"name": "JavaScript",
"bytes": "2424226"
},
{
"name": "PHP",
"bytes": "380417"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="运行状态" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/run_tv1"
android:drawableLeft="@drawable/shangliao"
android:text="工件输入" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv2"
android:drawableLeft="@drawable/shangliao"
android:text="工件输出" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv3"
android:drawableLeft="@drawable/shangliao"
android:text="手爪平移气缸" />
</TableRow>
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/run_tv4"
android:drawableLeft="@drawable/shangliao"
android:text="一轴正限位" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv5"
android:drawableLeft="@drawable/shangliao"
android:text="一轴原点" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv6"
android:drawableLeft="@drawable/shangliao"
android:text="手爪旋转气缸" />
</TableRow>
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/run_tv7"
android:drawableLeft="@drawable/shangliao"
android:text="一轴负限位" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv8"
android:drawableLeft="@drawable/shangliao"
android:text="手爪气缸" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv9"
android:drawableLeft="@drawable/shangliao"
android:text="平移气缸伸出" />
</TableRow>
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/run_tv10"
android:drawableLeft="@drawable/shangliao"
android:text="二轴正限位" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv11"
android:drawableLeft="@drawable/shangliao"
android:text="二轴负限位" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv12"
android:drawableLeft="@drawable/shangliao"
android:text="平移气缸缩回" />
</TableRow>
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/run_tv13"
android:drawableLeft="@drawable/shangliao"
android:text="旋转顺时针" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv14"
android:drawableLeft="@drawable/shangliao"
android:text="旋转逆时针" />
<TextView
style="@style/state_tv"
android:id="@+id/run_tv15"
android:drawableLeft="@drawable/shangliao"
android:text="单元报警" />
</TableRow>
</TableLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="center"
android:text="联机状态" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/online_tv1"
android:drawableLeft="@drawable/shangliao"
android:text="单机" />
<TextView
style="@style/state_tv"
android:id="@+id/online_tv2"
android:drawableLeft="@drawable/shangliao"
android:text="通讯断开" />
<TextView
style="@style/state_tv"
android:id="@+id/online_tv3"
android:drawableLeft="@drawable/shangliao"
android:text="复位完成" />
</TableRow>
<TableRow>
<TextView
style="@style/state_tv"
android:id="@+id/online_tv4"
android:drawableLeft="@drawable/shangliao"
android:text="复位中" />
<TextView
style="@style/state_tv"
android:id="@+id/online_tv5"
android:drawableLeft="@drawable/shangliao"
android:text="入库完成" />
<TextView
style="@style/state_tv"
android:id="@+id/online_tv6"
android:drawableLeft="@drawable/shangliao"
android:text="单元运行" />
</TableRow>
<TableRow android:weightSum="3">
<TextView
style="@style/state_tv"
android:id="@+id/online_tv7"
android:drawableLeft="@drawable/shangliao"
android:text="入库请求" />
<TextView
style="@style/state_tv"
android:id="@+id/online_tv8"
android:drawableLeft="@drawable/shangliao"
android:text="托盘请求输出" />
</TableRow>
</TableLayout>
</LinearLayout>
|
{
"content_hash": "1c729cc549fac05a5012ecde6dffaa0c",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 72,
"avg_line_length": 30.890625,
"alnum_prop": 0.48845051424717584,
"repo_name": "wangyong0910/MES-Android",
"id": "fd42a26f4acf816a5a2acdd712a0948d784fb556",
"size": "6157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/ti_sheng_activity.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "488223"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
J. Bot. 31:2, t. 331. 1893
#### Original name
null
### Remarks
null
|
{
"content_hash": "9cc5f5132964bb9880761637aa582f8f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 12,
"alnum_prop": 0.6666666666666666,
"repo_name": "mdoering/backbone",
"id": "211fe4adeb9d82d54dcfcb53686cb963a922653b",
"size": "205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Cycadophyta/Cycadopsida/Cycadales/Cycadaceae/Cycas/Cycas taiwaniana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package util
import (
"os"
"strconv"
"unsafe"
"github.com/prometheus/procfs"
)
const intSize = int(unsafe.Sizeof(0))
var bs *[intSize]byte
func init() {
i := 0x1
bs = (*[intSize]byte)(unsafe.Pointer(&i))
}
func IsBigEndian() bool {
return !IsLittleEndian()
}
func IsLittleEndian() bool {
return bs[0] == 0
}
func PathExist(path string) bool {
_, err := os.Stat(path)
return err == nil || os.IsExist(err)
}
func HostName() (hostname string) {
var err error
hostname, err = os.Hostname()
if err != nil {
hostname = "UNKNOWN"
}
return
}
func GetEnvInt(name string, def int) int {
env, ok := os.LookupEnv(name)
if ok {
i64, err := strconv.ParseInt(env, 10, 0)
if err != nil {
return def
}
return int(i64)
}
return def
}
func GetEnvString(name string, def string) string {
env, ok := os.LookupEnv(name)
if ok {
return env
}
return def
}
func GetProcCPUUsage() (pt float64, ct float64) {
p, _ := procfs.NewProc(os.Getpid())
stat, _ := procfs.NewStat()
pstat, _ := p.NewStat()
ct = stat.CPUTotal.User + stat.CPUTotal.Nice + stat.CPUTotal.System +
stat.CPUTotal.Idle + stat.CPUTotal.Iowait + stat.CPUTotal.IRQ +
stat.CPUTotal.SoftIRQ + stat.CPUTotal.Steal + stat.CPUTotal.Guest
pt = float64(pstat.UTime+pstat.STime+pstat.CUTime+pstat.CSTime) / 100
return
}
|
{
"content_hash": "0e5959aa6e4c60efe6f46eb2c9beeb24",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 70,
"avg_line_length": 17.958904109589042,
"alnum_prop": 0.6628527841342486,
"repo_name": "little-cui/service-center",
"id": "5e62cbe7b6424bc4234c880b6738dc7d9b91a22e",
"size": "2112",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pkg/util/sys.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1624"
},
{
"name": "CSS",
"bytes": "1622"
},
{
"name": "Dockerfile",
"bytes": "1336"
},
{
"name": "Go",
"bytes": "2931427"
},
{
"name": "HTML",
"bytes": "90879"
},
{
"name": "Java",
"bytes": "4822"
},
{
"name": "JavaScript",
"bytes": "90492"
},
{
"name": "SCSS",
"bytes": "30921"
},
{
"name": "Shell",
"bytes": "36451"
},
{
"name": "TypeScript",
"bytes": "90098"
}
],
"symlink_target": ""
}
|
package com.gpii.utils;
import com.gpii.jsonld.JsonLDManager;
import com.hp.hpl.jena.rdf.model.Model;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import org.codehaus.jackson.map.ObjectMapper;
/**
*
* @author nkak
* @author claudia loitsch
*/
public class Utils
{
private static Utils instance = null;
private Utils()
{
}
public static Utils getInstance()
{
if(instance == null)
instance = new Utils();
return instance;
}
public void writeFile(String path, String content)
{
try {
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path),"UTF-8"));
out.write(content);
out.close();
System.out.println("* Generated file: " + path);
}
catch (IOException e)
{
e.printStackTrace();
}
}
public String readFile(String pathname) throws IOException
{
String fileContents = "";
FileReader fileReader = new FileReader(pathname);
int i;
while((i = fileReader.read())!=-1)
{
char ch = (char)i;
fileContents = fileContents + ch;
}
return fileContents;
}
public void writeOntologyModelToFile(Model tmpModel, String tmpFilepath)
{
FileWriter out = null;
try {
out = new FileWriter(tmpFilepath);
} catch (IOException ex) {
ex.printStackTrace();
}
try {
tmpModel.write(out, "RDF/XML");
}
finally
{
try {
out.close();
System.out.println("* Generated file: " + tmpFilepath);
}
catch (IOException closeException) {
closeException.printStackTrace();
}
}
}
public String jsonPrettyPrint(String tmpJsonStr)
{
String res = "";
ObjectMapper mapper = new ObjectMapper();
try {
res = mapper.defaultPrettyPrintingWriter().writeValueAsString(JsonLDManager.getInstance().gson.fromJson(tmpJsonStr, Object.class));
} catch (IOException ex) {
ex.printStackTrace();
}
return res;
}
public Object transformValueSpace(Object o)
{
Object transVal = o;
try {
int i = Integer.parseInt(o.toString());
transVal = i;
}
catch (NumberFormatException e) {
}
try {
double i = Double.parseDouble(o.toString());
transVal = i;
}
catch (NumberFormatException e){
}
return transVal;
}
}
|
{
"content_hash": "828652a1da8921a2f867af4624f95aed",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 143,
"avg_line_length": 25.060344827586206,
"alnum_prop": 0.541795665634675,
"repo_name": "malarres/RuleBasedMatchMaker_RESTful_WS_Maven",
"id": "1bc33fb8cb7db6a0a8842d57ec34a431bafc9ec9",
"size": "2907",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/gpii/utils/Utils.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "113765"
},
{
"name": "Web Ontology Language",
"bytes": "3865444"
}
],
"symlink_target": ""
}
|
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
position:relative;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
color: #F79E21;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}
|
{
"content_hash": "ee6788d39491c2761fd9d24af03ba3c6",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 80,
"avg_line_length": 18.300469483568076,
"alnum_prop": 0.6062083119548486,
"repo_name": "dinphil/dinphil.github.io",
"id": "5f2fe8e6d3bf90fc2e0a2c50bab6d54b60c0c5d2",
"size": "7796",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "css/normalize.css",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "33151"
},
{
"name": "HTML",
"bytes": "24645"
},
{
"name": "JavaScript",
"bytes": "149098"
}
],
"symlink_target": ""
}
|
package org.jglue.totorom;
import java.util.Set;
import com.tinkerpop.blueprints.Element;
/**
* The base of all framed elements.
*
* @author Bryn Cooke (http://jglue.org)
*/
public abstract class FramedElement {
private Element element;
private FramedGraph graph;
protected void init(FramedGraph graph, Element element) {
this.graph = graph;
this.element = element;
}
protected void init() {
}
/**
* @return The id of this element.
*/
protected <N> N getId() {
return (N) element.getId();
}
/**
* @return The property keys of this element.
*/
protected Set<String> getPropertyKeys() {
return element.getPropertyKeys();
}
/**
* Remove this element from the graph.
*/
protected void remove() {
element.remove();
}
/**
* @return The underlying element.
*/
protected Element element() {
return element;
}
/**
* @return The underlying graph.
*/
protected FramedGraph graph() {
return graph;
}
/**
* Return a property value.
*
* @param name
* The name of the property.
* @return the value of the property or null if none was present.
*/
protected <T> T getProperty(String name) {
return element.getProperty(name);
}
/**
* Return a property value.
*
* @param name
* The name of the property.
* @param type
* The type of the property.
*
* @return the value of the property or null if none was present.
*/
protected <T> T getProperty(String name, Class<T> type) {
if (type.isEnum()) {
return (T) Enum.valueOf((Class<Enum>) type, (String) element.getProperty(name));
}
return element.getProperty(name);
}
/**
* Set a property value.
*
* @param name
* The name of the property.
* @param value
* The value of the property.
*/
protected void setProperty(String name, Object value) {
if (value == null) {
element.removeProperty(name);
} else {
if (value instanceof Enum) {
element.setProperty(name, value.toString());
} else {
element.setProperty(name, value);
}
}
}
/**
* Query over all vertices in the graph.
*
* @return The query.
*/
protected VertexTraversal<?, ?, ?> V() {
return graph.V();
}
/**
* Query over all edges in the graph.
*
* @return The query.
*/
protected EdgeTraversal<?, ?, ?> E() {
return graph.E();
}
/**
* Query over a list of vertices in the graph.
*
* @param ids
* The ids of the vertices.
* @return The query.
*/
protected VertexTraversal<?, ?, ?> v(final Object... ids) {
return graph.v(ids);
}
/**
* Query over a list of edges in the graph.
*
* @param ids
* The ids of the edges.
* @return The query.
*/
protected EdgeTraversal<?, ?, ?> e(final Object... ids) {
return graph.e(ids);
}
@Override
public int hashCode() {
return element.hashCode();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
FramedElement other = (FramedElement) obj;
if (element == null) {
if (other.element != null)
return false;
} else if (!element.equals(other.element))
return false;
return true;
}
protected <N> N getId(Class<N> clazz) {
return (N) getId();
}
@Override
public String toString() {
return element().toString();
}
}
|
{
"content_hash": "e51950940b6e6ae63bb97757a451e6e8",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 83,
"avg_line_length": 18.311827956989248,
"alnum_prop": 0.6127422196124486,
"repo_name": "BrynCooke/totorom",
"id": "be44e63b9daacdf0aab3972fa2d6da54029022a0",
"size": "5795",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "totorom-tinkerpop2/src/main/java/org/jglue/totorom/FramedElement.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "363387"
}
],
"symlink_target": ""
}
|
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#if !defined WIN32 && !defined _WIN32
#include <unistd.h>
#endif
#ifdef HAVE_GETOPT_H
#include <getopt.h>
#endif
#ifndef HAVE_GETOPT_LONG
#include "getopt_win.h"
#endif
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <speex/speex.h>
#include <ogg/ogg.h>
#include "wav_io.h"
#include <speex/speex_header.h>
#include <speex/speex_stereo.h>
#include <speex/speex_preprocess.h>
#if defined WIN32 || defined _WIN32
/* We need the following two to set stdout to binary */
#include <io.h>
#include <fcntl.h>
#endif
#include "skeleton.h"
void comment_init(char **comments, int* length, char *vendor_string);
void comment_add(char **comments, int* length, char *tag, char *val);
/*Write an Ogg page to a file pointer*/
int oe_write_page(ogg_page *page, FILE *fp)
{
int written;
written = fwrite(page->header,1,page->header_len, fp);
written += fwrite(page->body,1,page->body_len, fp);
return written;
}
#define MAX_FRAME_SIZE 2000
#define MAX_FRAME_BYTES 2000
/* Convert input audio bits, endians and channels */
static int read_samples(FILE *fin,int frame_size, int bits, int channels, int lsb, short * input, char *buff, spx_int32_t *size)
{
unsigned char in[MAX_FRAME_BYTES*2];
int i;
short *s;
int nb_read;
if (size && *size<=0)
{
return 0;
}
/*Read input audio*/
if (size)
*size -= bits/8*channels*frame_size;
if (buff)
{
for (i=0;i<12;i++)
in[i]=buff[i];
nb_read = fread(in+12,1,bits/8*channels*frame_size-12, fin) + 12;
if (size)
*size += 12;
} else {
nb_read = fread(in,1,bits/8*channels* frame_size, fin);
}
nb_read /= bits/8*channels;
/*fprintf (stderr, "%d\n", nb_read);*/
if (nb_read==0)
return 0;
s=(short*)in;
if(bits==8)
{
/* Convert 8->16 bits */
for(i=frame_size*channels-1;i>=0;i--)
{
s[i]=(in[i]<<8)^0x8000;
}
} else
{
/* convert to our endian format */
for(i=0;i<frame_size*channels;i++)
{
if(lsb)
s[i]=le_short(s[i]);
else
s[i]=be_short(s[i]);
}
}
/* FIXME: This is probably redundent now */
/* copy to float input buffer */
for (i=0;i<frame_size*channels;i++)
{
input[i]=(short)s[i];
}
for (i=nb_read*channels;i<frame_size*channels;i++)
{
input[i]=0;
}
return nb_read;
}
void add_fishead_packet (ogg_stream_state *os) {
fishead_packet fp;
memset(&fp, 0, sizeof(fp));
fp.ptime_n = 0;
fp.ptime_d = 1000;
fp.btime_n = 0;
fp.btime_d = 1000;
add_fishead_to_stream(os, &fp);
}
/*
* Adds the fishead packets in the skeleton output stream along with the e_o_s packet
*/
void add_fisbone_packet (ogg_stream_state *os, spx_int32_t serialno, SpeexHeader *header) {
fisbone_packet fp;
memset(&fp, 0, sizeof(fp));
fp.serial_no = serialno;
fp.nr_header_packet = 2 + header->extra_headers;
fp.granule_rate_n = header->rate;
fp.granule_rate_d = 1;
fp.start_granule = 0;
fp.preroll = 3;
fp.granule_shift = 0;
add_message_header_field(&fp, "Content-Type", "audio/x-speex");
add_fisbone_to_stream(os, &fp);
}
void version()
{
const char* speex_version;
speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
printf ("speexenc (Speex encoder) version %s (compiled " __DATE__ ")\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
void version_short()
{
const char* speex_version;
speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
printf ("speexenc version %s\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
void usage()
{
printf ("Usage: speexenc [options] input_file output_file\n");
printf ("\n");
printf ("Encodes input_file using Speex. It can read the WAV or raw files.\n");
printf ("\n");
printf ("input_file can be:\n");
printf (" filename.wav wav file\n");
printf (" filename.* Raw PCM file (any extension other than .wav)\n");
printf (" - stdin\n");
printf ("\n");
printf ("output_file can be:\n");
printf (" filename.spx Speex file\n");
printf (" - stdout\n");
printf ("\n");
printf ("Options:\n");
printf (" -n, --narrowband Narrowband (8 kHz) input file\n");
printf (" -w, --wideband Wideband (16 kHz) input file\n");
printf (" -u, --ultra-wideband \"Ultra-wideband\" (32 kHz) input file\n");
printf (" --quality n Encoding quality (0-10), default 8\n");
printf (" --bitrate n Encoding bit-rate (use bit-rate n or lower)\n");
printf (" --vbr Enable variable bit-rate (VBR)\n");
printf (" --vbr-max-bitrate Set max VBR bit-rate allowed\n");
printf (" --abr rate Enable average bit-rate (ABR) at rate bps\n");
printf (" --vad Enable voice activity detection (VAD)\n");
printf (" --dtx Enable file-based discontinuous transmission (DTX)\n");
printf (" --comp n Set encoding complexity (0-10), default 3\n");
printf (" --nframes n Number of frames per Ogg packet (1-10), default 1\n");
printf (" --denoise Denoise the input before encoding\n");
printf (" --agc Apply adaptive gain control (AGC) before encoding\n");
printf (" --skeleton Outputs ogg skeleton metadata (may cause incompatibilities)\n");
printf (" --headerbyte Outputs x-speex-with-header-byte (may cause incompatibilities)\n");
printf (" --comment Add the given string as an extra comment. This may be\n");
printf (" used multiple times\n");
printf (" --author Author of this track\n");
printf (" --title Title for this track\n");
printf (" --quiet No warnings or messages during encoding\n");
printf (" -h, --help This help\n");
printf (" -v, --version Version information\n");
printf (" -V Verbose mode (show bit-rate)\n");
printf ("Raw input options:\n");
printf (" --rate n Sampling rate for raw input\n");
printf (" --stereo Consider raw input as stereo\n");
printf (" --le Raw input is little-endian\n");
printf (" --be Raw input is big-endian\n");
printf (" --8bit Raw input is 8-bit unsigned\n");
printf (" --16bit Raw input is 16-bit signed\n");
printf ("Default raw PCM input is 16-bit, little-endian, mono\n");
printf ("\n");
printf ("More information is available from the Speex site: http://www.speex.org\n");
printf ("\n");
printf ("Please report bugs to the mailing list `speex-dev@xiph.org'.\n");
}
int main(int argc, char **argv)
{
int nb_samples, total_samples=0, nb_encoded;
int c;
int option_index = 0;
char *inFile, *outFile;
FILE *fin, *fout;
short input[MAX_FRAME_SIZE];
spx_int32_t frame_size;
int quiet=0;
spx_int32_t vbr_enabled=0;
spx_int32_t vbr_max=0;
int abr_enabled=0;
spx_int32_t vad_enabled=0;
spx_int32_t dtx_enabled=0;
int nbBytes;
const SpeexMode *mode=NULL;
int modeID = -1;
void *st;
SpeexBits bits;
char cbits[MAX_FRAME_BYTES];
int with_skeleton = 0;
int with_headerbyte = 0;
struct option long_options[] =
{
{"wideband", no_argument, NULL, 0},
{"ultra-wideband", no_argument, NULL, 0},
{"narrowband", no_argument, NULL, 0},
{"vbr", no_argument, NULL, 0},
{"vbr-max-bitrate", required_argument, NULL, 0},
{"abr", required_argument, NULL, 0},
{"vad", no_argument, NULL, 0},
{"dtx", no_argument, NULL, 0},
{"quality", required_argument, NULL, 0},
{"bitrate", required_argument, NULL, 0},
{"nframes", required_argument, NULL, 0},
{"comp", required_argument, NULL, 0},
{"denoise", no_argument, NULL, 0},
{"agc", no_argument, NULL, 0},
{"skeleton",no_argument,NULL, 0},
{"headerbyte",no_argument,NULL, 0},
{"help", no_argument, NULL, 0},
{"quiet", no_argument, NULL, 0},
{"le", no_argument, NULL, 0},
{"be", no_argument, NULL, 0},
{"8bit", no_argument, NULL, 0},
{"16bit", no_argument, NULL, 0},
{"stereo", no_argument, NULL, 0},
{"rate", required_argument, NULL, 0},
{"version", no_argument, NULL, 0},
{"version-short", no_argument, NULL, 0},
{"comment", required_argument, NULL, 0},
{"author", required_argument, NULL, 0},
{"title", required_argument, NULL, 0},
{0, 0, 0, 0}
};
int print_bitrate=0;
spx_int32_t rate=0;
spx_int32_t size;
int chan=1;
int fmt=16;
spx_int32_t quality=-1;
float vbr_quality=-1;
int lsb=1;
ogg_stream_state os;
ogg_stream_state so; /* ogg stream for skeleton bitstream */
ogg_page og;
ogg_packet op;
int bytes_written=0, ret, result;
int id=-1;
SpeexHeader header;
int nframes=1;
spx_int32_t complexity=3;
const char* speex_version;
char vendor_string[64];
char *comments;
int comments_length;
int close_in=0, close_out=0;
int eos=0;
spx_int32_t bitrate=0;
double cumul_bits=0, enc_frames=0;
char first_bytes[12];
int wave_input=0;
spx_int32_t tmp;
SpeexPreprocessState *preprocess = NULL;
int denoise_enabled=0, agc_enabled=0;
spx_int32_t lookahead = 0;
speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
snprintf(vendor_string, sizeof(vendor_string), "Encoded with Speex %s", speex_version);
comment_init(&comments, &comments_length, vendor_string);
/*Process command-line options*/
while(1)
{
c = getopt_long (argc, argv, "nwuhvV",
long_options, &option_index);
if (c==-1)
break;
switch(c)
{
case 0:
if (strcmp(long_options[option_index].name,"narrowband")==0)
{
modeID = SPEEX_MODEID_NB;
} else if (strcmp(long_options[option_index].name,"wideband")==0)
{
modeID = SPEEX_MODEID_WB;
} else if (strcmp(long_options[option_index].name,"ultra-wideband")==0)
{
modeID = SPEEX_MODEID_UWB;
} else if (strcmp(long_options[option_index].name,"vbr")==0)
{
vbr_enabled=1;
} else if (strcmp(long_options[option_index].name,"vbr-max-bitrate")==0)
{
vbr_max=atoi(optarg);
if (vbr_max<1)
{
fprintf (stderr, "Invalid VBR max bit-rate value: %d\n", vbr_max);
exit(1);
}
} else if (strcmp(long_options[option_index].name,"abr")==0)
{
abr_enabled=atoi(optarg);
if (!abr_enabled)
{
fprintf (stderr, "Invalid ABR value: %d\n", abr_enabled);
exit(1);
}
} else if (strcmp(long_options[option_index].name,"vad")==0)
{
vad_enabled=1;
} else if (strcmp(long_options[option_index].name,"dtx")==0)
{
dtx_enabled=1;
} else if (strcmp(long_options[option_index].name,"quality")==0)
{
quality = atoi (optarg);
vbr_quality=atof(optarg);
} else if (strcmp(long_options[option_index].name,"bitrate")==0)
{
bitrate = atoi (optarg);
} else if (strcmp(long_options[option_index].name,"nframes")==0)
{
nframes = atoi (optarg);
if (nframes<1)
nframes=1;
if (nframes>10)
nframes=10;
} else if (strcmp(long_options[option_index].name,"comp")==0)
{
complexity = atoi (optarg);
} else if (strcmp(long_options[option_index].name,"denoise")==0)
{
denoise_enabled=1;
} else if (strcmp(long_options[option_index].name,"agc")==0)
{
agc_enabled=1;
} else if (strcmp(long_options[option_index].name,"skeleton")==0)
{
with_skeleton=1;
} else if (strcmp(long_options[option_index].name,"headerbyte")==0)
{
with_headerbyte=1;
} else if (strcmp(long_options[option_index].name,"help")==0)
{
usage();
exit(0);
} else if (strcmp(long_options[option_index].name,"quiet")==0)
{
quiet = 1;
} else if (strcmp(long_options[option_index].name,"version")==0)
{
version();
exit(0);
} else if (strcmp(long_options[option_index].name,"version-short")==0)
{
version_short();
exit(0);
} else if (strcmp(long_options[option_index].name,"le")==0)
{
lsb=1;
} else if (strcmp(long_options[option_index].name,"be")==0)
{
lsb=0;
} else if (strcmp(long_options[option_index].name,"8bit")==0)
{
fmt=8;
} else if (strcmp(long_options[option_index].name,"16bit")==0)
{
fmt=16;
} else if (strcmp(long_options[option_index].name,"stereo")==0)
{
chan=2;
} else if (strcmp(long_options[option_index].name,"rate")==0)
{
rate=atoi (optarg);
} else if (strcmp(long_options[option_index].name,"comment")==0)
{
if (!strchr(optarg, '='))
{
fprintf (stderr, "Invalid comment: %s\n", optarg);
fprintf (stderr, "Comments must be of the form name=value\n");
exit(1);
}
comment_add(&comments, &comments_length, NULL, optarg);
} else if (strcmp(long_options[option_index].name,"author")==0)
{
comment_add(&comments, &comments_length, "author=", optarg);
} else if (strcmp(long_options[option_index].name,"title")==0)
{
comment_add(&comments, &comments_length, "title=", optarg);
}
break;
case 'n':
modeID = SPEEX_MODEID_NB;
break;
case 'h':
usage();
exit(0);
break;
case 'v':
version();
exit(0);
break;
case 'V':
print_bitrate=1;
break;
case 'w':
modeID = SPEEX_MODEID_WB;
break;
case 'u':
modeID = SPEEX_MODEID_UWB;
break;
case '?':
usage();
exit(1);
break;
}
}
if (argc-optind!=2)
{
usage();
exit(1);
}
inFile=argv[optind];
outFile=argv[optind+1];
/*Initialize Ogg stream struct*/
srand(time(NULL));
if (ogg_stream_init(&os, rand())==-1)
{
fprintf(stderr,"Error: stream init failed\n");
exit(1);
}
if (with_skeleton && ogg_stream_init(&so, rand())==-1)
{
fprintf(stderr,"Error: stream init failed\n");
exit(1);
}
if (strcmp(inFile, "-")==0)
{
#if defined WIN32 || defined _WIN32
_setmode(_fileno(stdin), _O_BINARY);
#elif defined OS2
_fsetmode(stdin,"b");
#endif
fin=stdin;
}
else
{
fin = fopen(inFile, "rb");
if (!fin)
{
perror(inFile);
exit(1);
}
close_in=1;
}
{
fread(first_bytes, 1, 12, fin);
if (strncmp(first_bytes,"RIFF",4)==0 && strncmp(first_bytes,"RIFF",4)==0)
{
if (read_wav_header(fin, &rate, &chan, &fmt, &size)==-1)
exit(1);
wave_input=1;
lsb=1; /* CHECK: exists big-endian .wav ?? */
}
}
if (modeID==-1 && !rate)
{
/* By default, use narrowband/8 kHz */
modeID = SPEEX_MODEID_NB;
rate=8000;
} else if (modeID!=-1 && rate)
{
mode = speex_lib_get_mode (modeID);
if (rate>48000)
{
fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate);
exit(1);
} else if (rate>25000)
{
if (modeID != SPEEX_MODEID_UWB)
{
fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try ultra-wideband instead\n", mode->modeName , rate);
}
} else if (rate>12500)
{
if (modeID != SPEEX_MODEID_WB)
{
fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try wideband instead\n", mode->modeName , rate);
}
} else if (rate>=6000)
{
if (modeID != SPEEX_MODEID_NB)
{
fprintf (stderr, "Warning: Trying to encode in %s at %d Hz. I'll do it but I suggest you try narrowband instead\n", mode->modeName , rate);
}
} else {
fprintf (stderr, "Error: sampling rate too low: %d Hz\n", rate);
exit(1);
}
} else if (modeID==-1)
{
if (rate>48000)
{
fprintf (stderr, "Error: sampling rate too high: %d Hz, try down-sampling\n", rate);
exit(1);
} else if (rate>25000)
{
modeID = SPEEX_MODEID_UWB;
} else if (rate>12500)
{
modeID = SPEEX_MODEID_WB;
} else if (rate>=6000)
{
modeID = SPEEX_MODEID_NB;
} else {
fprintf (stderr, "Error: Sampling rate too low: %d Hz\n", rate);
exit(1);
}
} else if (!rate)
{
if (modeID == SPEEX_MODEID_NB)
rate=8000;
else if (modeID == SPEEX_MODEID_WB)
rate=16000;
else if (modeID == SPEEX_MODEID_UWB)
rate=32000;
}
if (!quiet)
if (rate!=8000 && rate!=16000 && rate!=32000)
fprintf (stderr, "Warning: Speex is only optimized for 8, 16 and 32 kHz. It will still work at %d Hz but your mileage may vary\n", rate);
if (!mode)
mode = speex_lib_get_mode (modeID);
speex_init_header(&header, rate, 1, mode);
header.frames_per_packet=nframes;
header.vbr=vbr_enabled;
header.nb_channels = chan;
{
char *st_string="mono";
if (chan==2)
st_string="stereo";
if (!quiet)
fprintf (stderr, "Encoding %d Hz audio using %s mode (%s)\n",
header.rate, mode->modeName, st_string);
}
/*fprintf (stderr, "Encoding %d Hz audio at %d bps using %s mode\n",
header.rate, mode->bitrate, mode->modeName);*/
/*Initialize Speex encoder*/
st = speex_encoder_init(mode);
if (strcmp(outFile,"-")==0)
{
#if defined WIN32 || defined _WIN32
_setmode(_fileno(stdout), _O_BINARY);
#endif
fout=stdout;
}
else
{
fout = fopen(outFile, "wb");
if (!fout)
{
perror(outFile);
exit(1);
}
close_out=1;
}
speex_encoder_ctl(st, SPEEX_GET_FRAME_SIZE, &frame_size);
speex_encoder_ctl(st, SPEEX_SET_COMPLEXITY, &complexity);
speex_encoder_ctl(st, SPEEX_SET_SAMPLING_RATE, &rate);
if (quality >= 0)
{
if (vbr_enabled)
{
if (vbr_max>0)
speex_encoder_ctl(st, SPEEX_SET_VBR_MAX_BITRATE, &vbr_max);
speex_encoder_ctl(st, SPEEX_SET_VBR_QUALITY, &vbr_quality);
}
else
speex_encoder_ctl(st, SPEEX_SET_QUALITY, &quality);
}
if (bitrate)
{
if (quality >= 0 && vbr_enabled)
fprintf (stderr, "Warning: --bitrate option is overriding --quality\n");
speex_encoder_ctl(st, SPEEX_SET_BITRATE, &bitrate);
}
if (vbr_enabled)
{
tmp=1;
speex_encoder_ctl(st, SPEEX_SET_VBR, &tmp);
} else if (vad_enabled)
{
tmp=1;
speex_encoder_ctl(st, SPEEX_SET_VAD, &tmp);
}
if (dtx_enabled)
speex_encoder_ctl(st, SPEEX_SET_DTX, &tmp);
if (dtx_enabled && !(vbr_enabled || abr_enabled || vad_enabled) && !quiet)
{
fprintf (stderr, "Warning: --dtx is useless without --vad, --vbr or --abr\n");
} else if ((vbr_enabled || abr_enabled) && (vad_enabled) && !quiet)
{
fprintf (stderr, "Warning: --vad is already implied by --vbr or --abr\n");
}
if (with_skeleton && !quiet) {
fprintf (stderr, "Warning: Enabling skeleton output may cause some decoders to fail.\n");
}
if (with_headerbyte && !quiet) {
fprintf (stderr, "Warning: with-header-byte output will not be compatible with most decoders.\n");
}
if (abr_enabled)
{
speex_encoder_ctl(st, SPEEX_SET_ABR, &abr_enabled);
}
speex_encoder_ctl(st, SPEEX_GET_LOOKAHEAD, &lookahead);
if (denoise_enabled || agc_enabled)
{
preprocess = speex_preprocess_state_init(frame_size, rate);
speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_DENOISE, &denoise_enabled);
speex_preprocess_ctl(preprocess, SPEEX_PREPROCESS_SET_AGC, &agc_enabled);
lookahead += frame_size;
}
/* first packet should be the skeleton header. */
if (with_skeleton) {
add_fishead_packet(&so);
if ((ret = flush_ogg_stream_to_file(&so, fout))) {
fprintf (stderr,"Error: failed skeleton (fishead) header to output stream\n");
exit(1);
} else
bytes_written += ret;
}
/*Write header*/
{
int packet_size;
op.packet = (unsigned char *)speex_header_to_packet(&header, &packet_size);
op.bytes = packet_size;
op.b_o_s = 1;
op.e_o_s = 0;
op.granulepos = 0;
op.packetno = 0;
ogg_stream_packetin(&os, &op);
free(op.packet);
while((result = ogg_stream_flush(&os, &og)))
{
if(!result) break;
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
bytes_written += ret;
}
op.packet = (unsigned char *)comments;
op.bytes = comments_length;
op.b_o_s = 0;
op.e_o_s = 0;
op.granulepos = 0;
op.packetno = 1;
ogg_stream_packetin(&os, &op);
}
/* fisbone packet should be write after all bos pages */
if (with_skeleton) {
add_fisbone_packet(&so, os.serialno, &header);
if ((ret = flush_ogg_stream_to_file(&so, fout))) {
fprintf (stderr,"Error: failed writing skeleton (fisbone )header to output stream\n");
exit(1);
} else
bytes_written += ret;
}
/* writing the rest of the speex header packets */
while((result = ogg_stream_flush(&os, &og)))
{
if(!result) break;
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
bytes_written += ret;
}
free(comments);
/* write the skeleton eos packet */
if (with_skeleton) {
add_eos_packet_to_stream(&so);
if ((ret = flush_ogg_stream_to_file(&so, fout))) {
fprintf (stderr,"Error: failed writing skeleton header to output stream\n");
exit(1);
} else
bytes_written += ret;
}
speex_bits_init(&bits);
if (!wave_input)
{
nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, first_bytes, NULL);
} else {
nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, &size);
}
if (nb_samples==0)
eos=1;
total_samples += nb_samples;
nb_encoded = -lookahead;
/*Main encoding loop (one frame per iteration)*/
while (!eos || total_samples>nb_encoded)
{
id++;
/*Encode current frame*/
if (chan==2)
speex_encode_stereo_int(input, frame_size, &bits);
if (preprocess)
speex_preprocess(preprocess, input, NULL);
speex_encode_int(st, input, &bits);
nb_encoded += frame_size;
if (print_bitrate) {
int tmp;
char ch=13;
speex_encoder_ctl(st, SPEEX_GET_BITRATE, &tmp);
fputc (ch, stderr);
cumul_bits += tmp;
enc_frames += 1;
if (!quiet)
{
if (vad_enabled || vbr_enabled || abr_enabled)
fprintf (stderr, "Bitrate is use: %d bps (average %d bps) ", tmp, (int)(cumul_bits/enc_frames));
else
fprintf (stderr, "Bitrate is use: %d bps ", tmp);
}
}
if (wave_input)
{
nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, &size);
} else {
nb_samples = read_samples(fin,frame_size,fmt,chan,lsb,input, NULL, NULL);
}
if (nb_samples==0)
{
eos=1;
}
if (eos && total_samples<=nb_encoded)
op.e_o_s = 1;
else
op.e_o_s = 0;
total_samples += nb_samples;
if ((id+1)%nframes!=0)
continue;
speex_bits_insert_terminator(&bits);
/* Experimental: place the size of the frame as the first byte
This is the packet format for MIME type x-speex-with-header-byte.*/
if (with_headerbyte) {
nbBytes = speex_bits_write(&bits, cbits + 1, MAX_FRAME_BYTES);
cbits[0]= (char)nbBytes;
speex_bits_reset(&bits);
op.packet = (unsigned char *)cbits;
op.bytes = nbBytes + 1;
} else {
nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES);
speex_bits_reset(&bits);
op.packet = (unsigned char *)cbits;
op.bytes = nbBytes;
}
op.b_o_s = 0;
/*Is this redundent?*/
if (eos && total_samples<=nb_encoded)
op.e_o_s = 1;
else
op.e_o_s = 0;
op.granulepos = (id+1)*frame_size-lookahead;
if (op.granulepos>total_samples)
op.granulepos = total_samples;
/*printf ("granulepos: %d %d %d %d %d %d\n", (int)op.granulepos, id, nframes, lookahead, 5, 6);*/
op.packetno = 2+id/nframes;
ogg_stream_packetin(&os, &op);
/*Write all new pages (most likely 0 or 1)*/
while (ogg_stream_pageout(&os,&og))
{
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
bytes_written += ret;
}
}
if ((id+1)%nframes!=0)
{
while ((id+1)%nframes!=0)
{
id++;
speex_bits_pack(&bits, 15, 5);
}
/* Experimental: place the size of the frame as the first byte
This is the packet format for MIME type x-speex-with-header-byte.*/
if (with_headerbyte) {
fprintf (stderr,"Debug: headerbyte binary format \n");
nbBytes = speex_bits_write(&bits, cbits + 1, MAX_FRAME_BYTES);
cbits[0] = (char)nbBytes;
op.packet = (unsigned char *)cbits;
op.bytes = nbBytes + 1;
} else {
fprintf (stderr,"Debug: regular binary format \n");
nbBytes = speex_bits_write(&bits, cbits, MAX_FRAME_BYTES);
op.packet = (unsigned char *)cbits;
op.bytes = nbBytes;
}
op.b_o_s = 0;
op.e_o_s = 1;
op.granulepos = (id+1)*frame_size-lookahead;
if (op.granulepos>total_samples)
op.granulepos = total_samples;
op.packetno = 2+id/nframes;
ogg_stream_packetin(&os, &op);
}
/*Flush all pages left to be written*/
while (ogg_stream_flush(&os, &og))
{
ret = oe_write_page(&og, fout);
if(ret != og.header_len + og.body_len)
{
fprintf (stderr,"Error: failed writing header to output stream\n");
exit(1);
}
else
bytes_written += ret;
}
speex_encoder_destroy(st);
speex_bits_destroy(&bits);
ogg_stream_clear(&os);
if (close_in)
fclose(fin);
if (close_out)
fclose(fout);
return 0;
}
/*
Comments will be stored in the Vorbis style.
It is describled in the "Structure" section of
http://www.xiph.org/ogg/vorbis/doc/v-comment.html
The comment header is decoded as follows:
1) [vendor_length] = read an unsigned integer of 32 bits
2) [vendor_string] = read a UTF-8 vector as [vendor_length] octets
3) [user_comment_list_length] = read an unsigned integer of 32 bits
4) iterate [user_comment_list_length] times {
5) [length] = read an unsigned integer of 32 bits
6) this iteration's user comment = read a UTF-8 vector as [length] octets
}
7) [framing_bit] = read a single bit as boolean
8) if ( [framing_bit] unset or end of packet ) then ERROR
9) done.
If you have troubles, please write to ymnk@jcraft.com.
*/
#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
((buf[base+2]<<16)&0xff0000)| \
((buf[base+1]<<8)&0xff00)| \
(buf[base]&0xff))
#define writeint(buf, base, val) do{ buf[base+3]=((val)>>24)&0xff; \
buf[base+2]=((val)>>16)&0xff; \
buf[base+1]=((val)>>8)&0xff; \
buf[base]=(val)&0xff; \
}while(0)
void comment_init(char **comments, int* length, char *vendor_string)
{
int vendor_length=strlen(vendor_string);
int user_comment_list_length=0;
int len=4+vendor_length+4;
char *p=(char*)malloc(len);
if(p==NULL){
fprintf (stderr, "malloc failed in comment_init()\n");
exit(1);
}
writeint(p, 0, vendor_length);
memcpy(p+4, vendor_string, vendor_length);
writeint(p, 4+vendor_length, user_comment_list_length);
*length=len;
*comments=p;
}
void comment_add(char **comments, int* length, char *tag, char *val)
{
char* p=*comments;
int vendor_length=readint(p, 0);
int user_comment_list_length=readint(p, 4+vendor_length);
int tag_len=(tag?strlen(tag):0);
int val_len=strlen(val);
int len=(*length)+4+tag_len+val_len;
p=(char*)realloc(p, len);
if(p==NULL){
fprintf (stderr, "realloc failed in comment_add()\n");
exit(1);
}
writeint(p, *length, tag_len+val_len); /* length of comment */
if(tag) memcpy(p+*length+4, tag, tag_len); /* comment */
memcpy(p+*length+4+tag_len, val, val_len); /* comment */
writeint(p, 4+vendor_length, user_comment_list_length+1);
*comments=p;
*length=len;
}
#undef readint
#undef writeint
|
{
"content_hash": "24732eb9eabd52022ce34dce9d95f767",
"timestamp": "",
"source": "github",
"line_count": 1001,
"max_line_length": 155,
"avg_line_length": 30.015984015984017,
"alnum_prop": 0.5572122745124143,
"repo_name": "chengjunjian/Speex-with-header-bytes",
"id": "c1020929147fc9215fc54b18ea7876d9d1886513",
"size": "31603",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/speexenc.c",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "7918"
},
{
"name": "C",
"bytes": "1016947"
},
{
"name": "C++",
"bytes": "20708"
},
{
"name": "Groff",
"bytes": "3667"
},
{
"name": "Inno Setup",
"bytes": "2140"
},
{
"name": "Makefile",
"bytes": "8524"
},
{
"name": "Matlab",
"bytes": "2076"
},
{
"name": "Shell",
"bytes": "232014"
}
],
"symlink_target": ""
}
|
title: Exceptions Are The Work
category: thoughts
layout: post
tags:
- saas
- workflow
- retool
- process
---
I had an interesting conversation with a founder this week and he said something in our meeting that stuck with me. He said, _“A company’s real workflows are not the workflows they’ve built. It’s all the stuff that falls out of those workflows.”_
It's been on my mind the last few days and the more I think about it the more I think it helps explain a lot of what is going on today in saas.
There is a finite amount of stuff that you can put into any individual workflow. When you design a process it’s impossible to capture every single thing that happens. There’s too much variance across teams, people, etc.
What you can do is standardize the big buckets of work. And so what you can do is build happy path workflows that capture the straightforward cases. Most of the saas products in use today fit this description.
But now with those workflows in place, you quickly realize that you're now spending all of your time on all the stuff that falls out of those workflows. Because by definition all of the things that don't fit neatly into those workflow are custom. So each thing requires new thinking every time which takes a lot of time and effort.
So the next set of companies that will matter don't focus on work that fits neatly into predefined workflows. They're flexible to allow you to quickly and easily build for exceptions. Products like [Notion](https://www.notion.so/), [Airtable](https://airtable.com/), [Retool](https://retool.com/), are good examples of tools that fill the white space in between well defined saas.
Another interesting set of companies in this world are ones like [Flowdash](https://flowdash.com/), [Macro](https://www.usemacro.com/), etc. that are built specifically for exceptions -- human in the loop workflows.
And lastly for bigger companies products like [Skan](https://skan.ai/), [Cursive](https://cursive.io/), etc. help you identify both what think your processes are as well as the entire universe of exceptions that come with it. Once you know then you can decide how to solve -- whether it's through flexible tools, human + machines, or just pure automation.
Regardless of the approach, a lot of this converges on the same idea. We've solved generic workflows and exceptions are the next layer of work for us to tackle.
|
{
"content_hash": "7a6ebceb4fad0cca3ede061b26c0ccdb",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 380,
"avg_line_length": 85.42857142857143,
"alnum_prop": 0.7746655518394648,
"repo_name": "ChrisEYin/sustain",
"id": "b1b0406e0a1d8e5e99c1b322ee51a563c7e6a434",
"size": "2410",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2020-04-17-exceptions-are-the-work.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8720"
},
{
"name": "HTML",
"bytes": "29212"
},
{
"name": "JavaScript",
"bytes": "980"
},
{
"name": "Ruby",
"bytes": "6075"
}
],
"symlink_target": ""
}
|
<?php
namespace Proyecto\CompraBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class CompraExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
|
{
"content_hash": "fbee531393e076a6752530ced6a6c0bd",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 105,
"avg_line_length": 31.392857142857142,
"alnum_prop": 0.726962457337884,
"repo_name": "airamg/txikitwo",
"id": "0aade4426b370bab7e89c9f95d191c21507a75ec",
"size": "879",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Proyecto/CompraBundle/DependencyInjection/CompraExtension.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "22017"
},
{
"name": "PHP",
"bytes": "172256"
},
{
"name": "Shell",
"bytes": "754"
}
],
"symlink_target": ""
}
|
FROM node:0.10.38
MAINTAINER Nathan LeClaire <nathan@docker.com>
ADD . /app
WORKDIR /app
RUN npm install
RUN apt-get update
RUN apt-get install -y vim aptitude sudo
RUN useradd -m -s /bin/bash ysc
RUN adduser ysc sudo
RUN echo 'ysc:ysc' | chpasswd
EXPOSE 80
ENTRYPOINT ["node"]
CMD ["app.js", "-p", "80"]
|
{
"content_hash": "446f93cc48393e903f37498dcc4635ce",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 46,
"avg_line_length": 19.25,
"alnum_prop": 0.7175324675324676,
"repo_name": "imdjh/wetty",
"id": "1c6b82dbaf649bc0c373c08a3fcfad28197df922",
"size": "308",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1120"
},
{
"name": "JavaScript",
"bytes": "502795"
}
],
"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_171-google-v7) on Mon Apr 08 11:10:15 PDT 2019 -->
<title>Key (Google App Engine API for Java)</title>
<meta name="date" content="2019-04-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Key (Google App Engine API for Java)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/appengine/api/datastore/IndexTranslator.html" title="class in com.google.appengine.api.datastore"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../com/google/appengine/api/datastore/KeyFactory.html" title="class in com.google.appengine.api.datastore"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/appengine/api/datastore/Key.html" target="_top">Frames</a></li>
<li><a href="Key.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.google.appengine.api.datastore</div>
<h2 title="Class Key" class="title">Class Key</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.google.appengine.api.datastore.Key</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Comparable<<a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a>></dd>
</dl>
<hr>
<br>
<pre>public final class <span class="typeNameLabel">Key</span>
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable<<a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a>></pre>
<div class="block">The primary key for a datastore entity.
<p>A datastore GUID. A Key instance uniquely identifies an entity across all apps, and includes
all information necessary to fetch the entity from the datastore with <code>DatastoreService.get(Key)</code>.
<p>You can create <code>Key</code> objects directly by using <a href="../../../../../com/google/appengine/api/datastore/KeyFactory.html#createKey-java.lang.String-long-"><code>KeyFactory.createKey(java.lang.String, long)</code></a> or <a href="../../../../../com/google/appengine/api/datastore/Key.html#getChild-java.lang.String-long-"><code>getChild(java.lang.String, long)</code></a>.
<p>You can also retrieve the <code>Key</code> automatically created when you create a new <a href="../../../../../com/google/appengine/api/datastore/Entity.html" title="class in com.google.appengine.api.datastore"><code>Entity</code></a>, or serialize <code>Key</code> objects, or use <a href="../../../../../com/google/appengine/api/datastore/KeyFactory.html" title="class in com.google.appengine.api.datastore"><code>KeyFactory</code></a> to convert them to and from
websafe String values.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../com/google/appengine/api/datastore/KeyFactory.html" title="class in com.google.appengine.api.datastore"><code>KeyFactory</code></a>,
<a href="../../../../../serialized-form.html#com.google.appengine.api.datastore.Key">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#compareTo-com.google.appengine.api.datastore.Key-">compareTo</a></span>(<a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a> other)</code>
<div class="block">Compares two <code>Key</code> objects.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#equals-java.lang.Object-">equals</a></span>(java.lang.Object object)</code>
<div class="block">Compares two <code>Key</code> objects by comparing ids, kinds, parent and appIdNamespace.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getAppId--">getAppId</a></span>()</code>
<div class="block">Returns the appId for this <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore"><code>Key</code></a>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getChild-java.lang.String-long-">getChild</a></span>(java.lang.String kind,
long id)</code>
<div class="block">Creates a new key having <code>this</code> as parent and the given numeric identifier.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getChild-java.lang.String-java.lang.String-">getChild</a></span>(java.lang.String kind,
java.lang.String name)</code>
<div class="block">Creates a new key having <code>this</code> as parent and the given name.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getId--">getId</a></span>()</code>
<div class="block">Returns the numeric identifier of this <code>Key</code>.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getKind--">getKind</a></span>()</code>
<div class="block">Returns the kind of the <code>Entity</code> represented by this <code>Key</code>.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getName--">getName</a></span>()</code>
<div class="block">Returns the name of this <code>Key</code>.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getNamespace--">getNamespace</a></span>()</code>
<div class="block">Returns the namespace for this <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore"><code>Key</code></a>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#getParent--">getParent</a></span>()</code>
<div class="block">If this <code>Key</code> has a parent, return a <code>Key</code> that represents it.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#hashCode--">hashCode</a></span>()</code> </td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#isComplete--">isComplete</a></span>()</code>
<div class="block">Returns true if this Key has a name specified or has been assigned an identifier.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/google/appengine/api/datastore/Key.html#toString--">toString</a></span>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getKind--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKind</h4>
<pre>public java.lang.String getKind()</pre>
<div class="block">Returns the kind of the <code>Entity</code> represented by this <code>Key</code>.</div>
</li>
</ul>
<a name="getParent--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParent</h4>
<pre>public <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a> getParent()</pre>
<div class="block">If this <code>Key</code> has a parent, return a <code>Key</code> that represents it. If not, simply
return null.</div>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(java.lang.Object object)</pre>
<div class="block">Compares two <code>Key</code> objects by comparing ids, kinds, parent and appIdNamespace. If both
keys are assigned names rather than ids, compares names instead of ids. If neither key has an
id or a name, the keys are only equal if they reference the same object.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>equals</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="getAppId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAppId</h4>
<pre>public java.lang.String getAppId()</pre>
<div class="block">Returns the appId for this <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore"><code>Key</code></a>.</div>
</li>
</ul>
<a name="getNamespace--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNamespace</h4>
<pre>public java.lang.String getNamespace()</pre>
<div class="block">Returns the namespace for this <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore"><code>Key</code></a>.</div>
</li>
</ul>
<a name="getId--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre>public long getId()</pre>
<div class="block">Returns the numeric identifier of this <code>Key</code>.</div>
</li>
</ul>
<a name="getName--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre>public java.lang.String getName()</pre>
<div class="block">Returns the name of this <code>Key</code>.</div>
</li>
</ul>
<a name="getChild-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChild</h4>
<pre>public <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a> getChild(java.lang.String kind,
long id)</pre>
<div class="block">Creates a new key having <code>this</code> as parent and the given numeric identifier. The parent
key must be complete.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>kind</code> - the kind of the child key to create</dd>
<dd><code>id</code> - the numeric identifier of the key in <code>kind</code>, unique for this parent</dd>
</dl>
</li>
</ul>
<a name="getChild-java.lang.String-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getChild</h4>
<pre>public <a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a> getChild(java.lang.String kind,
java.lang.String name)</pre>
<div class="block">Creates a new key having <code>this</code> as parent and the given name. The parent key must be
complete.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>kind</code> - the kind of the child key to create</dd>
<dd><code>name</code> - the name of the key in <code>kind</code>, as an arbitrary string unique for this parent</dd>
</dl>
</li>
</ul>
<a name="isComplete--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isComplete</h4>
<pre>public boolean isComplete()</pre>
<div class="block">Returns true if this Key has a name specified or has been assigned an identifier.</div>
</li>
</ul>
<a name="compareTo-com.google.appengine.api.datastore.Key-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>compareTo</h4>
<pre>public int compareTo(<a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a> other)</pre>
<div class="block">Compares two <code>Key</code> objects. The algorithm proceeds as follows: Turn each <code>Key</code> into
an iterator where the first element returned is the top-most ancestor, the next element is the
child of the previous element, and so on. The last element will be the <code>Key</code> we started
with. Once we have assembled these two iterators (one for 'this' and one for the <code>Key</code>
we're comparing to), consume them in parallel, comparing the next element from each iterator.
If at any point the comparison of these two elements yields a non-zero result, return that as
the result of the overall comparison. If we exhaust the iterator built from 'this' before we
exhaust the iterator built from the other <code>Key</code>, we return less than. An example:
<p><code>app1.type1.4.app1.type2.9 < app1.type1.4.app1.type2.9.app1.type3.2</code>
<p>If we exhaust the iterator built from the other <code>Key</code> before we exhaust the iterator
built from 'this', we return greater than. An example:
<p><code>app1.type1.4.app1.type2.9.app1.type3.2 > app1.type1.4.app1.type2.9</code>
<p>The relationship between individual <code>Key Keys</code> is performed by comparing app followed
by kind followed by id. If both keys are assigned names rather than ids, compares names instead
of ids. If neither key has an id or a name we return an arbitrary but consistent result.
Assuming all other components are equal, all ids are less than all names.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>compareTo</code> in interface <code>java.lang.Comparable<<a href="../../../../../com/google/appengine/api/datastore/Key.html" title="class in com.google.appengine.api.datastore">Key</a>></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Java is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/google/appengine/api/datastore/IndexTranslator.html" title="class in com.google.appengine.api.datastore"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../com/google/appengine/api/datastore/KeyFactory.html" title="class in com.google.appengine.api.datastore"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/google/appengine/api/datastore/Key.html" target="_top">Frames</a></li>
<li><a href="Key.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"content_hash": "40e5ac5186c4c77e1b73110835f163bb",
"timestamp": "",
"source": "github",
"line_count": 498,
"max_line_length": 469,
"avg_line_length": 44.441767068273094,
"alnum_prop": 0.6637448039038496,
"repo_name": "googlearchive/caja",
"id": "3132f37838934a1fcf0e4fe7bca685055482ebb4",
"size": "22132",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "third_party/java/appengine/docs/javadoc/com/google/appengine/api/datastore/Key.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "30715"
},
{
"name": "HTML",
"bytes": "1086467"
},
{
"name": "Java",
"bytes": "2541899"
},
{
"name": "JavaScript",
"bytes": "2102219"
},
{
"name": "Perl",
"bytes": "25768"
},
{
"name": "Python",
"bytes": "150158"
},
{
"name": "Shell",
"bytes": "13072"
},
{
"name": "XSLT",
"bytes": "27472"
}
],
"symlink_target": ""
}
|
using System;
namespace Azure.ResourceManager.Network.Models
{
/// <summary> Properties of VPN client root certificate of VpnServerConfiguration. </summary>
public partial class VpnServerConfigVpnClientRootCertificate
{
/// <summary> Initializes a new instance of VpnServerConfigVpnClientRootCertificate. </summary>
public VpnServerConfigVpnClientRootCertificate()
{
}
/// <summary> Initializes a new instance of VpnServerConfigVpnClientRootCertificate. </summary>
/// <param name="name"> The certificate name. </param>
/// <param name="publicCertData"> The certificate public data. </param>
internal VpnServerConfigVpnClientRootCertificate(string name, BinaryData publicCertData)
{
Name = name;
PublicCertData = publicCertData;
}
/// <summary> The certificate name. </summary>
public string Name { get; set; }
/// <summary>
/// The certificate public data.
/// <para>
/// To assign an object to this property use <see cref="BinaryData.FromObjectAsJson{T}(T, System.Text.Json.JsonSerializerOptions?)"/>.
/// </para>
/// <para>
/// To assign an already formated json string to this property use <see cref="BinaryData.FromString(string)"/>.
/// </para>
/// <para>
/// Examples:
/// <list type="bullet">
/// <item>
/// <term>BinaryData.FromObjectAsJson("foo")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("\"foo\"")</term>
/// <description>Creates a payload of "foo".</description>
/// </item>
/// <item>
/// <term>BinaryData.FromObjectAsJson(new { key = "value" })</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// <item>
/// <term>BinaryData.FromString("{\"key\": \"value\"}")</term>
/// <description>Creates a payload of { "key": "value" }.</description>
/// </item>
/// </list>
/// </para>
/// </summary>
public BinaryData PublicCertData { get; set; }
}
}
|
{
"content_hash": "2618e248f0c8f315482c28403ced0584",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 142,
"avg_line_length": 40.44642857142857,
"alnum_prop": 0.5805739514348786,
"repo_name": "Azure/azure-sdk-for-net",
"id": "ae70c052f1f6961b9cbc5e8a28bb18941bbd77d4",
"size": "2403",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/network/Azure.ResourceManager.Network/src/Generated/Models/VpnServerConfigVpnClientRootCertificate.cs",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
"""Storage preference based location strategy module"""
from oslo_config import cfg
from oslo_log import log as logging
import six
import six.moves.urllib.parse as urlparse
from glance.i18n import _, _LW
LOG = logging.getLogger(__name__)
store_type_opts = [
cfg.ListOpt('store_type_preference',
default=[],
help=_("""
Preference order of storage backends.
Provide a comma separated list of store names in the order in
which images should be retrieved from storage backends.
These store names must be registered with the ``stores``
configuration option.
NOTE: The ``store_type_preference`` configuration option is applied
only if ``store_type`` is chosen as a value for the
``location_strategy`` configuration option. An empty list will not
change the location order.
Possible values:
* Empty list
* Comma separated list of registered store names. Legal values are:
* file
* http
* rbd
* swift
* sheepdog
* cinder
* vmware
Related options:
* location_strategy
* stores
"""))
]
CONF = cfg.CONF
CONF.register_opts(store_type_opts, group='store_type_location_strategy')
_STORE_TO_SCHEME_MAP = {}
def get_strategy_name():
"""Return strategy module name."""
return 'store_type'
def init():
"""Initialize strategy module."""
# NOTE(zhiyan): We have a plan to do a reusable glance client library for
# all clients like Nova and Cinder in near period, it would be able to
# contains common code to provide uniform image service interface for them,
# just like Brick in Cinder, this code can be moved to there and shared
# between Glance and client both side. So this implementation as far as
# possible to prevent make relationships with Glance(server)-specific code,
# for example: using functions within store module to validate
# 'store_type_preference' option.
mapping = {'file': ['file', 'filesystem'],
'http': ['http', 'https'],
'rbd': ['rbd'],
'swift': ['swift', 'swift+https', 'swift+http'],
'sheepdog': ['sheepdog'],
'cinder': ['cinder'],
'vmware': ['vsphere']}
_STORE_TO_SCHEME_MAP.clear()
_STORE_TO_SCHEME_MAP.update(mapping)
def get_ordered_locations(locations, uri_key='url', **kwargs):
"""
Order image location list.
:param locations: The original image location list.
:param uri_key: The key name for location URI in image location dictionary.
:returns: The image location list with preferred store type order.
"""
def _foreach_store_type_preference():
store_types = CONF.store_type_location_strategy.store_type_preference
for preferred_store in store_types:
preferred_store = str(preferred_store).strip()
if not preferred_store:
continue
# NOTE(dharinic): The following conversion of ``filesystem`` and
# ``vmware_datastore`` to ``file`` and ``vmware`` respectively
# are to make store names consistent in Glance and glance_store
# and also be backward compatible.
# Reference: Bug 1615852
if preferred_store == 'filesystem':
preferred_store = 'file'
msg = _LW('The value ``filesystem`` is DEPRECATED for use '
'with ``store_type_preference``. It will be '
'removed in the Pike release. Please use ``file`` '
'instead. Please see the Glance Newton release '
'notes for more information.')
LOG.warn(msg)
if preferred_store == 'vmware_datastore':
preferred_store = 'vmware'
msg = _LW('The value ``vmware_datastore`` is DEPRECATED for '
'use with ``store_type_preference``. It will be '
'removed in the Pike release. Please use ``vmware`` '
'instead. Please see the Glance Newton release '
'notes for more information.')
LOG.warn(msg)
yield preferred_store
if not locations:
return locations
preferences = {}
others = []
for preferred_store in _foreach_store_type_preference():
preferences[preferred_store] = []
for location in locations:
uri = location.get(uri_key)
if not uri:
continue
pieces = urlparse.urlparse(uri.strip())
store_name = None
for store, schemes in six.iteritems(_STORE_TO_SCHEME_MAP):
if pieces.scheme.strip() in schemes:
store_name = store
break
if store_name in preferences:
preferences[store_name].append(location)
else:
others.append(location)
ret = []
# NOTE(zhiyan): While configuration again since py26 does not support
# ordereddict container.
for preferred_store in _foreach_store_type_preference():
ret.extend(preferences[preferred_store])
ret.extend(others)
return ret
|
{
"content_hash": "abe84b6eae4cbc6d4a1eaf38adede611",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 34.945945945945944,
"alnum_prop": 0.608662026295437,
"repo_name": "stevelle/glance",
"id": "90ad5232094e63fa9f37719ea507c68ea73c2506",
"size": "5797",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "glance/common/location_strategy/store_type.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "3867110"
},
{
"name": "Shell",
"bytes": "7860"
}
],
"symlink_target": ""
}
|
#pragma once
#include <aws/s3/S3_EXPORTS.h>
#include <aws/s3/model/LifecycleExpiration.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/s3/model/LifecycleRuleFilter.h>
#include <aws/s3/model/ExpirationStatus.h>
#include <aws/core/utils/memory/stl/AWSVector.h>
#include <aws/s3/model/NoncurrentVersionExpiration.h>
#include <aws/s3/model/AbortIncompleteMultipartUpload.h>
#include <aws/s3/model/Transition.h>
#include <aws/s3/model/NoncurrentVersionTransition.h>
#include <utility>
namespace Aws
{
namespace Utils
{
namespace Xml
{
class XmlNode;
} // namespace Xml
} // namespace Utils
namespace S3
{
namespace Model
{
class AWS_S3_API LifecycleRule
{
public:
LifecycleRule();
LifecycleRule(const Aws::Utils::Xml::XmlNode& xmlNode);
LifecycleRule& operator=(const Aws::Utils::Xml::XmlNode& xmlNode);
void AddToNode(Aws::Utils::Xml::XmlNode& parentNode) const;
inline const LifecycleExpiration& GetExpiration() const{ return m_expiration; }
inline void SetExpiration(const LifecycleExpiration& value) { m_expirationHasBeenSet = true; m_expiration = value; }
inline void SetExpiration(LifecycleExpiration&& value) { m_expirationHasBeenSet = true; m_expiration = std::move(value); }
inline LifecycleRule& WithExpiration(const LifecycleExpiration& value) { SetExpiration(value); return *this;}
inline LifecycleRule& WithExpiration(LifecycleExpiration&& value) { SetExpiration(std::move(value)); return *this;}
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline const Aws::String& GetID() const{ return m_iD; }
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline void SetID(const Aws::String& value) { m_iDHasBeenSet = true; m_iD = value; }
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline void SetID(Aws::String&& value) { m_iDHasBeenSet = true; m_iD = std::move(value); }
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline void SetID(const char* value) { m_iDHasBeenSet = true; m_iD.assign(value); }
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline LifecycleRule& WithID(const Aws::String& value) { SetID(value); return *this;}
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline LifecycleRule& WithID(Aws::String&& value) { SetID(std::move(value)); return *this;}
/**
* <p>Unique identifier for the rule. The value cannot be longer than 255
* characters.</p>
*/
inline LifecycleRule& WithID(const char* value) { SetID(value); return *this;}
inline const LifecycleRuleFilter& GetFilter() const{ return m_filter; }
inline void SetFilter(const LifecycleRuleFilter& value) { m_filterHasBeenSet = true; m_filter = value; }
inline void SetFilter(LifecycleRuleFilter&& value) { m_filterHasBeenSet = true; m_filter = std::move(value); }
inline LifecycleRule& WithFilter(const LifecycleRuleFilter& value) { SetFilter(value); return *this;}
inline LifecycleRule& WithFilter(LifecycleRuleFilter&& value) { SetFilter(std::move(value)); return *this;}
/**
* <p>If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
* not currently being applied.</p>
*/
inline const ExpirationStatus& GetStatus() const{ return m_status; }
/**
* <p>If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
* not currently being applied.</p>
*/
inline void SetStatus(const ExpirationStatus& value) { m_statusHasBeenSet = true; m_status = value; }
/**
* <p>If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
* not currently being applied.</p>
*/
inline void SetStatus(ExpirationStatus&& value) { m_statusHasBeenSet = true; m_status = std::move(value); }
/**
* <p>If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
* not currently being applied.</p>
*/
inline LifecycleRule& WithStatus(const ExpirationStatus& value) { SetStatus(value); return *this;}
/**
* <p>If 'Enabled', the rule is currently being applied. If 'Disabled', the rule is
* not currently being applied.</p>
*/
inline LifecycleRule& WithStatus(ExpirationStatus&& value) { SetStatus(std::move(value)); return *this;}
inline const Aws::Vector<Transition>& GetTransitions() const{ return m_transitions; }
inline void SetTransitions(const Aws::Vector<Transition>& value) { m_transitionsHasBeenSet = true; m_transitions = value; }
inline void SetTransitions(Aws::Vector<Transition>&& value) { m_transitionsHasBeenSet = true; m_transitions = std::move(value); }
inline LifecycleRule& WithTransitions(const Aws::Vector<Transition>& value) { SetTransitions(value); return *this;}
inline LifecycleRule& WithTransitions(Aws::Vector<Transition>&& value) { SetTransitions(std::move(value)); return *this;}
inline LifecycleRule& AddTransitions(const Transition& value) { m_transitionsHasBeenSet = true; m_transitions.push_back(value); return *this; }
inline LifecycleRule& AddTransitions(Transition&& value) { m_transitionsHasBeenSet = true; m_transitions.push_back(std::move(value)); return *this; }
inline const Aws::Vector<NoncurrentVersionTransition>& GetNoncurrentVersionTransitions() const{ return m_noncurrentVersionTransitions; }
inline void SetNoncurrentVersionTransitions(const Aws::Vector<NoncurrentVersionTransition>& value) { m_noncurrentVersionTransitionsHasBeenSet = true; m_noncurrentVersionTransitions = value; }
inline void SetNoncurrentVersionTransitions(Aws::Vector<NoncurrentVersionTransition>&& value) { m_noncurrentVersionTransitionsHasBeenSet = true; m_noncurrentVersionTransitions = std::move(value); }
inline LifecycleRule& WithNoncurrentVersionTransitions(const Aws::Vector<NoncurrentVersionTransition>& value) { SetNoncurrentVersionTransitions(value); return *this;}
inline LifecycleRule& WithNoncurrentVersionTransitions(Aws::Vector<NoncurrentVersionTransition>&& value) { SetNoncurrentVersionTransitions(std::move(value)); return *this;}
inline LifecycleRule& AddNoncurrentVersionTransitions(const NoncurrentVersionTransition& value) { m_noncurrentVersionTransitionsHasBeenSet = true; m_noncurrentVersionTransitions.push_back(value); return *this; }
inline LifecycleRule& AddNoncurrentVersionTransitions(NoncurrentVersionTransition&& value) { m_noncurrentVersionTransitionsHasBeenSet = true; m_noncurrentVersionTransitions.push_back(std::move(value)); return *this; }
inline const NoncurrentVersionExpiration& GetNoncurrentVersionExpiration() const{ return m_noncurrentVersionExpiration; }
inline void SetNoncurrentVersionExpiration(const NoncurrentVersionExpiration& value) { m_noncurrentVersionExpirationHasBeenSet = true; m_noncurrentVersionExpiration = value; }
inline void SetNoncurrentVersionExpiration(NoncurrentVersionExpiration&& value) { m_noncurrentVersionExpirationHasBeenSet = true; m_noncurrentVersionExpiration = std::move(value); }
inline LifecycleRule& WithNoncurrentVersionExpiration(const NoncurrentVersionExpiration& value) { SetNoncurrentVersionExpiration(value); return *this;}
inline LifecycleRule& WithNoncurrentVersionExpiration(NoncurrentVersionExpiration&& value) { SetNoncurrentVersionExpiration(std::move(value)); return *this;}
inline const AbortIncompleteMultipartUpload& GetAbortIncompleteMultipartUpload() const{ return m_abortIncompleteMultipartUpload; }
inline void SetAbortIncompleteMultipartUpload(const AbortIncompleteMultipartUpload& value) { m_abortIncompleteMultipartUploadHasBeenSet = true; m_abortIncompleteMultipartUpload = value; }
inline void SetAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload&& value) { m_abortIncompleteMultipartUploadHasBeenSet = true; m_abortIncompleteMultipartUpload = std::move(value); }
inline LifecycleRule& WithAbortIncompleteMultipartUpload(const AbortIncompleteMultipartUpload& value) { SetAbortIncompleteMultipartUpload(value); return *this;}
inline LifecycleRule& WithAbortIncompleteMultipartUpload(AbortIncompleteMultipartUpload&& value) { SetAbortIncompleteMultipartUpload(std::move(value)); return *this;}
private:
LifecycleExpiration m_expiration;
bool m_expirationHasBeenSet;
Aws::String m_iD;
bool m_iDHasBeenSet;
LifecycleRuleFilter m_filter;
bool m_filterHasBeenSet;
ExpirationStatus m_status;
bool m_statusHasBeenSet;
Aws::Vector<Transition> m_transitions;
bool m_transitionsHasBeenSet;
Aws::Vector<NoncurrentVersionTransition> m_noncurrentVersionTransitions;
bool m_noncurrentVersionTransitionsHasBeenSet;
NoncurrentVersionExpiration m_noncurrentVersionExpiration;
bool m_noncurrentVersionExpirationHasBeenSet;
AbortIncompleteMultipartUpload m_abortIncompleteMultipartUpload;
bool m_abortIncompleteMultipartUploadHasBeenSet;
};
} // namespace Model
} // namespace S3
} // namespace Aws
|
{
"content_hash": "08fb127c8ff173a7e2304baa2f158916",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 221,
"avg_line_length": 38.076,
"alnum_prop": 0.7299086038449417,
"repo_name": "JoyIfBam5/aws-sdk-cpp",
"id": "d8db56d8777c2d2c8930a80e5bb07718e4fa3420",
"size": "10092",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-s3/include/aws/s3/model/LifecycleRule.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "11868"
},
{
"name": "C++",
"bytes": "167818064"
},
{
"name": "CMake",
"bytes": "591577"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "271801"
},
{
"name": "Python",
"bytes": "85650"
},
{
"name": "Shell",
"bytes": "5277"
}
],
"symlink_target": ""
}
|
pruebas de gh-pages
|
{
"content_hash": "f614ac44c16cd0d0d964d3ffd0ff2062",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 19,
"avg_line_length": 20,
"alnum_prop": 0.8,
"repo_name": "KEINNENNGEL/gh-pages",
"id": "0b76bcb5f2550421eef6e27f4a86ec7189506582",
"size": "31",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
/**
* Created by Alex on 2015/3/13.
*/
(function (window, $, namespace) {
/**
* 定义经纬度点类型
*/
$.DeclareClass("XspWeb.Controls.GISControl.Common.LongLatPoint", XspWeb.Controls.GISControl.Common.Point, {
/**
* 构造函数
*
* @param Double longitude 经度
* @param Double latitude 纬度
*/
Constructor: function (longitude, latitude) {
this.Super();
if (arguments.length == 2) {
this.mLongitude = longitude;
this.mLatitude = latitude;
}
else {
this.mLongitude = 0.0;
this.mLatitude = 0.0;
}
}
});
})(window, jQuery, $.Namespace());
|
{
"content_hash": "4d00f8c5c76b4e85068784433d22b510",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 111,
"avg_line_length": 25.275862068965516,
"alnum_prop": 0.48021828103683495,
"repo_name": "furongsoft/weiphp2.0.1202",
"id": "46df0eac1a6136cced96089cc770a58b949585b7",
"size": "765",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Sources/weiphp2.0.1202/XspWeb/Client/Scripts/Controls/GisControl/Common/LongLatPoint.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "1123"
},
{
"name": "Batchfile",
"bytes": "897"
},
{
"name": "C",
"bytes": "10209"
},
{
"name": "CSS",
"bytes": "2320628"
},
{
"name": "HTML",
"bytes": "1861453"
},
{
"name": "Java",
"bytes": "45492"
},
{
"name": "JavaScript",
"bytes": "6777210"
},
{
"name": "PHP",
"bytes": "6031142"
},
{
"name": "Shell",
"bytes": "574"
},
{
"name": "Smarty",
"bytes": "11952"
}
],
"symlink_target": ""
}
|
var path = require('path'),
config;
config = {
// ### Production
// When running Ghost in the wild, use the production environment.
// Configure your URL and mail settings here
production: {
url: 'http://my-ghost-blog.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
host: '10.0.0.0',
port: process.env.PORT
}
},
// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blog's published URL.
url: 'http://localhost:2368',
// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
// mail: {
// transport: 'SMTP',
// options: {
// service: 'Mailgun',
// auth: {
// user: '', // mailgun username
// pass: '' // mailgun password
// }
// }
// },
// ```
// #### Database
// Ghost supports sqlite3 (default), MySQL & PostgreSQL
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-dev.db')
},
debug: false
},
// #### Server
// Can be host & port (default), or socket
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
// #### Paths
// Specify where your content directory lives
paths: {
contentPath: path.join(__dirname, '/content/')
}
},
// **Developers only need to edit below here**
// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-test.db')
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},
// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};
module.exports = config;
|
{
"content_hash": "a4a508a226b05aebedc69eecfe914500",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 108,
"avg_line_length": 27.789473684210527,
"alnum_prop": 0.4383116883116883,
"repo_name": "Luciekimotho/blogging-with-ghost",
"id": "b5d9d84b7324fba5d7c2b94efc8b336311292fd6",
"size": "3948",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config.example.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "183143"
},
{
"name": "HTML",
"bytes": "55325"
},
{
"name": "JavaScript",
"bytes": "6191714"
},
{
"name": "XSLT",
"bytes": "7177"
}
],
"symlink_target": ""
}
|
package com.handstudio.android.hzgraphlib.vo.scattergraph;
import java.util.ArrayList;
public class ScatterGraph
{
public static final String TAG = ScatterGraph.class.getSimpleName();
private String name = null;
private int color = -1;
private float[] coordinateArr = null;
private int bitmapResource = -1;
public ScatterGraph(String name, int color, float[] coordinateArr)
{
this.name = name;
this.color = color;
this.coordinateArr = coordinateArr;
}
public ScatterGraph(String name, int color, float[] coordinateArr, int bitmapResource)
{
this(name, color, coordinateArr);
this.bitmapResource = bitmapResource;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public float[] getCoordinateArr() {
return coordinateArr;
}
public void setCoordinateArr(float[] coordinateArr) {
this.coordinateArr = coordinateArr;
}
public int getBitmapResource() {
return bitmapResource;
}
public void setBitmapResource(int bitmapResource) {
this.bitmapResource = bitmapResource;
}
}
|
{
"content_hash": "b953fab5940e15f355a783340adb760b",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 87,
"avg_line_length": 17.1,
"alnum_prop": 0.7192982456140351,
"repo_name": "handstudio/HzGrapher",
"id": "126b94d3473798700bfc030ce2dda20794647780",
"size": "1197",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "library/src/com/handstudio/android/hzgraphlib/vo/scattergraph/ScatterGraph.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "328340"
}
],
"symlink_target": ""
}
|
package org.infinispan.configuration.cache;
import org.infinispan.config.ConfigurationException;
import org.infinispan.configuration.Builder;
import org.infinispan.eviction.EvictionStrategy;
import org.infinispan.eviction.EvictionThreadPolicy;
import org.infinispan.util.logging.Log;
import org.infinispan.util.logging.LogFactory;
/**
* Controls the eviction settings for the cache.
*/
public class EvictionConfigurationBuilder extends AbstractConfigurationChildBuilder implements Builder<EvictionConfiguration> {
private static final Log log = LogFactory.getLog(EvictionConfigurationBuilder.class);
private int maxEntries = -1;
private EvictionStrategy strategy = EvictionStrategy.NONE;
private EvictionThreadPolicy threadPolicy = EvictionThreadPolicy.DEFAULT;
EvictionConfigurationBuilder(ConfigurationBuilder builder) {
super(builder);
}
/**
* Eviction strategy. Available options are 'UNORDERED', 'LRU', 'LIRS' and 'NONE' (to disable
* eviction).
*
* @param evictionStrategy
*/
public EvictionConfigurationBuilder strategy(EvictionStrategy evictionStrategy) {
this.strategy = evictionStrategy;
return this;
}
/**
* Threading policy for eviction.
*
* @param policy
*/
public EvictionConfigurationBuilder threadPolicy(EvictionThreadPolicy policy) {
this.threadPolicy = policy;
return this;
}
/**
* Maximum number of entries in a cache instance. Cache size is guaranteed not to exceed upper
* limit specified by max entries. However, due to the nature of eviction it is unlikely to ever
* be exactly maximum number of entries specified here.
*
* @param maxEntries
*/
public EvictionConfigurationBuilder maxEntries(int maxEntries) {
this.maxEntries = maxEntries;
return this;
}
@Override
public void validate() {
if (!strategy.isEnabled() && getBuilder().loaders().passivation())
log.passivationWithoutEviction();
if(strategy == EvictionStrategy.FIFO)
log.warn("FIFO strategy is deprecated, LRU will be used instead");
if (strategy.isEnabled() && maxEntries <= 0)
throw new ConfigurationException("Eviction maxEntries value cannot be less than or equal to zero if eviction is enabled");
if (maxEntries > 0 && !strategy.isEnabled()) {
strategy = EvictionStrategy.LIRS;
log.debugf("Max entries configured (%d) without eviction strategy. Eviction strategy overriden to %s", maxEntries, strategy);
}
}
@Override
public EvictionConfiguration create() {
return new EvictionConfiguration(maxEntries, strategy, threadPolicy);
}
@Override
public EvictionConfigurationBuilder read(EvictionConfiguration template) {
this.maxEntries = template.maxEntries();
this.strategy = template.strategy();
this.threadPolicy = template.threadPolicy();
return this;
}
@Override
public String toString() {
return "EvictionConfigurationBuilder{" +
"maxEntries=" + maxEntries +
", strategy=" + strategy +
", threadPolicy=" + threadPolicy +
'}';
}
}
|
{
"content_hash": "d5ae9965c8cd7569114ce66ff298414f",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 134,
"avg_line_length": 32.79381443298969,
"alnum_prop": 0.7054385413392015,
"repo_name": "nmldiegues/stibt",
"id": "3356eeb38ab6c464207631df70a36684ee499ad5",
"size": "3980",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "infinispan/core/src/main/java/org/infinispan/configuration/cache/EvictionConfigurationBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3441"
},
{
"name": "CSS",
"bytes": "6677"
},
{
"name": "GAP",
"bytes": "30552"
},
{
"name": "HTML",
"bytes": "17606"
},
{
"name": "Java",
"bytes": "15496473"
},
{
"name": "JavaScript",
"bytes": "3234"
},
{
"name": "Python",
"bytes": "131164"
},
{
"name": "Ruby",
"bytes": "36919"
},
{
"name": "Scala",
"bytes": "509174"
},
{
"name": "Shell",
"bytes": "146366"
},
{
"name": "XSLT",
"bytes": "52280"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="sk" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About DRACHMacoin</source>
<translation>O DRACHMacoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>DRACHMacoin</b> version</source>
<translation><b>DRACHMacoin</b> verzia</translation>
</message>
<message>
<location line="+57"/>
<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 (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The DRACHMacoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Adresár</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>Dvojklikom editovať adresu alebo popis</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Vytvoriť novú adresu</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Kopírovať práve zvolenú adresu do systémového klipbordu</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation>&Nová adresa</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your DRACHMacoin 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>Toto sú Vaše DRACHMacoin adresy pre prijímanie platieb. Môžete dať každému odosielateľovi inú rôznu adresu a tak udržiavať prehľad o platbách.</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation>&Kopírovať adresu</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Zobraz &QR Kód</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a DRACHMacoin address</source>
<translation>Podpísať správu a dokázať že vlastníte túto adresu</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Podpísať &správu</translation>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportovať tento náhľad do súboru</translation>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified DRACHMacoin 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>&Zmazať</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your DRACHMacoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation>Kopírovať &popis</translation>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation>&Upraviť</translation>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>Exportovať dáta z adresára</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Čiarkou oddelený súbor (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Chyba exportu.</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nedalo sa zapisovať do súboru %1.</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(bez popisu)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Zadajte heslo</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Nové heslo</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Zopakujte nové heslo</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<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>Zadajte nové heslo k peňaženke.<br/>Prosím použite heslo s dĺžkou aspon <b>10 alebo viac náhodných znakov</b>, alebo <b>8 alebo viac slov</b>.</translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Zašifrovať peňaženku</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Táto operácia potrebuje heslo k vašej peňaženke aby ju mohla dešifrovať.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Odomknúť peňaženku</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Táto operácia potrebuje heslo k vašej peňaženke na dešifrovanie peňaženky.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Dešifrovať peňaženku</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Zmena hesla</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Zadajte staré a nové heslo k peňaženke.</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>Potvrďte šifrovanie peňaženky</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DRACHMCOINS</b>!</source>
<translation>Varovanie: Ak zašifrujete peňaženku a stratíte heslo, <b>STRATÍTE VŠETKY VAŠE DRACHMCOINY</b>!⏎</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Ste si istí, že si želáte zašifrovať peňaženku?</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="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Varovanie: Caps Lock je zapnutý</translation>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>Peňaženka zašifrovaná</translation>
</message>
<message>
<location line="-56"/>
<source>DRACHMacoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your drachmacoins from being stolen by malware infecting your computer.</source>
<translation>DRACHMacoin sa teraz ukončí pre dokončenie procesu šifrovania. Pamätaj že šifrovanie peňaženky Ťa nemôže úplne ochrániť pred kráďežou drachmacoinov pomocou škodlivého software.</translation>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Šifrovanie peňaženky zlyhalo</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>Šifrovanie peňaženky zlyhalo kôli internej chybe. Vaša peňaženka nebola zašifrovaná.</translation>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>Zadané heslá nesúhlasia.</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation>Odomykanie peňaženky zlyhalo</translation>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>Zadané heslo pre dešifrovanie peňaženky bolo nesprávne.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Zlyhalo šifrovanie peňaženky.</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Heslo k peňaženke bolo úspešne zmenené.</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation>Podpísať &správu...</translation>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation>Synchronizácia so sieťou...</translation>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation>&Prehľad</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Zobraziť celkový prehľad o peňaženke</translation>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation>&Transakcie</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Prechádzať históriu transakcií</translation>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Editovať zoznam uložených adries a popisov</translation>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Zobraziť zoznam adries pre prijímanie platieb.</translation>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation>U&končiť</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Ukončiť program</translation>
</message>
<message>
<location line="+4"/>
<source>Show information about DRACHMacoin</source>
<translation>Zobraziť informácie o DRACHMacoin</translation>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation>O &Qt</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation>Zobrazit informácie o Qt</translation>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation>&Možnosti...</translation>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation>&Zašifrovať Peňaženku...</translation>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation>&Backup peňaženku...</translation>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation>&Zmena Hesla...</translation>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a DRACHMacoin address</source>
<translation>Poslať drachmacoins na adresu</translation>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for DRACHMacoin</source>
<translation>Upraviť možnosti nastavenia pre drachmacoin</translation>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation>Zálohovať peňaženku na iné miesto</translation>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Zmeniť heslo použité na šifrovanie peňaženky</translation>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation>&Okno pre ladenie</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Otvor konzolu pre ladenie a diagnostiku</translation>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>DRACHMacoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation>Peňaženka</translation>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About DRACHMacoin</source>
<translation>&O DRACHMacoin</translation>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your DRACHMacoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified DRACHMacoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation>&Súbor</translation>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation>&Nastavenia</translation>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation>&Pomoc</translation>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation>Lišta záložiek</translation>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation>[testovacia sieť]</translation>
</message>
<message>
<location line="+47"/>
<source>DRACHMacoin client</source>
<translation>DRACHMacoin klient</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to DRACHMacoin network</source>
<translation><numerusform>%n aktívne spojenie v DRACHMacoin sieti</numerusform><numerusform>%n aktívne spojenia v DRACHMacoin sieti</numerusform><numerusform>%n aktívnych spojení v Bitconi sieti</numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<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="-140"/>
<source>Up to date</source>
<translation>Aktualizovaný</translation>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation>Sťahujem...</translation>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation>Potvrď poplatok za transakciu.</translation>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation>Odoslané transakcie</translation>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation>Prijaté transakcie</translation>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation>Dátum: %1
Suma: %2
Typ: %3
Adresa: %4</translation>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid DRACHMacoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>Peňaženka je <b>zašifrovaná</b> a momentálne <b>odomknutá</b></translation>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>Peňaženka je <b>zašifrovaná</b> a momentálne <b>zamknutá</b></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. DRACHMacoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Upraviť adresu</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Popis</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation>Popis priradený k tomuto záznamu v adresári</translation>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation>&Adresa</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>Adresa spojená s týmto záznamom v adresári. Možno upravovať len pre odosielajúce adresy.</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation>Nová adresa pre prijímanie</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Nová adresa pre odoslanie</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Upraviť prijímacie adresy</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Upraviť odosielaciu adresu</translation>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>Vložená adresa "%1" sa už nachádza v adresári.</translation>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid DRACHMacoin address.</source>
<translation>Vložená adresa "%1" nieje platnou adresou drachmacoin.</translation>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation>Nepodarilo sa odomknúť peňaženku.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>Generovanie nového kľúča zlyhalo.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>DRACHMacoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation>verzia</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation>Použitie:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>UI možnosti</translation>
</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>Spustiť minimalizované</translation>
</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>Možnosti</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Hlavné</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.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation>Zaplatiť transakčné &poplatky</translation>
</message>
<message>
<location line="+31"/>
<source>Automatically start DRACHMacoin after logging in to the system.</source>
<translation>Automaticky spustiť DRACHMacoin po zapnutí počítača</translation>
</message>
<message>
<location line="+3"/>
<source>&Start DRACHMacoin on system login</source>
<translation>&Spustiť DRACHMacoin pri spustení systému správy okien</translation>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the DRACHMacoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation>Automaticky otvorit port pre DRACHMacoin na routeri. Toto funguje len ak router podporuje UPnP a je táto podpora aktivovaná.</translation>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation>Mapovať port pomocou &UPnP</translation>
</message>
<message>
<location line="+7"/>
<source>Connect to the DRACHMacoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation>Pripojiť do siete DRACHMacoin cez SOCKS proxy (napr. keď sa pripájate cez Tor)</translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation>&Pripojiť cez SOCKS proxy:</translation>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation>IP addresa proxy (napr. 127.0.0.1)</translation>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Port proxy (napr. 9050)</translation>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Zobraziť len ikonu na lište po minimalizovaní okna.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>Zobraziť len ikonu na lište po minimalizovaní okna.</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>Minimalizovat namiesto ukončenia aplikácie keď sa okno zavrie. Keď je zvolená táto možnosť, aplikácia sa zavrie len po zvolení Ukončiť v menu.</translation>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation>M&inimalizovať pri zavretí</translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Displej</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting DRACHMacoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation>&Zobrazovať hodnoty v jednotkách:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show DRACHMacoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Zobraziť adresy zo zoznamu transakcií</translation>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation>Varovanie</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting DRACHMacoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the DRACHMacoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation>Zostatok:</translation>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation>Nepotvrdené:</translation>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation>Peňaženka</translation>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation><b>Nedávne transakcie</b></translation>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation>Váš súčasný zostatok</translation>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation>Suma transakcií ktoré ešte neboli potvrdené a nezapočítavaju sa do celkového zostatku.</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start drachmacoin: click-to-pay handler</source>
<translation type="unfinished"/>
</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>Vyžiadať platbu</translation>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation>Suma:</translation>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation>Popis:</translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation>Správa:</translation>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation>&Uložiť ako...</translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation>Chyba v zakódovaní URI do QR kódu</translation>
</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>Výsledné URI príliš dlhé, skráť text pre názov / správu.</translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation>Ukladanie QR kódu</translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation>PNG obrázky (*.png)</translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation>Meno klienta</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="+339"/>
<source>N/A</source>
<translation>nie je k dispozícii</translation>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation>Verzia klienta</translation>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation>Sieť</translation>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation>Počet pripojení</translation>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation>Na testovacej sieti</translation>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation>Reťazec blokov</translation>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation>Aktuálny počet blokov</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 type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the DRACHMacoin-Qt help message to get a list with possible DRACHMacoin 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 type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>DRACHMacoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>DRACHMacoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the DRACHMacoin 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 type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the DRACHMacoin 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="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Poslať DRACHMacoins</translation>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation>Poslať viacerým príjemcom naraz</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>&Pridať príjemcu</translation>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation>Odobrať všetky políčka transakcie</translation>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation>Zmazať &všetko</translation>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation>Zostatok:</translation>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation>123.456 BTC</translation>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation>Potvrďte odoslanie</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Odoslať</translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation><b>%1</b> do %2 (%3)</translation>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation>Potvrdiť odoslanie drachmacoins</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation>Ste si istí, že chcete odoslať %1?</translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation> a</translation>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>Adresa príjemcu je neplatná, prosím, overte ju.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>Suma na úhradu musí byť väčšia ako 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>Suma je vyššia ako Váš zostatok.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>Suma celkom prevyšuje Váš zostatok ak sú započítané %1 transakčné poplatky.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Duplikát adresy objavený, je možné poslať na každú adresu len raz v jednej odchádzajúcej transakcii.</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>Chyba: Transakcia bola odmietnutá. Toto sa môže stať ak niektoré z mincí vo vašej peňaženke boli už utratené, napríklad ak používaš kópiu wallet.dat a mince označené v druhej kópií neboli označené ako utratené v tejto.</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation>Forma</translation>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation>Su&ma:</translation>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation>Zapla&tiť:</translation>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Vložte popis pre túto adresu aby sa pridala do adresára</translation>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation>&Popis:</translation>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation>Zvoľte adresu z adresára</translation>
</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>Vložiť adresu z klipbordu</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>Odstrániť tohto príjemcu</translation>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a DRACHMacoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Zadajte DRACHMacoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</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"/>
<source>&Sign Message</source>
<translation>&Podpísať Správu</translation>
</message>
<message>
<location line="+6"/>
<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>Môžete podpísať správy svojou adresou a dokázať, že ju vlastníte. Buďte opatrní a podpíšte len prehlásenia s ktorými plne súhlasíte, nakoľko útoky typu "phishing" Vás môžu lákať k ich podpísaniu.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Zadajte DRACHMacoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation>Zvoľte adresu z adresára</translation>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation>Vložte adresu z klipbordu</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>Sem vložte správu ktorú chcete podpísať</translation>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<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 DRACHMacoin address</source>
<translation>Podpíšte správu aby ste dokázali že vlastníte túto adresu</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation>Zmazať &všetko</translation>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<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. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Zadajte DRACHMacoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified DRACHMacoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a DRACHMacoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</source>
<translation>Zadajte DRACHMacoin adresu (napr. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L)</translation>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Kliknite "Podpísať Správu" na získanie podpisu</translation>
</message>
<message>
<location line="+3"/>
<source>Enter DRACHMacoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</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 type="unfinished"/>
</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 type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+25"/>
<source>The DRACHMacoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation>[testovacia sieť]</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation>Otvorené do %1</translation>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation>%1/nepotvrdené</translation>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation>%1 potvrdení</translation>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation>Stav</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>Dátum</translation>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation>od</translation>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation>popis</translation>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation>Kredit</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>neprijaté</translation>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation>Debet</translation>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation>Transakčný poplatok</translation>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation>Suma netto</translation>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation>Správa</translation>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation>Komentár</translation>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation>ID transakcie</translation>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 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 type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation>Transakcie</translation>
</message>
<message>
<location line="+3"/>
<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 type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation>, ešte nebola úspešne odoslaná</translation>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation>neznámy</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+14"/>
<source>Transaction details</source>
<translation>Detaily transakcie</translation>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Táto časť obrazovky zobrazuje detailný popis transakcie</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+225"/>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Adresa</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Hodnota</translation>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Otvorené do %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation>Offline (%1 potvrdení)</translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation>Nepotvrdené (%1 z %2 potvrdení)</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Potvrdené (%1 potvrdení)</translation>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform><numerusform></numerusform><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>Ten blok nebol prijatý žiadnou inou nódou a pravdepodobne nebude akceptovaný!</translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Vypočítané ale neakceptované</translation>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation>Prijaté s</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Prijaté od:</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Odoslané na</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Platba sebe samému</translation>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation>Vyfárané</translation>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Status transakcie. Pohybujte myšou nad týmto poľom a zjaví sa počet potvrdení.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Dátum a čas prijatia transakcie.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Typ transakcie.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Cieľová adresa transakcie.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Suma pridaná alebo odobraná k zostatku.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation>Všetko</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Dnes</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Tento týždeň</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Tento mesiac</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>Minulý mesiac</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Tento rok</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Rozsah...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Prijaté s</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Odoslané na</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>Samému sebe</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Vyfárané</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Iné</translation>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation>Vložte adresu alebo popis pre vyhľadávanie</translation>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation>Min množstvo</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Kopírovať adresu</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Kopírovať popis</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Kopírovať sumu</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Editovať popis</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation>Exportovať transakčné dáta</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Čiarkou oddelovaný súbor (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Potvrdené</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Dátum</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Typ</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Popis</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Adresa</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>Chyba exportu</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Nedalo sa zapisovať do súboru %1.</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Rozsah:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>do</translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation>Poslať DRACHMacoins</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportovať tento náhľad do súboru</translation>
</message>
<message>
<location line="+193"/>
<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>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>DRACHMacoin version</source>
<translation>DRACHMacoin verzia</translation>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation>Použitie:</translation>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or drachmacoind</source>
<translation>Odoslať príkaz -server alebo drachmacoind</translation>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation>Zoznam príkazov</translation>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation>Dostať pomoc pre príkaz</translation>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation>Možnosti:</translation>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: drachmacoin.conf)</source>
<translation>Určiť súbor s nastaveniami (predvolené: drachmacoin.conf)</translation>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: drachmacoind.pid)</source>
<translation>Určiť súbor pid (predvolené: drachmacoind.pid)</translation>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation>Určiť priečinok s dátami</translation>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Veľkosť vyrovnávajúcej pamäte pre databázu v megabytoch (predvolené:25)</translation>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 8333 or testnet: 18333)</source>
<translation>Načúvať spojeniam na <port> (prednastavené: 8333 alebo testovacia sieť: 18333)</translation>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Udržiavať maximálne <n> spojení (predvolené: 125)</translation>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Hranica pre odpojenie zle sa správajúcich peerov (predvolené: 100)</translation>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Počet sekúnd kedy sa zabráni zle sa správajúcim peerom znovupripojenie (predvolené: 86400)</translation>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)</source>
<translation>Počúvať JSON-RPC spojeniam na <port> (predvolené: 8332 or testnet: 18332)</translation>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Prijímať príkazy z príkazového riadku a JSON-RPC</translation>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Bežať na pozadí ako démon a prijímať príkazy</translation>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation>Použiť testovaciu sieť</translation>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=drachmacoinrpc
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 "DRACHMacoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<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="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. DRACHMacoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<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="+4"/>
<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="+3"/>
<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>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Varovanie: -paytxfee je nastavené veľmi vysoko. Toto sú transakčné poplatky ktoré zaplatíte ak odošlete transakciu.</translation>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong DRACHMacoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<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="+3"/>
<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="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation>Pripojiť sa len k určenej nóde</translation>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation>Neplatná adresa tor: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation>Produkovať extra ladiace informácie. Implies all other -debug* options</translation>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation>Pridať na začiatok ladiaceho výstupu časový údaj</translation>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the DRACHMacoin Wiki for SSL setup instructions)</source>
<translation>SSL možnosť: (pozrite DRACHMacoin Wiki pre návod na nastavenie SSL)</translation>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Odoslať trace/debug informácie na konzolu namiesto debug.info žurnálu</translation>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation>Odoslať trace/debug informácie do ladiaceho programu</translation>
</message>
<message>
<location line="+5"/>
<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="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Určiť aut spojenia v milisekundách (predvolené: 5000)</translation>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 0)</translation>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Skúsiť použiť UPnP pre mapovanie počúvajúceho portu (default: 1 when listening)</translation>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation>Užívateľské meno pre JSON-RPC spojenia</translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation>Heslo pre JSON-rPC spojenia</translation>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Povoliť JSON-RPC spojenia z určenej IP adresy.</translation>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Poslať príkaz nóde bežiacej na <ip> (predvolené: 127.0.0.1)</translation>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Vykonaj príkaz, ak zmeny v najlepšom bloku (%s v príkaze nahradí blok hash)</translation>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation>Aktualizuj peňaženku na najnovší formát.</translation>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Nastaviť zásobu adries na <n> (predvolené: 100)</translation>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Znovu skenovať reťaz blokov pre chýbajúce transakcie</translation>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Použiť OpenSSL (https) pre JSON-RPC spojenia</translation>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Súbor s certifikátom servra (predvolené: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Súkromný kľúč servra (predvolené: server.pem)</translation>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation>Prijateľné šifry (predvolené: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation>Táto pomocná správa</translation>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation>Pripojenie cez socks proxy</translation>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Povoliť vyhľadávanie DNS pre pridanie nódy a spojenie</translation>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation>Načítavanie adries...</translation>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Chyba načítania wallet.dat: Peňaženka je poškodená</translation>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of DRACHMacoin</source>
<translation>Chyba načítania wallet.dat: Peňaženka vyžaduje novšiu verziu DRACHMacoin</translation>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart DRACHMacoin to complete</source>
<translation>Bolo potrebné prepísať peňaženku: dokončite reštartovaním DRACHMacoin</translation>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation>Chyba načítania wallet.dat</translation>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Neplatná adresa proxy: '%s'</translation>
</message>
<message>
<location line="+56"/>
<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="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Neplatná suma pre -paytxfee=<amount>: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation>Neplatná suma</translation>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation>Nedostatok prostriedkov</translation>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation>Načítavanie zoznamu blokov...</translation>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Pridať nód na pripojenie a pokus o udržanie pripojenia otvoreného</translation>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. DRACHMacoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation>Poplatok za kB ktorý treba pridať k odoslanej transakcii</translation>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation>Načítavam peňaženku...</translation>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation>Nie je možné prejsť na nižšiu verziu peňaženky</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Nie je možné zapísať predvolenú adresu.</translation>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation>Dokončené načítavanie</translation>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation>Použiť %s možnosť.</translation>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation>Chyba</translation>
</message>
<message>
<location line="-31"/>
<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>Musíš nastaviť rpcpassword=<heslo> v konfiguračnom súbore:
%s
Ak súbor neexistuje, vytvor ho s oprávnením pre čítanie len vlastníkom (owner-readable-only)</translation>
</message>
</context>
</TS>
|
{
"content_hash": "dc8e96f93ad7b9403434138d9d5225e9",
"timestamp": "",
"source": "github",
"line_count": 2922,
"max_line_length": 395,
"avg_line_length": 36.229637234770706,
"alnum_prop": 0.6120835419362761,
"repo_name": "microcash-dev/DRACHMacoin",
"id": "d152559d0f7d19fefb8e3bac759b1b1e67b01640",
"size": "106689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/locale/bitcoin_sk.ts",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
* <img src='https://avatars1.githubusercontent.com/u/839283?v=3&s=40' height='20' width='20'>[
ibireme
/
YYKit
](https://github.com/ibireme/YYKit):
A collection of iOS components.
* <img src='https://avatars0.githubusercontent.com/u/5511525?v=3&s=40' height='20' width='20'>[
iThinkerYZ
/
YZDisplayViewController
](https://github.com/iThinkerYZ/YZDisplayViewController):
* <img src='https://avatars1.githubusercontent.com/u/5310542?v=3&s=40' height='20' width='20'>[
Aufree
/
ESTCollectionViewDropDownList
](https://github.com/Aufree/ESTCollectionViewDropDownList):
A demo implementation of a drop down tag list view for iOS.
* <img src='https://avatars1.githubusercontent.com/u/4755653?v=3&s=40' height='20' width='20'>[
zziking
/
KIZBehavior
](https://github.com/zziking/KIZBehavior):
可以利用IB,0代码集成的一些小功能
* <img src='https://avatars3.githubusercontent.com/u/7659?v=3&s=40' height='20' width='20'>[
AFNetworking
/
AFNetworking
](https://github.com/AFNetworking/AFNetworking):
A delightful iOS and OS X networking framework
* <img src='https://avatars1.githubusercontent.com/u/5310542?v=3&s=40' height='20' width='20'>[
Aufree
/
phphub-ios
](https://github.com/Aufree/phphub-ios):
PHPHub for iOS is the universal iPhone and iPad application for PHPHub
* <img src='https://avatars2.githubusercontent.com/u/2510864?v=3&s=40' height='20' width='20'>[
hanton
/
HTY360Player
](https://github.com/hanton/HTY360Player):
Open Source iOS 360° Video Player.
* <img src='https://avatars1.githubusercontent.com/u/839283?v=3&s=40' height='20' width='20'>[
ibireme
/
YYText
](https://github.com/ibireme/YYText):
Powerful text framework for iOS to display and edit rich text.
* <img src='https://avatars2.githubusercontent.com/u/10412193?v=3&s=40' height='20' width='20'>[
gsdios
/
SDAutoLayout
](https://github.com/gsdios/SDAutoLayout):
AutoLayout 一行代码搞定自动布局!支持Cell和Tableview高度自适应,Label和ScrollView内容自适应,致力于做最简单易用的AutoLayout库。The most easy way for autoLayout. Based Runtime.
* <img src='https://avatars0.githubusercontent.com/u/3817366?v=3&s=40' height='20' width='20'>[
CoderMJLee
/
MJRefresh
](https://github.com/CoderMJLee/MJRefresh):
An easy way to use pull-to-refresh.
* <img src='https://avatars3.githubusercontent.com/u/598870?v=3&s=40' height='20' width='20'>[
SnapKit
/
Masonry
](https://github.com/SnapKit/Masonry):
Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
* <img src='https://avatars2.githubusercontent.com/u/546885?v=3&s=40' height='20' width='20'>[
nicklockwood
/
iCarousel
](https://github.com/nicklockwood/iCarousel):
A simple, highly customisable, data-driven 3D carousel for iOS and Mac OS
* <img src='https://avatars1.githubusercontent.com/u/432536?v=3&s=40' height='20' width='20'>[
ReactiveCocoa
/
ReactiveCocoa
](https://github.com/ReactiveCocoa/ReactiveCocoa):
Streams of values over time
* <img src='https://avatars0.githubusercontent.com/u/1456711?v=3&s=40' height='20' width='20'>[
Sephiroth87
/
Crayons
](https://github.com/Sephiroth87/Crayons):
An Xcode plugin to improve dealing with colors in your project
* <img src='https://avatars3.githubusercontent.com/u/6493255?v=3&s=40' height='20' width='20'>[
Draveness
/
Ouroboros
](https://github.com/Draveness/Ouroboros):
ObjectiveC library for magical scroll interactions.
* <img src='https://avatars1.githubusercontent.com/u/198768?v=3&s=40' height='20' width='20'>[
mutualmobile
/
MMDrawerController
](https://github.com/mutualmobile/MMDrawerController):
A lightweight, easy to use, Side Drawer Navigation Controller
* <img src='https://avatars3.githubusercontent.com/u/735630?v=3&s=40' height='20' width='20'>[
facebook
/
AsyncDisplayKit
](https://github.com/facebook/AsyncDisplayKit):
Smooth asynchronous user interfaces for iOS apps.
* <img src='https://avatars1.githubusercontent.com/u/627285?v=3&s=40' height='20' width='20'>[
alcatraz
/
Alcatraz
](https://github.com/alcatraz/Alcatraz):
Package manager for Xcode
* <img src='https://avatars3.githubusercontent.com/u/679824?v=3&s=40' height='20' width='20'>[
qfish
/
XActivatePowerMode
](https://github.com/qfish/XActivatePowerMode):
An Xcode plug-in makes POWER MODE happen in your Xcode.
* <img src='https://avatars2.githubusercontent.com/u/68232?v=3&s=40' height='20' width='20'>[
rs
/
SDWebImage
](https://github.com/rs/SDWebImage):
Asynchronous image downloader with cache support as a UIImageView category
* <img src='https://avatars0.githubusercontent.com/u/60178?v=3&s=40' height='20' width='20'>[
ccgus
/
fmdb
](https://github.com/ccgus/fmdb):
A Cocoa / Objective-C wrapper around SQLite
* <img src='https://avatars1.githubusercontent.com/u/1019875?v=3&s=40' height='20' width='20'>[
onevcat
/
VVDocumenter-Xcode
](https://github.com/onevcat/VVDocumenter-Xcode):
Xcode plug-in which helps you write documentation comment easier, for both Objective-C and Swift.
* <img src='https://avatars1.githubusercontent.com/u/839283?v=3&s=40' height='20' width='20'>[
ibireme
/
YYModel
](https://github.com/ibireme/YYModel):
High performance model framework for iOS.
* <img src='https://avatars2.githubusercontent.com/u/954279?v=3&s=40' height='20' width='20'>[
BradLarson
/
GPUImage
](https://github.com/BradLarson/GPUImage):
An open source iOS framework for GPU-based image and video processing
* <img src='https://avatars0.githubusercontent.com/u/10103766?v=3&s=40' height='20' width='20'>[
SergioChan
/
SCNavigationControlCenter
](https://github.com/SergioChan/SCNavigationControlCenter):
This is an advanced navigation control center on iOS that can allow you to navigate to whichever view controller you want. iOS上的改进的导航栏控制中心。
#### go
* <img src='https://avatars1.githubusercontent.com/u/45629?v=3&s=40' height='20' width='20'>[
davidlazar
/
vuvuzela
](https://github.com/davidlazar/vuvuzela):
Private messaging system that hides metadata
* <img src='https://avatars3.githubusercontent.com/u/104030?v=3&s=40' height='20' width='20'>[
golang
/
go
](https://github.com/golang/go):
The Go programming language
* <img src='https://avatars1.githubusercontent.com/u/5000654?v=3&s=40' height='20' width='20'>[
getlantern
/
lantern
](https://github.com/getlantern/lantern):
Open Internet for everyone. Lantern is a free desktop application that delivers fast, reliable and secure access to the open Internet for users in censored regions. It uses a variety of techniques to stay unblocked, including P2P and domain fronting. Lantern relies on users in uncensored regions acting as access points to the open Internet.
* <img src='https://avatars2.githubusercontent.com/u/67471?v=3&s=40' height='20' width='20'>[
tsenart
/
vegeta
](https://github.com/tsenart/vegeta):
HTTP load testing tool and library. It's over 9000!
* <img src='https://avatars2.githubusercontent.com/u/8465?v=3&s=40' height='20' width='20'>[
motemen
/
gompatible
](https://github.com/motemen/gompatible):
A tool to show Go package's API changes between two (git) revisions
* <img src='https://avatars3.githubusercontent.com/u/5751682?v=3&s=40' height='20' width='20'>[
kubernetes
/
kubernetes
](https://github.com/kubernetes/kubernetes):
Container Cluster Manager from Google
* <img src='https://avatars2.githubusercontent.com/u/1457662?v=3&s=40' height='20' width='20'>[
Workiva
/
go-datastructures
](https://github.com/Workiva/go-datastructures):
* <img src='https://avatars3.githubusercontent.com/u/1278669?v=3&s=40' height='20' width='20'>[
intelsdi-x
/
snap
](https://github.com/intelsdi-x/snap):
A powerful telemetry framework
* <img src='https://avatars1.githubusercontent.com/u/749551?v=3&s=40' height='20' width='20'>[
docker
/
docker
](https://github.com/docker/docker):
Docker - the open-source application container engine
* <img src='https://avatars2.githubusercontent.com/u/36822?v=3&s=40' height='20' width='20'>[
raphael
/
goa
](https://github.com/raphael/goa):
Design-based HTTP microservices in Go
* <img src='https://avatars3.githubusercontent.com/u/31996?v=3&s=40' height='20' width='20'>[
avelino
/
awesome-go
](https://github.com/avelino/awesome-go):
A curated list of awesome Go frameworks, libraries and software
* <img src='https://avatars0.githubusercontent.com/u/173412?v=3&s=40' height='20' width='20'>[
spf13
/
hugo
](https://github.com/spf13/hugo):
A Fast and Flexible Static Site Generator built with love by spf13 in GoLang
* <img src='https://avatars2.githubusercontent.com/u/37492?v=3&s=40' height='20' width='20'>[
xordataexchange
/
superdog
](https://github.com/xordataexchange/superdog):
Easy and secure encryption in Go using Hashicorp's Vault
* <img src='https://avatars1.githubusercontent.com/u/2295542?v=3&s=40' height='20' width='20'>[
golang-china
/
gopl-zh
](https://github.com/golang-china/gopl-zh):
Go聖經讀書筆記
* <img src='https://avatars0.githubusercontent.com/u/1095328?v=3&s=40' height='20' width='20'>[
dvyukov
/
go-fuzz
](https://github.com/dvyukov/go-fuzz):
Randomized testing for Go
* <img src='https://avatars0.githubusercontent.com/u/2946214?v=3&s=40' height='20' width='20'>[
gogits
/
gogs
](https://github.com/gogits/gogs):
Gogs (Go Git Service) is a painless self-hosted Git service.
* <img src='https://avatars1.githubusercontent.com/u/4625714?v=3&s=40' height='20' width='20'>[
youtube
/
vitess
](https://github.com/youtube/vitess):
vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services.
* <img src='https://avatars1.githubusercontent.com/u/2270010?v=3&s=40' height='20' width='20'>[
hlandau
/
acme
](https://github.com/hlandau/acme):
ACME automatic certificate acquisition tool
* <img src='https://avatars1.githubusercontent.com/u/283442?v=3&s=40' height='20' width='20'>[
valyala
/
fasthttp
](https://github.com/valyala/fasthttp):
Fast HTTP package for Go
* <img src='https://avatars0.githubusercontent.com/u/173412?v=3&s=40' height='20' width='20'>[
spf13
/
afero
](https://github.com/spf13/afero):
A FileSystem Abstraction System for Go
* <img src='https://avatars3.githubusercontent.com/u/622699?v=3&s=40' height='20' width='20'>[
minio
/
mc
](https://github.com/minio/mc):
Minio Client for filesystem and cloud storage
* <img src='https://avatars2.githubusercontent.com/u/114509?v=3&s=40' height='20' width='20'>[
go-kit
/
kit
](https://github.com/go-kit/kit):
A standard library for microservices.
* <img src='https://avatars0.githubusercontent.com/u/1128849?v=3&s=40' height='20' width='20'>[
mholt
/
caddy
](https://github.com/mholt/caddy):
Fast, cross-platform HTTP/2 web server with automatic HTTPS
* <img src='https://avatars0.githubusercontent.com/u/592032?v=3&s=40' height='20' width='20'>[
hashicorp
/
consul
](https://github.com/hashicorp/consul):
Consul is a tool for service discovery, monitoring and configuration.
* <img src='https://avatars0.githubusercontent.com/u/578256?v=3&s=40' height='20' width='20'>[
xenolf
/
lego
](https://github.com/xenolf/lego):
Let's Encrypt client and ACME library written in Go
#### javascript
* <img src='https://avatars1.githubusercontent.com/u/948896?v=3&s=40' height='20' width='20'>[
oneuijs
/
You-Dont-Need-jQuery
](https://github.com/oneuijs/You-Dont-Need-jQuery):
You don't need jQuery any more, here is how you can get rid of it.
* <img src='https://avatars1.githubusercontent.com/u/985197?v=3&s=40' height='20' width='20'>[
FreeCodeCamp
/
FreeCodeCamp
](https://github.com/FreeCodeCamp/FreeCodeCamp):
The http://FreeCodeCamp.com open source codebase and curriculum. Learn to code and help nonprofits.
* <img src='https://avatars2.githubusercontent.com/u/1885623?v=3&s=40' height='20' width='20'>[
airbnb
/
enzyme
](https://github.com/airbnb/enzyme):
JavaScript Testing utilities for React
* <img src='https://avatars3.githubusercontent.com/u/1383872?v=3&s=40' height='20' width='20'>[
nathancahill
/
Split.js
](https://github.com/nathancahill/Split.js):
Lightweight, unopinionated utility for adjustable split views
* <img src='https://avatars3.githubusercontent.com/u/2062355?v=3&s=40' height='20' width='20'>[
sdc-alibaba
/
SUI-Mobile
](https://github.com/sdc-alibaba/SUI-Mobile):
SUI Mobile (MSUI)是由阿里巴巴国际UED前端出品的移动端UI库,轻量精美
* <img src='https://avatars3.githubusercontent.com/u/253398?v=3&s=40' height='20' width='20'>[
NARKOZ
/
hacker-scripts
](https://github.com/NARKOZ/hacker-scripts):
Based on a true story
* <img src='https://avatars1.githubusercontent.com/u/1211148?v=3&s=40' height='20' width='20'>[
CSNW
/
d3.compose
](https://github.com/CSNW/d3.compose):
Compose complex, data-driven visualizations from reusable charts and components with d3
* <img src='https://avatars3.githubusercontent.com/u/1659771?v=3&s=40' height='20' width='20'>[
twitter
/
labella.js
](https://github.com/twitter/labella.js):
Placing labels on a timeline without overlap.
* <img src='https://avatars0.githubusercontent.com/u/713256?v=3&s=40' height='20' width='20'>[
adleroliveira
/
dreamjs
](https://github.com/adleroliveira/dreamjs):
A lightweight json data generator.
* <img src='https://avatars0.githubusercontent.com/u/1050163?v=3&s=40' height='20' width='20'>[
douban
/
code
](https://github.com/douban/code):
Douban CODE
* <img src='https://avatars0.githubusercontent.com/u/11865795?v=3&s=40' height='20' width='20'>[
ipselon
/
structor
](https://github.com/ipselon/structor):
User interface builder for React
* <img src='https://avatars3.githubusercontent.com/u/8445?v=3&s=40' height='20' width='20'>[
facebook
/
react
](https://github.com/facebook/react):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
* <img src='https://avatars2.githubusercontent.com/u/230541?v=3&s=40' height='20' width='20'>[
d3
/
d3-shape
](https://github.com/d3/d3-shape):
Graphical primitives for visualization, such as lines and areas.
* <img src='https://avatars0.githubusercontent.com/u/197597?v=3&s=40' height='20' width='20'>[
facebook
/
react-native
](https://github.com/facebook/react-native):
A framework for building native apps with React.
* <img src='https://avatars3.githubusercontent.com/u/2293641?v=3&s=40' height='20' width='20'>[
callmecavs
/
jump.js
](https://github.com/callmecavs/jump.js):
A small, modern, dependency-free smooth scrolling library.
* <img src='https://avatars3.githubusercontent.com/u/810438?v=3&s=40' height='20' width='20'>[
rackt
/
redux
](https://github.com/rackt/redux):
Predictable state container for JavaScript apps
* <img src='https://avatars0.githubusercontent.com/u/6352327?v=3&s=40' height='20' width='20'>[
FormidableLabs
/
victory
](https://github.com/FormidableLabs/victory):
A collection of composable react components for building interactive data visualizations
* <img src='https://avatars1.githubusercontent.com/u/19343?v=3&s=40' height='20' width='20'>[
postcss
/
postcss
](https://github.com/postcss/postcss):
Transforming styles with JS plugins
* <img src='https://avatars2.githubusercontent.com/u/230541?v=3&s=40' height='20' width='20'>[
mbostock
/
d3
](https://github.com/mbostock/d3):
A JavaScript visualization library for HTML and SVG.
* <img src='https://avatars3.githubusercontent.com/u/216296?v=3&s=40' height='20' width='20'>[
angular
/
angular.js
](https://github.com/angular/angular.js):
HTML enhanced for web apps
* <img src='https://avatars1.githubusercontent.com/u/80?v=3&s=40' height='20' width='20'>[
nodejs
/
node
](https://github.com/nodejs/node):
Node.js JavaScript runtime
* <img src='https://avatars1.githubusercontent.com/u/9087372?v=3&s=40' height='20' width='20'>[
Rabrennie
/
anything.js
](https://github.com/Rabrennie/anything.js):
A javascript library that contains anything.
* <img src='https://avatars1.githubusercontent.com/u/499550?v=3&s=40' height='20' width='20'>[
vuejs
/
vue
](https://github.com/vuejs/vue):
Simple yet powerful library for building modern web interfaces.
* <img src='https://avatars1.githubusercontent.com/u/339208?v=3&s=40' height='20' width='20'>[
airbnb
/
javascript
](https://github.com/airbnb/javascript):
JavaScript Style Guide
* <img src='https://avatars0.githubusercontent.com/u/32314?v=3&s=40' height='20' width='20'>[
documentationjs
/
documentation
](https://github.com/documentationjs/documentation):
beautiful, flexible, powerful js docs
#### ruby
* <img src='https://avatars1.githubusercontent.com/u/1589480?v=3&s=40' height='20' width='20'>[
Homebrew
/
homebrew
](https://github.com/Homebrew/homebrew):
The missing package manager for OS X.
* <img src='https://avatars2.githubusercontent.com/u/16700?v=3&s=40' height='20' width='20'>[
ruby
/
ruby
](https://github.com/ruby/ruby):
The Ruby Programming Language
* <img src='https://avatars2.githubusercontent.com/u/869950?v=3&s=40' height='20' width='20'>[
fastlane
/
fastlane
](https://github.com/fastlane/fastlane):
Connect all iOS deployment tools into one streamlined workflow
* <img src='https://avatars2.githubusercontent.com/u/1356007?v=3&s=40' height='20' width='20'>[
kilimchoi
/
engineering-blogs
](https://github.com/kilimchoi/engineering-blogs):
A curated list of engineering blogs
* <img src='https://avatars1.githubusercontent.com/u/3124?v=3&s=40' height='20' width='20'>[
rails
/
rails
](https://github.com/rails/rails):
Ruby on Rails
* <img src='https://avatars1.githubusercontent.com/u/10555255?v=3&s=40' height='20' width='20'>[
applegrain
/
creact
](https://github.com/applegrain/creact):
crud + React tutorial
* <img src='https://avatars2.githubusercontent.com/u/237985?v=3&s=40' height='20' width='20'>[
jekyll
/
jekyll
](https://github.com/jekyll/jekyll):
Jekyll is a blog-aware, static site generator in Ruby
* <img src='https://avatars1.githubusercontent.com/u/198?v=3&s=40' height='20' width='20'>[
thoughtbot
/
guides
](https://github.com/thoughtbot/guides):
A guide for programming in style.
* <img src='https://avatars0.githubusercontent.com/u/5213?v=3&s=40' height='20' width='20'>[
discourse
/
discourse
](https://github.com/discourse/discourse):
A platform for community discussion. Free, open, simple.
* <img src='https://avatars3.githubusercontent.com/u/83390?v=3&s=40' height='20' width='20'>[
jondot
/
awesome-react-native
](https://github.com/jondot/awesome-react-native):
An "awesome" type curated list of React Native components, news, tools, and learning material
* <img src='https://avatars0.githubusercontent.com/u/2687?v=3&s=40' height='20' width='20'>[
solidusio
/
solidus
](https://github.com/solidusio/solidus):
Solidus, Rails eCommerce System
* <img src='https://avatars2.githubusercontent.com/u/813150?v=3&s=40' height='20' width='20'>[
linuxfoundation
/
cii-best-practices-badge
](https://github.com/linuxfoundation/cii-best-practices-badge):
Core Infrastructure Initiative Best Practices Badge
* <img src='https://avatars2.githubusercontent.com/u/1066?v=3&s=40' height='20' width='20'>[
dryrb
/
dry-validation
](https://github.com/dryrb/dry-validation):
Data validation library based on predicate logic and rule composition
* <img src='https://avatars1.githubusercontent.com/u/17579?v=3&s=40' height='20' width='20'>[
Thibaut
/
devdocs
](https://github.com/Thibaut/devdocs):
API Documentation Browser
* <img src='https://avatars3.githubusercontent.com/u/9582?v=3&s=40' height='20' width='20'>[
plataformatec
/
devise
](https://github.com/plataformatec/devise):
Flexible authentication solution for Rails with Warden.
* <img src='https://avatars2.githubusercontent.com/u/829576?v=3&s=40' height='20' width='20'>[
thoughtbot
/
administrate
](https://github.com/thoughtbot/administrate):
A Rails engine that helps you put together a super-flexible admin dashboard.
* <img src='https://avatars0.githubusercontent.com/u/131818?v=3&s=40' height='20' width='20'>[
elastic
/
logstash
](https://github.com/elastic/logstash):
logstash - transport and process your logs, events, or other data
* <img src='https://avatars1.githubusercontent.com/u/198?v=3&s=40' height='20' width='20'>[
thoughtbot
/
suspenders
](https://github.com/thoughtbot/suspenders):
A Rails template with our standard defaults, ready to deploy to Heroku.
* <img src='https://avatars0.githubusercontent.com/u/727482?v=3&s=40' height='20' width='20'>[
caskroom
/
homebrew-cask
](https://github.com/caskroom/homebrew-cask):
A CLI workflow for the administration of Mac applications distributed as binaries
* <img src='https://avatars2.githubusercontent.com/u/50245?v=3&s=40' height='20' width='20'>[
bkuhlmann
/
gemsmith
](https://github.com/bkuhlmann/gemsmith):
A command line interface for smithing new Ruby gems.
* <img src='https://avatars0.githubusercontent.com/u/131818?v=3&s=40' height='20' width='20'>[
jordansissel
/
fpm
](https://github.com/jordansissel/fpm):
Effing package management! Build packages for multiple platforms (deb, rpm, etc) with great ease and sanity.
* <img src='https://avatars2.githubusercontent.com/u/1118459?v=3&s=40' height='20' width='20'>[
shakacode
/
react_on_rails
](https://github.com/shakacode/react_on_rails):
Integration of React + Webpack + Rails to build Universal (Isomorphic) Apps
* <img src='https://avatars2.githubusercontent.com/u/869950?v=3&s=40' height='20' width='20'>[
fastlane
/
snapshot
](https://github.com/fastlane/snapshot):
Automate taking localized screenshots of your iOS app on every device
* <img src='https://avatars1.githubusercontent.com/u/1060?v=3&s=40' height='20' width='20'>[
24pullrequests
/
24pullrequests
](https://github.com/24pullrequests/24pullrequests):
Giving back little gifts of code for Christmas
* <img src='https://avatars3.githubusercontent.com/u/3832?v=3&s=40' height='20' width='20'>[
sketchplugins
/
plugin-directory
](https://github.com/sketchplugins/plugin-directory):
A semi-official directory of plugins, hosted in GitHub
|
{
"content_hash": "24bffa0e98b2b545530ad7e4619dfcd9",
"timestamp": "",
"source": "github",
"line_count": 708,
"max_line_length": 343,
"avg_line_length": 34.67090395480226,
"alnum_prop": 0.6558438913105471,
"repo_name": "josephyzhou/github-trending",
"id": "67fe8d9859d4521a34764a8456e5928ffea8e00c",
"size": "24771",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2015/2015-12-09.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "3251"
}
],
"symlink_target": ""
}
|
class CreateResults < ActiveRecord::Migration
def change
create_table :results do |t|
t.references :choice
t.references :user
t.references :question
t.timestamps null: false
end
end
end
|
{
"content_hash": "a948263ee23cc077c78dcd38d5381ca7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 45,
"avg_line_length": 22.2,
"alnum_prop": 0.6711711711711712,
"repo_name": "ebutler90/survey_gorilla-",
"id": "05a01d4124d1651c47dbf7dd0b5ac6019b5c75c1",
"size": "222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20150330151717_create_results.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2106"
},
{
"name": "HTML",
"bytes": "7445"
},
{
"name": "JavaScript",
"bytes": "283"
},
{
"name": "Ruby",
"bytes": "16217"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Branch Demo Page</title>
<meta name="viewport" content="width=device-width">
<meta name="description" content="Branch Demo Page">
<meta name="author" content="Mike Kwon">
<link rel="alternate" type="application/rss+xml" title="RSS" href="/feed.xml">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/css/font-awesome/css/font-awesome.min.css">
<link href="//fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
<link href="//fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic" rel="stylesheet" type="text/css">
<!-- Branch metatag -->
<meta name="branch:deeplink:demo" content="true" />
<!-- Web SDK will prioritize Branch tags > Facebook AppLinks > Twitter tags -->
<meta name="branch:deeplink:$ios_deeplink_path" content="branch metatag scraped for $ios_deeplink_path" />
<meta name="branch:deeplink:$android_deeplink_path" content="branch metatag scraped for $android_deeplink_path" />
<meta name="al:ios:url" content="Facebook applinks metatag scraped for $ios_deeplink_path">
<meta name="al:android:url" content="Facebook applinks metatag scraped for $android_deeplink_path">
<meta name="twitter:app:url:iphone" content="Twitter metatag scraped for $ios_deeplink_path">
<meta name="twitter:app:url:googleplay" content="Twitter metatag scraped for $android_deeplink_path">
<!-- Branch Web SDK -->
<script type="text/javascript">
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode autoAppIndex banner closeBanner closeJourney creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode trackCommerceEvent logEvent disableTracking getBrowserFingerprintId".split(" "), 0);
branch.init('key_test_heyZVwLzaWv08S8DWLNm9dhaxEdy4qtt',{}, function(err, data) {
console.log(data);
console.log('Branch SDK finished initializing at ' + Math.floor(Date.now() / 1000));
});
</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/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body id="page-top" class="index">
<!-- Navigation -->
<nav class="navbar navbar-default navbar-fixed-top">
<!-- Branch <div> that prevents banner from overlapping with a fixed|absolute positioned nav element, but adding a top-margin -->
<div class="branch-journeys-top" style="display:none;"></div>
<div class="container">
<div class="navbar-header page-scroll">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#page-top">Branch Demo</a>
</div>
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav navbar-right">
<li class="hidden">
<a href="#page-top"></a>
</li>
<li class="page-scroll">
<a href="#portfolio">Top Section</a>
</li>
<li class="page-scroll">
<a href="#about">Middle Section</a>
</li>
<li class="page-scroll">
<a href="#contact">Bottom Section</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Header -->
<header>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="intro-text">
<span class="name">Burger King</span>
<hr class="star-light">
<span class="skills">Testpage displaying a Journeys Banner</span>
</div>
</div>
</div>
</div>
</header>
<!-- Portfolio Grid Section -->
<section id="portfolio">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="intro-text">
<ul>
<li class="name"><a href="https://burgerking.app.link/WZIIkqi7hQ">Instagram</a><p></p></li>
<li class="name"><a href="https://burgerking.app.link/fYTINWf7hQ">Facebook</a><p></p></li>
<li class="name"><a href="https://burgerking.app.link/ESFEbPb7hQ">Twitter</a><p></p></li>
</ul>
<button onclick="launchBranchJourney()" onmouseover="" style="cursor: pointer; border-radius: 12px; background-color: #008CBA; border: none; color: white; padding: 12px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19); width:100%; margin: 5px 0px 5px 0px;">Launch Banner</button>
<button onclick="closeBranchJourney()" onmouseover="" style="cursor: pointer; border-radius: 12px; background-color: #008CBA; border: none; color: white; padding: 12px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2), 0 6px 20px 0 rgba(0,0,0,0.19); width:100%; margin: 5px 0px 5px 0px;">Close Banner</button>
<p></p>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section class="success" id="about">
<div class="container">
<!-- Section Header -->
<div class="row">
<div class="col-lg-12 text-center">
<h2>Filler Text</h2>
<hr class="star-light">
</div>
</div>
<!-- Description Text -->
<div class="row">
<div class="col-lg-5 col-lg-offset-1 col-md-6">
<p>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem</p>
</div>
<div class="col-lg-5 col-md-6">
<p>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem</p>
</div>
</div>
</div>
</section>
<!-- Contact Section -->
<section id="contact">
<div class="container">
<!-- Section Header -->
<div class="row">
<div class="col-lg-12 text-center">
<h2>Filler Text</h2>
<hr class="star-light">
</div>
</div>
<!-- Description Text -->
<div class="row">
<div class="col-lg-5 col-lg-offset-1 col-md-6">
<p>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem</p>
</div>
<div class="col-lg-5 col-md-6">
<p>Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem</p>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="text-center">
<div class="footer-above">
<div class="container">
<div class="row">
<div class="footer-col col-md-4">
<h3>Branch Demo Page</h3>
</div>
</div>
</div>
</div>
<div class="footer-below">
<div class="container">
<div class="row">
<div class="col-lg-12">
Contact mkwon@branch.io for questions
</div>
</div>
</div>
</div>
</footer>
<!-- Scroll to Top Button (Only visible on small and extra-small screen sizes) -->
<div class="scroll-top page-scroll visible-xs visible-sm">
<a class="btn btn-primary" href="#page-top">
<i class="fa fa-chevron-up"></i>
</a>
</div>
<!-- Branch javascript -->
<script>
// Branch listener object that retrieves banner link data and prints it to console
var listener = function(event, data) {
console.log(event + ' fired at ' + Math.floor(Date.now() / 1000));
console.log(data);
};
// Listener objects are activated in the Branch instance for specific events via .addListener
branch.addListener("willShowJourney", listener);
branch.addListener("didShowJourney", listener);
branch.addListener("willNotShowJourney", listener);
branch.addListener("didClickJourneyCTA", listener);
branch.addListener("didClickJourneyClose", listener);
branch.addListener("willCloseJourney", listener);
branch.addListener("didCloseJourney", listener);
branch.addListener("didCallJourneyClose", listener);
// function to manually launch journey and change banner link data (will NOT launch if banner's dismissal period active)
function launchBranchJourney(){
console.log("launchBranchJourney called");
var linkData = {
data: {
'custom_bool': true,
'$journeys_button_get_no_app':'changed!',
'$journeys_button_get_has_app':'changed!',
'$journeys_title':'Title reset by button click',
'$journeys_description':'Description reset by button click'
}
};
branch.setBranchViewData(linkData);
branch.track('pageview',{},{'disable_entry_animation':true,'disable_exit_animation':true});
}
// function for button to close journey (will NOT activate template's dismissal period)
function closeBranchJourney(){
console.log("closeBranchJourney called");
branch.closeJourney(function(err) {});
}
</script>
<script src="/js/jquery-1.11.0.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.easing.min.js"></script>
<script src="/js/classie.js"></script>
<script src="/js/cbpAnimatedHeader.js"></script>
<script src="/js/jqBootstrapValidation.js"></script>
<script src="/js/contact_me_static.js"></script>
<script src="/js/freelancer.js"></script>
</body>
</html>
|
{
"content_hash": "dd5e6c25353f2789fd002d09969a1173",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 662,
"avg_line_length": 44.93359375,
"alnum_prop": 0.5649830479005477,
"repo_name": "MikeKwon36/MikeKwon36.github.io",
"id": "71a972b93a4c6c1275dbb241e1feef56b16296ce",
"size": "11503",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "burgerking_testpage.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "9562"
},
{
"name": "HTML",
"bytes": "1056071"
},
{
"name": "JavaScript",
"bytes": "379827"
},
{
"name": "Makefile",
"bytes": "4912"
},
{
"name": "PHP",
"bytes": "1194"
},
{
"name": "Perl",
"bytes": "2897"
},
{
"name": "Python",
"bytes": "1247"
},
{
"name": "Shell",
"bytes": "11819"
}
],
"symlink_target": ""
}
|
class GameObject : public sf::Sprite
{
private:
sf::Texture texture;
public:
GameObject(const char* path)
{
texture.loadFromFile(path);
texture.setSmooth(true);
setTexture(texture, true);
setOrigin(texture.getSize().x / 2, texture.getSize().y / 2);
}
virtual void Update(float dt) {}
virtual ~GameObject() {}
};
|
{
"content_hash": "5020c4b964bf30110777a79e9cd14f76",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 17.36842105263158,
"alnum_prop": 0.6878787878787879,
"repo_name": "Zarokhan/MAH_BOIDS",
"id": "273ff398ec9a656875577f373a1b0a409a574f3b",
"size": "373",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SteeringBehaviors/GameObject.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "266"
},
{
"name": "C++",
"bytes": "1679903"
}
],
"symlink_target": ""
}
|
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Turtle {
TurtleState turtleState;
Stack<TurtleState> tss;
public Turtle(float w){
turtleState = new TurtleState(w, Matrix4x4.identity);
tss = new Stack<TurtleState>();
}
public void Gravity(float fraction){
turtleState.M = Gravity (turtleState.M, fraction);
}
public float GetDist(){
return turtleState.dist;
}
public static Matrix4x4 Gravity(Matrix4x4 m, float fraction){
Quaternion q = QuaternionFromMatrix(m);
Quaternion q1 = Quaternion.Euler (180, 0, 0);
//float currentAngle = Quaternion.Angle (q, q1);
Quaternion newDir = Quaternion.Slerp (q, q1, fraction);
return m * Matrix4x4.TRS(Vector3.zero, Quaternion.Inverse (q) * newDir, Vector3.one);
}
public static Quaternion QuaternionFromMatrix(Matrix4x4 m) {
// Adapted from: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
Quaternion q = new Quaternion();
q.w = Mathf.Sqrt( Mathf.Max( 0, 1 + m[0,0] + m[1,1] + m[2,2] ) ) / 2;
q.x = Mathf.Sqrt( Mathf.Max( 0, 1 + m[0,0] - m[1,1] - m[2,2] ) ) / 2;
q.y = Mathf.Sqrt( Mathf.Max( 0, 1 - m[0,0] + m[1,1] - m[2,2] ) ) / 2;
q.z = Mathf.Sqrt( Mathf.Max( 0, 1 - m[0,0] - m[1,1] + m[2,2] ) ) / 2;
q.x *= Mathf.Sign( q.x * ( m[2,1] - m[1,2] ) );
q.y *= Mathf.Sign( q.y * ( m[0,2] - m[2,0] ) );
q.z *= Mathf.Sign( q.z * ( m[1,0] - m[0,1] ) );
return q;
}
public void Turn(float angle){
turtleState.M = turtleState.M * Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0,angle,0), Vector3.one);
}
public void Roll(float angle){
turtleState.M = turtleState.M * Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(0,0,angle), Vector3.one);
}
public void Move(float dist){
turtleState.M = turtleState.M * Matrix4x4.TRS(new Vector3(0,0,dist), Quaternion.identity, Vector3.one);
turtleState.dist += dist;
}
// Store the current state
public void Push(){
tss.Push(turtleState);
}
// Restore a previous state
public void Pop(){
if (tss.Count==0){
Debug.LogError("Invalid pop. Stack is empty (more pop than push)");
}
turtleState = tss.Pop();
}
public TurtleState Peek(){
return turtleState;
}
public void SetWidth(float w){
turtleState.w = w;
}
public float GetWidth(){
return turtleState.w;
}
public Matrix4x4 GetTransform(){
return turtleState.M;
}
}
|
{
"content_hash": "205661d9c1fe9868436b84efbc9990af",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 114,
"avg_line_length": 27.42528735632184,
"alnum_prop": 0.6617770326906958,
"repo_name": "mortennobel/A-Study-in-Composition",
"id": "4a0d3ee6de562c07ab5ba79f6139224edf8c2207",
"size": "2388",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/script/lsystem/Turtle.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "122987"
},
{
"name": "ShaderLab",
"bytes": "8166"
}
],
"symlink_target": ""
}
|
function contains(context, element, text, message) {
var matches = context.$(element).text().match(new RegExp(text));
message = message || `${element} should contain "${text}"`;
this.push(!!matches, matches, text, message);
}
export default contains;
|
{
"content_hash": "5f990ec24d8dda82eee54586801940ef",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 66,
"avg_line_length": 32.375,
"alnum_prop": 0.6911196911196911,
"repo_name": "albertodotcom/ember-cart",
"id": "c544b2b72a0197fa4c3bb9257313dbdf5da0270c",
"size": "259",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/assertions/contains.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1574"
},
{
"name": "Handlebars",
"bytes": "595"
},
{
"name": "JavaScript",
"bytes": "24643"
}
],
"symlink_target": ""
}
|
package gozfs
import (
"bytes"
"syscall"
"github.com/mistifyio/gozfs/nv"
)
func exists(name string) error {
m := map[string]interface{}{
"cmd": "zfs_exists",
"version": uint64(0),
}
encoded := &bytes.Buffer{}
err := nv.NewNativeEncoder(encoded).Encode(m)
if err != nil {
return err
}
return ioctl(zfs, name, encoded.Bytes(), nil)
}
// Exists determines whether a dataset exists or not.
func Exists(name string) (bool, error) {
if err := exists(name); err != nil {
if err == syscall.ENOENT {
err = nil
}
return false, err
}
return true, nil
}
|
{
"content_hash": "4c0136a3f9a0d064e812ab68af9a0fce",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 53,
"avg_line_length": 17.058823529411764,
"alnum_prop": 0.6396551724137931,
"repo_name": "mistifyio/gozfs",
"id": "1071ce80ca3583630ac7f16df7883abf103e04e9",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "exists.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1204"
},
{
"name": "C++",
"bytes": "16872"
},
{
"name": "Go",
"bytes": "249271"
},
{
"name": "Makefile",
"bytes": "376"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Non focused states -->
<item android:state_focused="false" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/bg_shape_buttn_normal" />
<item android:state_focused="false" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/bg_shape_buttn_pressed" />
<!-- Focused states -->
<item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/bg_shape_buttn_pressed" />
<item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/bg_shape_buttn_pressed" />
<!-- Pressed -->
<item android:state_selected="true" android:state_pressed="true" android:drawable="@drawable/bg_shape_buttn_pressed" />
<item android:state_pressed="true" android:drawable="@drawable/bg_shape_buttn_pressed" />
</selector>
|
{
"content_hash": "469e883f6b839f122bdf5f3d954396dc",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 154,
"avg_line_length": 86.5,
"alnum_prop": 0.7273603082851637,
"repo_name": "tanhuopeng/classLock",
"id": "cc7f5afb97facc6ba6fe319d30088dc5ed3a6361",
"size": "1038",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/drawable/selector_btn_checkbox.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "90395"
}
],
"symlink_target": ""
}
|
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>John Doe's blog</title>
<meta name="author">
<meta name="description" content="The awesome blog of John Doe.">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="generator" content="Hugo 0.31.1" />
<link href="/post/index.xml" rel="alternate" type="application/rss+xml" title="John Doe's blog" />
<link href="/post/index.xml" rel="feed" type="application/rss+xml" title="John Doe's blog" />
<link href='//fonts.googleapis.com/css?family=Roboto:400,300,700|Noto+Serif:400,400italic,700,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/styles.css">
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="stylesheet" href="/css/highlightjs/monokai.css">
<script src="/js/vendor/modernizr-2.8.0.min.js"></script>
<style>
.site-header h2 .logo {
background: url(/img/desk.jpg) no-repeat 0 0;
}
@media (min--moz-device-pixel-ratio: 1.3), (-o-min-device-pixel-ratio: 2.6 / 2), (-webkit-min-device-pixel-ratio: 1.3), (min-device-pixel-ratio: 1.3), (min-resolution: 1.3dppx) {
.site-header h2 .logo {
background-image: url(/img/desk.jpg);
}}
.site-header {
background: #2a373d url(/img/desk.jpg) no-repeat center center;
z-index: -1;
}
</style>
</head>
<body>
<header class="site-header">
<div class="transparent-layer">
<h2>Customizable header title</h2>
</div>
</header>
<div class="container clearfix">
<main role="main" class="content">
<article class="post">
<a class="btn home" href="/" title="Back to home">« Back to home</a>
<h1><a href="/post/go-is-for-lovers/" title="Go is for lovers">Go is for lovers</a></h1>
<footer class="post-info">Posted on <span class="post-meta"><time datetime="2015.09.17">2015.09.17</time>
</span>
</footer>
<p>Hugo uses the excellent <a href="http://golang.org/>">go</a> <a href="http://golang.org/pkg/html/template/>">html/template</a> library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in go templates.</p>
<p>This document is a brief primer on using go templates. The <a href="http://golang.org/pkg/html/template/>">go docs</a>
provide more details.</p>
<h2 id="introduction-to-go-templates">Introduction to Go Templates</h2>
<p>Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.</p>
<p>A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the <a href="http://golang.org/pkg/html/template/>">go docs</a>.</p>
<h2 id="basic-syntax">Basic Syntax</h2>
<p>Go lang templates are html files with the addition of variables and
functions.</p>
<p><strong>Go variables and functions are accessible within {{ }}</strong></p>
<p>Accessing a predefined variable “foo”:</p>
<pre><code>{{ foo }}
</code></pre>
<p><strong>Parameters are separated using spaces</strong></p>
<p>Calling the add function with input of 1, 2:</p>
<pre><code>{{ add 1 2 }}
</code></pre>
<p><strong>Methods and fields are accessed via dot notation</strong></p>
<p>Accessing the Page Parameter “bar”</p>
<pre><code>{{ .Params.bar }}
</code></pre>
<p><strong>Parentheses can be used to group items together</strong></p>
<pre><code>{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
</code></pre>
<h2 id="variables">Variables</h2>
<p>Each go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
<a href="/layout/variables">variables</a> page.</p>
<p>A variable is accessed by referencing the variable name.</p>
<pre><code><title>{{ .Title }}</title>
</code></pre>
<p>Variables can also be defined and referenced.</p>
<pre><code>{{ $address := "123 Main St."}}
{{ $address }}
</code></pre>
<h2 id="functions">Functions</h2>
<p>Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. <a href="/layout/functions">Hugo template
functions</a> provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.</p>
<p><strong>Example:</strong></p>
<pre><code>{{ add 1 2 }}
</code></pre>
<h2 id="includes">Includes</h2>
<p>When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.</p>
<p><strong>Example:</strong></p>
<pre><code>{{ template "chrome/header.html" . }}
</code></pre>
<h2 id="logic">Logic</h2>
<p>Go templates provide the most basic iteration and conditional logic.</p>
<h3 id="iteration">Iteration</h3>
<p>Just like in go, the go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.</p>
<p><strong>Example 1: Using Context</strong></p>
<pre><code>{{ range array }}
{{ . }}
{{ end }}
</code></pre>
<p><strong>Example 2: Declaring value variable name</strong></p>
<pre><code>{{range $element := array}}
{{ $element }}
{{ end }}
</code></pre>
<p><strong>Example 2: Declaring key and value variable name</strong></p>
<pre><code>{{range $index, $element := array}}
{{ $index }}
{{ $element }}
{{ end }}
</code></pre>
<h3 id="conditionals">Conditionals</h3>
<p>If, else, with, or, & and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with <code>end</code>.</p>
<p>Go Templates treat the following values as false:</p>
<ul>
<li>false</li>
<li>0</li>
<li>any array, slice, map, or string of length zero</li>
</ul>
<p><strong>Example 1: If</strong></p>
<pre><code>{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
</code></pre>
<p><strong>Example 2: If -> Else</strong></p>
<pre><code>{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{else}}
{{ index .Params "caption" }}
{{ end }}
</code></pre>
<p><strong>Example 3: And & Or</strong></p>
<pre><code>{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
</code></pre>
<p><strong>Example 4: With</strong></p>
<p>An alternative way of writing “if” and then referencing the same value
is to use “with” instead. With rebinds the context <code>.</code> within its scope,
and skips the block if the variable is absent.</p>
<p>The first example above could be simplified as:</p>
<pre><code>{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
</code></pre>
<p><strong>Example 5: If -> Else If</strong></p>
<pre><code>{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{ else if isset .Params "caption" }}
{{ index .Params "caption" }}
{{ end }}
</code></pre>
<h2 id="pipes">Pipes</h2>
<p>One of the most powerful components of go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline’s output becomes the
input of the following pipe.</p>
<p>Because of the very simple syntax of go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.</p>
<p>A few simple examples should help convey how to use the pipe.</p>
<p><strong>Example 1 :</strong></p>
<pre><code>{{ if eq 1 1 }} Same {{ end }}
</code></pre>
<p>is the same as</p>
<pre><code>{{ eq 1 1 | if }} Same {{ end }}
</code></pre>
<p>It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.</p>
<p><strong>Example 2 :</strong></p>
<pre><code>{{ index .Params "disqus_url" | html }}
</code></pre>
<p>Access the page parameter called “disqus_url” and escape the HTML.</p>
<p><strong>Example 3 :</strong></p>
<pre><code>{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
Stuff Here
{{ end }}
</code></pre>
<p>Could be rewritten as</p>
<pre><code>{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
Stuff Here
{{ end }}
</code></pre>
<h2 id="context-aka-the-dot">Context (aka. the dot)</h2>
<p>The most easily overlooked concept to understand about go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.</p>
<p><strong>Example:</strong></p>
<pre><code> {{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}
</code></pre>
<p>Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.</p>
<h1 id="hugo-parameters">Hugo Parameters</h1>
<p>Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.</p>
<h2 id="using-content-page-parameters">Using Content (page) Parameters</h2>
<p>In each piece of content you can provide variables to be used by the
templates. This happens in the <a href="/content/front-matter">front matter</a>.</p>
<p>An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn’t make a lot of sense. We’ve defined a variable in our front matter
of some pages to turn off the TOC from being displayed.</p>
<p>Here is the example front matter:</p>
<pre><code>---
title: "Permalinks"
date: "2013-11-18"
aliases:
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
notoc: true
---
</code></pre>
<p>Here is the corresponding code inside of the template:</p>
<pre><code> {{ if not .Params.notoc }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}
</code></pre>
<h2 id="using-site-config-parameters">Using Site (config) Parameters</h2>
<p>In your top-level configuration file (eg, <code>config.yaml</code>) you can define site
parameters, which are values which will be available to you in chrome.</p>
<p>For instance, you might declare:</p>
<pre><code class="language-yaml">params:
CopyrightHTML: "Copyright &#xA9; 2013 John Doe. All Rights Reserved."
TwitterUser: "spf13"
SidebarRecentLimit: 5
</code></pre>
<p>Within a footer layout, you might then declare a <code><footer></code> which is only
provided if the <code>CopyrightHTML</code> parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again. This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.</p>
<pre><code>{{if .Site.Params.CopyrightHTML}}<footer>
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
</footer>{{end}}
</code></pre>
<p>An alternative way of writing the “if” and then referencing the same value
is to use “with” instead. With rebinds the context <code>.</code> within its scope,
and skips the block if the variable is absent:</p>
<pre><code>{{with .Site.Params.TwitterUser}}<span class="twitter">
<a href="https://twitter.com/{{.}}" rel="author">
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
alt="Twitter"></a>
</span>{{end}}
</code></pre>
<p>Finally, if you want to pull “magic constants” out of your layouts, you can do
so, such as in this example:</p>
<pre><code><nav class="recent">
<h1>Recent Posts</h1>
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}</ul>
</nav>
</code></pre>
<ul class="share-buttons">
<li>Share this article:</li>
<li>
<a class="icon-facebook-squared" href="https://www.facebook.com/sharer/sharer.php?u=%2fpost%2fgo-is-for-lovers%2f" onclick="window.open(this.href, 'facebook-share','width=580,height=296');return false;" title="Share on Facebook"></a>
</li>
<li>
<a class="icon-twitter" href="https://twitter.com/share?text=Go%20is%20for%20lovers&url=%2fpost%2fgo-is-for-lovers%2f" onclick="window.open(this.href, 'twitter-share', 'width=550,height=235');return false;" title="Tweet this article"></a>
</li>
<li>
<a class="icon-gplus" href="https://plus.google.com/share?url=%2fpost%2fgo-is-for-lovers%2f" onclick="window.open(this.href, 'google-plus-share', 'width=490,height=530');return false;" title="Share on Google+"></a>
</li>
<li>
<a class="icon-linkedin" href="https://www.linkedin.com/shareArticle?mini=true&url=%2fpost%2fgo-is-for-lovers%2f&title=Go%20is%20for%20lovers" onclick="window.open(this.href, 'linkedin-share', 'width=600,height=494');return false;" title="Share on Linkedin"></a>
</li>
</ul>
</article>
<div class="comments">
<h3>Comments</h3>
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
};
(function() {
if (["localhost", "127.0.0.1"].indexOf(window.location.hostname) != -1) {
document.getElementById('disqus_thread').innerHTML = 'Disqus comments not available by default when the website is previewed locally.';
return;
}
var d = document, s = d.createElement('script'); s.async = true;
s.src = '//' + "spf13" + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="https://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
</main>
<aside class="author">
<img class="profile-image" src="/img/profile-image.png" alt="John Doe" />
<p class="name">by
<strong>John Doe</strong></p>
<p class="address">Earth</p>
<p class="link"></p>
<ul class="social">
<li><a href="//twitter.com/spf13" class="icon-twitter" target="_blank" title="Twitter"></a></li>
<li><a href="//github.com/digitalcraftsman" class="icon-github" target="_blank" title="Github"></a></li>
<li><a href="/post/index.xml" class="icon-rss" target="_blank" title="RSS"></a></li>
</ul>
<br><br>
</aside>
</div>
<footer class="main-footer">
<div class="container clearfix">
<a class="icon-rss" href="/post/index.xml" title="RSS"></a>
<p>© 2017 · Powered by <a href="http://gohugo.io">Hugo</a>.</p>
</div>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>window.jQuery || document.write('<script src="\/js\/vendor\/jquery-1.11.0.min.js"><\/script>')</script>
<script src="/js/plugins.js"></script>
</body>
</html>
|
{
"content_hash": "a3dacfec2a80217b57e5763d0e3223be",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 270,
"avg_line_length": 35.93482688391039,
"alnum_prop": 0.6705962366810247,
"repo_name": "rebcavee/Blog",
"id": "d3a5f607a752fc76241558e340bf65be06788a34",
"size": "17644",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/post/go-is-for-lovers/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "36464"
},
{
"name": "HTML",
"bytes": "197723"
},
{
"name": "JavaScript",
"bytes": "1466"
}
],
"symlink_target": ""
}
|
layout : blocks/working-session
title : Dependency Check
type : workshop
organizers : Steve Springett
technology : Java
status : done
track : Owasp Projects
owasp-project: yes
when-day : Fri
when-time : PM-2
location : Room-3
room-layout : cabaret
organizers : Steve Springett, Steven Wierckx
participants : Johan Peeters, Brian Glas
---
## Why
Use of vulnerable components (A9) contributes to some of the worlds largest breaches. It is unique among other types of security issues - in that vulnerabilities can suddenly arrise at any point in the software development lifecycle with or without code changes. OWASP Dependency-Check - a project created by Jeremy Long in 2012 - is a flagship OWASP project with thousands of users and many volunteers. It has grown from a single command line tool into a full suite designed to provide visibility of vulnerable components throughout the software development lifecycle.
## What
* An overview of the state-of-the-art of the Dependency-Check & Dependency-Track ecosystem
* Provide sneak peak at v2.0.0
* Demos (may the demo gods be gracious)
* Get direct feedback on existing and in-progress features
## Outcomes
* Identify areas - Dependency-Check and Dependency-Track need improvement
* Learn about complementary issues that put use of third-party components at risk
* Learn how to contribute to the projects
## Who
* Security practitioners
* CI/CD/DevOps practitioners
* Software engineers
* QA engineers
* Anyone responsible for the design, creation, testing, or operation of software
---
## Working materials
Here are the current 'work in progress' materials for this session (please add as much information as possible before the sessions)
### Content
...add content...
|
{
"content_hash": "cfbed326d7bf539e0607085754e3362c",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 570,
"avg_line_length": 35.03921568627451,
"alnum_prop": 0.7588136541689984,
"repo_name": "OWASP/owasp-summit-2017",
"id": "10c7087aab769b05750cd4df22e1bbd642adcda4",
"size": "1795",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Working-Sessions/Owasp-Projects/Dependency-Check.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1554683"
},
{
"name": "CoffeeScript",
"bytes": "37707"
},
{
"name": "HTML",
"bytes": "1042534"
},
{
"name": "JavaScript",
"bytes": "319138"
},
{
"name": "PHP",
"bytes": "198040"
},
{
"name": "Shell",
"bytes": "3696"
}
],
"symlink_target": ""
}
|
package uk.co.real_logic.aeron.samples;
import uk.co.real_logic.aeron.Aeron;
import uk.co.real_logic.aeron.Subscription;
import uk.co.real_logic.aeron.logbuffer.FragmentHandler;
import uk.co.real_logic.aeron.driver.MediaDriver;
import uk.co.real_logic.agrona.CloseHelper;
import uk.co.real_logic.agrona.concurrent.SigInt;
import java.util.concurrent.atomic.AtomicBoolean;
import static uk.co.real_logic.aeron.samples.SamplesUtil.printStringMessage;
/**
* This is a Basic Aeron subscriber application
* The application subscribes to a default channel and stream ID. These defaults can
* be overwritten by changing their value in {@link SampleConfiguration} or by
* setting their corresponding Java system properties at the command line, e.g.:
* -Daeron.sample.channel=udp://localhost:5555 -Daeron.sample.streamId=20
* This application only handles non-fragmented data. A DataHandler method is called
* for every received message or message fragment.
* For an example that implements reassembly of large, fragmented messages, see
* {link@ MultipleSubscribersWithFragmentAssembly}.
*/
public class BasicSubscriber
{
private static final int STREAM_ID = SampleConfiguration.STREAM_ID;
private static final String CHANNEL = SampleConfiguration.CHANNEL;
private static final int FRAGMENT_COUNT_LIMIT = SampleConfiguration.FRAGMENT_COUNT_LIMIT;
private static final boolean EMBEDDED_MEDIA_DRIVER = SampleConfiguration.EMBEDDED_MEDIA_DRIVER;
public static void main(final String[] args) throws Exception
{
System.out.println("Subscribing to " + CHANNEL + " on stream Id " + STREAM_ID);
final MediaDriver driver = EMBEDDED_MEDIA_DRIVER ? MediaDriver.launchEmbedded() : null;
final Aeron.Context ctx = new Aeron.Context()
.newImageHandler(SamplesUtil::printNewImage)
.inactiveImageHandler(SamplesUtil::printInactiveImage);
if (EMBEDDED_MEDIA_DRIVER)
{
ctx.dirName(driver.contextDirName());
}
final FragmentHandler fragmentHandler = printStringMessage(STREAM_ID);
final AtomicBoolean running = new AtomicBoolean(true);
// Register a SIGINT handler for graceful shutdown.
SigInt.register(() -> running.set(false));
// Create an Aeron instance using the configured Context and create a
// Subscription on that instance that subscribes to the configured
// channel and stream ID.
// The Aeron and Subscription classes implement "AutoCloseable" and will automatically
// clean up resources when this try block is finished
try (final Aeron aeron = Aeron.connect(ctx);
final Subscription subscription = aeron.addSubscription(CHANNEL, STREAM_ID))
{
SamplesUtil.subscriberLoop(fragmentHandler, FRAGMENT_COUNT_LIMIT, running).accept(subscription);
System.out.println("Shutting down...");
}
CloseHelper.quietClose(driver);
}
}
|
{
"content_hash": "62a68f3b1b99ebcc6ad98ddb4765a437",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 108,
"avg_line_length": 43.86764705882353,
"alnum_prop": 0.7291317465638619,
"repo_name": "UIKit0/Aeron",
"id": "b091c64b1605dc4cdf836aad8b5487ead79da086",
"size": "3584",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aeron-samples/src/main/java/uk/co/real_logic/aeron/samples/BasicSubscriber.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "570"
},
{
"name": "C++",
"bytes": "491858"
},
{
"name": "CMake",
"bytes": "12769"
},
{
"name": "Java",
"bytes": "1487887"
},
{
"name": "Shell",
"bytes": "314"
}
],
"symlink_target": ""
}
|
package org.ands.rifcs.base;
import org.w3c.dom.Node;
/**
* Class representing a RIF-CS Arg.
*
* @author Scott Yeadon
*
*/
public class Arg extends RIFCSElement {
/**
* Construct an Arg object.
*
* @param n
* A w3c Node, typically an Element
*
* @throws RIFCSException A RIFCSException
*/
protected Arg(final Node n) throws RIFCSException {
super(n, Constants.ELEMENT_ARG);
}
/**
* Set the type.
*
* @param type
* The type of argument
*/
public final void setType(final String type) {
super.setAttributeValue(Constants.ATTRIBUTE_TYPE, type);
}
/**
* return the type.
*
* @return
* The type attribute value or empty string if attribute
* is empty or not present
*/
public final String getType() {
return super.getAttributeValue(Constants.ATTRIBUTE_TYPE);
}
/**
* Set whether the argument is mandatory.
*
* @param required
* <code>true</code> or <code>false</code>
*/
public final void setRequired(final String required) {
super.setAttributeValue(Constants.ATTRIBUTE_REQUIRED, required);
}
/**
* return whether the argument is mandatory.
*
* @return
* The attribute value or empty string if attribute
* is empty or not present
*/
public final String getRequired() {
return super.getAttributeValue(Constants.ATTRIBUTE_REQUIRED);
}
/**
* Set the use of the argument.
*
* @param use
* term indicating the use of the argument
*/
public final void setUse(final String use) {
super.setAttributeValue(Constants.ATTRIBUTE_USE, use);
}
/**
* return the use of the argument.
*
* @return
* The attribute value or empty string if attribute
* is empty or not present
*/
public final String getUse() {
return super.getAttributeValue(Constants.ATTRIBUTE_USE);
}
/**
* Set the name of the argument.
*
* @param name
* The argument name
*/
public final void setName(final String name) {
super.setTextContent(name);
}
/**
* return the name of the argument.
*
* @return
* The name or empty string if not set
*/
public final String getName() {
return super.getTextContent();
}
}
|
{
"content_hash": "fc3508ad8de21034c7911ac55ea14222",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 72,
"avg_line_length": 21.42608695652174,
"alnum_prop": 0.5799512987012987,
"repo_name": "au-research/ANDS-RIFCS-API",
"id": "f0547d1bdfc5dac58273b1d5e29e2816310b750a",
"size": "3088",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/org/ands/rifcs/base/Arg.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "407696"
}
],
"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_23) on Sun Feb 26 06:28:55 CET 2012 -->
<TITLE>
Get.VerboseProgress (Apache Ant API)
</TITLE>
<META NAME="date" CONTENT="2012-02-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="Get.VerboseProgress (Apache Ant 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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</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">
<A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.NullProgress.html" title="class in org.apache.tools.ant.taskdefs"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/tools/ant/taskdefs/GUnzip.html" title="class in org.apache.tools.ant.taskdefs"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/tools/ant/taskdefs/Get.VerboseProgress.html" target="_top"><B>FRAMES</B></A>
<A HREF="Get.VerboseProgress.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.tools.ant.taskdefs</FONT>
<BR>
Class Get.VerboseProgress</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.tools.ant.taskdefs.Get.VerboseProgress</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html" title="interface in org.apache.tools.ant.taskdefs">Get.DownloadProgress</A></DD>
</DL>
<DL>
<DT><B>Enclosing class:</B><DD><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.html" title="class in org.apache.tools.ant.taskdefs">Get</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public static class <B>Get.VerboseProgress</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html" title="interface in org.apache.tools.ant.taskdefs">Get.DownloadProgress</A></DL>
</PRE>
<P>
verbose progress system prints to some output stream
<P>
<P>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.VerboseProgress.html#Get.VerboseProgress(java.io.PrintStream)">Get.VerboseProgress</A></B>(java.io.PrintStream out)</CODE>
<BR>
Construct a verbose progress reporter.</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.VerboseProgress.html#beginDownload()">beginDownload</A></B>()</CODE>
<BR>
begin a download</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.VerboseProgress.html#endDownload()">endDownload</A></B>()</CODE>
<BR>
end a download</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.VerboseProgress.html#onTick()">onTick</A></B>()</CODE>
<BR>
tick handler</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Get.VerboseProgress(java.io.PrintStream)"><!-- --></A><H3>
Get.VerboseProgress</H3>
<PRE>
public <B>Get.VerboseProgress</B>(java.io.PrintStream out)</PRE>
<DL>
<DD>Construct a verbose progress reporter.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>out</CODE> - the output stream.</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="beginDownload()"><!-- --></A><H3>
beginDownload</H3>
<PRE>
public void <B>beginDownload</B>()</PRE>
<DL>
<DD>begin a download
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html#beginDownload()">beginDownload</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html" title="interface in org.apache.tools.ant.taskdefs">Get.DownloadProgress</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="onTick()"><!-- --></A><H3>
onTick</H3>
<PRE>
public void <B>onTick</B>()</PRE>
<DL>
<DD>tick handler
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html#onTick()">onTick</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html" title="interface in org.apache.tools.ant.taskdefs">Get.DownloadProgress</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="endDownload()"><!-- --></A><H3>
endDownload</H3>
<PRE>
public void <B>endDownload</B>()</PRE>
<DL>
<DD>end a download
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html#endDownload()">endDownload</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.DownloadProgress.html" title="interface in org.apache.tools.ant.taskdefs">Get.DownloadProgress</A></CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</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">
<A HREF="../../../../../org/apache/tools/ant/taskdefs/Get.NullProgress.html" title="class in org.apache.tools.ant.taskdefs"><B>PREV CLASS</B></A>
<A HREF="../../../../../org/apache/tools/ant/taskdefs/GUnzip.html" title="class in org.apache.tools.ant.taskdefs"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/apache/tools/ant/taskdefs/Get.VerboseProgress.html" target="_top"><B>FRAMES</B></A>
<A HREF="Get.VerboseProgress.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
|
{
"content_hash": "c4a481f8c4d25261716e553a2a4584b4",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 343,
"avg_line_length": 40.1577287066246,
"alnum_prop": 0.6296150824823252,
"repo_name": "kolbasa/IaTestGen",
"id": "fd503e221baf74ae4e2506985ed8d4930d4ccc59",
"size": "12730",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "build/files/apache_ant_1.8.3/manual/api/org/apache/tools/ant/taskdefs/Get.VerboseProgress.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "8599"
},
{
"name": "Java",
"bytes": "383882"
},
{
"name": "Perl",
"bytes": "9844"
},
{
"name": "Python",
"bytes": "3299"
},
{
"name": "Shell",
"bytes": "45576"
},
{
"name": "XML",
"bytes": "221100"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/item_iv_deck"
android:layout_width="40dp"
android:layout_height="50dp" >
</ImageView>
</LinearLayout>
|
{
"content_hash": "7db1da88808ec3998479ab59254cd7d0",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 72,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.6620111731843575,
"repo_name": "hailuo966/YuGiOh",
"id": "eb1a00409cb002462510c0c8c874f68d6d490e49",
"size": "358",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "res/layout/item_grid_image.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "91533"
}
],
"symlink_target": ""
}
|
import apisauce from 'apisauce';
import { info, builds, jobs, views, que, load, login, logout } from '../Services/';
// our "constructor"
const create = (baseURL = 'http://') => {
// ------
// STEP 1
// ------
//
// Create and configure an apisauce-based api object.
//
const api = apisauce.create({
// base URL is read from the "constructor"
baseURL,
// here are some default headers
headers: {
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31',
'Accept-Language': 'en-US,en;q=0.8'
},
// 10 second timeout...
timeout: 10000
});
// Wrap api's addMonitor to allow the calling code to attach
// additional monitors in the future.
const addMonitor = api.addMonitor((response) => {
// Monitors are called passively after every request.
});
const updateDefaultBaseURL = (data) => {
const protocol = data.https ? 'https' : 'http';
api.axiosInstance.defaults.baseURL = `${protocol}://${data.host}:${data.port}`;
};
// ------
// STEP 2
// ------
//
// Define some functions that call the api. The goal is to provide
// a thin wrapper of the api layer providing nicer feeling functions
// rather than "get", "post" and friends.
//
// I generally don't like wrapping the output at this level because
// sometimes specific actions need to be take on `403` or `401`, etc.
//
// Since we can't hide from that, we embrace it by getting out of the
// way at this level.
//
const getJenkinsJobs = () => jobs.getJobs(api);
const getJenkinsViews = () => views.getViews(api);
const getQueAPI = () => que.getQueApi(api);
const getLoadAPI = () => load.getLoadApi(api);
const getBuilds = (job) => builds.getBuilds(api, job);
const getBuild = (job, buildNumber) => builds.getBuild(api, job, buildNumber);
const getJenkinsInfo = () => info.getInfo(api);
const startJob = (job) => jobs.getJob(api, job);
const startLogin = (username, password, instanceName, host, port, https) => {
updateDefaultBaseURL({host, port, https});
return login.attemptLogin(api, username, password, https);
};
const startLogout = () => logout.attemptLogout(api);
// ------
// STEP 3
// ------
//
// Return back a collection of functions that we would consider our
// interface. Most of the time it'll be just the list of all the
// methods in step 2.
//
// Notice we're not returning back the `api` created in step 1? That's
// because it is scoped privately. This is one way to create truly
// private scoped goodies in JavaScript.
//
return {
// a list of the API functions from step 2
getJenkinsInfo,
getJenkinsJobs,
getJenkinsViews,
getQueAPI,
getLoadAPI,
getBuild,
getBuilds,
startLogin,
startLogout,
startJob,
// additional utilities
addMonitor
};
};
// let's return back our create method as the default.
export default {
create
};
|
{
"content_hash": "f50cab35d110f4630d82c368eb55dbb1",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 131,
"avg_line_length": 30.69,
"alnum_prop": 0.6392961876832844,
"repo_name": "derickwarshaw/jenkins",
"id": "c13314d3896f1f5e5ae44e86dd0ea6195d41946d",
"size": "3113",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "App/Services/Api.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1483"
},
{
"name": "JavaScript",
"bytes": "73331"
},
{
"name": "Objective-C",
"bytes": "4404"
},
{
"name": "Python",
"bytes": "1639"
}
],
"symlink_target": ""
}
|
package org.baade.otter.core.session;
import java.net.SocketAddress;
import java.nio.channels.SocketChannel;
import java.util.HashMap;
import java.util.Map;
public class SessionRecycle implements ISessionRecycle{
private Map<SocketAddress, ISession> allSessions;
public SessionRecycle(){
allSessions = new HashMap<SocketAddress, ISession>();
}
@Override
public void put(ISession session) {
if(session.isConnected()){
SocketAddress remote = session.getRemote();
if(remote != null){
allSessions.put(remote, session);
}else{
//提示
}
}else{
//已经断开连接
}
}
@Override
public ISession get(SocketChannel socketChannel) {
ISession session = null;
if(socketChannel.isConnected()){
SocketAddress remote = socketChannel.socket().getRemoteSocketAddress();
session = allSessions.get(remote);
}
return session;
}
@Override
public ISession get(SocketAddress socketAddress) {
return allSessions.get(socketAddress);
}
@Override
public void remove(ISession session) {
allSessions.remove(session.getRemote());
}
}
|
{
"content_hash": "3332636e335ac436eaa0f8d428910210",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 74,
"avg_line_length": 20.18867924528302,
"alnum_prop": 0.7299065420560747,
"repo_name": "baade-org/otter",
"id": "b26b6dc2ae69c5d459c202dc02075bf2e74b79fb",
"size": "1086",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "otter-core/src/main/java/org/baade/otter/core/session/SessionRecycle.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "17214"
}
],
"symlink_target": ""
}
|
void test_ecmascript_enum_encoding_strategy(void);
|
{
"content_hash": "2f88a7164f8ec94df23d98a33057d6df",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 50,
"avg_line_length": 51,
"alnum_prop": 0.8235294117647058,
"repo_name": "TyRoXx/Lpg",
"id": "c3dace3a121f22d24073beb1f023a5945c95cf8f",
"size": "65",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/test_ecmascript_enum_encoding_strategy.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1445652"
},
{
"name": "C++",
"bytes": "7969"
},
{
"name": "CMake",
"bytes": "12126"
},
{
"name": "HTML",
"bytes": "118"
},
{
"name": "JavaScript",
"bytes": "6884"
},
{
"name": "Objective-C",
"bytes": "4127"
},
{
"name": "Shell",
"bytes": "652"
}
],
"symlink_target": ""
}
|
module Azure::Network::Mgmt::V2020_08_01
module Models
#
# A load balancer probe.
#
class Probe < SubResource
include MsRestAzure
# @return [Array<SubResource>] The load balancer rules that use this
# probe.
attr_accessor :load_balancing_rules
# @return [ProbeProtocol] The protocol of the end point. If 'Tcp' is
# specified, a received ACK is required for the probe to be successful.
# If 'Http' or 'Https' is specified, a 200 OK response from the specifies
# URI is required for the probe to be successful. Possible values
# include: 'Http', 'Tcp', 'Https'
attr_accessor :protocol
# @return [Integer] The port for communicating the probe. Possible values
# range from 1 to 65535, inclusive.
attr_accessor :port
# @return [Integer] The interval, in seconds, for how frequently to probe
# the endpoint for health status. Typically, the interval is slightly
# less than half the allocated timeout period (in seconds) which allows
# two full probes before taking the instance out of rotation. The default
# value is 15, the minimum value is 5.
attr_accessor :interval_in_seconds
# @return [Integer] The number of probes where if no response, will
# result in stopping further traffic from being delivered to the
# endpoint. This values allows endpoints to be taken out of rotation
# faster or slower than the typical times used in Azure.
attr_accessor :number_of_probes
# @return [String] The URI used for requesting health status from the VM.
# Path is required if a protocol is set to http. Otherwise, it is not
# allowed. There is no default value.
attr_accessor :request_path
# @return [ProvisioningState] The provisioning state of the probe
# resource. Possible values include: 'Succeeded', 'Updating', 'Deleting',
# 'Failed'
attr_accessor :provisioning_state
# @return [String] The name of the resource that is unique within the set
# of probes used by the load balancer. This name can be used to access
# the resource.
attr_accessor :name
# @return [String] A unique read-only string that changes whenever the
# resource is updated.
attr_accessor :etag
# @return [String] Type of the resource.
attr_accessor :type
#
# Mapper for Probe class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'Probe',
type: {
name: 'Composite',
class_name: 'Probe',
model_properties: {
id: {
client_side_validation: true,
required: false,
serialized_name: 'id',
type: {
name: 'String'
}
},
load_balancing_rules: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.loadBalancingRules',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'SubResourceElementType',
type: {
name: 'Composite',
class_name: 'SubResource'
}
}
}
},
protocol: {
client_side_validation: true,
required: true,
serialized_name: 'properties.protocol',
type: {
name: 'String'
}
},
port: {
client_side_validation: true,
required: true,
serialized_name: 'properties.port',
type: {
name: 'Number'
}
},
interval_in_seconds: {
client_side_validation: true,
required: false,
serialized_name: 'properties.intervalInSeconds',
type: {
name: 'Number'
}
},
number_of_probes: {
client_side_validation: true,
required: false,
serialized_name: 'properties.numberOfProbes',
type: {
name: 'Number'
}
},
request_path: {
client_side_validation: true,
required: false,
serialized_name: 'properties.requestPath',
type: {
name: 'String'
}
},
provisioning_state: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'properties.provisioningState',
type: {
name: 'String'
}
},
name: {
client_side_validation: true,
required: false,
serialized_name: 'name',
type: {
name: 'String'
}
},
etag: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'etag',
type: {
name: 'String'
}
},
type: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'type',
type: {
name: 'String'
}
}
}
}
}
end
end
end
end
|
{
"content_hash": "fe3836a2a48bb40b7523feed120014bb",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 79,
"avg_line_length": 33.668508287292816,
"alnum_prop": 0.48900557925828686,
"repo_name": "Azure/azure-sdk-for-ruby",
"id": "cdea8aace6cac13ddd75476907c5a1fd83a657c8",
"size": "6258",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "management/azure_mgmt_network/lib/2020-08-01/generated/azure_mgmt_network/models/probe.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "345216400"
},
{
"name": "Shell",
"bytes": "305"
}
],
"symlink_target": ""
}
|
<?php
/**
* @file Client.php
* @brief APP <--> Gapper Client <--> Gapper Server
*
* @author Hongjie Zhu
*
* @version 0.1.0
* @date 2014-06-18
*/
/**
* $client = \Gini\IoC::construct('\Gini\Gapper\Client', true); (default)
* $client = \Gini\IoC::construct('\Gini\Gapper\Client', false);
* $username = $client->getCurrentUserName();
* $userdata = $client->getUserInfo();
* $groupdata = $client->getGroupInfo();.
*/
namespace Gini\Gapper;
class Client
{
use \Gini\Module\Gapper\Client\RPCTrait;
const STEP_LOGIN = 0;
const STEP_GROUP = 1;
const STEP_DONE = 2;
const STEP_USER_401 = 3;
const STEP_GROUP_401 = 4;
private static $sessionKey = 'gapper.client';
private static function prepareSession()
{
$_SESSION[self::$sessionKey] = $_SESSION[self::$sessionKey] ?: [];
}
private static function hasSession($key)
{
return isset($_SESSION[self::$sessionKey][$key]);
}
private static function getSession($key)
{
return $_SESSION[self::$sessionKey][$key];
}
private static function setSession($key, $value)
{
self::prepareSession();
$_SESSION[self::$sessionKey][$key] = $value;
}
private static function unsetSession($key)
{
self::prepareSession();
unset($_SESSION[self::$sessionKey][$key]);
}
public static function init()
{
$gapperToken = $_GET['gapper-token'];
if ($gapperToken) {
\Gini\Gapper\Client::logout();
\Gini\Gapper\Client::loginByToken($gapperToken);
} else {
// 提供第三方登录验证入口
$third = (array) \Gini\Config::get('gapper.3rd');
foreach ($third as $key => $value) {
if (isset($value['condition']) && !$_GET[$value['condition']]) {
continue;
}
$className = $value['class'];
if (!class_exists($className)) {
continue;
}
$handler = \Gini\IoC::construct($className, $value['params']);
$handler->run();
}
}
$gapperGroup = $_GET['gapper-group'];
if ($gapperGroup && \Gini\Gapper\Client::getLoginStep() === \Gini\Gapper\Client::STEP_GROUP) {
\Gini\Gapper\Client::chooseGroup($gapperGroup);
}
}
public static function getLoginStep()
{
// 错误的client信息,用户无法登陆
$config = \Gini\Config::get('gapper.rpc');
$client_id = $config['client_id'];
if (!$client_id) {
return self::STEP_LOGIN;
}
try {
$app = self::getRPC()->gapper->app->getInfo($client_id);
} catch (\Gini\RPC\Exception $e) {
$app = [];
}
if (!isset($app['id'])) {
return self::STEP_LOGIN;
}
$username = self::getUserName();
if (!$username) {
return self::STEP_LOGIN;
}
if ($app['type'] === 'group' && empty(self::getGroupInfo())) {
$groups = self::getGroups();
if (!empty($groups) && is_array($groups)) {
return self::STEP_GROUP;
} else {
return self::STEP_GROUP_401;
}
} elseif ($app['type'] === 'user') {
try {
$apps = (array) self::getRPC()->gapper->user->getApps(self::getUserName());
} catch (\Gini\RPC\Exception $e) {
$apps = [];
}
if (!in_array($client_id, $apps)) {
return self::STEP_USER_401;
}
}
return self::STEP_DONE;
}
public static function loginByUserName($username)
{
list($name, $backend) = explode('|', $username, 2);
$backend = $backend ?: 'gapper';
return self::setUserName($name.'|'.$backend);
}
public static function loginByToken($token)
{
try {
$user = self::getRPC()->gapper->user->authorizeByToken($token);
} catch (\Exception $e) {
}
if ($user && $user['username']) {
return self::loginByUserName($user['username']);
}
return false;
}
private static $keyUserName = 'username';
private static function setUserName($username)
{
// 错误的client信息,用户无法登陆
$config = \Gini\Config::get('gapper.rpc');
$client_id = $config['client_id'];
if (!$client_id) {
return false;
}
try {
$app = self::getRPC()->gapper->app->getInfo($client_id);
} catch (\Exception $e) {
}
if (!$app['id']) {
return false;
}
self::setSession(self::$keyUserName, $username);
return true;
}
public static function getUserName()
{
if (self::hasSession(self::$keyUserName)) {
$username = self::getSession(self::$keyUserName);
}
return $username;
}
public static function getUserInfo()
{
if (!self::getUserName()) {
return;
}
try {
$data = self::getRPC()->gapper->user->getInfo([
'username' => self::getUserName(),
]);
} catch (\Gini\RPC\Exception $e) {
}
return $data;
}
public static function getGroups()
{
$config = \Gini\Config::get('gapper.rpc');
$client_id = $config['client_id'];
if (!$client_id) {
return false;
}
try {
$app = self::getRPC()->gapper->app->getInfo($client_id);
} catch (\Exception $e) {
}
if (!$app['id']) {
return false;
}
$username = self::getUserName();
if (!$username) {
return false;
}
try {
$groups = self::getRPC()->gapper->user->getGroups($username);
} catch (\Exception $e) {
}
if (empty($groups)) {
return false;
}
$result = [];
try {
foreach ($groups as $k => $g) {
$apps = self::getRPC()->gapper->group->getApps((int) $g['id']);
if (is_array($apps) && in_array($client_id, array_keys($apps))) {
$result[$k] = $g;
}
}
} catch (\Exception $e) {
}
return $result;
}
private static $keyGroupID = 'groupid';
public static function resetGroup()
{
return self::setSession(self::$keyGroupID, 0);
}
public static function chooseGroup($groupID)
{
$config = (array) \Gini\Config::get('gapper.rpc');
$client_id = $config['client_id'];
if (!$client_id) {
return false;
}
try {
$app = self::getRPC()->gapper->app->getInfo($client_id);
} catch (\Exception $e) {
}
if (!$app['id']) {
return false;
}
$username = self::getUserName();
if (!$username) {
return false;
}
try {
$groups = self::getRPC()->gapper->user->getGroups($username);
} catch (\Exception $e) {
}
if (!is_array($groups) || !in_array($groupID, array_keys($groups))) {
return false;
}
try {
$apps = self::getRPC()->gapper->group->getApps((int) $groupID);
} catch (\Exception $e) {
}
if (is_array($apps) && in_array($client_id, array_keys($apps))) {
self::setSession(self::$keyGroupID, $groupID);
return true;
}
return false;
}
public static function getGroupInfo()
{
if (self::hasSession(self::$keyGroupID)) {
$groupID = self::getSession(self::$keyGroupID);
try {
$data = self::getRPC()->gapper->group->getInfo((int) $groupID);
} catch (\Exception $e) {
}
return $data;
}
}
public static function getGroupID()
{
if (self::hasSession(self::$keyGroupID)) {
$groupID = self::getSession(self::$keyGroupID);
return $groupID;
}
}
public static function logout()
{
self::unsetSession(self::$keyGroupID);
self::unsetSession(self::$keyUserName);
return true;
}
public static function goLogin()
{
$url = \Gini\URI::url('gapper/client/login', ['redirect' => $_SERVER['REQUEST_URI']]);
\Gini\CGI::redirect($url);
}
}
|
{
"content_hash": "05d0d8fe246cf8e1256f9331ce17355a",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 102,
"avg_line_length": 26.5527950310559,
"alnum_prop": 0.48947368421052634,
"repo_name": "lqvfyr/gapper",
"id": "edb8100077fb62ff469254dae92796ef3d5035a2",
"size": "8620",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "class/Gini/Gapper/Client.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9404"
},
{
"name": "HTML",
"bytes": "21535"
},
{
"name": "JavaScript",
"bytes": "35169"
},
{
"name": "PHP",
"bytes": "34977"
}
],
"symlink_target": ""
}
|
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace patroclus.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
}
}
|
{
"content_hash": "35d770343060554adce68d60c820d618",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 151,
"avg_line_length": 40.92307692307692,
"alnum_prop": 0.5808270676691729,
"repo_name": "ahopper/Patroclus",
"id": "052a9bd56ed190889187294d7cf3fae13e810a67",
"size": "1066",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "patroclus/Properties/Settings.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "192573"
}
],
"symlink_target": ""
}
|
.. _release-notes:
#############
Release Notes
#############
.. _rel-0.7.1:
v0.7.1
==============
* Added instrumentation to ``Task``, using metrics annotations.
* Added ability to blacklist SSL cipher suites.
* Added ``@PATCH`` annotation for Jersey resource methods to indicate use of the HTTP ``PATCH`` method.
* Added support for configurble request retry behavior for ``HttpClientBuilder`` and ``JerseyClientBuilder``.
* Added facility to get the admin HTTP port in ``DropwizardAppTestRule``.
* Added ``ScanningHibernateBundle``, which scans packages for entities, instead of requiring you to add them individually.
* Added facility to invalidate credentials from the ``CachingAuthenticator`` that match a specified ``Predicate``.
* Added a CI build profile for JDK 8 to ensure that Dropwizard builds against the latest version of the JDK.
* Added ``--catalog`` and ``--schema`` options to Liquibase.
* Added ``stackTracePrefix`` configuration option to ``SyslogAppenderFactory`` to configure the pattern prepended to each line in the stack-trace sent to syslog. Defaults to the TAB character, "\t". Note: this is different from the bang prepended to text logs (such as "console", and "file"), as syslog has different conventions for multi-line messages.
* Added ability to validate ``Optional`` values using validation annotations. Such values require the ``@UnwrapValidatedValue`` annotation, in addition to the validations you wish to use.
* Added facility to configure the ``User-Agent`` for ``HttpClient``. Configurable via the ``userAgent`` configuration option.
* Added configurable ``AllowedMethodsFilter``. Configure allowed HTTP methods for both the application and admin connnectors with ``allowedMethods``.
* Added support for specifying a ``CredentialProvider`` for HTTP clients.
* Fixed silently overriding Servlets or ServletFilters; registering a duplicate will now emit a warning.
* Fixed ``SyslogAppenderFactory`` failing when the application name contains a PCRE reserved character (e.g. ``/`` or ``$``).
* Fixed regression causing JMX reporting of metrics to not be enabled by default.
* Fixed transitive dependencies on log4j and extraneous sl4j backends bleeding in to projects. Dropwizard will now enforce that only Logback and slf4j-logback are used everywhere.
* Fixed clients disconnecting before the request has been fully received causing a "500 Internal Server Error" to be generated for the request log. Such situations will now correctly generate a "400 Bad Request", as the request is malformed. Clients will never see these responses, but they matter for logging and metrics that were previously considering this situation as a server error.
* Fixed ``DiscoverableSubtypeResolver`` using the system ``ClassLoader``, instead of the local one.
* Fixed regression causing Liquibase ``--dump`` to fail to dump the database.
* Fixed the CSV metrics reporter failing when the output directory doesn't exist. It will now attempt to create the directory on startup.
* Fixed global frequency for metrics reporters being permenantly overridden by the default frequency for individual reporters.
* Fixed tests failing on Windows due to platform-specific line separators.
* Changed ``DropwizardAppTestRule`` so that it no longer requires a configuration path to operate. When no path is specified, it will now use the applications' default configuration.
* Changed ``Bootstrap`` so that ``getMetricsFactory()`` may now be overridden to provide a custom instance to the framework to use.
* Upgraded to Guava 17.0
Note: this addresses a bug with BloomFilters that is incompatible with pre-17.0 BloomFilters.
* Upgraded to Jackson 2.3.3
* Upgraded to Apache HttpClient 4.3.4
* Upgraded to Metrics 3.0.2
* Upgraded to Logback 1.1.2
* Upgraded to h2 1.4.178
* Upgraded to jDBI 2.55
* Upgraded to Hibernate 5.3.5 Final
* Upgraded to Hibernate Validator 5.1.1 Final
* Upgraded to Mustache 0.8.15
.. _rel-0.7.0:
v0.7.0: Apr 04 2014
===============
* Upgraded to Java 7.
* Moved to the ``io.dropwizard`` group ID and namespace.
* Extracted out a number of reusable libraries: ``dropwizard-configuration``,
``dropwizard-jackson``, ``dropwizard-jersey``, ``dropwizard-jetty``, ``dropwizard-lifecycle``,
``dropwizard-logging``, ``dropwizard-servlets``, ``dropwizard-util``, ``dropwizard-validation``.
* Extracted out various elements of ``Environment`` to separate classes: ``JerseyEnvironment``,
``LifecycleEnvironment``, etc.
* Extracted out ``dropwizard-views-freemarker`` and ``dropwizard-views-mustache``.
``dropwizard-views`` just provides infrastructure now.
* Renamed ``Service`` to ``Application``.
* Added ``dropwizard-forms``, which provides support for multipart MIME entities.
* Added ``dropwizard-spdy``.
* Added ``AppenderFactory``, allowing for arbitrary logging appenders for application and request
logs.
* Added ``ConnectorFactory``, allowing for arbitrary Jetty connectors.
* Added ``ServerFactory``, with multi- and single-connector implementations.
* Added ``ReporterFactory``, for metrics reporters, with Graphite and Ganglia implementations.
* Added ``ConfigurationSourceProvider`` to allow loading configuration files from sources other than
the filesystem.
* Added setuid support. Configure the user/group to run as and soft/hard open file limits in the
``ServerFactory``. To bind to privileged ports (e.g. 80), enable ``startAsRoot`` and set ``user``
and ``group``, then start your application as the root user.
* Added builders for managed executors.
* Added a default ``check`` command, which loads and validates the service configuration.
* Added support for the Jersey HTTP client to ``dropwizard-client``.
* Added Jackson Afterburner support.
* Added support for ``deflate``-encoded requests and responses.
* Added support for HTTP Sessions. Add the annotated parameter to your resource method:
``@Session HttpSession session`` to have the session context injected.
* Added support for a "flash" message to be propagated across requests. Add the annotated parameter
to your resource method: ``@Session Flash message`` to have any existing flash message injected.
* Added support for deserializing Java ``enums`` with fuzzy matching rules (i.e., whitespace
stripping, ``-``/``_`` equivalence, case insensitivity, etc.).
* Added ``HibernateBundle#configure(Configuration)`` for customization of Hibernate configuration.
* Added support for Joda Time ``DateTime`` arguments and results when using JDBI.
* Added configuration option to include Exception stack-traces when logging to syslog. Stack traces
are now excluded by default.
* Added the application name and PID (if detectable) to the beginning of syslog messages, as is the
convention.
* Added ``--migrations-file`` command-line option to ``migrate`` command to supply the migrations
file explicitly.
* Validation errors are now returned as ``application/json`` responses.
* Simplified ``AsyncRequestLog``; now standardized on Jetty 9 NCSA format.
* Renamed ``DatabaseConfiguration`` to ``DataSourceFactory``, and ``ConfigurationStrategy`` to
``DatabaseConfiguration``.
* Changed logging to be asynchronous. Messages are now buffered and batched in-memory before being
delivered to the configured appender(s).
* Changed handling of runtime configuration errors. Will no longer display an Exception stack-trace
and will present a more useful description of the problem, including suggestions when appropriate.
* Changed error handling to depend more heavily on Jersey exception mapping.
* Changed ``dropwizard-db`` to use ``tomcat-jdbc`` instead of ``tomcat-dbcp``.
* Changed default formatting when logging nested Exceptions to display the root-cause first.
* Replaced ``ResourceTest`` with ``ResourceTestRule``, a JUnit ``TestRule``.
* Dropped Scala support.
* Dropped ``ManagedSessionFactory``.
* Dropped ``ObjectMapperFactory``; use ``ObjectMapper`` instead.
* Dropped ``Validator``; use ``javax.validation.Validator`` instead.
* Fixed a shutdown bug in ``dropwizard-migrations``.
* Fixed formatting of "Caused by" lines not being prefixed when logging nested Exceptions.
* Fixed not all available Jersey endpoints were being logged at startup.
* Upgraded to argparse4j 0.4.3.
* Upgraded to Guava 16.0.1.
* Upgraded to Hibernate Validator 5.0.2.
* Upgraded to Jackson 2.3.1.
* Upgraded to JDBI 2.53.
* Upgraded to Jetty 9.0.7.
* Upgraded to Liquibase 3.1.1.
* Upgraded to Logback 1.1.1.
* Upgraded to Metrics 3.0.1.
* Upgraded to Mustache 0.8.14.
* Upgraded to SLF4J 1.7.6.
* Upgraded to Jersey 1.18.
* Upgraded to Apache HttpClient 4.3.2.
* Upgraded to tomcat-jdbc 7.0.50.
* Upgraded to Hibernate 4.3.1.Final.
.. _rel-0.6.2:
v0.6.2: Mar 18 2013
===================
* Added support for non-UTF8 views.
* Fixed an NPE for services in the root package.
* Fixed exception handling in ``TaskServlet``.
* Upgraded to Slf4j 1.7.4.
* Upgraded to Jetty 8.1.10.
* Upgraded to Jersey 1.17.1.
* Upgraded to Jackson 2.1.4.
* Upgraded to Logback 1.0.10.
* Upgraded to Hibernate 4.1.9.
* Upgraded to Hibernate Validator 4.3.1.
* Upgraded to tomcat-dbcp 7.0.37.
* Upgraded to Mustache.java 0.8.10.
* Upgraded to Apache HttpClient 4.2.3.
* Upgraded to Jackson 2.1.3.
* Upgraded to argparse4j 0.4.0.
* Upgraded to Guava 14.0.1.
* Upgraded to Joda Time 2.2.
* Added ``retries`` to ``HttpClientConfiguration``.
* Fixed log formatting for extended stack traces, also now using extended stack traces as the
default.
* Upgraded to FEST Assert 2.0M10.
.. _rel-0.6.1:
v0.6.1: Nov 28 2012
===================
* Fixed incorrect latencies in request logs on Linux.
* Added ability to register multiple ``ServerLifecycleListener`` instances.
.. _rel-0.6.0:
v0.6.0: Nov 26 2012
===================
* Added Hibernate support in ``dropwizard-hibernate``.
* Added Liquibase migrations in ``dropwizard-migrations``.
* Renamed ``http.acceptorThreadCount`` to ``http.acceptorThreads``.
* Renamed ``ssl.keyStorePath`` to ``ssl.keyStore``.
* Dropped ``JerseyClient``. Use Jersey's ``Client`` class instead.
* Moved JDBI support to ``dropwizard-jdbi``.
* Dropped ``Database``. Use JDBI's ``DBI`` class instead.
* Dropped the ``Json`` class. Use ``ObjectMapperFactory`` and ``ObjectMapper`` instead.
* Decoupled JDBI support from tomcat-dbcp.
* Added group support to ``Validator``.
* Moved CLI support to argparse4j.
* Fixed testing support for ``Optional`` resource method parameters.
* Fixed Freemarker support to use its internal encoding map.
* Added property support to ``ResourceTest``.
* Fixed JDBI metrics support for raw SQL queries.
* Dropped Hamcrest matchers in favor of FEST assertions in ``dropwizard-testing``.
* Split ``Environment`` into ``Bootstrap`` and ``Environment``, and broke configuration of each into
``Service``'s ``#initialize(Bootstrap)`` and ``#run(Configuration, Environment)``.
* Combined ``AbstractService`` and ``Service``.
* Trimmed down ``ScalaService``, so be sure to add ``ScalaBundle``.
* Added support for using ``JerseyClientFactory`` without an ``Environment``.
* Dropped Jerkson in favor of Jackson's Scala module.
* Added ``Optional`` support for JDBI.
* Fixed bug in stopping ``AsyncRequestLog``.
* Added ``UUIDParam``.
* Upgraded to Metrics 2.2.0.
* Upgraded to Jetty 8.1.8.
* Upgraded to Mockito 1.9.5.
* Upgraded to tomcat-dbcp 7.0.33.
* Upgraded to Mustache 0.8.8.
* Upgraded to Jersey 1.15.
* Upgraded to Apache HttpClient 4.2.2.
* Upgraded to JDBI 2.41.
* Upgraded to Logback 1.0.7 and SLF4J 1.7.2.
* Upgraded to Guava 13.0.1.
* Upgraded to Jackson 2.1.1.
* Added support for Joda Time.
.. note:: Upgrading to 0.6.0 will require changing your code. First, your ``Service`` subclass will
need to implement both ``#initialize(Bootstrap<T>)`` **and**
``#run(T, Environment)``. What used to be in ``initialize`` should be moved to ``run``.
Second, your representation classes need to be migrated to Jackson 2. For the most part,
this is just changing imports to ``com.fasterxml.jackson.annotation.*``, but there are
`some subtler changes in functionality <http://wiki.fasterxml.com/JacksonUpgradeFrom19To20>`_.
Finally, references to 0.5.x's ``Json``, ``JerseyClient``, or ``JDBI`` classes should be
changed to Jackon's ``ObjectMapper``, Jersey's ``Client``, and JDBI's ``DBI``
respectively.
.. _rel-0.5.1:
v0.5.1: Aug 06 2012
===================
* Fixed logging of managed objects.
* Fixed default file logging configuration.
* Added FEST-Assert as a ``dropwizard-testing`` dependency.
* Added support for Mustache templates (``*.mustache``) to ``dropwizard-views``.
* Added support for arbitrary view renderers.
* Fixed command-line overrides when no configuration file is present.
* Added support for arbitrary ``DnsResolver`` implementations in ``HttpClientFactory``.
* Upgraded to Guava 13.0 final.
* Fixed task path bugs.
* Upgraded to Metrics 2.1.3.
* Added ``JerseyClientConfiguration#compressRequestEntity`` for disabling the compression of request
entities.
* Added ``Environment#scanPackagesForResourcesAndProviders`` for automatically detecting Jersey
providers and resources.
* Added ``Environment#setSessionHandler``.
.. _rel-0.5.0:
v0.5.0: Jul 30 2012
===================
* Upgraded to JDBI 2.38.1.
* Upgraded to Jackson 1.9.9.
* Upgraded to Jersey 1.13.
* Upgraded to Guava 13.0-rc2.
* Upgraded to HttpClient 4.2.1.
* Upgraded to tomcat-dbcp 7.0.29.
* Upgraded to Jetty 8.1.5.
* Improved ``AssetServlet``:
* More accurate ``Last-Modified-At`` timestamps.
* More general asset specification.
* Default filename is now configurable.
* Improved ``JacksonMessageBodyProvider``:
* Now based on Jackson's JAX-RS support.
* Doesn't read or write types annotated with ``@JsonIgnoreType``.
* Added ``@MinSize``, ``@MaxSize``, and ``@SizeRange`` validations.
* Added ``@MinDuration``, ``@MaxDuration``, and ``@DurationRange`` validations.
* Fixed race conditions in Logback initialization routines.
* Fixed ``TaskServlet`` problems with custom context paths.
* Added ``jersey-text-framework-core`` as an explicit dependency of ``dropwizard-testing``. This
helps out some non-Maven build frameworks with bugs in dependency processing.
* Added ``addProvider`` to ``JerseyClientFactory``.
* Fixed ``NullPointerException`` problems with anonymous health check classes.
* Added support for serializing/deserializing ``ByteBuffer`` instances as JSON.
* Added ``supportedProtocols`` to SSL configuration, and disabled SSLv2 by default.
* Added support for ``Optional<Integer>`` query parameters and others.
* Removed ``jersey-freemarker`` dependency from ``dropwizard-views``.
* Fixed missing thread contexts in logging statements.
* Made the configuration file argument for the ``server`` command optional.
* Added support for disabling log rotation.
* Added support for arbitrary KeyStore types.
* Added ``Log.forThisClass()``.
* Made explicit service names optional.
.. _rel-0.4.4:
v0.4.4: Jul 24 2012
===================
* Added support for ``@JsonIgnoreType`` to ``JacksonMessageBodyProvider``.
.. _rel-0.4.3:
v0.4.3: Jun 22 2012
===================
* Re-enable immediate flushing for file and console logging appenders.
.. _rel-0.4.2:
v0.4.2: Jun 20 2012
===================
* Fixed ``JsonProcessingExceptionMapper``. Now returns human-readable error messages for malformed
or invalid JSON as a ``400 Bad Request``. Also handles problems with JSON generation and object
mapping in a developer-friendly way.
.. _rel-0.4.1:
v0.4.1: Jun 19 2012
===================
* Fixed type parameter resolution in for subclasses of subclasses of ``ConfiguredCommand``.
* Upgraded to Jackson 1.9.7.
* Upgraded to Logback 1.0.6, with asynchronous logging.
* Upgraded to Hibernate Validator 4.3.0.
* Upgraded to JDBI 2.34.
* Upgraded to Jetty 8.1.4.
* Added ``logging.console.format``, ``logging.file.format``, and ``logging.syslog.format``
parameters for custom log formats.
* Extended ``ResourceTest`` to allow for enabling/disabling specific Jersey features.
* Made ``Configuration`` serializable as JSON.
* Stopped lumping command-line options in a group in ``Command``.
* Fixed ``java.util.logging`` level changes.
* Upgraded to Apache HttpClient 4.2.
* Improved performance of ``AssetServlet``.
* Added ``withBundle`` to ``ScalaService`` to enable bundle mix-ins.
* Upgraded to SLF4J 1.6.6.
* Enabled configuration-parameterized Jersey containers.
* Upgraded to Jackson Guava 1.9.1, with support for ``Optional``.
* Fixed error message in ``AssetBundle``.
* Fixed ``WebApplicationException``s being thrown by ``JerseyClient``.
.. _rel-0.4.0:
v0.4.0: May 1 2012
==================
* Switched logging from Log4j__ to Logback__.
* Deprecated ``Log#fatal`` methods.
* Deprecated Log4j usage.
* Removed Log4j JSON support.
* Switched file logging to a time-based rotation system with optional GZIP and ZIP compression.
* Replaced ``logging.file.filenamePattern`` with ``logging.file.currentLogFilename`` and
``logging.file.archivedLogFilenamePattern``.
* Replaced ``logging.file.retainedFileCount`` with ``logging.file.archivedFileCount``.
* Moved request logging to use a Logback-backed, time-based rotation system with optional GZIP
and ZIP compression. ``http.requestLog`` now has ``console``, ``file``, and ``syslog``
sections.
* Fixed validation errors for logging configuration.
* Added ``ResourceTest#addProvider(Class<?>)``.
* Added ``ETag`` and ``Last-Modified`` support to ``AssetServlet``.
* Fixed ``off`` logging levels conflicting with YAML's helpfulness.
* Improved ``Optional`` support for some JDBC drivers.
* Added ``ResourceTest#getJson()``.
* Upgraded to Jackson 1.9.6.
* Improved syslog logging.
* Fixed template paths for views.
* Upgraded to Guava 12.0.
* Added support for deserializing ``CacheBuilderSpec`` instances from JSON/YAML.
* Switched ``AssetsBundle`` and servlet to using cache builder specs.
* Switched ``CachingAuthenticator`` to using cache builder specs.
* Malformed JSON request entities now produce a ``400 Bad Request`` instead of a
``500 Server Error`` response.
* Added ``connectionTimeout``, ``maxConnectionsPerRoute``, and ``keepAlive`` to
``HttpClientConfiguration``.
* Added support for using Guava's ``HostAndPort`` in configuration properties.
* Upgraded to tomcat-dbcp 7.0.27.
* Upgraded to JDBI 2.33.2.
* Upgraded to HttpClient 4.1.3.
* Upgraded to Metrics 2.1.2.
* Upgraded to Jetty 8.1.3.
* Added SSL support.
.. __: http://logging.apache.org/log4j/1.2/
.. __: http://logback.qos.ch/
.. _rel-0.3.1:
v0.3.1: Mar 15 2012
===================
* Fixed debug logging levels for ``Log``.
.. _rel-0.3.0:
v0.3.0: Mar 13 2012
===================
* Upgraded to JDBI 2.31.3.
* Upgraded to Jackson 1.9.5.
* Upgraded to Jetty 8.1.2. (Jetty 9 is now the experimental branch. Jetty 8 is just Jetty 7 with
Servlet 3.0 support.)
* Dropped ``dropwizard-templates`` and added ``dropwizard-views`` instead.
* Added ``AbstractParam#getMediaType()``.
* Fixed potential encoding bug in parsing YAML files.
* Fixed a ``NullPointerException`` when getting logging levels via JMX.
* Dropped support for ``@BearerToken`` and added ``dropwizard-auth`` instead.
* Added ``@CacheControl`` for resource methods.
* Added ``AbstractService#getJson()`` for full Jackson customization.
* Fixed formatting of configuration file parsing errors.
* ``ThreadNameFilter`` is now added by default. The thread names Jetty worker threads are set to the
method and URI of the HTTP request they are currently processing.
* Added command-line overriding of configuration parameters via system properties. For example,
``-Ddw.http.port=8090`` will override the configuration file to set ``http.port`` to ``8090``.
* Removed ``ManagedCommand``. It was rarely used and confusing.
* If ``http.adminPort`` is the same as ``http.port``, the admin servlet will be hosted under
``/admin``. This allows Dropwizard applications to be deployed to environments like Heroku, which
require applications to open a single port.
* Added ``http.adminUsername`` and ``http.adminPassword`` to allow for Basic HTTP Authentication
for the admin servlet.
* Upgraded to `Metrics 2.1.1 <http://metrics.codahale.com/about/release-notes/#v2-1-1-mar-13-2012>`_.
.. _rel-0.2.1:
v0.2.1: Feb 24 2012
===================
* Added ``logging.console.timeZone`` and ``logging.file.timeZone`` to control the time zone of
the timestamps in the logs. Defaults to UTC.
* Upgraded to Jetty 7.6.1.
* Upgraded to Jersey 1.12.
* Upgraded to Guava 11.0.2.
* Upgraded to SnakeYAML 1.10.
* Upgraded to tomcat-dbcp 7.0.26.
* Upgraded to Metrics 2.0.3.
.. _rel-0.2.0:
v0.2.0: Feb 15 2012
===================
* Switched to using ``jackson-datatype-guava`` for JSON serialization/deserialization of Guava
types.
* Use ``InstrumentedQueuedThreadPool`` from ``metrics-jetty``.
* Upgraded to Jackson 1.9.4.
* Upgraded to Jetty 7.6.0 final.
* Upgraded to tomcat-dbcp 7.0.25.
* Improved fool-proofing for ``Service`` vs. ``ScalaService``.
* Switched to using Jackson for configuration file parsing. SnakeYAML is used to parse YAML
configuration files to a JSON intermediary form, then Jackson is used to map that to your
``Configuration`` subclass and its fields. Configuration files which don't end in ``.yaml`` or
``.yml`` are treated as JSON.
* Rewrote ``Json`` to no longer be a singleton.
* Converted ``JsonHelpers`` in ``dropwizard-testing`` to use normalized JSON strings to compare
JSON.
* Collapsed ``DatabaseConfiguration``. It's no longer a map of connection names to configuration
objects.
* Changed ``Database`` to use the validation query in ``DatabaseConfiguration`` for its ``#ping()``
method.
* Changed many ``HttpConfiguration`` defaults to match Jetty's defaults.
* Upgraded to JDBI 2.31.2.
* Fixed JAR locations in the CLI usage screens.
* Upgraded to Metrics 2.0.2.
* Added support for all servlet listener types.
* Added ``Log#setLevel(Level)``.
* Added ``Service#getJerseyContainer``, which allows services to fully customize the Jersey
container instance.
* Added the ``http.contextParameters`` configuration parameter.
.. _rel-0.1.3:
v0.1.3: Jan 19 2012
===================
* Upgraded to Guava 11.0.1.
* Fixed logging in ``ServerCommand``. For the last time.
* Switched to using the instrumented connectors from ``metrics-jetty``. This allows for much
lower-level metrics about your service, including whether or not your thread pools are overloaded.
* Added FindBugs to the build process.
* Added ``ResourceTest`` to ``dropwizard-testing``, which uses the Jersey Test Framework to provide
full testing of resources.
* Upgraded to Jetty 7.6.0.RC4.
* Decoupled URIs and resource paths in ``AssetServlet`` and ``AssetsBundle``.
* Added ``rootPath`` to ``Configuration``. It allows you to serve Jersey assets off a specific path
(e.g., ``/resources/*`` vs ``/*``).
* ``AssetServlet`` now looks for ``index.htm`` when handling requests for the root URI.
* Upgraded to Metrics 2.0.0-RC0.
.. _rel-0.1.2:
v0.1.2: Jan 07 2012
===================
* All Jersey resource methods annotated with ``@Timed``, ``@Metered``, or ``@ExceptionMetered`` are
now instrumented via ``metrics-jersey``.
* Now licensed under Apache License 2.0.
* Upgraded to Jetty 7.6.0.RC3.
* Upgraded to Metrics 2.0.0-BETA19.
* Fixed logging in ``ServerCommand``.
* Made ``ServerCommand#run()`` non-``final``.
.. _rel-0.1.1:
v0.1.1: Dec 28 2011
===================
* Fixed ``ManagedCommand`` to provide access to the ``Environment``, among other things.
* Made ``JerseyClient``'s thread pool managed.
* Improved ease of use for ``Duration`` and ``Size`` configuration parameters.
* Upgraded to Mockito 1.9.0.
* Upgraded to Jetty 7.6.0.RC2.
* Removed single-arg constructors for ``ConfiguredCommand``.
* Added ``Log``, a simple front-end for logging.
.. _rel-0.1.0:
v0.1.0: Dec 21 2011
===================
* Initial release
|
{
"content_hash": "fa44fed9d6c45a60d7c5d90d748e73c0",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 388,
"avg_line_length": 46.67056530214425,
"alnum_prop": 0.7290117784646228,
"repo_name": "boundary/dropwizard",
"id": "3f82b23a6bf84aab5c4ac6b0c45f011574df91bd",
"size": "23942",
"binary": false,
"copies": "1",
"ref": "refs/heads/boundary/patch/0.7.1",
"path": "docs/source/about/release-notes.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "501"
},
{
"name": "Java",
"bytes": "902274"
}
],
"symlink_target": ""
}
|
\documentclass[12pt]{article}
\title{Open \LaTeX{} Studio - ${pom.version}}
\date{}
\author{Sebastian Brudzinski}
\begin{document}
\maketitle
\section{Welcome}
Thanks for trying out the Open \LaTeX{} Studio - an Open Source \LaTeX{} editor. Please note, that the
application is in constant development. You might encounter some bugs or inconveniences. If that happens,
we would be extremely thankful, for letting us know about encountered problems. Any ideas or new feature
requests are welcome as well! Please see the project page at
https://github.com/sebbrudzinski/Open-LaTeX-Studio
or contact us via mailing list: open-latex-studio@googlegroups.com
\section{Features}
New features and fixes are added to the project on a regular basis. Currently, the application provides
a nifty code editor, with syntax highlight, basic code completion and live preview. You can also save your tex
documents or generate PDF documents from your \LaTeX{} code. For the application to work, it may be necessary to
set the path of the LaTeX distribution. You can do so in the Tools / Options window. If you cannot see anything in the preview window, it most likely means that
the path is not set properly. The application also provides integration with Dropbox.
\section{Contribute}
Are you a developer and would like to contribute to the project? Take a look at the link provided in section one,
and simply find something to work on. The issue tracker is constantly updated with user feedback. You can also
find some useful information on the project wiki.
\end{document}
|
{
"content_hash": "d9a3c25e63463567bb4d00d0f9ea5e17",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 162,
"avg_line_length": 61.61538461538461,
"alnum_prop": 0.7734082397003745,
"repo_name": "sebbrudzinski/Open-LaTeX-Studio",
"id": "5314b0cfef0c75917b5d845f189750031b8502a4",
"size": "1602",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "OpenLaTeXStudio/Editor/src/main/resources/openlatexstudio/welcome.tex",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Common Workflow Language",
"bytes": "14941"
},
{
"name": "Java",
"bytes": "211625"
},
{
"name": "TeX",
"bytes": "48638"
}
],
"symlink_target": ""
}
|
module ClioClient
module Api
class Relationship < Base
include ClioClient::Api::Listable
include ClioClient::Api::Findable
include ClioClient::Api::Crudable
private
def data_klass(*args)
ClioClient::Relationship
end
def end_point_url; 'relationships'; end
def plural_resource; 'relationships'; end
def singular_resource; 'relationship'; end
end
end
end
|
{
"content_hash": "0e8879d362323e8511f1cc46f6030dc1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 20.136363636363637,
"alnum_prop": 0.6410835214446953,
"repo_name": "clio/clio_client",
"id": "976f8448cfa6ccb14dc5284a8e96564df3ba9b0f",
"size": "443",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/clio_client/api/relationship.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "81676"
}
],
"symlink_target": ""
}
|
<?php
namespace Trinity\Utils\Config;
/**
* Interface for configuration loaders.
*
* @author Tomasz Jędrzejewski
* @copyright Invenzzia Group <http://www.invenzzia.org/> and contributors.
* @license http://www.invenzzia.org/license/new-bsd New BSD License
*/
interface Loader
{
/**
* The read options are returned as a plain list that must be converted
* by the configuration object for a tree.
*/
const PLAIN_LIST = 0;
/**
* The option list is returned in a nested form.
*/
const NESTED_LIST = 1;
/**
* Loads the configuration for the specified environment.
*
* @param string $environment The environment name.
* @return array
*/
public function loadConfig($environment);
/**
* Returns the type of the output returned by loadConfig() in order
* to provide a proper deploying strategy.
*
* @return int
*/
public function getOutputType();
} // end Loader;
|
{
"content_hash": "d9faf76061e35f357ecbe3bdb09c401c",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 22.575,
"alnum_prop": 0.6954595791805094,
"repo_name": "zyxist/Trinity",
"id": "d2d8112d1c6e63c1f14fef1e230f141dc549f7b8",
"size": "1274",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Trinity/Utils/Config/Loader.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "258903"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "d600aa7817901b47a2d7939ec75044b5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "925c12eeb89599d8d9b8737666abe2ad76051378",
"size": "180",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Cucurbitales/Cucurbitaceae/Momordica/Momordica glauca/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package org.apache.hadoop.hbase.io.hfile.bucket;
import java.util.Comparator;
import java.util.Map;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.hadoop.hbase.io.hfile.BlockCacheKey;
import org.apache.hbase.thirdparty.com.google.common.collect.MinMaxPriorityQueue;
/**
* A memory-bound queue that will grow until an element brings total size larger
* than maxSize. From then on, only entries that are sorted larger than the
* smallest current entry will be inserted/replaced.
*
* <p>
* Use this when you want to find the largest elements (according to their
* ordering, not their heap size) that consume as close to the specified maxSize
* as possible. Default behavior is to grow just above rather than just below
* specified max.
*/
@InterfaceAudience.Private
public class CachedEntryQueue {
private static final Comparator<Map.Entry<BlockCacheKey, BucketEntry>> COMPARATOR =
(a, b) -> BucketEntry.COMPARATOR.compare(a.getValue(), b.getValue());
private MinMaxPriorityQueue<Map.Entry<BlockCacheKey, BucketEntry>> queue;
private long cacheSize;
private long maxSize;
/**
* @param maxSize the target size of elements in the queue
* @param blockSize expected average size of blocks
*/
public CachedEntryQueue(long maxSize, long blockSize) {
int initialSize = (int) (maxSize / blockSize);
if (initialSize == 0) {
initialSize++;
}
queue = MinMaxPriorityQueue.orderedBy(COMPARATOR).expectedSize(initialSize).create();
cacheSize = 0;
this.maxSize = maxSize;
}
/**
* Attempt to add the specified entry to this queue.
* <p>
* If the queue is smaller than the max size, or if the specified element is
* ordered after the smallest element in the queue, the element will be added
* to the queue. Otherwise, there is no side effect of this call.
* @param entry a bucket entry with key to try to add to the queue
*/
public void add(Map.Entry<BlockCacheKey, BucketEntry> entry) {
if (cacheSize < maxSize) {
queue.add(entry);
cacheSize += entry.getValue().getLength();
} else {
BucketEntry head = queue.peek().getValue();
if (BucketEntry.COMPARATOR.compare(entry.getValue(), head) > 0) {
cacheSize += entry.getValue().getLength();
cacheSize -= head.getLength();
if (cacheSize > maxSize) {
queue.poll();
} else {
cacheSize += head.getLength();
}
queue.add(entry);
}
}
}
/**
* @return The next element in this queue, or {@code null} if the queue is
* empty.
*/
public Map.Entry<BlockCacheKey, BucketEntry> poll() {
return queue.poll();
}
/**
* @return The last element in this queue, or {@code null} if the queue is
* empty.
*/
public Map.Entry<BlockCacheKey, BucketEntry> pollLast() {
return queue.pollLast();
}
}
|
{
"content_hash": "33a04b51d9da35098611b1d713c172d4",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 89,
"avg_line_length": 31.813186813186814,
"alnum_prop": 0.681174438687392,
"repo_name": "ChinmaySKulkarni/hbase",
"id": "d8c677c8fb9cfb131cacb4ad73848e12be342d8c",
"size": "3738",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/bucket/CachedEntryQueue.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "25330"
},
{
"name": "C",
"bytes": "28534"
},
{
"name": "C++",
"bytes": "56085"
},
{
"name": "CMake",
"bytes": "13186"
},
{
"name": "CSS",
"bytes": "37063"
},
{
"name": "Dockerfile",
"bytes": "4842"
},
{
"name": "Groovy",
"bytes": "37692"
},
{
"name": "HTML",
"bytes": "17275"
},
{
"name": "Java",
"bytes": "35158950"
},
{
"name": "JavaScript",
"bytes": "2694"
},
{
"name": "Makefile",
"bytes": "1359"
},
{
"name": "PHP",
"bytes": "8385"
},
{
"name": "Perl",
"bytes": "383739"
},
{
"name": "Python",
"bytes": "90226"
},
{
"name": "Ruby",
"bytes": "664576"
},
{
"name": "Shell",
"bytes": "254684"
},
{
"name": "Thrift",
"bytes": "52351"
},
{
"name": "XSLT",
"bytes": "6764"
}
],
"symlink_target": ""
}
|
.. index:: Reference Architectures: Networking HA Details
.. _Close_look_networking_HA:
HA deployment for Networking
----------------------------
Fuel leverages
`Pacemaker resource agents <http://www.linux-ha.org/wiki/Resource_agents>`_
in order to deploy highly avaiable networking for OpenStack environments.
Virtual IP addresses deployment details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Starting from the Fuel 5.0 release, HAProxy service and network interfaces
running virtual IP addresses reside in separate `haproxy`
network namespace. Using a separate namespace forces Linux kernel to treat
connections from OpenStack services to HAProxy as remote ones, this ensures
reliable failover of established connections when the management IP address
migrates to another node. In order to achieve this, resource agent scripts
for `ocf:fuel:ns_haproxy` and `ocf:fuel:ns_IPaddr2` were hardened with
network namespaces support.
Successfull failover of public VIP address requires controller nodes
to perform active checking of the public gateway. Fuel configures
the Pacemaker resource `clone_ping_vip__public` that makes public VIP to
migrate in case the controller can't ping its public gateway.
TCP keepalive configuration details
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Failover sometimes ends up with dead connections. The detection
of such connections requires additional assistance from the Linux kernel.
To speed up the detection process from the default of two hours to a more
acceptable 3 minutes, Fuel adjusts kernel parameters for
`net.ipv4.tcp_keepalive_time`, `net.ipv4.tcp_keepalive_intvl`,
`net.ipv4.tcp_keepalive_probes` and `net.ipv4.tcp_retries2`.
|
{
"content_hash": "4347812d114715b59d78fd8da632f82d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 75,
"avg_line_length": 45.08108108108108,
"alnum_prop": 0.7643884892086331,
"repo_name": "ogelbukh/fuel-docs",
"id": "d9862c2d2687586c3f0d7a145cb0c6c04ba4920e",
"size": "1668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pages/reference-architecture/network-concepts/6011-ha-networking.rst",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "13104"
},
{
"name": "HTML",
"bytes": "48200"
},
{
"name": "JavaScript",
"bytes": "9903"
},
{
"name": "Makefile",
"bytes": "6759"
},
{
"name": "Python",
"bytes": "15576"
},
{
"name": "Shell",
"bytes": "2863"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8"?>
<labels>
<label index="date">Data</label>
<label index="time">Ora</label>
<label index="hrs">h</label>
<label index="month.january">Gennaio</label>
<label index="month.february">Febbraio</label>
<label index="month.march">Marzo</label>
<label index="month.april">Aprile</label>
<label index="month.may">Maggio</label>
<label index="month.june">Giugno</label>
<label index="month.july">Luglio</label>
<label index="month.august">Agosto</label>
<label index="month.september">Settembre</label>
<label index="month.october">Ottobre</label>
<label index="month.november">Novembre</label>
<label index="month.december">Dicembre</label>
<label index="weekday.monday">Lunedì</label>
<label index="weekday.tuesday">Martedì</label>
<label index="weekday.wednesday">Mercoledì</label>
<label index="weekday.thursday">Giovedì</label>
<label index="weekday.friday">Venerdì</label>
<label index="weekday.saturday">Sabato</label>
<label index="weekday.sunday">Domenica</label>
<label index="weekday.mon">Lun</label>
<label index="weekday.tue">Mar</label>
<label index="weekday.wed">Mer</label>
<label index="weekday.thu">Gio</label>
<label index="weekday.fri">Ven</label>
<label index="weekday.sat">Sab</label>
<label index="weekday.sun">Dom</label>
<label index="time.second">Secondo</label>
<label index="time.seconds">Secondi</label>
<label index="time.minute">Minuto</label>
<label index="time.minutes">Minuti</label>
<label index="time.hour">Ora</label>
<label index="time.hours">Ore</label>
<label index="day">Giorno</label>
<label index="days">Giorni</label>
<label index="week">Settimana</label>
<label index="weeks">Settimane</label>
<label index="month">Mese</label>
<label index="months">Mesi</label>
<label index="year">Anno</label>
<label index="years">Anni</label>
<label index="weeknumber">Numero settimana</label>
<label index="weeknumberAbbr">Settimana</label>
<label index="daily">Giornaliero</label>
<label index="weekly">Settimanale</label>
<label index="monthly">Mensile</label>
<label index="yearly">Annuale</label>
<label index="today">Oggi</label>
<label index="dyndate.today">Oggi</label>
<label index="dyndate.tomorrow">Domani</label>
<label index="dyndate.dayaftertomorrow">Dopodomani</label>
<label index="dyndate.yesterday">Ieri</label>
<label index="dyndate.daybeforeyesterday">L'altroieri</label>
<label index="dyndate.currentweek">Settimana corrente</label>
<label index="dyndate.nextweek">Prossima settimana</label>
<label index="dyndate.lastweek">Settimana precedente</label>
<label index="dyndate.currentyear">Anno corrente</label>
<label index="dyndate.lastyear">Anno precedente</label>
<label index="dyndate.nextyear">Prossima anno</label>
</labels>
|
{
"content_hash": "eac8ea825de92174a0ea03d568bf2ea8",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 62,
"avg_line_length": 43.296875,
"alnum_prop": 0.7318657524359437,
"repo_name": "JoAutomation/todo-for-you",
"id": "d84bd3412e7918de88d7e32d682d9d653b9cbc50",
"size": "2776",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/locale/it_IT/date.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "302967"
},
{
"name": "JavaScript",
"bytes": "1840518"
},
{
"name": "PHP",
"bytes": "4705200"
}
],
"symlink_target": ""
}
|
/*******************************
Standard
*******************************/
.ui.grid {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
padding: 0em;
}
/*----------------------
Remove Gutters
-----------------------*/
.ui.grid {
margin-top: -1rem;
margin-bottom: -1rem;
margin-left: -1rem;
margin-right: -1rem;
}
.ui.relaxed.grid {
margin-left: -1.5rem;
margin-right: -1.5rem;
}
.ui[class*="very relaxed"].grid {
margin-left: -2.5rem;
margin-right: -2.5rem;
}
/* Preserve Rows Spacing on Consecutive Grids */
.ui.grid + .grid {
margin-top: 1rem;
}
/*-------------------
Columns
--------------------*/
/* Standard 16 column */
.ui.grid > .column:not(.row),
.ui.grid > .row > .column {
position: relative;
display: inline-block;
width: 6.25%;
padding-left: 1rem;
padding-right: 1rem;
vertical-align: top;
}
.ui.grid > * {
padding-left: 1rem;
padding-right: 1rem;
}
/*-------------------
Rows
--------------------*/
.ui.grid > .row {
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: horizontal;
-webkit-box-direction: normal;
-webkit-flex-direction: row;
-ms-flex-direction: row;
flex-direction: row;
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-pack: inherit;
-webkit-justify-content: inherit;
-ms-flex-pack: inherit;
justify-content: inherit;
-webkit-box-align: stretch;
-webkit-align-items: stretch;
-ms-flex-align: stretch;
align-items: stretch;
width: 100% !important;
padding: 0rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
/*-------------------
Columns
--------------------*/
/* Vertical padding when no rows */
.ui.grid > .column:not(.row) {
padding-top: 1rem;
padding-bottom: 1rem;
}
.ui.grid > .row > .column {
margin-top: 0em;
margin-bottom: 0em;
}
/*-------------------
Content
--------------------*/
.ui.grid > .row > img,
.ui.grid > .row > .column > img {
max-width: 100%;
}
/*-------------------
Loose Coupling
--------------------*/
/* Collapse Margin on Consecutive Grid */
.ui.grid > .ui.grid:first-child {
margin-top: 0em;
}
.ui.grid > .ui.grid:last-child {
margin-bottom: 0em;
}
/* Segment inside Aligned Grid */
.ui.grid .aligned.row > .column > .segment:not(.compact):not(.attached),
.ui.aligned.grid .column > .segment:not(.compact):not(.attached) {
width: 100%;
}
/* Align Dividers with Gutter */
.ui.grid .row + .ui.divider {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
margin: 1rem 1rem;
}
.ui.grid .column + .ui.vertical.divider {
height: calc(50% - 1rem );
}
/* Remove Border on Last Horizontal Segment */
.ui.grid > .row > .column:last-child > .horizontal.segment,
.ui.grid > .column:last-child > .horizontal.segment {
box-shadow: none;
}
/*******************************
Variations
*******************************/
/*-----------------------
Page Grid
-------------------------*/
@media only screen and (max-width: 767px) {
.ui.page.grid {
width: auto;
padding-left: 0em;
padding-right: 0em;
margin-left: 0em;
margin-right: 0em;
}
}
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 2em;
padding-right: 2em;
}
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 3%;
padding-right: 3%;
}
}
@media only screen and (min-width: 1200px) and (max-width: 1919px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 15%;
padding-right: 15%;
}
}
@media only screen and (min-width: 1920px) {
.ui.page.grid {
width: auto;
margin-left: 0em;
margin-right: 0em;
padding-left: 23%;
padding-right: 23%;
}
}
/*-------------------
Column Count
--------------------*/
/* Assume full width with one column */
.ui.grid > .column:only-child,
.ui.grid > .row > .column:only-child {
width: 100%;
}
/* Grid Based */
.ui[class*="one column"].grid > .row > .column,
.ui[class*="one column"].grid > .column:not(.row) {
width: 100%;
}
.ui[class*="two column"].grid > .row > .column,
.ui[class*="two column"].grid > .column:not(.row) {
width: 50%;
}
.ui[class*="three column"].grid > .row > .column,
.ui[class*="three column"].grid > .column:not(.row) {
width: 33.33333333%;
}
.ui[class*="four column"].grid > .row > .column,
.ui[class*="four column"].grid > .column:not(.row) {
width: 25%;
}
.ui[class*="five column"].grid > .row > .column,
.ui[class*="five column"].grid > .column:not(.row) {
width: 20%;
}
.ui[class*="six column"].grid > .row > .column,
.ui[class*="six column"].grid > .column:not(.row) {
width: 16.66666667%;
}
.ui[class*="seven column"].grid > .row > .column,
.ui[class*="seven column"].grid > .column:not(.row) {
width: 14.28571429%;
}
.ui[class*="eight column"].grid > .row > .column,
.ui[class*="eight column"].grid > .column:not(.row) {
width: 12.5%;
}
.ui[class*="nine column"].grid > .row > .column,
.ui[class*="nine column"].grid > .column:not(.row) {
width: 11.11111111%;
}
.ui[class*="ten column"].grid > .row > .column,
.ui[class*="ten column"].grid > .column:not(.row) {
width: 10%;
}
.ui[class*="eleven column"].grid > .row > .column,
.ui[class*="eleven column"].grid > .column:not(.row) {
width: 9.09090909%;
}
.ui[class*="twelve column"].grid > .row > .column,
.ui[class*="twelve column"].grid > .column:not(.row) {
width: 8.33333333%;
}
.ui[class*="thirteen column"].grid > .row > .column,
.ui[class*="thirteen column"].grid > .column:not(.row) {
width: 7.69230769%;
}
.ui[class*="fourteen column"].grid > .row > .column,
.ui[class*="fourteen column"].grid > .column:not(.row) {
width: 7.14285714%;
}
.ui[class*="fifteen column"].grid > .row > .column,
.ui[class*="fifteen column"].grid > .column:not(.row) {
width: 6.66666667%;
}
.ui[class*="sixteen column"].grid > .row > .column,
.ui[class*="sixteen column"].grid > .column:not(.row) {
width: 6.25%;
}
/* Row Based Overrides */
.ui.grid > [class*="one column"].row > .column {
width: 100% !important;
}
.ui.grid > [class*="two column"].row > .column {
width: 50% !important;
}
.ui.grid > [class*="three column"].row > .column {
width: 33.33333333% !important;
}
.ui.grid > [class*="four column"].row > .column {
width: 25% !important;
}
.ui.grid > [class*="five column"].row > .column {
width: 20% !important;
}
.ui.grid > [class*="six column"].row > .column {
width: 16.66666667% !important;
}
.ui.grid > [class*="seven column"].row > .column {
width: 14.28571429% !important;
}
.ui.grid > [class*="eight column"].row > .column {
width: 12.5% !important;
}
.ui.grid > [class*="nine column"].row > .column {
width: 11.11111111% !important;
}
.ui.grid > [class*="ten column"].row > .column {
width: 10% !important;
}
.ui.grid > [class*="eleven column"].row > .column {
width: 9.09090909% !important;
}
.ui.grid > [class*="twelve column"].row > .column {
width: 8.33333333% !important;
}
.ui.grid > [class*="thirteen column"].row > .column {
width: 7.69230769% !important;
}
.ui.grid > [class*="fourteen column"].row > .column {
width: 7.14285714% !important;
}
.ui.grid > [class*="fifteen column"].row > .column {
width: 6.66666667% !important;
}
.ui.grid > [class*="sixteen column"].row > .column {
width: 6.25% !important;
}
/* Celled Page */
.ui.celled.page.grid {
box-shadow: none;
}
/*-------------------
Column Width
--------------------*/
/* Sizing Combinations */
.ui.grid > .row > [class*="one wide"].column,
.ui.grid > .column.row > [class*="one wide"].column,
.ui.grid > [class*="one wide"].column,
.ui.column.grid > [class*="one wide"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide"].column,
.ui.grid > .column.row > [class*="two wide"].column,
.ui.grid > [class*="two wide"].column,
.ui.column.grid > [class*="two wide"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide"].column,
.ui.grid > .column.row > [class*="three wide"].column,
.ui.grid > [class*="three wide"].column,
.ui.column.grid > [class*="three wide"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide"].column,
.ui.grid > .column.row > [class*="four wide"].column,
.ui.grid > [class*="four wide"].column,
.ui.column.grid > [class*="four wide"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide"].column,
.ui.grid > .column.row > [class*="five wide"].column,
.ui.grid > [class*="five wide"].column,
.ui.column.grid > [class*="five wide"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide"].column,
.ui.grid > .column.row > [class*="six wide"].column,
.ui.grid > [class*="six wide"].column,
.ui.column.grid > [class*="six wide"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide"].column,
.ui.grid > .column.row > [class*="seven wide"].column,
.ui.grid > [class*="seven wide"].column,
.ui.column.grid > [class*="seven wide"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide"].column,
.ui.grid > .column.row > [class*="eight wide"].column,
.ui.grid > [class*="eight wide"].column,
.ui.column.grid > [class*="eight wide"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide"].column,
.ui.grid > .column.row > [class*="nine wide"].column,
.ui.grid > [class*="nine wide"].column,
.ui.column.grid > [class*="nine wide"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide"].column,
.ui.grid > .column.row > [class*="ten wide"].column,
.ui.grid > [class*="ten wide"].column,
.ui.column.grid > [class*="ten wide"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide"].column,
.ui.grid > .column.row > [class*="eleven wide"].column,
.ui.grid > [class*="eleven wide"].column,
.ui.column.grid > [class*="eleven wide"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide"].column,
.ui.grid > .column.row > [class*="twelve wide"].column,
.ui.grid > [class*="twelve wide"].column,
.ui.column.grid > [class*="twelve wide"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide"].column,
.ui.grid > .column.row > [class*="thirteen wide"].column,
.ui.grid > [class*="thirteen wide"].column,
.ui.column.grid > [class*="thirteen wide"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide"].column,
.ui.grid > .column.row > [class*="fourteen wide"].column,
.ui.grid > [class*="fourteen wide"].column,
.ui.column.grid > [class*="fourteen wide"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide"].column,
.ui.grid > .column.row > [class*="fifteen wide"].column,
.ui.grid > [class*="fifteen wide"].column,
.ui.column.grid > [class*="fifteen wide"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide"].column,
.ui.grid > .column.row > [class*="sixteen wide"].column,
.ui.grid > [class*="sixteen wide"].column,
.ui.column.grid > [class*="sixteen wide"].column {
width: 100% !important;
}
/*----------------------
Width per Device
-----------------------*/
/* Mobile Sizing Combinations */
@media only screen and (min-width: 320px) and (max-width: 767px) {
.ui.grid > .row > [class*="one wide mobile"].column,
.ui.grid > .column.row > [class*="one wide mobile"].column,
.ui.grid > [class*="one wide mobile"].column,
.ui.column.grid > [class*="one wide mobile"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide mobile"].column,
.ui.grid > .column.row > [class*="two wide mobile"].column,
.ui.grid > [class*="two wide mobile"].column,
.ui.column.grid > [class*="two wide mobile"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide mobile"].column,
.ui.grid > .column.row > [class*="three wide mobile"].column,
.ui.grid > [class*="three wide mobile"].column,
.ui.column.grid > [class*="three wide mobile"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide mobile"].column,
.ui.grid > .column.row > [class*="four wide mobile"].column,
.ui.grid > [class*="four wide mobile"].column,
.ui.column.grid > [class*="four wide mobile"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide mobile"].column,
.ui.grid > .column.row > [class*="five wide mobile"].column,
.ui.grid > [class*="five wide mobile"].column,
.ui.column.grid > [class*="five wide mobile"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide mobile"].column,
.ui.grid > .column.row > [class*="six wide mobile"].column,
.ui.grid > [class*="six wide mobile"].column,
.ui.column.grid > [class*="six wide mobile"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide mobile"].column,
.ui.grid > .column.row > [class*="seven wide mobile"].column,
.ui.grid > [class*="seven wide mobile"].column,
.ui.column.grid > [class*="seven wide mobile"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide mobile"].column,
.ui.grid > .column.row > [class*="eight wide mobile"].column,
.ui.grid > [class*="eight wide mobile"].column,
.ui.column.grid > [class*="eight wide mobile"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide mobile"].column,
.ui.grid > .column.row > [class*="nine wide mobile"].column,
.ui.grid > [class*="nine wide mobile"].column,
.ui.column.grid > [class*="nine wide mobile"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide mobile"].column,
.ui.grid > .column.row > [class*="ten wide mobile"].column,
.ui.grid > [class*="ten wide mobile"].column,
.ui.column.grid > [class*="ten wide mobile"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide mobile"].column,
.ui.grid > .column.row > [class*="eleven wide mobile"].column,
.ui.grid > [class*="eleven wide mobile"].column,
.ui.column.grid > [class*="eleven wide mobile"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide mobile"].column,
.ui.grid > .column.row > [class*="twelve wide mobile"].column,
.ui.grid > [class*="twelve wide mobile"].column,
.ui.column.grid > [class*="twelve wide mobile"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide mobile"].column,
.ui.grid > .column.row > [class*="thirteen wide mobile"].column,
.ui.grid > [class*="thirteen wide mobile"].column,
.ui.column.grid > [class*="thirteen wide mobile"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide mobile"].column,
.ui.grid > .column.row > [class*="fourteen wide mobile"].column,
.ui.grid > [class*="fourteen wide mobile"].column,
.ui.column.grid > [class*="fourteen wide mobile"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide mobile"].column,
.ui.grid > .column.row > [class*="fifteen wide mobile"].column,
.ui.grid > [class*="fifteen wide mobile"].column,
.ui.column.grid > [class*="fifteen wide mobile"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide mobile"].column,
.ui.grid > .column.row > [class*="sixteen wide mobile"].column,
.ui.grid > [class*="sixteen wide mobile"].column,
.ui.column.grid > [class*="sixteen wide mobile"].column {
width: 100% !important;
}
}
/* Tablet Sizing Combinations */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.grid > .row > [class*="one wide tablet"].column,
.ui.grid > .column.row > [class*="one wide tablet"].column,
.ui.grid > [class*="one wide tablet"].column,
.ui.column.grid > [class*="one wide tablet"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide tablet"].column,
.ui.grid > .column.row > [class*="two wide tablet"].column,
.ui.grid > [class*="two wide tablet"].column,
.ui.column.grid > [class*="two wide tablet"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide tablet"].column,
.ui.grid > .column.row > [class*="three wide tablet"].column,
.ui.grid > [class*="three wide tablet"].column,
.ui.column.grid > [class*="three wide tablet"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide tablet"].column,
.ui.grid > .column.row > [class*="four wide tablet"].column,
.ui.grid > [class*="four wide tablet"].column,
.ui.column.grid > [class*="four wide tablet"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide tablet"].column,
.ui.grid > .column.row > [class*="five wide tablet"].column,
.ui.grid > [class*="five wide tablet"].column,
.ui.column.grid > [class*="five wide tablet"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide tablet"].column,
.ui.grid > .column.row > [class*="six wide tablet"].column,
.ui.grid > [class*="six wide tablet"].column,
.ui.column.grid > [class*="six wide tablet"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide tablet"].column,
.ui.grid > .column.row > [class*="seven wide tablet"].column,
.ui.grid > [class*="seven wide tablet"].column,
.ui.column.grid > [class*="seven wide tablet"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide tablet"].column,
.ui.grid > .column.row > [class*="eight wide tablet"].column,
.ui.grid > [class*="eight wide tablet"].column,
.ui.column.grid > [class*="eight wide tablet"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide tablet"].column,
.ui.grid > .column.row > [class*="nine wide tablet"].column,
.ui.grid > [class*="nine wide tablet"].column,
.ui.column.grid > [class*="nine wide tablet"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide tablet"].column,
.ui.grid > .column.row > [class*="ten wide tablet"].column,
.ui.grid > [class*="ten wide tablet"].column,
.ui.column.grid > [class*="ten wide tablet"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide tablet"].column,
.ui.grid > .column.row > [class*="eleven wide tablet"].column,
.ui.grid > [class*="eleven wide tablet"].column,
.ui.column.grid > [class*="eleven wide tablet"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide tablet"].column,
.ui.grid > .column.row > [class*="twelve wide tablet"].column,
.ui.grid > [class*="twelve wide tablet"].column,
.ui.column.grid > [class*="twelve wide tablet"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide tablet"].column,
.ui.grid > .column.row > [class*="thirteen wide tablet"].column,
.ui.grid > [class*="thirteen wide tablet"].column,
.ui.column.grid > [class*="thirteen wide tablet"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide tablet"].column,
.ui.grid > .column.row > [class*="fourteen wide tablet"].column,
.ui.grid > [class*="fourteen wide tablet"].column,
.ui.column.grid > [class*="fourteen wide tablet"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide tablet"].column,
.ui.grid > .column.row > [class*="fifteen wide tablet"].column,
.ui.grid > [class*="fifteen wide tablet"].column,
.ui.column.grid > [class*="fifteen wide tablet"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide tablet"].column,
.ui.grid > .column.row > [class*="sixteen wide tablet"].column,
.ui.grid > [class*="sixteen wide tablet"].column,
.ui.column.grid > [class*="sixteen wide tablet"].column {
width: 100% !important;
}
}
/* Computer/Desktop Sizing Combinations */
@media only screen and (min-width: 992px) {
.ui.grid > .row > [class*="one wide computer"].column,
.ui.grid > .column.row > [class*="one wide computer"].column,
.ui.grid > [class*="one wide computer"].column,
.ui.column.grid > [class*="one wide computer"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide computer"].column,
.ui.grid > .column.row > [class*="two wide computer"].column,
.ui.grid > [class*="two wide computer"].column,
.ui.column.grid > [class*="two wide computer"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide computer"].column,
.ui.grid > .column.row > [class*="three wide computer"].column,
.ui.grid > [class*="three wide computer"].column,
.ui.column.grid > [class*="three wide computer"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide computer"].column,
.ui.grid > .column.row > [class*="four wide computer"].column,
.ui.grid > [class*="four wide computer"].column,
.ui.column.grid > [class*="four wide computer"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide computer"].column,
.ui.grid > .column.row > [class*="five wide computer"].column,
.ui.grid > [class*="five wide computer"].column,
.ui.column.grid > [class*="five wide computer"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide computer"].column,
.ui.grid > .column.row > [class*="six wide computer"].column,
.ui.grid > [class*="six wide computer"].column,
.ui.column.grid > [class*="six wide computer"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide computer"].column,
.ui.grid > .column.row > [class*="seven wide computer"].column,
.ui.grid > [class*="seven wide computer"].column,
.ui.column.grid > [class*="seven wide computer"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide computer"].column,
.ui.grid > .column.row > [class*="eight wide computer"].column,
.ui.grid > [class*="eight wide computer"].column,
.ui.column.grid > [class*="eight wide computer"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide computer"].column,
.ui.grid > .column.row > [class*="nine wide computer"].column,
.ui.grid > [class*="nine wide computer"].column,
.ui.column.grid > [class*="nine wide computer"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide computer"].column,
.ui.grid > .column.row > [class*="ten wide computer"].column,
.ui.grid > [class*="ten wide computer"].column,
.ui.column.grid > [class*="ten wide computer"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide computer"].column,
.ui.grid > .column.row > [class*="eleven wide computer"].column,
.ui.grid > [class*="eleven wide computer"].column,
.ui.column.grid > [class*="eleven wide computer"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide computer"].column,
.ui.grid > .column.row > [class*="twelve wide computer"].column,
.ui.grid > [class*="twelve wide computer"].column,
.ui.column.grid > [class*="twelve wide computer"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide computer"].column,
.ui.grid > .column.row > [class*="thirteen wide computer"].column,
.ui.grid > [class*="thirteen wide computer"].column,
.ui.column.grid > [class*="thirteen wide computer"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide computer"].column,
.ui.grid > .column.row > [class*="fourteen wide computer"].column,
.ui.grid > [class*="fourteen wide computer"].column,
.ui.column.grid > [class*="fourteen wide computer"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide computer"].column,
.ui.grid > .column.row > [class*="fifteen wide computer"].column,
.ui.grid > [class*="fifteen wide computer"].column,
.ui.column.grid > [class*="fifteen wide computer"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide computer"].column,
.ui.grid > .column.row > [class*="sixteen wide computer"].column,
.ui.grid > [class*="sixteen wide computer"].column,
.ui.column.grid > [class*="sixteen wide computer"].column {
width: 100% !important;
}
}
/* Large Monitor Sizing Combinations */
@media only screen and (min-width: 1200px) and (max-width: 1919px) {
.ui.grid > .row > [class*="one wide large screen"].column,
.ui.grid > .column.row > [class*="one wide large screen"].column,
.ui.grid > [class*="one wide large screen"].column,
.ui.column.grid > [class*="one wide large screen"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide large screen"].column,
.ui.grid > .column.row > [class*="two wide large screen"].column,
.ui.grid > [class*="two wide large screen"].column,
.ui.column.grid > [class*="two wide large screen"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide large screen"].column,
.ui.grid > .column.row > [class*="three wide large screen"].column,
.ui.grid > [class*="three wide large screen"].column,
.ui.column.grid > [class*="three wide large screen"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide large screen"].column,
.ui.grid > .column.row > [class*="four wide large screen"].column,
.ui.grid > [class*="four wide large screen"].column,
.ui.column.grid > [class*="four wide large screen"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide large screen"].column,
.ui.grid > .column.row > [class*="five wide large screen"].column,
.ui.grid > [class*="five wide large screen"].column,
.ui.column.grid > [class*="five wide large screen"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide large screen"].column,
.ui.grid > .column.row > [class*="six wide large screen"].column,
.ui.grid > [class*="six wide large screen"].column,
.ui.column.grid > [class*="six wide large screen"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide large screen"].column,
.ui.grid > .column.row > [class*="seven wide large screen"].column,
.ui.grid > [class*="seven wide large screen"].column,
.ui.column.grid > [class*="seven wide large screen"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide large screen"].column,
.ui.grid > .column.row > [class*="eight wide large screen"].column,
.ui.grid > [class*="eight wide large screen"].column,
.ui.column.grid > [class*="eight wide large screen"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide large screen"].column,
.ui.grid > .column.row > [class*="nine wide large screen"].column,
.ui.grid > [class*="nine wide large screen"].column,
.ui.column.grid > [class*="nine wide large screen"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide large screen"].column,
.ui.grid > .column.row > [class*="ten wide large screen"].column,
.ui.grid > [class*="ten wide large screen"].column,
.ui.column.grid > [class*="ten wide large screen"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide large screen"].column,
.ui.grid > .column.row > [class*="eleven wide large screen"].column,
.ui.grid > [class*="eleven wide large screen"].column,
.ui.column.grid > [class*="eleven wide large screen"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide large screen"].column,
.ui.grid > .column.row > [class*="twelve wide large screen"].column,
.ui.grid > [class*="twelve wide large screen"].column,
.ui.column.grid > [class*="twelve wide large screen"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide large screen"].column,
.ui.grid > .column.row > [class*="thirteen wide large screen"].column,
.ui.grid > [class*="thirteen wide large screen"].column,
.ui.column.grid > [class*="thirteen wide large screen"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide large screen"].column,
.ui.grid > .column.row > [class*="fourteen wide large screen"].column,
.ui.grid > [class*="fourteen wide large screen"].column,
.ui.column.grid > [class*="fourteen wide large screen"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide large screen"].column,
.ui.grid > .column.row > [class*="fifteen wide large screen"].column,
.ui.grid > [class*="fifteen wide large screen"].column,
.ui.column.grid > [class*="fifteen wide large screen"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide large screen"].column,
.ui.grid > .column.row > [class*="sixteen wide large screen"].column,
.ui.grid > [class*="sixteen wide large screen"].column,
.ui.column.grid > [class*="sixteen wide large screen"].column {
width: 100% !important;
}
}
/* Widescreen Sizing Combinations */
@media only screen and (min-width: 1920px) {
.ui.grid > .row > [class*="one wide widescreen"].column,
.ui.grid > .column.row > [class*="one wide widescreen"].column,
.ui.grid > [class*="one wide widescreen"].column,
.ui.column.grid > [class*="one wide widescreen"].column {
width: 6.25% !important;
}
.ui.grid > .row > [class*="two wide widescreen"].column,
.ui.grid > .column.row > [class*="two wide widescreen"].column,
.ui.grid > [class*="two wide widescreen"].column,
.ui.column.grid > [class*="two wide widescreen"].column {
width: 12.5% !important;
}
.ui.grid > .row > [class*="three wide widescreen"].column,
.ui.grid > .column.row > [class*="three wide widescreen"].column,
.ui.grid > [class*="three wide widescreen"].column,
.ui.column.grid > [class*="three wide widescreen"].column {
width: 18.75% !important;
}
.ui.grid > .row > [class*="four wide widescreen"].column,
.ui.grid > .column.row > [class*="four wide widescreen"].column,
.ui.grid > [class*="four wide widescreen"].column,
.ui.column.grid > [class*="four wide widescreen"].column {
width: 25% !important;
}
.ui.grid > .row > [class*="five wide widescreen"].column,
.ui.grid > .column.row > [class*="five wide widescreen"].column,
.ui.grid > [class*="five wide widescreen"].column,
.ui.column.grid > [class*="five wide widescreen"].column {
width: 31.25% !important;
}
.ui.grid > .row > [class*="six wide widescreen"].column,
.ui.grid > .column.row > [class*="six wide widescreen"].column,
.ui.grid > [class*="six wide widescreen"].column,
.ui.column.grid > [class*="six wide widescreen"].column {
width: 37.5% !important;
}
.ui.grid > .row > [class*="seven wide widescreen"].column,
.ui.grid > .column.row > [class*="seven wide widescreen"].column,
.ui.grid > [class*="seven wide widescreen"].column,
.ui.column.grid > [class*="seven wide widescreen"].column {
width: 43.75% !important;
}
.ui.grid > .row > [class*="eight wide widescreen"].column,
.ui.grid > .column.row > [class*="eight wide widescreen"].column,
.ui.grid > [class*="eight wide widescreen"].column,
.ui.column.grid > [class*="eight wide widescreen"].column {
width: 50% !important;
}
.ui.grid > .row > [class*="nine wide widescreen"].column,
.ui.grid > .column.row > [class*="nine wide widescreen"].column,
.ui.grid > [class*="nine wide widescreen"].column,
.ui.column.grid > [class*="nine wide widescreen"].column {
width: 56.25% !important;
}
.ui.grid > .row > [class*="ten wide widescreen"].column,
.ui.grid > .column.row > [class*="ten wide widescreen"].column,
.ui.grid > [class*="ten wide widescreen"].column,
.ui.column.grid > [class*="ten wide widescreen"].column {
width: 62.5% !important;
}
.ui.grid > .row > [class*="eleven wide widescreen"].column,
.ui.grid > .column.row > [class*="eleven wide widescreen"].column,
.ui.grid > [class*="eleven wide widescreen"].column,
.ui.column.grid > [class*="eleven wide widescreen"].column {
width: 68.75% !important;
}
.ui.grid > .row > [class*="twelve wide widescreen"].column,
.ui.grid > .column.row > [class*="twelve wide widescreen"].column,
.ui.grid > [class*="twelve wide widescreen"].column,
.ui.column.grid > [class*="twelve wide widescreen"].column {
width: 75% !important;
}
.ui.grid > .row > [class*="thirteen wide widescreen"].column,
.ui.grid > .column.row > [class*="thirteen wide widescreen"].column,
.ui.grid > [class*="thirteen wide widescreen"].column,
.ui.column.grid > [class*="thirteen wide widescreen"].column {
width: 81.25% !important;
}
.ui.grid > .row > [class*="fourteen wide widescreen"].column,
.ui.grid > .column.row > [class*="fourteen wide widescreen"].column,
.ui.grid > [class*="fourteen wide widescreen"].column,
.ui.column.grid > [class*="fourteen wide widescreen"].column {
width: 87.5% !important;
}
.ui.grid > .row > [class*="fifteen wide widescreen"].column,
.ui.grid > .column.row > [class*="fifteen wide widescreen"].column,
.ui.grid > [class*="fifteen wide widescreen"].column,
.ui.column.grid > [class*="fifteen wide widescreen"].column {
width: 93.75% !important;
}
.ui.grid > .row > [class*="sixteen wide widescreen"].column,
.ui.grid > .column.row > [class*="sixteen wide widescreen"].column,
.ui.grid > [class*="sixteen wide widescreen"].column,
.ui.column.grid > [class*="sixteen wide widescreen"].column {
width: 100% !important;
}
}
/*----------------------
Centered
-----------------------*/
.ui.centered.grid,
.ui.centered.grid > .row,
.ui.grid > .centered.row {
text-align: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
.ui.centered.grid > .column:not(.aligned):not(.row),
.ui.centered.grid > .row > .column:not(.aligned),
.ui.grid .centered.row > .column:not(.aligned) {
text-align: left;
}
.ui.grid > .centered.column,
.ui.grid > .row > .centered.column {
display: block;
margin-left: auto;
margin-right: auto;
}
/*----------------------
Relaxed
-----------------------*/
.ui.relaxed.grid > .column:not(.row),
.ui.relaxed.grid > .row > .column,
.ui.grid > .relaxed.row > .column {
padding-left: 1.5rem;
padding-right: 1.5rem;
}
.ui[class*="very relaxed"].grid > .column:not(.row),
.ui[class*="very relaxed"].grid > .row > .column,
.ui.grid > [class*="very relaxed"].row > .column {
padding-left: 2.5rem;
padding-right: 2.5rem;
}
/* Coupling with UI Divider */
.ui.relaxed.grid .row + .ui.divider,
.ui.grid .relaxed.row + .ui.divider {
margin-left: 1.5rem;
margin-right: 1.5rem;
}
.ui[class*="very relaxed"].grid .row + .ui.divider,
.ui.grid [class*="very relaxed"].row + .ui.divider {
margin-left: 2.5rem;
margin-right: 2.5rem;
}
/*----------------------
Padded
-----------------------*/
.ui.padded.grid:not(.vertically):not(.horizontally) {
margin: 0em !important;
}
[class*="horizontally padded"].ui.grid {
margin-left: 0em !important;
margin-right: 0em !important;
}
[class*="vertically padded"].ui.grid {
margin-top: 0em !important;
margin-bottom: 0em !important;
}
/*----------------------
"Floated"
-----------------------*/
.ui.grid [class*="left floated"].column {
margin-right: auto;
}
.ui.grid [class*="right floated"].column {
margin-left: auto;
}
/*----------------------
Divided
-----------------------*/
.ui.divided.grid:not([class*="vertically divided"]) > .column:not(.row),
.ui.divided.grid:not([class*="vertically divided"]) > .row > .column {
box-shadow: -1px 0px 0px 0px rgba(34, 36, 38, 0.15);
}
/* Swap from padding to margin on columns to have dividers align */
.ui[class*="vertically divided"].grid > .column:not(.row),
.ui[class*="vertically divided"].grid > .row > .column {
margin-top: 1rem;
margin-bottom: 1rem;
padding-top: 0rem;
padding-bottom: 0rem;
}
.ui[class*="vertically divided"].grid > .row {
margin-top: 0em;
margin-bottom: 0em;
}
/* No divider on first column on row */
.ui.divided.grid:not([class*="vertically divided"]) > .column:first-child,
.ui.divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: none;
}
/* Divided Row */
.ui.grid > .divided.row > .column {
box-shadow: -1px 0px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui.grid > .divided.row > .column:first-child {
box-shadow: none;
}
/* Vertically Divided */
.ui[class*="vertically divided"].grid > .row {
position: relative;
}
.ui[class*="vertically divided"].grid > .row:before {
position: absolute;
content: "";
top: 0em;
left: 0px;
width: calc(100% - 2rem );
height: 1px;
margin: 0% 1rem;
box-shadow: 0px -1px 0px 0px rgba(34, 36, 38, 0.15);
}
/* Padded Horizontally Divided */
[class*="horizontally padded"].ui.divided.grid,
.ui.padded.divided.grid:not(.vertically):not(.horizontally) {
width: 100%;
}
/* First Row Vertically Divided */
.ui[class*="vertically divided"].grid > .row:first-child:before {
box-shadow: none;
}
/* Inverted Divided */
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .column:not(.row),
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .row > .column {
box-shadow: -1px 0px 0px 0px rgba(255, 255, 255, 0.1);
}
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .column:not(.row):first-child,
.ui.inverted.divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: none;
}
.ui.inverted[class*="vertically divided"].grid > .row:before {
box-shadow: 0px -1px 0px 0px rgba(255, 255, 255, 0.1);
}
/* Relaxed */
.ui.relaxed[class*="vertically divided"].grid > .row:before {
margin-left: 1.5rem;
margin-right: 1.5rem;
width: calc(100% - 3rem );
}
.ui[class*="very relaxed"][class*="vertically divided"].grid > .row:before {
margin-left: 5rem;
margin-right: 5rem;
width: calc(100% - 5rem );
}
/*----------------------
Celled
-----------------------*/
.ui.celled.grid {
width: 100%;
margin: 1em 0em;
box-shadow: 0px 0px 0px 1px #D4D4D5;
}
.ui.celled.grid > .row {
width: 100% !important;
margin: 0em;
padding: 0em;
box-shadow: 0px -1px 0px 0px #D4D4D5;
}
.ui.celled.grid > .column:not(.row),
.ui.celled.grid > .row > .column {
box-shadow: -1px 0px 0px 0px #D4D4D5;
}
.ui.celled.grid > .column:first-child,
.ui.celled.grid > .row > .column:first-child {
box-shadow: none;
}
.ui.celled.grid > .column:not(.row),
.ui.celled.grid > .row > .column {
padding: 1em;
}
.ui.relaxed.celled.grid > .column:not(.row),
.ui.relaxed.celled.grid > .row > .column {
padding: 1.5em;
}
.ui[class*="very relaxed"].celled.grid > .column:not(.row),
.ui[class*="very relaxed"].celled.grid > .row > .column {
padding: 2em;
}
/* Internally Celled */
.ui[class*="internally celled"].grid {
box-shadow: none;
margin: 0em;
}
.ui[class*="internally celled"].grid > .row:first-child {
box-shadow: none;
}
.ui[class*="internally celled"].grid > .row > .column:first-child {
box-shadow: none;
}
/*----------------------
Vertically Aligned
-----------------------*/
/* Top Aligned */
.ui[class*="top aligned"].grid > .column:not(.row),
.ui[class*="top aligned"].grid > .row > .column,
.ui.grid > [class*="top aligned"].row > .column,
.ui.grid > [class*="top aligned"].column:not(.row),
.ui.grid > .row > [class*="top aligned"].column {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
vertical-align: top;
-webkit-align-self: flex-start !important;
-ms-flex-item-align: start !important;
align-self: flex-start !important;
}
/* Middle Aligned */
.ui[class*="middle aligned"].grid > .column:not(.row),
.ui[class*="middle aligned"].grid > .row > .column,
.ui.grid > [class*="middle aligned"].row > .column,
.ui.grid > [class*="middle aligned"].column:not(.row),
.ui.grid > .row > [class*="middle aligned"].column {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
vertical-align: middle;
-webkit-align-self: center !important;
-ms-flex-item-align: center !important;
align-self: center !important;
}
/* Bottom Aligned */
.ui[class*="bottom aligned"].grid > .column:not(.row),
.ui[class*="bottom aligned"].grid > .row > .column,
.ui.grid > [class*="bottom aligned"].row > .column,
.ui.grid > [class*="bottom aligned"].column:not(.row),
.ui.grid > .row > [class*="bottom aligned"].column {
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
vertical-align: bottom;
-webkit-align-self: flex-end !important;
-ms-flex-item-align: end !important;
align-self: flex-end !important;
}
/* Stretched */
.ui.stretched.grid > .row > .column,
.ui.stretched.grid > .column,
.ui.grid > .stretched.row > .column,
.ui.grid > .stretched.column:not(.row),
.ui.grid > .row > .stretched.column {
display: -webkit-inline-box !important;
display: -webkit-inline-flex !important;
display: -ms-inline-flexbox !important;
display: inline-flex !important;
-webkit-align-self: stretch;
-ms-flex-item-align: stretch;
align-self: stretch;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
}
.ui.stretched.grid > .row > .column > *,
.ui.stretched.grid > .column > *,
.ui.grid > .stretched.row > .column > *,
.ui.grid > .stretched.column:not(.row) > *,
.ui.grid > .row > .stretched.column > * {
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
/*----------------------
Horizontally Centered
-----------------------*/
/* Left Aligned */
.ui[class*="left aligned"].grid > .column,
.ui[class*="left aligned"].grid > .row > .column,
.ui.grid > [class*="left aligned"].row > .column,
.ui.grid > [class*="left aligned"].column.column,
.ui.grid > .row > [class*="left aligned"].column {
text-align: left;
-webkit-align-self: inherit;
-ms-flex-item-align: inherit;
align-self: inherit;
}
/* Center Aligned */
.ui[class*="center aligned"].grid > .column,
.ui[class*="center aligned"].grid > .row > .column,
.ui.grid > [class*="center aligned"].row > .column,
.ui.grid > [class*="center aligned"].column.column,
.ui.grid > .row > [class*="center aligned"].column {
text-align: center;
-webkit-align-self: inherit;
-ms-flex-item-align: inherit;
align-self: inherit;
}
.ui[class*="center aligned"].grid {
-webkit-box-pack: center;
-webkit-justify-content: center;
-ms-flex-pack: center;
justify-content: center;
}
/* Right Aligned */
.ui[class*="right aligned"].grid > .column,
.ui[class*="right aligned"].grid > .row > .column,
.ui.grid > [class*="right aligned"].row > .column,
.ui.grid > [class*="right aligned"].column.column,
.ui.grid > .row > [class*="right aligned"].column {
text-align: right;
-webkit-align-self: inherit;
-ms-flex-item-align: inherit;
align-self: inherit;
}
/* Justified */
.ui.justified.grid > .column,
.ui.justified.grid > .row > .column,
.ui.grid > .justified.row > .column,
.ui.grid > .justified.column.column,
.ui.grid > .row > .justified.column {
text-align: justify;
-webkit-hyphens: auto;
-moz-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
/*----------------------
Colored
-----------------------*/
.ui.grid > .row > .red.column,
.ui.grid > .row > .orange.column,
.ui.grid > .row > .yellow.column,
.ui.grid > .row > .olive.column,
.ui.grid > .row > .green.column,
.ui.grid > .row > .teal.column,
.ui.grid > .row > .blue.column,
.ui.grid > .row > .violet.column,
.ui.grid > .row > .purple.column,
.ui.grid > .row > .pink.column,
.ui.grid > .row > .brown.column,
.ui.grid > .row > .grey.column,
.ui.grid > .row > .black.column {
margin-top: -1rem;
margin-bottom: -1rem;
padding-top: 1rem;
padding-bottom: 1rem;
}
/* Red */
.ui.grid > .red.row,
.ui.grid > .red.column,
.ui.grid > .row > .red.column {
background-color: #E87722 !important;
color: #FFFFFF;
}
/* Orange */
.ui.grid > .orange.row,
.ui.grid > .orange.column,
.ui.grid > .row > .orange.column {
background-color: #EAAA00 !important;
color: #FFFFFF;
}
/* Yellow */
.ui.grid > .yellow.row,
.ui.grid > .yellow.column,
.ui.grid > .row > .yellow.column {
background-color: #FEDD00 !important;
color: #FFFFFF;
}
/* Olive */
.ui.grid > .olive.row,
.ui.grid > .olive.column,
.ui.grid > .row > .olive.column {
background-color: #64A70B !important;
color: #FFFFFF;
}
/* Green */
.ui.grid > .green.row,
.ui.grid > .green.column,
.ui.grid > .row > .green.column {
background-color: #50A684 !important;
color: #FFFFFF;
}
/* Teal */
.ui.grid > .teal.row,
.ui.grid > .teal.column,
.ui.grid > .row > .teal.column {
background-color: #0093B2 !important;
color: #FFFFFF;
}
/* Blue */
.ui.grid > .blue.row,
.ui.grid > .blue.column,
.ui.grid > .row > .blue.column {
background-color: #64A70B !important;
color: #FFFFFF;
}
/* Violet */
.ui.grid > .violet.row,
.ui.grid > .violet.column,
.ui.grid > .row > .violet.column {
background-color: #EE82EE !important;
color: #FFFFFF;
}
/* Purple */
.ui.grid > .purple.row,
.ui.grid > .purple.column,
.ui.grid > .row > .purple.column {
background-color: #B413EC !important;
color: #FFFFFF;
}
/* Pink */
.ui.grid > .pink.row,
.ui.grid > .pink.column,
.ui.grid > .row > .pink.column {
background-color: #FF1493 !important;
color: #FFFFFF;
}
/* Brown */
.ui.grid > .brown.row,
.ui.grid > .brown.column,
.ui.grid > .row > .brown.column {
background-color: #A52A2A !important;
color: #FFFFFF;
}
/* Grey */
.ui.grid > .grey.row,
.ui.grid > .grey.column,
.ui.grid > .row > .grey.column {
background-color: #A0A0A0 !important;
color: #FFFFFF;
}
/* Black */
.ui.grid > .black.row,
.ui.grid > .black.column,
.ui.grid > .row > .black.column {
background-color: #000000 !important;
color: #FFFFFF;
}
/*----------------------
Equal Width
-----------------------*/
.ui[class*="equal width"].grid > .column:not(.row),
.ui[class*="equal width"].grid > .row > .column,
.ui.grid > [class*="equal width"].row > .column {
display: inline-block;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
-ms-flex-positive: 1;
flex-grow: 1;
}
.ui[class*="equal width"].grid > .wide.column,
.ui[class*="equal width"].grid > .row > .wide.column,
.ui.grid > [class*="equal width"].row > .wide.column {
-webkit-box-flex: 0;
-webkit-flex-grow: 0;
-ms-flex-positive: 0;
flex-grow: 0;
}
/*----------------------
Reverse
-----------------------*/
/* Mobile */
@media only screen and (max-width: 767px) {
.ui[class*="mobile reversed"].grid,
.ui[class*="mobile reversed"].grid > .row,
.ui.grid > [class*="mobile reversed"].row {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-webkit-flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.ui[class*="mobile vertically reversed"].grid,
.ui.stackable[class*="mobile reversed"] {
-webkit-box-orient: vertical;
-webkit-box-direction: reverse;
-webkit-flex-direction: column-reverse;
-ms-flex-direction: column-reverse;
flex-direction: column-reverse;
}
/* Divided Reversed */
.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"]) > .column:first-child,
.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"]) > .column:last-child,
.ui[class*="mobile reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:last-child {
box-shadow: none;
}
/* Vertically Divided Reversed */
.ui.grid[class*="vertically divided"][class*="mobile vertically reversed"] > .row:first-child:before {
box-shadow: 0px -1px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui.grid[class*="vertically divided"][class*="mobile vertically reversed"] > .row:last-child:before {
box-shadow: none;
}
/* Celled Reversed */
.ui[class*="mobile reversed"].celled.grid > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px #D4D4D5;
}
.ui[class*="mobile reversed"].celled.grid > .row > .column:last-child {
box-shadow: none;
}
}
/* Tablet */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui[class*="tablet reversed"].grid,
.ui[class*="tablet reversed"].grid > .row,
.ui.grid > [class*="tablet reversed"].row {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-webkit-flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.ui[class*="tablet vertically reversed"].grid {
-webkit-box-orient: vertical;
-webkit-box-direction: reverse;
-webkit-flex-direction: column-reverse;
-ms-flex-direction: column-reverse;
flex-direction: column-reverse;
}
/* Divided Reversed */
.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"]) > .column:first-child,
.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"]) > .column:last-child,
.ui[class*="tablet reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:last-child {
box-shadow: none;
}
/* Vertically Divided Reversed */
.ui.grid[class*="vertically divided"][class*="tablet vertically reversed"] > .row:first-child:before {
box-shadow: 0px -1px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui.grid[class*="vertically divided"][class*="tablet vertically reversed"] > .row:last-child:before {
box-shadow: none;
}
/* Celled Reversed */
.ui[class*="tablet reversed"].celled.grid > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px #D4D4D5;
}
.ui[class*="tablet reversed"].celled.grid > .row > .column:last-child {
box-shadow: none;
}
}
/* Computer */
@media only screen and (min-width: 992px) {
.ui[class*="computer reversed"].grid,
.ui[class*="computer reversed"].grid > .row,
.ui.grid > [class*="computer reversed"].row {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-webkit-flex-direction: row-reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.ui[class*="computer vertically reversed"].grid {
-webkit-box-orient: vertical;
-webkit-box-direction: reverse;
-webkit-flex-direction: column-reverse;
-ms-flex-direction: column-reverse;
flex-direction: column-reverse;
}
/* Divided Reversed */
.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"]) > .column:first-child,
.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"]) > .column:last-child,
.ui[class*="computer reversed"].divided.grid:not([class*="vertically divided"]) > .row > .column:last-child {
box-shadow: none;
}
/* Vertically Divided Reversed */
.ui.grid[class*="vertically divided"][class*="computer vertically reversed"] > .row:first-child:before {
box-shadow: 0px -1px 0px 0px rgba(34, 36, 38, 0.15);
}
.ui.grid[class*="vertically divided"][class*="computer vertically reversed"] > .row:last-child:before {
box-shadow: none;
}
/* Celled Reversed */
.ui[class*="computer reversed"].celled.grid > .row > .column:first-child {
box-shadow: -1px 0px 0px 0px #D4D4D5;
}
.ui[class*="computer reversed"].celled.grid > .row > .column:last-child {
box-shadow: none;
}
}
/*-------------------
Doubling
--------------------*/
/* Tablet Only */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui.doubling.grid {
width: auto;
}
.ui.grid > .doubling.row,
.ui.doubling.grid > .row {
margin: 0em !important;
padding: 0em !important;
}
.ui.grid > .doubling.row > .column,
.ui.doubling.grid > .row > .column {
display: inline-block !important;
padding-top: 1rem !important;
padding-bottom: 1rem !important;
box-shadow: none !important;
margin: 0em;
}
.ui[class*="two column"].doubling.grid > .row > .column,
.ui[class*="two column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="two column"].doubling.row.row > .column {
width: 100% !important;
}
.ui[class*="three column"].doubling.grid > .row > .column,
.ui[class*="three column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="three column"].doubling.row.row > .column {
width: 50% !important;
}
.ui[class*="four column"].doubling.grid > .row > .column,
.ui[class*="four column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="four column"].doubling.row.row > .column {
width: 50% !important;
}
.ui[class*="five column"].doubling.grid > .row > .column,
.ui[class*="five column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="five column"].doubling.row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="six column"].doubling.grid > .row > .column,
.ui[class*="six column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="six column"].doubling.row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="seven column"].doubling.grid > .row > .column,
.ui[class*="seven column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="seven column"].doubling.row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="eight column"].doubling.grid > .row > .column,
.ui[class*="eight column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="eight column"].doubling.row.row > .column {
width: 25% !important;
}
.ui[class*="nine column"].doubling.grid > .row > .column,
.ui[class*="nine column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="nine column"].doubling.row.row > .column {
width: 25% !important;
}
.ui[class*="ten column"].doubling.grid > .row > .column,
.ui[class*="ten column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="ten column"].doubling.row.row > .column {
width: 20% !important;
}
.ui[class*="eleven column"].doubling.grid > .row > .column,
.ui[class*="eleven column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="eleven column"].doubling.row.row > .column {
width: 20% !important;
}
.ui[class*="twelve column"].doubling.grid > .row > .column,
.ui[class*="twelve column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="twelve column"].doubling.row.row > .column {
width: 16.66666667% !important;
}
.ui[class*="thirteen column"].doubling.grid > .row > .column,
.ui[class*="thirteen column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="thirteen column"].doubling.row.row > .column {
width: 16.66666667% !important;
}
.ui[class*="fourteen column"].doubling.grid > .row > .column,
.ui[class*="fourteen column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="fourteen column"].doubling.row.row > .column {
width: 14.28571429% !important;
}
.ui[class*="fifteen column"].doubling.grid > .row > .column,
.ui[class*="fifteen column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="fifteen column"].doubling.row.row > .column {
width: 14.28571429% !important;
}
.ui[class*="sixteen column"].doubling.grid > .row > .column,
.ui[class*="sixteen column"].doubling.grid > .column:not(.row),
.ui.grid > [class*="sixteen column"].doubling.row.row > .column {
width: 12.5% !important;
}
}
/* Mobily Only */
@media only screen and (max-width: 767px) {
.ui.grid > .doubling.row,
.ui.doubling.grid > .row {
margin: 0em !important;
padding: 0em !important;
}
.ui.grid > .doubling.row > .column,
.ui.doubling.grid > .row > .column {
padding-top: 1rem !important;
padding-bottom: 1rem !important;
margin: 0em !important;
box-shadow: none !important;
}
.ui[class*="two column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="two column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="two column"].doubling:not(.stackable).row.row > .column {
width: 100% !important;
}
.ui[class*="three column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="three column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="three column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="four column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="four column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="four column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="five column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="five column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="five column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="six column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="six column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="six column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="seven column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="seven column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="seven column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="eight column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="eight column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="eight column"].doubling:not(.stackable).row.row > .column {
width: 50% !important;
}
.ui[class*="nine column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="nine column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="nine column"].doubling:not(.stackable).row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="ten column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="ten column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="ten column"].doubling:not(.stackable).row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="eleven column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="eleven column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="eleven column"].doubling:not(.stackable).row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="twelve column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="twelve column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="twelve column"].doubling:not(.stackable).row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="thirteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="thirteen column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="thirteen column"].doubling:not(.stackable).row.row > .column {
width: 33.33333333% !important;
}
.ui[class*="fourteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="fourteen column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="fourteen column"].doubling:not(.stackable).row.row > .column {
width: 25% !important;
}
.ui[class*="fifteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="fifteen column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="fifteen column"].doubling:not(.stackable).row.row > .column {
width: 25% !important;
}
.ui[class*="sixteen column"].doubling:not(.stackable).grid > .row > .column,
.ui[class*="sixteen column"].doubling:not(.stackable).grid > .column:not(.row),
.ui.grid > [class*="sixteen column"].doubling:not(.stackable).row.row > .column {
width: 25% !important;
}
}
/*-------------------
Stackable
--------------------*/
@media only screen and (max-width: 767px) {
.ui.stackable.grid {
width: auto;
margin-left: 0em !important;
margin-right: 0em !important;
}
.ui.stackable.grid > .row > .wide.column,
.ui.stackable.grid > .wide.column,
.ui.stackable.grid > .column.grid > .column,
.ui.stackable.grid > .column.row > .column,
.ui.stackable.grid > .row > .column,
.ui.stackable.grid > .column:not(.row),
.ui.grid > .stackable.stackable.row > .column {
width: 100% !important;
margin: 0em 0em !important;
box-shadow: none !important;
padding: 1rem 1rem !important;
}
.ui.stackable.grid:not(.vertically) > .row {
margin: 0em;
padding: 0em;
}
/* Coupling */
.ui.container > .ui.stackable.grid > .column,
.ui.container > .ui.stackable.grid > .row > .column {
padding-left: 0em !important;
padding-right: 0em !important;
}
/* Don't pad inside segment or nested grid */
.ui.grid .ui.stackable.grid,
.ui.segment:not(.vertical) .ui.stackable.page.grid {
margin-left: -1rem !important;
margin-right: -1rem !important;
}
/* Divided Stackable */
.ui.stackable.divided.grid > .row:first-child > .column:first-child,
.ui.stackable.celled.grid > .row:first-child > .column:first-child,
.ui.stackable.divided.grid > .column:not(.row):first-child,
.ui.stackable.celled.grid > .column:not(.row):first-child {
border-top: none !important;
}
.ui.inverted.stackable.celled.grid > .column:not(.row),
.ui.inverted.stackable.divided.grid > .column:not(.row),
.ui.inverted.stackable.celled.grid > .row > .column,
.ui.inverted.stackable.divided.grid > .row > .column {
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.ui.stackable.celled.grid > .column:not(.row),
.ui.stackable.divided:not(.vertically).grid > .column:not(.row),
.ui.stackable.celled.grid > .row > .column,
.ui.stackable.divided:not(.vertically).grid > .row > .column {
border-top: 1px solid rgba(34, 36, 38, 0.15);
box-shadow: none !important;
padding-top: 2rem !important;
padding-bottom: 2rem !important;
}
.ui.stackable.celled.grid > .row {
box-shadow: none !important;
}
.ui.stackable.divided:not(.vertically).grid > .column:not(.row),
.ui.stackable.divided:not(.vertically).grid > .row > .column {
padding-left: 0em !important;
padding-right: 0em !important;
}
}
/*----------------------
Only (Device)
-----------------------*/
/* These include arbitrary class repetitions for forced specificity */
/* Mobile Only Hide */
@media only screen and (max-width: 767px) {
.ui[class*="tablet only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="tablet only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="computer only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="computer only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="computer only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="computer only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="large screen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="large screen only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="widescreen only"].column:not(.mobile) {
display: none !important;
}
}
/* Tablet Only Hide */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.ui[class*="mobile only"].grid.grid.grid:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.tablet),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.tablet),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.tablet) {
display: none !important;
}
.ui[class*="computer only"].grid.grid.grid:not(.tablet),
.ui.grid.grid.grid > [class*="computer only"].row:not(.tablet),
.ui.grid.grid.grid > [class*="computer only"].column:not(.tablet),
.ui.grid.grid.grid > .row > [class*="computer only"].column:not(.tablet) {
display: none !important;
}
.ui[class*="large screen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="large screen only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="widescreen only"].column:not(.mobile) {
display: none !important;
}
}
/* Computer Only Hide */
@media only screen and (min-width: 992px) and (max-width: 1199px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
.ui[class*="tablet only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].row:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.computer) {
display: none !important;
}
.ui[class*="large screen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="large screen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="large screen only"].column:not(.mobile) {
display: none !important;
}
.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="widescreen only"].column:not(.mobile) {
display: none !important;
}
}
/* Large Screen Only Hide */
@media only screen and (min-width: 1200px) and (max-width: 1919px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
.ui[class*="tablet only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].row:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.computer) {
display: none !important;
}
.ui[class*="widescreen only"].grid.grid.grid:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].row:not(.mobile),
.ui.grid.grid.grid > [class*="widescreen only"].column:not(.mobile),
.ui.grid.grid.grid > .row > [class*="widescreen only"].column:not(.mobile) {
display: none !important;
}
}
/* Widescreen Only Hide */
@media only screen and (min-width: 1920px) {
.ui[class*="mobile only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].row:not(.computer),
.ui.grid.grid.grid > [class*="mobile only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="mobile only"].column:not(.computer) {
display: none !important;
}
.ui[class*="tablet only"].grid.grid.grid:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].row:not(.computer),
.ui.grid.grid.grid > [class*="tablet only"].column:not(.computer),
.ui.grid.grid.grid > .row > [class*="tablet only"].column:not(.computer) {
display: none !important;
}
}
/*******************************
Theme Overrides
*******************************/
/*******************************
Site Overrides
*******************************/
|
{
"content_hash": "940dcf59d349f3320c1d5dcc594a8510",
"timestamp": "",
"source": "github",
"line_count": 2019,
"max_line_length": 112,
"avg_line_length": 34.551263001485886,
"alnum_prop": 0.6238478189194225,
"repo_name": "LiberisLabs/LiberisLabs.github.io",
"id": "c1835d23c73f12c9444b1bd6a3b778478a70accc",
"size": "69955",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "semantic/dist/components/grid.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "579572"
},
{
"name": "HTML",
"bytes": "48885"
},
{
"name": "JavaScript",
"bytes": "861013"
}
],
"symlink_target": ""
}
|
package com.pekingopera.versionupdate.util;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.Uri;
import java.io.File;
/**
* @author Administrator
*/
public class InstallUtil {
/**
* install apk
* @param context the context is used to send install apk broadcast;
* @param filename the file name to be installed;
*/
public static void installApk(Context context, String filename) {
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Intent.ACTION_VIEW);
String type = "application/vnd.android.package-archive";
File pluginfile = new File(filename);
intent.setDataAndType(Uri.fromFile(pluginfile), type);
context.startActivity(intent);
}
public static int getApkVersion (Context context) throws PackageManager.NameNotFoundException {
PackageManager pm = context.getPackageManager();
PackageInfo packageInfo = pm.getPackageInfo(context.getPackageName(), 0);
return packageInfo.versionCode;
}
}
|
{
"content_hash": "cd88e03111db4be373cc09c792995cab",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 99,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7117346938775511,
"repo_name": "ecnuBeidou/ESeal",
"id": "25d41374e9f3caeb7c42a37cff47533125cc5ced",
"size": "1176",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "versionupdate/src/main/java/com/pekingopera/versionupdate/util/InstallUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "861731"
}
],
"symlink_target": ""
}
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
Ext.define('sisprod.view.WorkCategoryDetail.AddWorkCategoryDetail', {
extend: 'sisprod.view.base.BaseDataWindow',
alias: 'widget.addWorkCategoryDetail',
require: [
'sisprod.view.base.BaseDataWindow'
],
title: 'Agregar Detalle de Categoría de Trabajo',
modal: true,
width: 400,
// height: 150,
formOptions: {
bodyPadding: 2,
defaults:{
labelWidth: 140
},
items: [
{
xtype: 'combobox',
grow: true,
name: 'idWorkCategory',
store: Ext.create('sisprod.store.WorkCategoryAll'),
fieldLabel: 'Categoria de Trabajo',
displayField: 'workCategoryName',
valueField: 'idWorkCategory',
emptyText: 'Seleccione',
forceSelection: true,
anchor: '100%',
allowBlank: false
},
{
xtype: 'textfield',
grow: true,
name: 'workCategoryDetailName',
fieldLabel: 'Descripción',
anchor: '100%',
allowBlank: false
}
]
}
});
|
{
"content_hash": "fa420f2081dabe3b5d38e0a5599c3539",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 69,
"avg_line_length": 28.183673469387756,
"alnum_prop": 0.47719044170890657,
"repo_name": "jgin/testphp",
"id": "d1447ce0c93aee8d868fafc18477a83571c25b25",
"size": "1383",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/bundles/hrmpayroll/app/view/WorkCategoryDetail/AddWorkCategoryDetail.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "743341"
},
{
"name": "JavaScript",
"bytes": "26577383"
},
{
"name": "PHP",
"bytes": "87904"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="pl">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.google.code.play2.provider.api.Play2TemplateCompiler (Play! 2.x Provider API 1.0.0-beta3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.google.code.play2.provider.api.Play2TemplateCompiler (Play! 2.x Provider API 1.0.0-beta3 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../com/google/code/play2/provider/api/package-summary.html">Package</a></li>
<li><a href="../../../../../../../com/google/code/play2/provider/api/Play2TemplateCompiler.html" title="interface in com.google.code.play2.provider.api">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?com/google/code/play2/provider/api/class-use/Play2TemplateCompiler.html" target="_top">Frames</a></li>
<li><a href="Play2TemplateCompiler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface com.google.code.play2.provider.api.Play2TemplateCompiler" class="title">Uses of Interface<br>com.google.code.play2.provider.api.Play2TemplateCompiler</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.google.code.play2.provider.api">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../com/google/code/play2/provider/api/Play2TemplateCompiler.html" title="interface in com.google.code.play2.provider.api">Play2TemplateCompiler</a> in <a href="../../../../../../../com/google/code/play2/provider/api/package-summary.html">com.google.code.play2.provider.api</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../com/google/code/play2/provider/api/package-summary.html">com.google.code.play2.provider.api</a> that return <a href="../../../../../../../com/google/code/play2/provider/api/Play2TemplateCompiler.html" title="interface in com.google.code.play2.provider.api">Play2TemplateCompiler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../com/google/code/play2/provider/api/Play2TemplateCompiler.html" title="interface in com.google.code.play2.provider.api">Play2TemplateCompiler</a></code></td>
<td class="colLast"><span class="typeNameLabel">Play2Provider.</span><code><span class="memberNameLink"><a href="../../../../../../../com/google/code/play2/provider/api/Play2Provider.html#getTemplatesCompiler--">getTemplatesCompiler</a></span>()</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../com/google/code/play2/provider/api/package-summary.html">Package</a></li>
<li><a href="../../../../../../../com/google/code/play2/provider/api/Play2TemplateCompiler.html" title="interface in com.google.code.play2.provider.api">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?com/google/code/play2/provider/api/class-use/Play2TemplateCompiler.html" target="_top">Frames</a></li>
<li><a href="Play2TemplateCompiler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2013–2015. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "176e4408fe660e7de9e7da2951587986",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 389,
"avg_line_length": 43.391891891891895,
"alnum_prop": 0.6337589535970103,
"repo_name": "play2-maven-plugin/play2-maven-plugin.github.io",
"id": "6fec0b499a5ea7bad8252ceff70cfd7d9127ebdd",
"size": "6422",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "play2-maven-plugin/1.0.0-beta3/play2-provider-api/apidocs/com/google/code/play2/provider/api/class-use/Play2TemplateCompiler.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2793124"
},
{
"name": "HTML",
"bytes": "178221432"
},
{
"name": "JavaScript",
"bytes": "120742"
}
],
"symlink_target": ""
}
|
<!--<?php
require_once template('head');
require_once template('sidebar');
$en_title = ucfirst(str_replace('_',' ',$class_list[$classnow]['filename']));
$met_product=methtml_imgdisplay('product');
$met_productnext=methtml_prenextinfo(1);
$methits=methtml_hits('product');
echo <<<EOT
-->
<article class="page-main">
<div class="page-crumb">
<a href="{$index_url}" title="{$lang_home}">{$lang_home} ></a> {$nav_x[name]}
</div>
<div class="page-content p-article">
<h1 class="title">
{$en_title}
<p>{$class_list[$classnow][name]}</p>
</h1>
<h2 class="stitle">{$product[title]}</h2>
<div class="thumb">{$met_product}</div>
<div class="paralist">
<!--
EOT;
foreach($product_paralist as $key=>$val2){
echo <<<EOT
-->
<p><span class="name">{$val2[name]}</span>: <span class="value">{$product[$val2[para]]}</span></p>
<!--
EOT;
}
echo <<<EOT
-->
</div>
<div class="text">{$product[content]}</div>
<div class="hits">{$methits}</div>
<div class="page">{$met_productnext}</div>
<div class="clear"></div>
</div>
</article>
<div class="clear"></div>
</div>
</section>
<!--
EOT;
require_once template('foot');
?>
|
{
"content_hash": "41b605e43298356273c6cbc1a12746d7",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 122,
"avg_line_length": 30.82608695652174,
"alnum_prop": 0.4915373765867419,
"repo_name": "maicong/OpenAPI",
"id": "e6cc2690d346fc81d25b31783c7d35dc54a3f47a",
"size": "1420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MetInfo5.2/templates/default/showproduct.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1307"
},
{
"name": "CSS",
"bytes": "288580"
},
{
"name": "HTML",
"bytes": "991091"
},
{
"name": "JavaScript",
"bytes": "2520056"
},
{
"name": "PHP",
"bytes": "2727936"
},
{
"name": "Shell",
"bytes": "5926"
},
{
"name": "Vim script",
"bytes": "226"
}
],
"symlink_target": ""
}
|
import DS from 'ember-data';
import DomainResource from 'ember-fhir/models/domain-resource';
const { attr, belongsTo, hasMany } = DS;
export default DomainResource.extend({
identifier: belongsTo('identifier', { async: false }),
type_: belongsTo('codeable-concept', { async: false }),
unit: belongsTo('codeable-concept', { async: false }),
source: belongsTo('reference', { async: false }),
parent: belongsTo('reference', { async: false }),
operationalStatus: attr('string'),
color: attr('string'),
category: attr('string'),
measurementPeriod: belongsTo('timing', { async: false }),
calibration: hasMany('device-metric-calibration', { async: true })
});
|
{
"content_hash": "30cbde4d37c3a6631c93470eac457ba1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 39.588235294117645,
"alnum_prop": 0.6968796433878157,
"repo_name": "davekago/ember-fhir",
"id": "3f1038bbae7869181aa728324e16f64caab6a04b",
"size": "673",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addon/models/device-metric.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1703"
},
{
"name": "JavaScript",
"bytes": "990500"
}
],
"symlink_target": ""
}
|
"""The bare-metal admin extension."""
import netaddr
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import exception
from nova.openstack.common.gettextutils import _
from nova.virt.baremetal import db
authorize = extensions.extension_authorizer('compute', 'baremetal_nodes')
node_fields = ['id', 'cpus', 'local_gb', 'memory_mb', 'pm_address',
'pm_user',
'service_host', 'terminal_port', 'instance_uuid',
]
node_ext_fields = ['uuid', 'task_state', 'updated_at', 'pxe_config_path']
interface_fields = ['id', 'address', 'datapath_id', 'port_no']
def _interface_dict(interface_ref):
d = {}
for f in interface_fields:
d[f] = interface_ref.get(f)
return d
def _make_node_elem(elem):
for f in node_fields:
elem.set(f)
for f in node_ext_fields:
elem.set(f)
def _make_interface_elem(elem):
for f in interface_fields:
elem.set(f)
def is_valid_mac(address):
"""Verify the format of a MAC address."""
class mac_dialect(netaddr.mac_eui48):
word_fmt = '%.02x'
word_sep = ':'
try:
na = netaddr.EUI(address, dialect=mac_dialect)
except Exception:
return False
return str(na) == address.lower()
class NodeTemplate(xmlutil.TemplateBuilder):
def construct(self):
node_elem = xmlutil.TemplateElement('node', selector='node')
_make_node_elem(node_elem)
ifs_elem = xmlutil.TemplateElement('interfaces')
if_elem = xmlutil.SubTemplateElement(ifs_elem, 'interface',
selector='interfaces')
_make_interface_elem(if_elem)
node_elem.append(ifs_elem)
return xmlutil.MasterTemplate(node_elem, 1)
class NodesTemplate(xmlutil.TemplateBuilder):
def construct(self):
root = xmlutil.TemplateElement('nodes')
node_elem = xmlutil.SubTemplateElement(root, 'node', selector='nodes')
_make_node_elem(node_elem)
ifs_elem = xmlutil.TemplateElement('interfaces')
if_elem = xmlutil.SubTemplateElement(ifs_elem, 'interface',
selector='interfaces')
_make_interface_elem(if_elem)
node_elem.append(ifs_elem)
return xmlutil.MasterTemplate(root, 1)
class InterfaceTemplate(xmlutil.TemplateBuilder):
def construct(self):
root = xmlutil.TemplateElement('interface', selector='interface')
_make_interface_elem(root)
return xmlutil.MasterTemplate(root, 1)
class BareMetalNodeController(wsgi.Controller):
"""The Bare-Metal Node API controller for the OpenStack API."""
def __init__(self, ext_mgr=None, *args, **kwargs):
super(BareMetalNodeController, self).__init__(*args, **kwargs)
self.ext_mgr = ext_mgr
def _node_dict(self, node_ref):
d = {}
for f in node_fields:
d[f] = node_ref.get(f)
if self.ext_mgr.is_loaded('os-baremetal-ext-status'):
for f in node_ext_fields:
d[f] = node_ref.get(f)
return d
@wsgi.serializers(xml=NodesTemplate)
def index(self, req):
context = req.environ['nova.context']
authorize(context)
nodes_from_db = db.bm_node_get_all(context)
nodes = []
for node_from_db in nodes_from_db:
try:
ifs = db.bm_interface_get_all_by_bm_node_id(
context, node_from_db['id'])
except exception.NodeNotFound:
ifs = []
node = self._node_dict(node_from_db)
node['interfaces'] = [_interface_dict(i) for i in ifs]
nodes.append(node)
return {'nodes': nodes}
@wsgi.serializers(xml=NodeTemplate)
def show(self, req, id):
context = req.environ['nova.context']
authorize(context)
try:
node = db.bm_node_get(context, id)
except exception.NodeNotFound:
raise webob.exc.HTTPNotFound()
try:
ifs = db.bm_interface_get_all_by_bm_node_id(context, id)
except exception.NodeNotFound:
ifs = []
node = self._node_dict(node)
node['interfaces'] = [_interface_dict(i) for i in ifs]
return {'node': node}
@wsgi.serializers(xml=NodeTemplate)
def create(self, req, body):
context = req.environ['nova.context']
authorize(context)
values = body['node'].copy()
prov_mac_address = values.pop('prov_mac_address', None)
if (prov_mac_address is not None
and not is_valid_mac(prov_mac_address)):
raise webob.exc.HTTPBadRequest(
explanation=_("Must specify address "
"in the form of xx:xx:xx:xx:xx:xx"))
node = db.bm_node_create(context, values)
node = self._node_dict(node)
if prov_mac_address:
if_id = db.bm_interface_create(context,
bm_node_id=node['id'],
address=prov_mac_address,
datapath_id=None,
port_no=None)
if_ref = db.bm_interface_get(context, if_id)
node['interfaces'] = [_interface_dict(if_ref)]
else:
node['interfaces'] = []
return {'node': node}
def delete(self, req, id):
context = req.environ['nova.context']
authorize(context)
try:
db.bm_node_destroy(context, id)
except exception.NodeNotFound:
raise webob.exc.HTTPNotFound()
return webob.Response(status_int=202)
def _check_node_exists(self, context, node_id):
try:
db.bm_node_get(context, node_id)
except exception.NodeNotFound:
raise webob.exc.HTTPNotFound()
@wsgi.serializers(xml=InterfaceTemplate)
@wsgi.action('add_interface')
def _add_interface(self, req, id, body):
context = req.environ['nova.context']
authorize(context)
self._check_node_exists(context, id)
body = body['add_interface']
address = body['address']
datapath_id = body.get('datapath_id')
port_no = body.get('port_no')
if not is_valid_mac(address):
raise webob.exc.HTTPBadRequest(
explanation=_("Must specify address "
"in the form of xx:xx:xx:xx:xx:xx"))
if_id = db.bm_interface_create(context,
bm_node_id=id,
address=address,
datapath_id=datapath_id,
port_no=port_no)
if_ref = db.bm_interface_get(context, if_id)
return {'interface': _interface_dict(if_ref)}
@wsgi.response(202)
@wsgi.action('remove_interface')
def _remove_interface(self, req, id, body):
context = req.environ['nova.context']
authorize(context)
self._check_node_exists(context, id)
body = body['remove_interface']
if_id = body.get('id')
address = body.get('address')
if not if_id and not address:
raise webob.exc.HTTPBadRequest(
explanation=_("Must specify id or address"))
ifs = db.bm_interface_get_all_by_bm_node_id(context, id)
for i in ifs:
if if_id and if_id != i['id']:
continue
if address and address != i['address']:
continue
db.bm_interface_destroy(context, i['id'])
return webob.Response(status_int=202)
raise webob.exc.HTTPNotFound()
class Baremetal_nodes(extensions.ExtensionDescriptor):
"""Admin-only bare-metal node administration."""
name = "BareMetalNodes"
alias = "os-baremetal-nodes"
namespace = "http://docs.openstack.org/compute/ext/baremetal_nodes/api/v2"
updated = "2013-01-04T00:00:00Z"
def get_resources(self):
resources = []
res = extensions.ResourceExtension('os-baremetal-nodes',
BareMetalNodeController(self.ext_mgr),
member_actions={"action": "POST", })
resources.append(res)
return resources
|
{
"content_hash": "7d5edcb0f5db2851a3aed071ce2ba22d",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 78,
"avg_line_length": 35.273109243697476,
"alnum_prop": 0.5696247766527696,
"repo_name": "tanglei528/nova",
"id": "22a3faa98ce66094af18eca244b24e0360400317",
"size": "9031",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "nova/api/openstack/compute/contrib/baremetal_nodes.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "13998720"
},
{
"name": "Shell",
"bytes": "17451"
}
],
"symlink_target": ""
}
|
<h1>SDLLockScreenConfiguration Class Reference</h1>
<h3>Section Contents</h3>
<ul>
<li><a href="#section-showInOptionalState">showInOptionalState</a></li>
<li><a href="#section-enableAutomaticLockScreen">enableAutomaticLockScreen</a></li>
<li><a href="#section-backgroundColor">backgroundColor</a></li>
<li><a href="#section-appIcon">appIcon</a></li>
<li><a href="#section-customViewController">customViewController</a></li>
<li><a href="#section--init">-init</a></li>
<li><a href="#section-+disabledConfiguration">+disabledConfiguration</a></li>
<li><a href="#section-+enabledConfiguration">+enabledConfiguration</a></li>
<li><a href="#section-+enabledConfigurationWithAppIcon:backgroundColor:">+enabledConfigurationWithAppIcon:backgroundColor:</a></li>
<li><a href="#section-+enabledConfigurationWithViewController:">+enabledConfigurationWithViewController:</a></li>
</ul>
<h3>Overview</h3>
<p>Undocumented</p>
<section class="section task-group-section">
<h3 id="section-showInOptionalState">
showInOptionalState
</h3>
<p>Whether or not the lock screen should be shown in the <q>lock screen optional</q> state. Defaults to ‘NO’.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">assign</span><span class="p">,</span> <span class="n">readwrite</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">BOOL</span> <span class="n">showInOptionalState</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">showInOptionalState</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
<h3 id="section-enableAutomaticLockScreen">
enableAutomaticLockScreen
</h3>
<p>If YES, the lock screen should be managed by SDL and automatically engage when necessary. If NO, then the lock screen will never be engaged.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">assign</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">BOOL</span> <span class="n">enableAutomaticLockScreen</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="k">var</span> <span class="nv">enableAutomaticLockScreen</span><span class="p">:</span> <span class="kt">Bool</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
<h3 id="section-backgroundColor">
backgroundColor
</h3>
<p>The background color of the lock screen. This could be a branding color, or leave at the default for a dark blue-gray.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">copy</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">)</span> <span class="n">UIColor</span> <span class="o">*</span><span class="n">_Nonnull</span> <span class="n">backgroundColor</span><span class="p">;</span></code></pre>
<h3 id="section-appIcon">
appIcon
</h3>
<p>Your app icon as it will appear on the lock screen.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">copy</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">,</span> <span class="n">nullable</span><span class="p">)</span> <span class="n">UIImage</span> <span class="o">*</span><span class="n">appIcon</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="kd">@NSCopying</span> <span class="k">var</span> <span class="nv">appIcon</span><span class="p">:</span> <span class="kt">NSImage</span><span class="p">?</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>
<h3 id="section-customViewController">
customViewController
</h3>
<p>A custom view controller that the lock screen will manage the presentation of.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">@property</span> <span class="p">(</span><span class="n">readonly</span><span class="p">,</span> <span class="n">strong</span><span class="p">,</span> <span class="n">nonatomic</span><span class="p">,</span> <span class="n">nullable</span><span class="p">)</span>
<span class="n">UIViewController</span> <span class="o">*</span><span class="n">customViewController</span><span class="p">;</span></code></pre>
<h3 id="section--init">
-init
</h3>
<p>Undocumented</p>
<h3 id="section-+disabledConfiguration">
+disabledConfiguration
</h3>
<p>Use this configuration if you wish to manage a lock screen yourself. This may be useful if the automatic presentation feature of SDLLockScreenManager is failing for some reason.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">+</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span><span class="n">disabledConfiguration</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="kd">class</span> <span class="kd">func</span> <span class="nf">disabled</span><span class="p">()</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
<div>
<h4>Return Value</h4>
<p>The configuration</p>
</div>
<h3 id="section-+enabledConfiguration">
+enabledConfiguration
</h3>
<p>Use this configuration for the basic default lock screen. A custom app icon will not be used.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">+</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span><span class="n">enabledConfiguration</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="kd">class</span> <span class="kd">func</span> <span class="nf">enabled</span><span class="p">()</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
<div>
<h4>Return Value</h4>
<p>The configuration</p>
</div>
<h3 id="section-+enabledConfigurationWithAppIcon:backgroundColor:">
+enabledConfigurationWithAppIcon:backgroundColor:
</h3>
<p>Use this configuration to provide a custom lock screen icon and a custom background color, or nil if you wish to use the default background color. This will use the default lock screen layout.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">+</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span>
<span class="nf">enabledConfigurationWithAppIcon</span><span class="p">:(</span><span class="n">nonnull</span> <span class="n">UIImage</span> <span class="o">*</span><span class="p">)</span><span class="nv">lockScreenAppIcon</span>
<span class="nf">backgroundColor</span><span class="p">:(</span><span class="n">nullable</span> <span class="n">UIColor</span> <span class="o">*</span><span class="p">)</span><span class="nv">lockScreenBackgroundColor</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="kd">class</span> <span class="kd">func</span> <span class="nf">enabledConfiguration</span><span class="p">(</span><span class="n">withAppIcon</span> <span class="nv">lockScreenAppIcon</span><span class="p">:</span> <span class="kt">Any</span><span class="o">!</span><span class="p">,</span> <span class="n"><a href="../Classes/SDLLockScreenConfiguration.html#/c:objc(cs)SDLLockScreenConfiguration(py)backgroundColor">backgroundColor</a></span> <span class="nv">lockScreenBackgroundColor</span><span class="p">:</span> <span class="kt">Any</span><span class="o">!</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
<h4>Parameters</h4>
<dl>
<dt>lockScreenAppIcon</dt>
<dd><p>The app icon to be shown on the lock screen</p>
</dd>
<dt>lockScreenBackgroundColor</dt>
<dd><p>The color of the lock screen background</p>
</dd>
</dl>
<div>
<h4>Return Value</h4>
<p>The configuration</p>
</div>
<h3 id="section-+enabledConfigurationWithViewController:">
+enabledConfigurationWithViewController:
</h3>
<p>Use this configuration if you wish to provide your own view controller for the lock screen. This view controller’s presentation and dismissal will still be managed by the lock screen manager. Note that you may subclass SDLLockScreenViewController and pass it here to continue to have the vehicle icon set to your view controller by the manager.</p>
<h4>Objective-C</h4>
<pre class="highlight"><code><span class="k">+</span> <span class="p">(</span><span class="n">nonnull</span> <span class="n">instancetype</span><span class="p">)</span><span class="nf">enabledConfigurationWithViewController</span><span class="p">:</span>
<span class="p">(</span><span class="n">nonnull</span> <span class="n">UIViewController</span> <span class="o">*</span><span class="p">)</span><span class="nv">viewController</span><span class="p">;</span></code></pre>
<h4>Swift</h4>
<pre class="highlight"><code><span class="kd">class</span> <span class="kd">func</span> <span class="nf">enabledConfiguration</span><span class="p">(</span><span class="n">withViewController</span> <span class="nv">viewController</span><span class="p">:</span> <span class="kt">Any</span><span class="o">!</span><span class="p">)</span> <span class="o">-></span> <span class="k">Self</span></code></pre>
<h4>Parameters</h4>
<dl>
<dt>viewController</dt>
<dd><p>The view controller to be managed</p>
</dd>
</dl>
<div>
<h4>Return Value</h4>
<p>The configuration</p>
</div>
</section>
|
{
"content_hash": "e97eda1b9953358765d61645846f8a74",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 707,
"avg_line_length": 45.743478260869566,
"alnum_prop": 0.6592529227259766,
"repo_name": "davidswi/sdl_ios",
"id": "13c3bd48b046413bccbffce5d944fd921fd23155",
"size": "10521",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/Classes/SDLLockScreenConfiguration.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C++",
"bytes": "438"
},
{
"name": "HTML",
"bytes": "1587"
},
{
"name": "Objective-C",
"bytes": "2448707"
},
{
"name": "Ruby",
"bytes": "11697"
},
{
"name": "Shell",
"bytes": "240"
},
{
"name": "Swift",
"bytes": "62"
}
],
"symlink_target": ""
}
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use canvas_traits::webgl::WebGLVertexArrayId;
use core::cell::Ref;
use core::iter::FromIterator;
use dom::bindings::cell::DomRefCell;
use dom::bindings::codegen::Bindings::WebGLVertexArrayObjectOESBinding;
use dom::bindings::reflector::reflect_dom_object;
use dom::bindings::root::{Dom, DomRoot, MutNullableDom};
use dom::globalscope::GlobalScope;
use dom::webglbuffer::WebGLBuffer;
use dom::webglobject::WebGLObject;
use dom_struct::dom_struct;
use std::cell::Cell;
use std::collections::HashMap;
#[dom_struct]
pub struct WebGLVertexArrayObjectOES {
webgl_object_: WebGLObject,
id: WebGLVertexArrayId,
ever_bound: Cell<bool>,
is_deleted: Cell<bool>,
bound_attrib_buffers: DomRefCell<HashMap<u32, Dom<WebGLBuffer>>>,
bound_buffer_element_array: MutNullableDom<WebGLBuffer>,
}
impl WebGLVertexArrayObjectOES {
fn new_inherited(id: WebGLVertexArrayId) -> WebGLVertexArrayObjectOES {
Self {
webgl_object_: WebGLObject::new_inherited(),
id: id,
ever_bound: Cell::new(false),
is_deleted: Cell::new(false),
bound_attrib_buffers: DomRefCell::new(HashMap::new()),
bound_buffer_element_array: MutNullableDom::new(None),
}
}
pub fn new(global: &GlobalScope, id: WebGLVertexArrayId) -> DomRoot<WebGLVertexArrayObjectOES> {
reflect_dom_object(box WebGLVertexArrayObjectOES::new_inherited(id),
global,
WebGLVertexArrayObjectOESBinding::Wrap)
}
pub fn id(&self) -> WebGLVertexArrayId {
self.id
}
pub fn is_deleted(&self) -> bool {
self.is_deleted.get()
}
pub fn set_deleted(&self) {
self.is_deleted.set(true)
}
pub fn ever_bound(&self) -> bool {
return self.ever_bound.get()
}
pub fn set_ever_bound(&self) {
self.ever_bound.set(true);
}
pub fn borrow_bound_attrib_buffers(&self) -> Ref<HashMap<u32, Dom<WebGLBuffer>>> {
self.bound_attrib_buffers.borrow()
}
pub fn bound_attrib_buffers(&self) -> Vec<DomRoot<WebGLBuffer>> {
self.bound_attrib_buffers.borrow().iter().map(|(_, b)| DomRoot::from_ref(&**b)).collect()
}
pub fn set_bound_attrib_buffers<'a, T>(&self, iter: T) where T: Iterator<Item=(u32, &'a WebGLBuffer)> {
*self.bound_attrib_buffers.borrow_mut() = HashMap::from_iter(iter.map(|(k,v)| (k, Dom::from_ref(v))));
}
pub fn bound_buffer_element_array(&self) -> Option<DomRoot<WebGLBuffer>> {
self.bound_buffer_element_array.get()
}
pub fn set_bound_buffer_element_array(&self, buffer: Option<&WebGLBuffer>) {
self.bound_buffer_element_array.set(buffer);
}
}
|
{
"content_hash": "39aa2c03297a7eb035b5b28d89167ebc",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 110,
"avg_line_length": 33.95348837209303,
"alnum_prop": 0.6486301369863013,
"repo_name": "nrc/rustc-perf",
"id": "8433b34532819e33d8feeb8f2db15b90dcbf7a35",
"size": "2920",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "collector/benchmarks/style-servo/components/script/dom/webgl_extensions/ext/webglvertexarrayobjectoes.rs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1954"
},
{
"name": "HTML",
"bytes": "26683"
},
{
"name": "JavaScript",
"bytes": "41635"
},
{
"name": "Shell",
"bytes": "114"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Pertusaria eyelpistia A. Massal.
### Remarks
null
|
{
"content_hash": "3a74e2e6ea45859d92dcc71f3fc2c205",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 32,
"avg_line_length": 10.538461538461538,
"alnum_prop": 0.708029197080292,
"repo_name": "mdoering/backbone",
"id": "d73f38463f7e9df7bbaf79cab1c97b5a28efc92a",
"size": "193",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Pertusariales/Pertusariaceae/Pertusaria/Pertusaria eyelpistia/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
using YamlDotNet.Serialization;
namespace WizBot.Common.Attributes;
public static class CommandNameLoadHelper
{
private static readonly IDeserializer _deserializer = new Deserializer();
private static readonly Lazy<Dictionary<string, string[]>> _lazyCommandAliases
= new(() => LoadAliases());
public static Dictionary<string, string[]> LoadAliases(string aliasesFilePath = "data/aliases.yml")
{
var text = File.ReadAllText(aliasesFilePath);
return _deserializer.Deserialize<Dictionary<string, string[]>>(text);
}
public static string[] GetAliasesFor(string methodName)
=> _lazyCommandAliases.Value.TryGetValue(methodName.ToLowerInvariant(), out var aliases) && aliases.Length > 1
? aliases.Skip(1).ToArray()
: Array.Empty<string>();
public static string GetCommandNameFor(string methodName)
{
methodName = methodName.ToLowerInvariant();
var toReturn = _lazyCommandAliases.Value.TryGetValue(methodName, out var aliases) && aliases.Length > 0
? aliases[0]
: methodName;
return toReturn;
}
}
|
{
"content_hash": "90a63945fb8a09c217deacfbd7d38637",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 118,
"avg_line_length": 36.58064516129032,
"alnum_prop": 0.6869488536155203,
"repo_name": "Wizkiller96/WizBot",
"id": "daf07c03fef4bc95d48535191e0aa302bd5d778b",
"size": "1134",
"binary": false,
"copies": "1",
"ref": "refs/heads/v4",
"path": "src/WizBot/Common/Attributes/CommandNameLoadHelper.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "3295747"
},
{
"name": "Dockerfile",
"bytes": "2340"
},
{
"name": "Inno Setup",
"bytes": "3459"
},
{
"name": "PowerShell",
"bytes": "2421"
},
{
"name": "Shell",
"bytes": "686"
}
],
"symlink_target": ""
}
|
/* global describe, it, beforeEach, expect, spyOn, jasmine */
/* eslint camelcase: 0, no-invalid-this: 0 */
const _ = require('underscore');
const Player = require('../../../server/game/player.js');
const DrawCard = require('../../../server/game/drawcard.js');
describe('Player', function() {
describe('moveCard', function() {
beforeEach(function() {
this.gameSpy = jasmine.createSpyObj('game', ['raiseEvent', 'getOtherPlayer', 'playerDecked']);
this.player = new Player('1', 'Player 1', true, this.gameSpy);
this.player.initialise();
this.player.phase = 'marshal';
this.card = new DrawCard(this.player, { code: '1', name: 'Test' });
spyOn(this.card, 'leavesPlay');
});
describe('when the card is not in a pile', function() {
beforeEach(function() {
this.card.location = '';
});
it('should add the card to the player hand', function() {
this.player.moveCard(this.card, 'hand');
expect(this.player.hand).toContain(this.card);
expect(this.card.location).toBe('hand');
});
it('should add the card to the player discard pile', function() {
this.player.moveCard(this.card, 'discard pile');
expect(this.player.discardPile).toContain(this.card);
expect(this.card.location).toBe('discard pile');
});
it('should add the card to the player dead pile', function() {
this.player.moveCard(this.card, 'dead pile');
expect(this.player.deadPile).toContain(this.card);
expect(this.card.location).toBe('dead pile');
});
it('should add the card to the player play area', function() {
this.player.moveCard(this.card, 'play area');
expect(this.player.cardsInPlay).toContain(this.card);
expect(this.card.location).toBe('play area');
});
});
describe('when the card is in a non-play-area pile', function() {
beforeEach(function() {
this.player.discardPile.push(this.card);
this.card.location = 'discard pile';
this.player.moveCard(this.card, 'hand');
});
it('should move it to the target pile', function() {
expect(this.player.hand).toContain(this.card);
});
it('should remove it from the original pile', function() {
expect(this.player.discardPile).not.toContain(this.card);
});
it('should not make the card leave play', function() {
expect(this.card.leavesPlay).not.toHaveBeenCalled();
});
it('should not to raise the left play event', function() {
expect(this.gameSpy.raiseEvent).not.toHaveBeenCalledWith('onCardLeftPlay', jasmine.any(Object), jasmine.any(Object));
});
});
describe('when the card is in the play area', function() {
beforeEach(function() {
this.player.cardsInPlay.push(this.card);
this.card.location = 'play area';
});
it('should make the card leave play', function() {
this.player.moveCard(this.card, 'dead pile');
expect(this.card.leavesPlay).toHaveBeenCalled();
});
it('should raise the left play event', function() {
this.player.moveCard(this.card, 'dead pile');
expect(this.gameSpy.raiseEvent).toHaveBeenCalledWith('onCardLeftPlay', this.player, this.card);
});
describe('when the card has attachments', function() {
beforeEach(function() {
this.attachment = new DrawCard(this.player, {});
this.attachment.parent = this.card;
this.attachment.location = 'play area';
this.card.attachments.push(this.attachment);
spyOn(this.player, 'removeAttachment');
this.player.moveCard(this.card, 'hand');
});
it('should remove the attachments', function() {
expect(this.player.removeAttachment).toHaveBeenCalledWith(this.attachment, false);
});
});
describe('when the card is an attachment', function() {
beforeEach(function() {
this.attachment = new DrawCard(this.player, {});
this.attachment.parent = this.card;
this.attachment.location = 'play area';
this.card.attachments.push(this.attachment);
spyOn(this.player, 'removeAttachment');
this.player.moveCard(this.attachment, 'hand');
});
it('should place the attachment in the target pile', function() {
expect(this.player.hand).toContain(this.attachment);
expect(this.attachment.location).toBe('hand');
});
it('should remove the attachment from the card', function() {
expect(this.card.attachments).not.toContain(this.attachment);
});
});
describe('when the card has duplicates', function() {
beforeEach(function() {
this.dupe = new DrawCard(this.player, {});
this.card.addDuplicate(this.dupe);
this.player.moveCard(this.card, 'hand');
});
it('should discard the dupes', function() {
expect(this.player.discardPile).toContain(this.dupe);
expect(this.dupe.location).toBe('discard pile');
});
});
});
describe('when the target location is the draw deck', function() {
beforeEach(function() {
this.player.drawDeck = _([{}, {}, {}]);
});
it('should add the card to the top of the deck', function() {
this.player.moveCard(this.card, 'draw deck');
expect(this.player.drawDeck.first()).toBe(this.card);
});
it('should add the card to the bottom of the deck when the option is passed', function() {
this.player.moveCard(this.card, 'draw deck', { bottom: true });
expect(this.player.drawDeck.last()).toBe(this.card);
});
it('should be able to move a card from top to bottom of the deck', function() {
this.player.drawDeck = _([this.card, {}, {}, {}]);
this.card.location = 'draw deck';
this.player.moveCard(this.card, 'draw deck', { bottom: true });
expect(this.player.drawDeck.size()).toBe(4);
expect(this.player.drawDeck.last()).toBe(this.card);
});
});
});
});
|
{
"content_hash": "b6b82545ccc9972d15a92b6b15565397",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 133,
"avg_line_length": 42.44311377245509,
"alnum_prop": 0.5266647855530474,
"repo_name": "cavnak/throneteki",
"id": "12fcaa65d2a79027d0ff1e6a8b024b2a23257123",
"size": "7088",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/server/player/movecard.spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14272"
},
{
"name": "HTML",
"bytes": "1243"
},
{
"name": "JavaScript",
"bytes": "1022437"
}
],
"symlink_target": ""
}
|
namespace HotelsSystem.Web.ViewModels.Account
{
using System.ComponentModel.DataAnnotations;
public class RegisterViewModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
}
|
{
"content_hash": "0b0a296ae75d12459545aaae6e06a4bc",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 110,
"avg_line_length": 32.73913043478261,
"alnum_prop": 0.6268260292164675,
"repo_name": "hrist0stoichev/HotelsSystem",
"id": "2c2b7da9b2827bd315a0afc73809904061d6766e",
"size": "755",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Source/Web/HotelsSystem.Web/ViewModels/Account/RegisterViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "107"
},
{
"name": "C#",
"bytes": "138764"
},
{
"name": "CSS",
"bytes": "137500"
},
{
"name": "JavaScript",
"bytes": "19307"
}
],
"symlink_target": ""
}
|
using System.Collections.Generic;
using System.Linq;
using $safeprojectname$.Data.Entities;
using $safeprojectname$.Data.ViewModels;
namespace $safeprojectname$.Data.Converters
{
public static class MediaTypeConverter
{
public static MediaTypeViewModel Convert(MediaType mediaType)
{
var mediaTypeViewModel = new MediaTypeViewModel
{
MediaTypeId = mediaType.MediaTypeId,
Name = mediaType.Name
};
return mediaTypeViewModel;
}
public static List<MediaTypeViewModel> ConvertList(IEnumerable<MediaType> mediaTypes)
{
return mediaTypes.Select(m =>
{
var model = new MediaTypeViewModel
{
MediaTypeId = m.MediaTypeId,
Name = m.Name
};
return model;
})
.ToList();
}
}
}
|
{
"content_hash": "366e89cf1ee37f02347fcd73ee69f5a4",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 93,
"avg_line_length": 29.176470588235293,
"alnum_prop": 0.532258064516129,
"repo_name": "miseeger/VisualStudio.Templates",
"id": "e1033354790e10dacd486935f2fe6e9d58a5df68",
"size": "994",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Sources/AspDotNet Core JWTAuth WebApi VueClient EF/NetCoreApi.Core/Data/Converters/MediaTypeConverter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "641932"
},
{
"name": "CSS",
"bytes": "3740"
},
{
"name": "HTML",
"bytes": "18315"
},
{
"name": "JavaScript",
"bytes": "17700"
},
{
"name": "TypeScript",
"bytes": "75139"
},
{
"name": "VBA",
"bytes": "16407"
},
{
"name": "Vue",
"bytes": "70164"
}
],
"symlink_target": ""
}
|
@interface MessageTopButtonsViewTests : XCTestCase
@end
@implementation MessageTopButtonsViewTests
- (void)setUp {
[super setUp];
// Put setup code here. This method is called before the invocation of each test method in the class.
}
- (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown];
}
- (void)testExample {
// This is an example of a functional test case.
XCTAssert(YES, @"Pass");
}
- (void)testPerformanceExample {
// This is an example of a performance test case.
[self measureBlock:^{
// Put the code you want to measure the time of here.
}];
}
@end
|
{
"content_hash": "3feb6585f5d9363b2917e64391d4a2dd",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 107,
"avg_line_length": 24,
"alnum_prop": 0.6896551724137931,
"repo_name": "janZhao/ZJMessageTopButtonsView",
"id": "602dd34b2627dbcb99a8befa2d8c3fe274a4eed4",
"size": "904",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "MessageTopButtonsView/MessageTopButtonsViewTests/MessageTopButtonsViewTests.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "12286"
}
],
"symlink_target": ""
}
|
class Granularity < ActiveRecord::Base
end
|
{
"content_hash": "b2afe57256be817f7136380c4d4b9e70",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 38,
"avg_line_length": 21.5,
"alnum_prop": 0.813953488372093,
"repo_name": "0r4cl3/rails-trader",
"id": "931774a0294ebbfd86644a45d88b6dfed48d684e",
"size": "43",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/granularity.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1360"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "HTML",
"bytes": "14195"
},
{
"name": "JavaScript",
"bytes": "661"
},
{
"name": "Ruby",
"bytes": "39599"
}
],
"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_05) on Thu Oct 06 22:53:37 EDT 2016 -->
<title>Uses of Class org.drip.execution.optimum.LinearTradingEnhancedTrajectory</title>
<meta name="date" content="2016-10-06">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.drip.execution.optimum.LinearTradingEnhancedTrajectory";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/execution/optimum/class-use/LinearTradingEnhancedTrajectory.html" target="_top">Frames</a></li>
<li><a href="LinearTradingEnhancedTrajectory.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.drip.execution.optimum.LinearTradingEnhancedTrajectory" class="title">Uses of Class<br>org.drip.execution.optimum.LinearTradingEnhancedTrajectory</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">LinearTradingEnhancedTrajectory</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.drip.execution.optimum">org.drip.execution.optimum</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.drip.execution.optimum">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">LinearTradingEnhancedTrajectory</a> in <a href="../../../../../org/drip/execution/optimum/package-summary.html">org.drip.execution.optimum</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/drip/execution/optimum/package-summary.html">org.drip.execution.optimum</a> that return <a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">LinearTradingEnhancedTrajectory</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">LinearTradingEnhancedTrajectory</a></code></td>
<td class="colLast"><span class="typeNameLabel">LinearTradingEnhancedTrajectory.</span><code><span class="memberNameLink"><a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html#Standard-org.drip.execution.strategy.TradingTrajectory-org.drip.execution.dynamics.ArithmeticPriceEvolutionParameters-double-double-">Standard</a></span>(<a href="../../../../../org/drip/execution/strategy/TradingTrajectory.html" title="class in org.drip.execution.strategy">TradingTrajectory</a> tt,
<a href="../../../../../org/drip/execution/dynamics/ArithmeticPriceEvolutionParameters.html" title="class in org.drip.execution.dynamics">ArithmeticPriceEvolutionParameters</a> apep,
double dblCharacteristicTime,
double dblCharacteristicSize)</code>
<div class="block">Construct a Standard LinearTradingEnhancedTrajectory Instance</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../org/drip/execution/optimum/LinearTradingEnhancedTrajectory.html" title="class in org.drip.execution.optimum">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/drip/execution/optimum/class-use/LinearTradingEnhancedTrajectory.html" target="_top">Frames</a></li>
<li><a href="LinearTradingEnhancedTrajectory.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"content_hash": "b124aa47cdc25b28a1c5cf3abbc4eb57",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 515,
"avg_line_length": 44.32544378698225,
"alnum_prop": 0.6658657055132826,
"repo_name": "lakshmiDRIP/DRIP",
"id": "22fc7ad65806f65854b260d2c9ee401597f739df",
"size": "7491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Javadoc/org/drip/execution/optimum/class-use/LinearTradingEnhancedTrajectory.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "19869"
},
{
"name": "HTML",
"bytes": "5974"
},
{
"name": "Java",
"bytes": "20814325"
},
{
"name": "JavaScript",
"bytes": "16520"
}
],
"symlink_target": ""
}
|
/*******************************************************/
/* "C" Language Integrated Production System */
/* */
/* CLIPS Version 6.24 06/05/06 */
/* */
/* UTILITY HEADER FILE */
/*******************************************************/
/*************************************************************/
/* Purpose: Provides a set of utility functions useful to */
/* other modules. Primarily these are the functions for */
/* handling periodic garbage collection and appending */
/* string data. */
/* */
/* Principal Programmer(s): */
/* Gary D. Riley */
/* */
/* Contributing Programmer(s): */
/* */
/* Revision History: */
/* */
/* 6.24: Renamed BOOLEAN macro type to intBool. */
/* */
/*************************************************************/
#ifndef _H_utility
#define _H_utility
#ifdef LOCALE
#undef LOCALE
#endif
struct callFunctionItem
{
char *name;
void (*func)(void *);
int priority;
struct callFunctionItem *next;
short int environmentAware;
void *context;
};
struct trackedMemory
{
void *theMemory;
struct trackedMemory *next;
struct trackedMemory *prev;
size_t memSize;
};
#define UTILITY_DATA 55
struct utilityData
{
struct callFunctionItem *ListOfCleanupFunctions;
struct callFunctionItem *ListOfPeriodicFunctions;
short GarbageCollectionLocks;
short GarbageCollectionHeuristicsEnabled;
short PeriodicFunctionsEnabled;
short YieldFunctionEnabled;
long EphemeralItemCount;
long EphemeralItemSize;
long CurrentEphemeralCountMax;
long CurrentEphemeralSizeMax;
void (*YieldTimeFunction)(void);
int LastEvaluationDepth ;
struct trackedMemory *trackList;
};
#define UtilityData(theEnv) ((struct utilityData *) GetEnvironmentData(theEnv,UTILITY_DATA))
/* Is c the start of a utf8 sequence? */
#define IsUTF8Start(ch) (((ch) & 0xC0) != 0x80)
#define IsUTF8MultiByteStart(ch) ((((unsigned char) ch) >= 0xC0) && (((unsigned char) ch) <= 0xF7))
#define IsUTF8MultiByteContinuation(ch) ((((unsigned char) ch) >= 0x80) && (((unsigned char) ch) <= 0xBF))
#ifdef _UTILITY_SOURCE_
#define LOCALE
#else
#define LOCALE extern
#endif
#define DecrementGCLocks() EnvDecrementGCLocks(GetCurrentEnvironment())
#define IncrementGCLocks() EnvIncrementGCLocks(GetCurrentEnvironment())
#define RemovePeriodicFunction(a) EnvRemovePeriodicFunction(GetCurrentEnvironment(),a)
LOCALE void InitializeUtilityData(void *);
LOCALE void PeriodicCleanup(void *,intBool,intBool);
LOCALE intBool AddCleanupFunction(void *,char *,void (*)(void *),int);
LOCALE intBool EnvAddPeriodicFunction(void *,char *,void (*)(void *),int);
LOCALE intBool AddPeriodicFunction(char *,void (*)(void),int);
LOCALE intBool RemoveCleanupFunction(void *,char *);
LOCALE intBool EnvRemovePeriodicFunction(void *,char *);
LOCALE char *AppendStrings(void *,char *,char *);
LOCALE char *StringPrintForm(void *,char *);
LOCALE char *AppendToString(void *,char *,char *,size_t *,size_t *);
LOCALE char *InsertInString(void *,char *,size_t,char *,size_t *,size_t *);
LOCALE char *AppendNToString(void *,char *,char *,size_t,size_t *,size_t *);
LOCALE char *EnlargeString(void *,size_t,char *,size_t *,size_t *);
LOCALE char *ExpandStringWithChar(void *,int,char *,size_t *,size_t *,size_t);
LOCALE struct callFunctionItem *AddFunctionToCallList(void *,char *,int,void (*)(void *),
struct callFunctionItem *,intBool);
LOCALE struct callFunctionItem *AddFunctionToCallListWithContext(void *,char *,int,void (*)(void *),
struct callFunctionItem *,intBool,void *);
LOCALE struct callFunctionItem *RemoveFunctionFromCallList(void *,char *,
struct callFunctionItem *,
int *);
LOCALE void DeallocateCallList(void *,struct callFunctionItem *);
LOCALE unsigned long ItemHashValue(void *,unsigned short,void *,unsigned long);
LOCALE void YieldTime(void *);
LOCALE short SetGarbageCollectionHeuristics(void *,short);
LOCALE void EnvIncrementGCLocks(void *);
LOCALE void EnvDecrementGCLocks(void *);
LOCALE short EnablePeriodicFunctions(void *,short);
LOCALE short EnableYieldFunction(void *,short);
LOCALE struct trackedMemory *AddTrackedMemory(void *,void *,size_t);
LOCALE void RemoveTrackedMemory(void *,struct trackedMemory *);
LOCALE void UTF8Increment(char *,size_t *);
LOCALE size_t UTF8Offset(char *,size_t);
LOCALE size_t UTF8Length(char *);
LOCALE size_t UTF8CharNum(char *,size_t);
#endif
|
{
"content_hash": "c7d8aec03e8e1c13f6a3e528b97c99f0",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 116,
"avg_line_length": 47.960629921259844,
"alnum_prop": 0.49564931866688555,
"repo_name": "DrItanium/LibExpertSystem",
"id": "5705fb58d3240a51930ab31e0e0087625364a9ae",
"size": "6091",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "utility.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "5658834"
},
{
"name": "C++",
"bytes": "256944"
},
{
"name": "CLIPS",
"bytes": "46829"
},
{
"name": "Objective-C",
"bytes": "7544"
}
],
"symlink_target": ""
}
|
package org.wso2.carbon.identity.openidconnect;
import com.nimbusds.jose.Algorithm;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.JWSHeader;
import com.nimbusds.jose.JWSSigner;
import com.nimbusds.jose.crypto.RSASSASigner;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.PlainJWT;
import com.nimbusds.jwt.SignedJWT;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.Charsets;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.oltu.oauth2.common.message.types.GrantType;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.core.util.KeyStoreManager;
import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
import org.wso2.carbon.identity.application.common.model.ServiceProvider;
import org.wso2.carbon.identity.application.mgt.ApplicationManagementService;
import org.wso2.carbon.identity.base.IdentityException;
import org.wso2.carbon.identity.core.util.IdentityTenantUtil;
import org.wso2.carbon.identity.core.util.IdentityUtil;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCache;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheEntry;
import org.wso2.carbon.identity.oauth.cache.AuthorizationGrantCacheKey;
import org.wso2.carbon.identity.oauth.cache.CacheEntry;
import org.wso2.carbon.identity.oauth.cache.OAuthCache;
import org.wso2.carbon.identity.oauth.cache.OAuthCacheKey;
import org.wso2.carbon.identity.oauth.common.OAuthConstants;
import org.wso2.carbon.identity.oauth.config.OAuthServerConfiguration;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.authz.OAuthAuthzReqMessageContext;
import org.wso2.carbon.identity.oauth2.dao.TokenMgtDAO;
import org.wso2.carbon.identity.oauth2.dto.OAuth2AccessTokenRespDTO;
import org.wso2.carbon.identity.oauth2.dto.OAuth2AuthorizeRespDTO;
import org.wso2.carbon.identity.oauth2.internal.OAuth2ServiceComponentHolder;
import org.wso2.carbon.identity.oauth2.model.AccessTokenDO;
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
import org.wso2.carbon.identity.oauth2.util.OAuth2Util;
import org.wso2.carbon.user.core.UserStoreException;
import java.security.Key;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.interfaces.RSAPrivateKey;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* This is the IDToken generator for the OpenID Connect Implementation. This
* IDToken Generator utilizes the Nimbus SDK to build the IDToken.
*/
public class DefaultIDTokenBuilder implements org.wso2.carbon.identity.openidconnect.IDTokenBuilder {
private static final String NONE = "NONE";
private static final String SHA256_WITH_RSA = "SHA256withRSA";
private static final String SHA384_WITH_RSA = "SHA384withRSA";
private static final String SHA512_WITH_RSA = "SHA512withRSA";
private static final String SHA256_WITH_HMAC = "SHA256withHMAC";
private static final String SHA384_WITH_HMAC = "SHA384withHMAC";
private static final String SHA512_WITH_HMAC = "SHA512withHMAC";
private static final String SHA256_WITH_EC = "SHA256withEC";
private static final String SHA384_WITH_EC = "SHA384withEC";
private static final String SHA512_WITH_EC = "SHA512withEC";
private static final String SHA256 = "SHA-256";
private static final String SHA384 = "SHA-384";
private static final String SHA512 = "SHA-512";
private static final String AUTHORIZATION_CODE = "AuthorizationCode";
private static final String INBOUND_AUTH2_TYPE = "oauth2";
private static final Log log = LogFactory.getLog(DefaultIDTokenBuilder.class);
private static Map<Integer, Key> privateKeys = new ConcurrentHashMap<>();
private OAuthServerConfiguration config = null;
private Algorithm signatureAlgorithm = null;
public DefaultIDTokenBuilder() throws IdentityOAuth2Exception {
config = OAuthServerConfiguration.getInstance();
//map signature algorithm from identity.xml to nimbus format, this is a one time configuration
signatureAlgorithm = mapSignatureAlgorithm(config.getSignatureAlgorithm());
}
@Override
public String buildIDToken(OAuthTokenReqMessageContext request, OAuth2AccessTokenRespDTO tokenRespDTO)
throws IdentityOAuth2Exception {
String issuer = OAuth2Util.getIDTokenIssuer();
long lifetimeInMillis = Integer.parseInt(config.getOpenIDConnectIDTokenExpiration()) * 1000;
long curTimeInMillis = Calendar.getInstance().getTimeInMillis();
// setting subject
String subject = request.getAuthorizedUser().getAuthenticatedSubjectIdentifier();
if (!GrantType.AUTHORIZATION_CODE.toString().equals(request.getOauth2AccessTokenReqDTO().getGrantType()) &&
!org.wso2.carbon.identity.oauth.common.GrantType.SAML20_BEARER.toString().equals(
request.getOauth2AccessTokenReqDTO().getGrantType())) {
ApplicationManagementService applicationMgtService = OAuth2ServiceComponentHolder
.getApplicationMgtService();
ServiceProvider serviceProvider = null;
try {
String tenantDomain = request.getOauth2AccessTokenReqDTO().getTenantDomain();
String spName = applicationMgtService.getServiceProviderNameByClientId(
request.getOauth2AccessTokenReqDTO().getClientId(), INBOUND_AUTH2_TYPE, tenantDomain);
serviceProvider = applicationMgtService.getApplicationExcludingFileBasedSPs(spName, tenantDomain);
} catch (IdentityApplicationManagementException e) {
throw new IdentityOAuth2Exception("Error while getting service provider information.", e);
}
if (serviceProvider != null) {
String claim = serviceProvider.getLocalAndOutBoundAuthenticationConfig().getSubjectClaimUri();
if (claim != null) {
String username = request.getAuthorizedUser().toString();
String tenantUser = request.getAuthorizedUser().getUserName();
String domainName = request.getAuthorizedUser().getTenantDomain();
try {
subject = IdentityTenantUtil.getRealm(domainName, username).getUserStoreManager().
getUserClaimValue(tenantUser, claim, null);
if (subject == null) {
subject = request.getAuthorizedUser().getAuthenticatedSubjectIdentifier();
}
} catch (IdentityException e) {
String error = "Error occurred while getting user claim for domain " + domainName + ", " +
"user " + username + ", claim " + claim;
throw new IdentityOAuth2Exception(error, e);
} catch (UserStoreException e) {
if (e.getMessage().contains("UserNotFound")) {
if (log.isDebugEnabled()) {
log.debug("User " + username + " not found in user store");
}
subject = request.getAuthorizedUser().toString();
} else {
String error = "Error occurred while getting user claim for domain " + domainName + ", " +
"user " + username + ", claim " + claim;
throw new IdentityOAuth2Exception(error, e);
}
}
}
}
}
String nonceValue = null;
// AuthorizationCode only available for authorization code grant type
if (request.getProperty(AUTHORIZATION_CODE) != null) {
AuthorizationGrantCacheEntry authorizationGrantCacheEntry = getAuthorizationGrantCacheEntry(request);
if (authorizationGrantCacheEntry != null) {
nonceValue = authorizationGrantCacheEntry.getNonceValue();
}
}
// Get access token issued time
long accessTokenIssuedTime = getAccessTokenIssuedTime(tokenRespDTO.getAccessToken(), request) / 1000;
String atHash = null;
if (!JWSAlgorithm.NONE.getName().equals(signatureAlgorithm.getName())) {
String digAlg = mapDigestAlgorithm(signatureAlgorithm);
MessageDigest md;
try {
md = MessageDigest.getInstance(digAlg);
} catch (NoSuchAlgorithmException e) {
throw new IdentityOAuth2Exception("Invalid Algorithm : " + digAlg);
}
md.update(tokenRespDTO.getAccessToken().getBytes(Charsets.UTF_8));
byte[] digest = md.digest();
int leftHalfBytes = 16;
if (SHA384.equals(digAlg)) {
leftHalfBytes = 24;
} else if (SHA512.equals(digAlg)) {
leftHalfBytes = 32;
}
byte[] leftmost = new byte[leftHalfBytes];
for (int i = 0; i < leftHalfBytes; i++) {
leftmost[i] = digest[i];
}
atHash = new String(Base64.encodeBase64URLSafe(leftmost), Charsets.UTF_8);
}
if (log.isDebugEnabled()) {
StringBuilder stringBuilder = (new StringBuilder())
.append("Using issuer ").append(issuer).append("\n")
.append("Subject ").append(subject).append("\n")
.append("ID Token life time ").append(lifetimeInMillis / 1000).append("\n")
.append("Current time ").append(curTimeInMillis / 1000).append("\n")
.append("Nonce Value ").append(nonceValue).append("\n")
.append("Signature Algorithm ").append(signatureAlgorithm).append("\n");
if (log.isDebugEnabled()) {
log.debug(stringBuilder.toString());
}
}
JWTClaimsSet jwtClaimsSet = new JWTClaimsSet();
jwtClaimsSet.setIssuer(issuer);
jwtClaimsSet.setSubject(subject);
jwtClaimsSet.setAudience(Arrays.asList(request.getOauth2AccessTokenReqDTO().getClientId()));
jwtClaimsSet.setClaim("azp", request.getOauth2AccessTokenReqDTO().getClientId());
jwtClaimsSet.setExpirationTime(new Date(curTimeInMillis + lifetimeInMillis));
jwtClaimsSet.setIssueTime(new Date(curTimeInMillis));
jwtClaimsSet.setClaim("auth_time", accessTokenIssuedTime);
if(atHash != null){
jwtClaimsSet.setClaim("at_hash", atHash);
}
if (nonceValue != null) {
jwtClaimsSet.setClaim("nonce", nonceValue);
}
request.addProperty(OAuthConstants.ACCESS_TOKEN, tokenRespDTO.getAccessToken());
CustomClaimsCallbackHandler claimsCallBackHandler =
OAuthServerConfiguration.getInstance().getOpenIDConnectCustomClaimsCallbackHandler();
claimsCallBackHandler.handleCustomClaims(jwtClaimsSet, request);
if (JWSAlgorithm.NONE.getName().equals(signatureAlgorithm.getName())) {
return new PlainJWT(jwtClaimsSet).serialize();
}
return signJWT(jwtClaimsSet, request);
}
@Override
public String buildIDToken(OAuthAuthzReqMessageContext request, OAuth2AuthorizeRespDTO tokenRespDTO)
throws IdentityOAuth2Exception {
String issuer = OAuth2Util.getIDTokenIssuer();
long lifetimeInMillis = Integer.parseInt(config.getOpenIDConnectIDTokenExpiration()) * 1000;
long curTimeInMillis = Calendar.getInstance().getTimeInMillis();
// setting subject
String subject = request.getAuthorizationReqDTO().getUser().getAuthenticatedSubjectIdentifier();
String nonceValue = request.getAuthorizationReqDTO().getNonce();
// Get access token issued time
long accessTokenIssuedTime = getAccessTokenIssuedTime(tokenRespDTO.getAccessToken(), request) / 1000;
String atHash = null;
if (!JWSAlgorithm.NONE.getName().equals(signatureAlgorithm.getName())) {
String digAlg = mapDigestAlgorithm(signatureAlgorithm);
MessageDigest md;
try {
md = MessageDigest.getInstance(digAlg);
} catch (NoSuchAlgorithmException e) {
throw new IdentityOAuth2Exception("Invalid Algorithm : " + digAlg);
}
md.update(tokenRespDTO.getAccessToken().getBytes(Charsets.UTF_8));
byte[] digest = md.digest();
int leftHalfBytes = 16;
if (SHA384.equals(digAlg)) {
leftHalfBytes = 24;
} else if (SHA512.equals(digAlg)) {
leftHalfBytes = 32;
}
byte[] leftmost = new byte[leftHalfBytes];
for (int i = 0; i < leftHalfBytes; i++) {
leftmost[i] = digest[i];
}
atHash = new String(Base64.encodeBase64URLSafe(leftmost), Charsets.UTF_8);
}
if (log.isDebugEnabled()) {
StringBuilder stringBuilder = (new StringBuilder())
.append("Using issuer ").append(issuer).append("\n")
.append("Subject ").append(subject).append("\n")
.append("ID Token life time ").append(lifetimeInMillis / 1000).append("\n")
.append("Current time ").append(curTimeInMillis / 1000).append("\n")
.append("Nonce Value ").append(nonceValue).append("\n")
.append("Signature Algorithm ").append(signatureAlgorithm).append("\n");
if (log.isDebugEnabled()) {
log.debug(stringBuilder.toString());
}
}
JWTClaimsSet jwtClaimsSet = new JWTClaimsSet();
jwtClaimsSet.setIssuer(issuer);
jwtClaimsSet.setSubject(subject);
jwtClaimsSet.setAudience(Arrays.asList(request.getAuthorizationReqDTO().getConsumerKey()));
jwtClaimsSet.setClaim("azp", request.getAuthorizationReqDTO().getConsumerKey());
jwtClaimsSet.setExpirationTime(new Date(curTimeInMillis + lifetimeInMillis));
jwtClaimsSet.setIssueTime(new Date(curTimeInMillis));
jwtClaimsSet.setClaim("auth_time", accessTokenIssuedTime);
if(atHash != null){
jwtClaimsSet.setClaim("at_hash", atHash);
}
if (nonceValue != null) {
jwtClaimsSet.setClaim("nonce", nonceValue);
}
request.addProperty(OAuthConstants.ACCESS_TOKEN, tokenRespDTO.getAccessToken());
CustomClaimsCallbackHandler claimsCallBackHandler =
OAuthServerConfiguration.getInstance().getOpenIDConnectCustomClaimsCallbackHandler();
claimsCallBackHandler.handleCustomClaims(jwtClaimsSet, request);
if (JWSAlgorithm.NONE.getName().equals(signatureAlgorithm.getName())) {
return new PlainJWT(jwtClaimsSet).serialize();
}
return signJWT(jwtClaimsSet, request);
}
/**
* sign JWT token from RSA algorithm
*
* @param jwtClaimsSet contains JWT body
* @param request
* @return signed JWT token
* @throws IdentityOAuth2Exception
*/
protected String signJWTWithRSA(JWTClaimsSet jwtClaimsSet, OAuthTokenReqMessageContext request)
throws IdentityOAuth2Exception {
try {
String tenantDomain = request.getAuthorizedUser().getTenantDomain();
int tenantId = IdentityTenantUtil.getTenantId(tenantDomain);
Key privateKey;
if (!(privateKeys.containsKey(tenantId))) {
// get tenant's key store manager
KeyStoreManager tenantKSM = KeyStoreManager.getInstance(tenantId);
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
// derive key store name
String ksName = tenantDomain.trim().replace(".", "-");
String jksName = ksName + ".jks";
// obtain private key
privateKey = tenantKSM.getPrivateKey(jksName, tenantDomain);
} else {
try {
privateKey = tenantKSM.getDefaultPrivateKey();
} catch (Exception e) {
throw new IdentityOAuth2Exception("Error while obtaining private key for super tenant", e);
}
}
//privateKey will not be null always
privateKeys.put(tenantId, privateKey);
} else {
//privateKey will not be null because containsKey() true says given key is exist and ConcurrentHashMap
// does not allow to store null values
privateKey = privateKeys.get(tenantId);
}
JWSSigner signer = new RSASSASigner((RSAPrivateKey) privateKey);
SignedJWT signedJWT = new SignedJWT(new JWSHeader((JWSAlgorithm) signatureAlgorithm), jwtClaimsSet);
signedJWT.sign(signer);
return signedJWT.serialize();
} catch (JOSEException e) {
throw new IdentityOAuth2Exception("Error occurred while signing JWT", e);
}
}
protected String signJWTWithRSA(JWTClaimsSet jwtClaimsSet, OAuthAuthzReqMessageContext request)
throws IdentityOAuth2Exception {
try {
String tenantDomain = request.getAuthorizationReqDTO().getUser().getTenantDomain();
int tenantId = IdentityTenantUtil.getTenantId(tenantDomain);
Key privateKey;
if (!(privateKeys.containsKey(tenantId))) {
// get tenant's key store manager
KeyStoreManager tenantKSM = KeyStoreManager.getInstance(tenantId);
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
// derive key store name
String ksName = tenantDomain.trim().replace(".", "-");
String jksName = ksName + ".jks";
// obtain private key
privateKey = tenantKSM.getPrivateKey(jksName, tenantDomain);
} else {
try {
privateKey = tenantKSM.getDefaultPrivateKey();
} catch (Exception e) {
throw new IdentityOAuth2Exception("Error while obtaining private key for super tenant", e);
}
}
//privateKey will not be null always
privateKeys.put(tenantId, privateKey);
} else {
//privateKey will not be null because containsKey() true says given key is exist and ConcurrentHashMap
// does not allow to store null values
privateKey = privateKeys.get(tenantId);
}
JWSSigner signer = new RSASSASigner((RSAPrivateKey) privateKey);
SignedJWT signedJWT = new SignedJWT(new JWSHeader((JWSAlgorithm) signatureAlgorithm), jwtClaimsSet);
signedJWT.sign(signer);
return signedJWT.serialize();
} catch (JOSEException e) {
throw new IdentityOAuth2Exception("Error occurred while signing JWT", e);
}
}
/**
* @param request
* @return AuthorizationGrantCacheEntry contains user attributes and nonce value
*/
private AuthorizationGrantCacheEntry getAuthorizationGrantCacheEntry(
OAuthTokenReqMessageContext request) {
String authorizationCode = (String) request.getProperty(AUTHORIZATION_CODE);
AuthorizationGrantCacheKey authorizationGrantCacheKey = new AuthorizationGrantCacheKey(authorizationCode);
AuthorizationGrantCacheEntry authorizationGrantCacheEntry =
(AuthorizationGrantCacheEntry) AuthorizationGrantCache.getInstance().
getValueFromCacheByCode(authorizationGrantCacheKey);
return authorizationGrantCacheEntry;
}
private long getAccessTokenIssuedTime(String accessToken, OAuthTokenReqMessageContext request)
throws IdentityOAuth2Exception {
AccessTokenDO accessTokenDO = null;
TokenMgtDAO tokenMgtDAO = new TokenMgtDAO();
OAuthCache oauthCache = OAuthCache.getInstance();
String authorizedUser = request.getAuthorizedUser().toString();
boolean isUsernameCaseSensitive = IdentityUtil.isUserStoreInUsernameCaseSensitive(authorizedUser);
if (!isUsernameCaseSensitive){
authorizedUser = authorizedUser.toLowerCase();
}
OAuthCacheKey cacheKey = new OAuthCacheKey(
request.getOauth2AccessTokenReqDTO().getClientId() + ":" + authorizedUser +
":" + OAuth2Util.buildScopeString(request.getScope()));
CacheEntry result = oauthCache.getValueFromCache(cacheKey);
// cache hit, do the type check.
if (result instanceof AccessTokenDO) {
accessTokenDO = (AccessTokenDO) result;
}
// Cache miss, load the access token info from the database.
if (accessTokenDO == null) {
accessTokenDO = tokenMgtDAO.retrieveAccessToken(accessToken, false);
}
// if the access token or client id is not valid
if (accessTokenDO == null) {
throw new IdentityOAuth2Exception("Access token based information is not available in cache or database");
}
return accessTokenDO.getIssuedTime().getTime();
}
private long getAccessTokenIssuedTime(String accessToken, OAuthAuthzReqMessageContext request)
throws IdentityOAuth2Exception {
AccessTokenDO accessTokenDO = null;
TokenMgtDAO tokenMgtDAO = new TokenMgtDAO();
OAuthCache oauthCache = OAuthCache.getInstance();
String authorizedUser = request.getAuthorizationReqDTO().getUser().toString();
boolean isUsernameCaseSensitive = IdentityUtil.isUserStoreInUsernameCaseSensitive(authorizedUser);
if (!isUsernameCaseSensitive){
authorizedUser = authorizedUser.toLowerCase();
}
OAuthCacheKey cacheKey = new OAuthCacheKey(
request.getAuthorizationReqDTO().getConsumerKey() + ":" + authorizedUser +
":" + OAuth2Util.buildScopeString(request.getApprovedScope()));
CacheEntry result = oauthCache.getValueFromCache(cacheKey);
// cache hit, do the type check.
if (result instanceof AccessTokenDO) {
accessTokenDO = (AccessTokenDO) result;
}
// Cache miss, load the access token info from the database.
if (accessTokenDO == null) {
accessTokenDO = tokenMgtDAO.retrieveAccessToken(accessToken, false);
}
// if the access token or client id is not valid
if (accessTokenDO == null) {
throw new IdentityOAuth2Exception("Access token based information is not available in cache or database");
}
return accessTokenDO.getIssuedTime().getTime();
}
/**
* Generic Signing function
*
* @param jwtClaimsSet contains JWT body
* @param request
* @return
* @throws IdentityOAuth2Exception
*/
protected String signJWT(JWTClaimsSet jwtClaimsSet, OAuthTokenReqMessageContext request)
throws IdentityOAuth2Exception {
if (JWSAlgorithm.RS256.equals(signatureAlgorithm) || JWSAlgorithm.RS384.equals(signatureAlgorithm) ||
JWSAlgorithm.RS512.equals(signatureAlgorithm)) {
return signJWTWithRSA(jwtClaimsSet, request);
} else if (JWSAlgorithm.HS256.equals(signatureAlgorithm) || JWSAlgorithm.HS384.equals(signatureAlgorithm) ||
JWSAlgorithm.HS512.equals(signatureAlgorithm)) {
// return signWithHMAC(jwtClaimsSet,jwsAlgorithm,request); implementation need to be done
return null;
} else {
// return signWithEC(jwtClaimsSet,jwsAlgorithm,request); implementation need to be done
return null;
}
}
protected String signJWT(JWTClaimsSet jwtClaimsSet, OAuthAuthzReqMessageContext request)
throws IdentityOAuth2Exception {
if (JWSAlgorithm.RS256.equals(signatureAlgorithm) || JWSAlgorithm.RS384.equals(signatureAlgorithm) ||
JWSAlgorithm.RS512.equals(signatureAlgorithm)) {
return signJWTWithRSA(jwtClaimsSet, request);
} else if (JWSAlgorithm.HS256.equals(signatureAlgorithm) || JWSAlgorithm.HS384.equals(signatureAlgorithm) ||
JWSAlgorithm.HS512.equals(signatureAlgorithm)) {
// return signWithHMAC(jwtClaimsSet,jwsAlgorithm,request); implementation need to be done
return null;
} else {
// return signWithEC(jwtClaimsSet,jwsAlgorithm,request); implementation need to be done
return null;
}
}
/**
* This method map signature algorithm define in identity.xml to nimbus
* signature algorithm
* format, Strings are defined inline hence there are not being used any
* where
*
* @param signatureAlgorithm
* @return
* @throws IdentityOAuth2Exception
*/
protected JWSAlgorithm mapSignatureAlgorithm(String signatureAlgorithm) throws IdentityOAuth2Exception {
if (NONE.equals(signatureAlgorithm)) {
return new JWSAlgorithm(JWSAlgorithm.NONE.getName());
} else if (SHA256_WITH_RSA.equals(signatureAlgorithm)) {
return JWSAlgorithm.RS256;
} else if (SHA384_WITH_RSA.equals(signatureAlgorithm)) {
return JWSAlgorithm.RS384;
} else if (SHA512_WITH_RSA.equals(signatureAlgorithm)) {
return JWSAlgorithm.RS512;
} else if (SHA256_WITH_HMAC.equals(signatureAlgorithm)) {
return JWSAlgorithm.HS256;
} else if (SHA384_WITH_HMAC.equals(signatureAlgorithm)) {
return JWSAlgorithm.HS384;
} else if (SHA512_WITH_HMAC.equals(signatureAlgorithm)) {
return JWSAlgorithm.HS512;
} else if (SHA256_WITH_EC.equals(signatureAlgorithm)) {
return JWSAlgorithm.ES256;
} else if (SHA384_WITH_EC.equals(signatureAlgorithm)) {
return JWSAlgorithm.ES384;
} else if (SHA512_WITH_EC.equals(signatureAlgorithm)) {
return JWSAlgorithm.ES512;
}
throw new IdentityOAuth2Exception("Unsupported Signature Algorithm in identity.xml");
}
/**
* This method maps signature algorithm define in identity.xml to digest algorithms to generate the at_hash
*
* @param signatureAlgorithm
* @return
* @throws IdentityOAuth2Exception
*/
protected String mapDigestAlgorithm(Algorithm signatureAlgorithm) throws IdentityOAuth2Exception {
if (JWSAlgorithm.RS256.equals(signatureAlgorithm) || JWSAlgorithm.HS256.equals(signatureAlgorithm) ||
JWSAlgorithm.ES256.equals(signatureAlgorithm)) {
return SHA256;
} else if (JWSAlgorithm.RS384.equals(signatureAlgorithm) || JWSAlgorithm.HS384.equals(signatureAlgorithm) ||
JWSAlgorithm.ES384.equals(signatureAlgorithm)) {
return SHA384;
} else if (JWSAlgorithm.RS512.equals(signatureAlgorithm) || JWSAlgorithm.HS512.equals(signatureAlgorithm) ||
JWSAlgorithm.ES512.equals(signatureAlgorithm)) {
return SHA512;
}
throw new RuntimeException("Cannot map Signature Algorithm in identity.xml to hashing algorithm");
}
}
|
{
"content_hash": "2f8225035c41e55269cd0385a4482a9c",
"timestamp": "",
"source": "github",
"line_count": 583,
"max_line_length": 118,
"avg_line_length": 47.74271012006861,
"alnum_prop": 0.6539484084213552,
"repo_name": "thilina27/carbon-identity",
"id": "82424298c980313f5c779e2c94e83237bc4820a0",
"size": "28506",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "components/oauth/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/openidconnect/DefaultIDTokenBuilder.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "108257"
},
{
"name": "HTML",
"bytes": "115507"
},
{
"name": "Java",
"bytes": "12725948"
},
{
"name": "JavaScript",
"bytes": "431798"
},
{
"name": "Objective-C",
"bytes": "13608"
},
{
"name": "PLSQL",
"bytes": "58383"
},
{
"name": "Thrift",
"bytes": "338"
},
{
"name": "XSLT",
"bytes": "1030"
}
],
"symlink_target": ""
}
|
.center-bkgnd {
background:#D1C5B7;
border:0;
}
#testBody {
color:black;
background:#D1C5B7;
padding:0
}
#testLayoutEast {
height:100%;
width: 100%;
text-align: left;
font-family: arial,helvetica,sans-serif;
font-size: small;
font-weight: normal;
margin: 0;
padding: 0;
background: #4D4D4D;
border: none;
border-radius: 0;
overflow: hidden;
}
#testLayoutEast div#testList {
margin: 5px;
border-radius: 5px;
border: 0;
}
#testLayoutCenter {
padding: 10px !important;
overflow: auto !important;
left: 0;
right: 0;
top: 0;
bottom: 0;
/*background:transparent;*/
border: none #dcdcdc;
border-radius: 0;
}
.hide {
display: none;
}
#testParameters > .panel-body {
padding: 0 15px 5px;
}
#testParameters div.form-group, #testAssertions div.form-group {
margin-bottom: 10px;
margin-top: 10px;
}
#testParameters div.form-group:last-child, #testAssertions div.form-group:last-child {
margin-bottom: 10px;
}
#testParametersDiv {
overflow: visible;
margin-top: 15px;
}
#testListWarning {
margin: 5px 5px 0 5px;
}
#testListItems {
margin-bottom: 0;
box-shadow: none;
-webkit-box-shadow: none;
}
#testListItems a.selected {
color: #444;
background: rgb(217, 237, 247); /* fallback */
background: rgba(61, 139, 202, .25);
padding: 0 5px 0 5px !important;
text-shadow: none !important;
}
#testListItems a {
color: #444;
padding: 0 5px 0 5px !important;
}
#testList div.panel-body {
padding: 5px;
margin: 0;
overflow: auto;
height: calc(100% - 30px);
}
#testList div.panel-heading {
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
#testAssertionsDiv, #testResultsDiv {
margin-top: 10px;
}
#testResults {
-webkit-touch-callout: initial;
-webkit-user-select: initial;
-khtml-user-select: initial;
-moz-user-select: initial;
-ms-user-select: initial;
user-select: initial;
}
#selectedTestName {
display: inline-block;
margin: 0 25px;
line-height: 34px;
font-size: 24px;
}
|
{
"content_hash": "e743485c7563d775ba216002b1e9e28c",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 86,
"avg_line_length": 17.816666666666666,
"alnum_prop": 0.6323666978484564,
"repo_name": "kpartlow/n-cube-editor",
"id": "2ac679f6e8248853d3e5910ab0be1a4b5846b68a",
"size": "2138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/resources/static/css/test.css",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "555249"
},
{
"name": "Groovy",
"bytes": "3392"
},
{
"name": "HTML",
"bytes": "101316"
},
{
"name": "JavaScript",
"bytes": "6749348"
}
],
"symlink_target": ""
}
|
<section id="instance-list">
<section id="content" style="top:">
<section class="hbox stretch">
<section class="vbox no-margin">
<section class="scrollable wrapper-lg">
<div class="m-b-md h2">
<span class="font-thin">Applications</span>
</div>
<div class="row m-b">
<div class="col-sm-6 col-md-4">
<section class="panel b-a" style=" height:268px;" >
<div class="panel-heading lter" >
<!-- Might be good for notifications
<span class="pull-right badge dk m-t-sm">17</span> -->
<a href="" class="h4 text-lt m-t-sm m-b-sm block font-bold"><p class="text-dark">NEW PYRO APP</p></a>
</div>
<div class="panel-body text-center" style="padding-top:30px;">
<div ng-hide="existingMode == true || simpleMode == true" style="margin-bottom:40px;">
<a href="" ng-click="simpleMode = true" class="btn btn-s-md btn-warning">Simple Setup</a>
</div>
<!-- <a href="" ng-show="existingMode == true || simpleMode == true" ng-click="existingMode = false; simpleMode = false" class="btn btn-warning btn-fab btn-raised" style="position:absolute;top:0.5em;right:1em;"><i class="ion-close-round" style="font-size:1em;margin-top:-.75em;"></i></a> -->
<div ng-show="simpleMode == true" class="ng-hide" style="padding-left:10%; padding-right:10%;">
<a href="" ng-show="simpleMode == true" ng-click="simpleSetup()" class="btn btn-fab btn-raised" ng-class="{'btn-default disabled': !newAppData.name || loading.simpleSetup, 'btn-warning':newAppData.name}" style="position:absolute;top:0.5em;right:1em;"><i class="ion-android-add" style="font-size:1em;top:-.175em;"></i></a>
<div class="form-group">
<h4 style="color:red;" ng-show="err.hasOwnProperty('error') || err.hasOwnProperty('message')">{{err.message || err.error || "Error"}}</h4>
<h5><label class="pull-left m-b-md font-thin">Enter the name of your new app:</label></h5>
<input type="text" ng-model="newAppData.name" placeholder="exampleApp" class="form-control m-t-lg">
</div>
<!-- <a href="" ng-click="simpleSetup()" class="btn btn-s-md" ng-class="{'btn-default disabled': !newAppData.name || loading.simpleSetup, 'btn-warning':newAppData.name}"><span ng-hide="loading.simpleSetup">Create New App</span><i class="icon ion-load-d fa-spin" ng-show="loading.simpleSetup"></i></a> -->
</div>
<!-- <div ng-hide="existingMode == true || simpleMode == true" style="margin-top:20px;"> -->
<div ng-hide="true" style="margin-top:20px;">
<a href="" ng-click="existingMode = true" class="btn btn-s-md btn-default btn-secondary">Manage Existing Database</a>
</div>
<div ng-show="existingMode == true" ng-hide="existingMode != true || simpleMode == true">
<a href="" ng-click="manageInstance()" class="btn btn-s-md" ng-class="{'btn-default disabled': !newAppData.name, 'btn-info':newAppData.name}">Start Managing</a>
<h4 style="color:red;">{{err.message}}</h4>
<div class="form-group " style="margin-top:40px;">
<label class="pull-left">Firebase Url</label>
<div class="row">
https://
<input type="text" ng-model="newAppData.name" placeholder="yourApp" class="form-control" style="width:100px; display:inline;">
.firebaseio.com
</div>
</div>
</div>
<div class="clearfix panel-footer" ng-show="existingMode == true">
<a href="" ng-click="existingMode = false" class="pull-right"><i class="i i-trashcan text-muted"></i></a>
</div>
</div>
</section>
</div>
<div class="col-sm-6 col-md-4" ng-repeat="instance in instanceList">
<section class="panel b-a">
<div class="panel-heading no-border">
<a href="" ng-click="viewDetail(instance.name)" class="btn btn-warning btn-fab btn-raised pull-right"><i class="fa fa-fire" style="font-size:0.75em;top:-.4em;"></i></a>
<a ng-click="viewDetail(instance.name)" class="h4 text-lt m-t-sm m-b-sm block font-bold"><p class="text-dark">{{instance.name}}</p></a>
</div>
<div class="panel-body">
<!-- <span class="pull-right text-muted">{{instance.createdAt || "At Some Point"}}</span> -->
<h4 class="font-thin">{{instance.url || "unknown url"}}</h4>
<div class="row text-center m-t">
<div class="col-xs-6">
<h3 class="font-thin">{{instance.userCount || "0"}}</h3>
<p>Total {{instance.userCount !== 1 ? "Users" : "User"}}</p>
</div>
<div class="col-xs-6">
<h3 class="font-thin">{{instance.sessionCount || "0"}}</h3>
<p>Total {{instance.sessionCount !== 1 ? "Sessions" : "Session"}}</p>
</div>
</div>
</div>
<div class="clearfix panel-footer">
<a href="" class="pull-right" ng-click="startDelete(instance.name)"><i class="i i-trashcan text-muted"></i></a>
</div>
</section>
</div>
</div>
</section>
</section>
</section>
</section>
</section>
|
{
"content_hash": "499bb3199a15757a7dad49e9a950bda3",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 341,
"avg_line_length": 68.69411764705882,
"alnum_prop": 0.5190957355711594,
"repo_name": "pyrolabs/Pyro",
"id": "6a02308863c33a17f3be2c15eafabdd6797f1655",
"size": "5839",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/components/instance/instance-list.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "588"
},
{
"name": "CSS",
"bytes": "633411"
},
{
"name": "HTML",
"bytes": "63388"
},
{
"name": "JavaScript",
"bytes": "17117370"
}
],
"symlink_target": ""
}
|
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null
|
{
"content_hash": "4f4fb0b80cffe70d3bf0675ae0a09423",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "53e8400cb6eca4d981ee52b6605e187d49bc4843",
"size": "177",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Boraginales/Boraginaceae/Sauria/Sauria akkolia/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
package org.apache.struts2.components;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import org.apache.struts2.components.template.Template;
import org.apache.struts2.components.template.TemplateEngine;
import org.apache.struts2.components.template.TemplateEngineManager;
import org.apache.struts2.components.template.TemplateRenderingContext;
import org.apache.struts2.util.TextProviderHelper;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.util.ContextUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* UIBean is the standard superclass of all Struts UI components.
* It defines common Struts and html properties all UI components should present for usage.
*
* <!-- START SNIPPET: templateRelatedAttributes -->
*
* <table border="1">
* <thead>
* <tr>
* <td>Attribute</td>
* <td>Theme</td>
* <td>Data Types</td>
* <td>Description</td>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>templateDir</td>
* <td>n/a</td>
* <td>String</td>
* <td>define the template directory</td>
* </td>
* <tr>
* <td>theme</td>
* <td>n/a</td>
* <td>String</td>
* <td>define the theme name</td>
* </td>
* <tr>
* <td>template</td>
* <td>n/a</td>
* <td>String</td>
* <td>define the template name</td>
* </td>
* <tr>
* <td>themeExpansionToken</td>
* <td>n/a</td>
* <td>String</td>
* <td>special token (defined with struts.ui.theme.expansion.token) used to search for template in parent theme
* (don't use it separately!)</td>
* </td>
* <tr>
* <td>expandTheme</td>
* <td>n/a</td>
* <td>String</td>
* <td>concatenation of themeExpansionToken and theme which tells internal template loader mechanism
* to try load template from current theme and then from parent theme (and parent theme, and so on)
* when used with <#include/> directive</td>
* </td>
* </tbody>
* </table>
*
* <!-- END SNIPPET: templateRelatedAttributes -->
*
* <p/>
*
* <!-- START SNIPPET: generalAttributes -->
*
* <table border="1">
* <thead>
* <tr>
* <td>Attribute</td>
* <td>Theme</td>
* <td>Data Types</td>
* <td>Description</td>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>cssClass</td>
* <td>simple</td>
* <td>String</td>
* <td>define html class attribute</td>
* </tr>
* <tr>
* <td>cssStyle</td>
* <td>simple</td>
* <td>String</td>
* <td>define html style attribute</td>
* </tr>
* <tr>
* <td>cssClass</td>
* <td>simple</td>
* <td>String</td>
* <td>error class attribute</td>
* </tr>
* <tr>
* <td>cssStyle</td>
* <td>simple</td>
* <td>String</td>
* <td>error style attribute</td>
* </tr>
* <tr>
* <td>title</td>
* <td>simple</td>
* <td>String</td>
* <td>define html title attribute</td>
* </tr>
* <tr>
* <td>disabled</td>
* <td>simple</td>
* <td>String</td>
* <td>define html disabled attribute</td>
* </tr>
* <tr>
* <td>label</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define label of form element</td>
* </tr>
* <tr>
* <td>labelPosition</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define label position of form element (top/left), default to left</td>
* </tr>
* <tr>
* <td>requiredPosition</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define required label position of form element (left/right), default to right</td>
* </tr>
* <tr>
* <td>errorPosition</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define error position of form element (top|bottom), default to top</td>
* </tr>
* <tr>
* <td>name</td>
* <td>simple</td>
* <td>String</td>
* <td>Form Element's field name mapping</td>
* </tr>
* <tr>
* <td>required</td>
* <td>xhtml</td>
* <td>Boolean</td>
* <td>add * to label (true to add false otherwise)</td>
* </tr>
* <tr>
* <td>tabIndex</td>
* <td>simple</td>
* <td>String</td>
* <td>define html tabindex attribute</td>
* </tr>
* <tr>
* <td>value</td>
* <td>simple</td>
* <td>Object</td>
* <td>define value of form element</td>
* </tr>
* </tbody>
* </table>
*
* <!-- END SNIPPET: generalAttributes -->
*
* <p/>
*
* <!-- START SNIPPET: javascriptRelatedAttributes -->
*
* <table border="1">
* <thead>
* <tr>
* <td>Attribute</td>
* <td>Theme</td>
* <td>Data Types</td>
* <td>Description</td>
* </tr>
* </thead>
* <tbody>
* <tr>
* <td>onclick</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onclick attribute</td>
* </tr>
* <tr>
* <td>ondblclick</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript ondbclick attribute</td>
* </tr>
* <tr>
* <td>onmousedown</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onmousedown attribute</td>
* </tr>
* <tr>
* <td>onmouseup</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onmouseup attribute</td>
* </tr>
* <tr>
* <td>onmouseover</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onmouseover attribute</td>
* </tr>
* <tr>
* <td>onmouseout</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onmouseout attribute</td>
* </tr>
* <tr>
* <td>onfocus</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onfocus attribute</td>
* </tr>
* <tr>
* <td>onblur</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onblur attribute</td>
* </tr>
* <tr>
* <td>onkeypress</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onkeypress attribute</td>
* </tr>
* <tr>
* <td>onkeyup</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onkeyup attribute</td>
* </tr>
* <tr>
* <td>onkeydown</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onkeydown attribute</td>
* </tr>
* <tr>
* <td>onselect</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onselect attribute</td>
* </tr>
* <tr>
* <td>onchange</td>
* <td>simple</td>
* <td>String</td>
* <td>html javascript onchange attribute</td>
* </tr>
* </tbody>
* </table>
*
* <!-- END SNIPPET: javascriptRelatedAttributes -->
*
* <p/>
*
* <!-- START SNIPPET: tooltipattributes -->
*
* <table border="1">
* <tr>
* <td>Attribute</td>
* <td>Data Type</td>
* <td>Default</td>
* <td>Description</td>
* </tr>
* <tr>
* <td>tooltip</td>
* <td>String</td>
* <td>none</td>
* <td>Set the tooltip of this particular component</td>
* </tr>
* <tr>
* <td>jsTooltipEnabled</td>
* <td>String</td>
* <td>false</td>
* <td>Enable js tooltip rendering</td>
* </tr>
* <tr>
* <td>tooltipIcon</td>
* <td>String</td>
* <td>/struts/static/tooltip/tooltip.gif</td>
* <td>The url to the tooltip icon</td>
* <tr>
* <td>tooltipDelay</td>
* <td>String</td>
* <td>500</td>
* <td>Tooltip shows up after the specified timeout (miliseconds). A behavior similar to that of OS based tooltips.</td>
* </tr>
* <tr>
* <td>key</td>
* <td>simple</td>
* <td>String</td>
* <td>The name of the property this input field represents. This will auto populate the name, label, and value</td>
* </tr>
* </table>
*
* <!-- END SNIPPET: tooltipattributes -->
*
*
* <!-- START SNIPPET: tooltipdescription -->
* <b>tooltipConfig is deprecated, use individual tooltip configuration attributes instead </b>
*
* Every Form UI component (in xhtml / css_xhtml or any other that extends them) can
* have tooltips assigned to them. The Form component's tooltip related attribute, once
* defined, will be applied to all form UI components that are created under it unless
* explicitly overriden by having the Form UI component itself defined with their own tooltip attribute.
*
* <p/>
*
* In Example 1, the textfield will inherit the tooltipDelay and tooltipIconPath attribte from
* its containing form. In other words, although it doesn't define a tooltipIconPath
* attribute, it will have that attribute inherited from its containing form.
*
* <p/>
*
* In Example 2, the textfield will inherite both the tooltipDelay and
* tooltipIconPath attribute from its containing form, but the tooltipDelay
* attribute is overriden at the textfield itself. Hence, the textfield actually will
* have its tooltipIcon defined as /myImages/myIcon.gif, inherited from its containing form, and
* tooltipDelay defined as 5000.
*
* <p/>
*
* Example 3, 4 and 5 show different ways of setting the tooltip configuration attribute.<br/>
* <b>Example 3:</b> Set tooltip config through the body of the param tag<br/>
* <b>Example 4:</b> Set tooltip config through the value attribute of the param tag<br/>
* <b>Example 5:</b> Set tooltip config through the tooltip attributes of the component tag<br/>
*
* <!-- END SNIPPET: tooltipdescription -->
*
*
* <pre>
* <!-- START SNIPPET: tooltipexample -->
*
* <!-- Example 1: -->
* <s:form
* tooltipDelay="500"
* tooltipIconPath="/myImages/myIcon.gif" .... >
* ....
* <s:textfield label="Customer Name" tooltip="Enter the customer name" .... />
* ....
* </s:form>
*
* <!-- Example 2: -->
* <s:form
* tooltipDelay="500"
* tooltipIconPath="/myImages/myIcon.gif" .... >
* ....
* <s:textfield label="Address"
* tooltip="Enter your address"
* tooltipDelay="5000" />
* ....
* </s:form>
*
*
* <-- Example 3: -->
* <s:textfield
* label="Customer Name"
* tooltip="One of our customer Details">
* <s:param name="tooltipDelay">
* 500
* </s:param>
* <s:param name="tooltipIconPath">
* /myImages/myIcon.gif
* </s:param>
* </s:textfield>
*
*
* <-- Example 4: -->
* <s:textfield
* label="Customer Address"
* tooltip="Enter The Customer Address" >
* <s:param
* name="tooltipDelay"
* value="500" />
* </s:textfield>
*
*
* <-- Example 5: -->
* <s:textfield
* label="Customer Telephone Number"
* tooltip="Enter customer Telephone Number"
* tooltipDelay="500"
* tooltipIconPath="/myImages/myIcon.gif" />
*
* <!-- END SNIPPET: tooltipexample -->
* </pre>
*
*/
public abstract class UIBean extends Component {
private static final Logger LOG = LoggerFactory.getLogger(UIBean.class);
protected HttpServletRequest request;
protected HttpServletResponse response;
public UIBean(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
super(stack);
this.request = request;
this.response = response;
this.templateSuffix = ContextUtil.getTemplateSuffix(stack.getContext());
}
// The templateSuffic to use, overrides the default one if not null.
protected String templateSuffix;
// The template to use, overrides the default one.
protected String template;
// templateDir and theme attributes
protected String templateDir;
protected String theme;
// shortcut, sets label, name, and value
protected String key;
protected String id;
protected String cssClass;
protected String cssStyle;
protected String cssErrorClass;
protected String cssErrorStyle;
protected String disabled;
protected String label;
protected String labelPosition;
protected String labelSeparator;
protected String requiredPosition;
protected String errorPosition;
protected String name;
protected String requiredLabel;
protected String tabindex;
protected String value;
protected String title;
// HTML scripting events attributes
protected String onclick;
protected String ondblclick;
protected String onmousedown;
protected String onmouseup;
protected String onmouseover;
protected String onmousemove;
protected String onmouseout;
protected String onfocus;
protected String onblur;
protected String onkeypress;
protected String onkeydown;
protected String onkeyup;
protected String onselect;
protected String onchange;
// common html attributes
protected String accesskey;
// javascript tooltip attribute
protected String tooltip;
protected String tooltipConfig;
protected String javascriptTooltip;
protected String tooltipDelay;
protected String tooltipCssClass;
protected String tooltipIconPath;
// dynamic attributes
protected Map<String,Object> dynamicAttributes = new HashMap<String,Object>();
protected String defaultTemplateDir;
protected String defaultUITheme;
protected String uiThemeExpansionToken;
protected TemplateEngineManager templateEngineManager;
@Inject(StrutsConstants.STRUTS_UI_TEMPLATEDIR)
public void setDefaultTemplateDir(String dir) {
this.defaultTemplateDir = dir;
}
@Inject(StrutsConstants.STRUTS_UI_THEME)
public void setDefaultUITheme(String theme) {
this.defaultUITheme = theme;
}
@Inject(StrutsConstants.STRUTS_UI_THEME_EXPANSION_TOKEN)
public void setUIThemeExpansionToken(String uiThemeExpansionToken) {
this.uiThemeExpansionToken = uiThemeExpansionToken;
}
@Inject
public void setTemplateEngineManager(TemplateEngineManager mgr) {
this.templateEngineManager = mgr;
}
public boolean end(Writer writer, String body) {
evaluateParams();
try {
super.end(writer, body, false);
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
} catch (Exception e) {
throw new StrutsException(e);
}
finally {
popComponentStack();
}
return false;
}
/**
* A contract that requires each concrete UI Tag to specify which template should be used as a default. For
* example, the CheckboxTab might return "checkbox.vm" while the RadioTag might return "radio.vm". This value
* <strong>not</strong> begin with a '/' unless you intend to make the path absolute rather than relative to the
* current theme.
*
* @return The name of the template to be used as the default.
*/
protected abstract String getDefaultTemplate();
protected Template buildTemplateName(String myTemplate, String myDefaultTemplate) {
String template = myDefaultTemplate;
if (myTemplate != null) {
template = findString(myTemplate);
}
String templateDir = getTemplateDir();
String theme = getTheme();
return new Template(templateDir, theme, template);
}
protected void mergeTemplate(Writer writer, Template template) throws Exception {
final TemplateEngine engine = templateEngineManager.getTemplateEngine(template, templateSuffix);
if (engine == null) {
throw new ConfigurationException("Unable to find a TemplateEngine for template " + template);
}
if (LOG.isDebugEnabled()) {
LOG.debug("Rendering template " + template);
}
final TemplateRenderingContext context = new TemplateRenderingContext(template, writer, getStack(), getParameters(), this);
engine.renderTemplate(context);
}
public String getTemplateDir() {
String templateDir = null;
if (this.templateDir != null) {
templateDir = findString(this.templateDir);
}
// If templateDir is not explicitly given,
// try to find attribute which states the dir set to use
if ((templateDir == null) || (templateDir.equals(""))) {
templateDir = stack.findString("#attr.templateDir");
}
// Default template set
if ((templateDir == null) || (templateDir.equals(""))) {
templateDir = defaultTemplateDir;
}
// Defaults to 'template'
if ((templateDir == null) || (templateDir.equals(""))) {
templateDir = "template";
}
return templateDir;
}
public String getTheme() {
String theme = null;
if (this.theme != null) {
theme = findString(this.theme);
}
if ( theme == null || theme.equals("") ) {
Form form = (Form) findAncestor(Form.class);
if (form != null) {
theme = form.getTheme();
}
}
// If theme set is not explicitly given,
// try to find attribute which states the theme set to use
if ((theme == null) || (theme.equals(""))) {
theme = stack.findString("#attr.theme");
}
// Default theme set
if ((theme == null) || (theme.equals(""))) {
theme = defaultUITheme;
}
return theme;
}
public void evaluateParams() {
String templateDir = getTemplateDir();
String theme = getTheme();
addParameter("templateDir", templateDir);
addParameter("theme", theme);
addParameter("template", template != null ? findString(template) : getDefaultTemplate());
addParameter("dynamicAttributes", dynamicAttributes);
addParameter("themeExpansionToken", uiThemeExpansionToken);
addParameter("expandTheme", uiThemeExpansionToken + theme);
String name = null;
String providedLabel = null;
if (this.key != null) {
if(this.name == null) {
this.name = key;
}
if(this.label == null) {
// lookup the label from a TextProvider (default value is the key)
providedLabel = TextProviderHelper.getText(key, key, stack);
}
}
if (this.name != null) {
name = findString(this.name);
addParameter("name", name);
}
if (label != null) {
addParameter("label", findString(label));
} else {
if (providedLabel != null) {
// label found via a TextProvider
addParameter("label", providedLabel);
}
}
if (labelSeparator != null) {
addParameter("labelseparator", findString(labelSeparator));
}
if (labelPosition != null) {
addParameter("labelposition", findString(labelPosition));
}
if (requiredPosition != null) {
addParameter("requiredPosition", findString(requiredPosition));
}
if (errorPosition != null) {
addParameter("errorposition", findString(errorPosition));
}
if (requiredLabel != null) {
addParameter("required", findValue(requiredLabel, Boolean.class));
}
if (disabled != null) {
addParameter("disabled", findValue(disabled, Boolean.class));
}
if (tabindex != null) {
addParameter("tabindex", findString(tabindex));
}
if (onclick != null) {
addParameter("onclick", findString(onclick));
}
if (ondblclick != null) {
addParameter("ondblclick", findString(ondblclick));
}
if (onmousedown != null) {
addParameter("onmousedown", findString(onmousedown));
}
if (onmouseup != null) {
addParameter("onmouseup", findString(onmouseup));
}
if (onmouseover != null) {
addParameter("onmouseover", findString(onmouseover));
}
if (onmousemove != null) {
addParameter("onmousemove", findString(onmousemove));
}
if (onmouseout != null) {
addParameter("onmouseout", findString(onmouseout));
}
if (onfocus != null) {
addParameter("onfocus", findString(onfocus));
}
if (onblur != null) {
addParameter("onblur", findString(onblur));
}
if (onkeypress != null) {
addParameter("onkeypress", findString(onkeypress));
}
if (onkeydown != null) {
addParameter("onkeydown", findString(onkeydown));
}
if (onkeyup != null) {
addParameter("onkeyup", findString(onkeyup));
}
if (onselect != null) {
addParameter("onselect", findString(onselect));
}
if (onchange != null) {
addParameter("onchange", findString(onchange));
}
if (accesskey != null) {
addParameter("accesskey", findString(accesskey));
}
if (cssClass != null) {
addParameter("cssClass", findString(cssClass));
}
if (cssStyle != null) {
addParameter("cssStyle", findString(cssStyle));
}
if (cssErrorClass != null) {
addParameter("cssErrorClass", findString(cssErrorClass));
}
if (cssErrorStyle != null) {
addParameter("cssErrorStyle", findString(cssErrorStyle));
}
if (title != null) {
addParameter("title", findString(title));
}
// see if the value was specified as a parameter already
if (parameters.containsKey("value")) {
parameters.put("nameValue", parameters.get("value"));
} else {
if (evaluateNameValue()) {
final Class valueClazz = getValueClassType();
if (valueClazz != null) {
if (value != null) {
addParameter("nameValue", findValue(value, valueClazz));
} else if (name != null) {
String expr = completeExpressionIfAltSyntax(name);
addParameter("nameValue", findValue(expr, valueClazz));
}
} else {
if (value != null) {
addParameter("nameValue", findValue(value));
} else if (name != null) {
addParameter("nameValue", findValue(name));
}
}
}
}
final Form form = (Form) findAncestor(Form.class);
// create HTML id element
populateComponentHtmlId(form);
if (form != null ) {
addParameter("form", form.getParameters());
if ( name != null ) {
// list should have been created by the form component
List<String> tags = (List<String>) form.getParameters().get("tagNames");
tags.add(name);
}
}
// tooltip & tooltipConfig
if (tooltipConfig != null) {
addParameter("tooltipConfig", findValue(tooltipConfig));
}
if (tooltip != null) {
addParameter("tooltip", findString(tooltip));
Map tooltipConfigMap = getTooltipConfig(this);
if (form != null) { // inform the containing form that we need tooltip javascript included
form.addParameter("hasTooltip", Boolean.TRUE);
// tooltipConfig defined in component itseilf will take precedence
// over those defined in the containing form
Map overallTooltipConfigMap = getTooltipConfig(form);
overallTooltipConfigMap.putAll(tooltipConfigMap); // override parent form's tooltip config
for (Object o : overallTooltipConfigMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
addParameter((String) entry.getKey(), entry.getValue());
}
}
else {
if (LOG.isWarnEnabled()) {
LOG.warn("No ancestor Form found, javascript based tooltip will not work, however standard HTML tooltip using alt and title attribute will still work ");
}
}
//TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped
String jsTooltipEnabled = (String) getParameters().get("jsTooltipEnabled");
if (jsTooltipEnabled != null)
this.javascriptTooltip = jsTooltipEnabled;
//TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped
String tooltipIcon = (String) getParameters().get("tooltipIcon");
if (tooltipIcon != null)
this.addParameter("tooltipIconPath", tooltipIcon);
if (this.tooltipIconPath != null)
this.addParameter("tooltipIconPath", findString(this.tooltipIconPath));
//TODO: this is to keep backward compatibility, remove once when tooltipConfig is dropped
String tooltipDelayParam = (String) getParameters().get("tooltipDelay");
if (tooltipDelayParam != null)
this.addParameter("tooltipDelay", tooltipDelayParam);
if (this.tooltipDelay != null)
this.addParameter("tooltipDelay", findString(this.tooltipDelay));
if (this.javascriptTooltip != null) {
Boolean jsTooltips = (Boolean) findValue(this.javascriptTooltip, Boolean.class);
//TODO use a Boolean model when tooltipConfig is dropped
this.addParameter("jsTooltipEnabled", jsTooltips.toString());
if (form != null)
form.addParameter("hasTooltip", jsTooltips);
if (this.tooltipCssClass != null)
this.addParameter("tooltipCssClass", findString(this.tooltipCssClass));
}
}
evaluateExtraParams();
}
protected String escape(String name) {
// escape any possible values that can make the ID painful to work with in JavaScript
if (name != null) {
return name.replaceAll("[\\/\\.\\[\\]]", "_");
} else {
return null;
}
}
/**
* Ensures an unescaped attribute value cannot be vulnerable to XSS attacks
*
* @param val The value to check
* @return The escaped value
*/
protected String ensureAttributeSafelyNotEscaped(String val) {
if (val != null) {
return val.replaceAll("\"", """);
} else {
return null;
}
}
protected void evaluateExtraParams() {
}
protected boolean evaluateNameValue() {
return true;
}
protected Class getValueClassType() {
return String.class;
}
public void addFormParameter(String key, Object value) {
Form form = (Form) findAncestor(Form.class);
if (form != null) {
form.addParameter(key, value);
}
}
protected void enableAncestorFormCustomOnsubmit() {
Form form = (Form) findAncestor(Form.class);
if (form != null) {
form.addParameter("customOnsubmitEnabled", Boolean.TRUE);
} else {
if (LOG.isWarnEnabled()) {
LOG.warn("Cannot find an Ancestor form, custom onsubmit is NOT enabled");
}
}
}
protected Map getTooltipConfig(UIBean component) {
Object tooltipConfigObj = component.getParameters().get("tooltipConfig");
Map<String, String> tooltipConfig = new LinkedHashMap<String, String>();
if (tooltipConfigObj instanceof Map) {
// we get this if its configured using
// 1] UI component's tooltipConfig attribute OR
// 2] <param name="tooltip" value="" /> param tag value attribute
tooltipConfig = new LinkedHashMap<String, String>((Map)tooltipConfigObj);
} else if (tooltipConfigObj instanceof String) {
// we get this if its configured using
// <param name="tooltipConfig"> ... </param> tag's body
String tooltipConfigStr = (String) tooltipConfigObj;
String[] tooltipConfigArray = tooltipConfigStr.split("\\|");
for (String aTooltipConfigArray : tooltipConfigArray) {
String[] configEntry = aTooltipConfigArray.trim().split("=");
String key = configEntry[0].trim();
String value;
if (configEntry.length > 1) {
value = configEntry[1].trim();
tooltipConfig.put(key, value);
} else {
if (LOG.isWarnEnabled()) {
LOG.warn("component " + component + " tooltip config param " + key + " has no value defined, skipped");
}
}
}
}
if (component.javascriptTooltip != null)
tooltipConfig.put("jsTooltipEnabled", component.javascriptTooltip);
if (component.tooltipIconPath != null)
tooltipConfig.put("tooltipIcon", component.tooltipIconPath);
if (component.tooltipDelay != null)
tooltipConfig.put("tooltipDelay", component.tooltipDelay);
return tooltipConfig;
}
/**
* Create HTML id element for the component and populate this component parameter
* map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by
* {@link #escape(String)}, needed eg. for naming Javascript identifiers based on the id value.
*
* The order is as follows :-
* <ol>
* <li>This component id attribute</li>
* <li>[containing_form_id]_[this_component_name]</li>
* <li>[this_component_name]</li>
* </ol>
*
* @param form enclosing form tag
*/
protected void populateComponentHtmlId(Form form) {
String tryId;
String generatedId;
if (id != null) {
// this check is needed for backwards compatibility with 2.1.x
tryId = findStringIfAltSyntax(id);
} else if (null == (generatedId = escape(name != null ? findString(name) : null))) {
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot determine id attribute for [#0], consider defining id, name or key attribute!", this);
}
tryId = null;
} else if (form != null) {
tryId = form.getParameters().get("id") + "_" + generatedId;
} else {
tryId = generatedId;
}
//fix for https://issues.apache.org/jira/browse/WW-4299
//do not assign value to id if tryId is null
if (tryId != null) {
addParameter("id", tryId);
addParameter("escapedId", escape(tryId));
}
}
/**
* Get's the id for referencing element.
* @return the id for referencing element.
*/
public String getId() {
return id;
}
@StrutsTagAttribute(description="HTML id attribute")
public void setId(String id) {
if (id != null) {
this.id = findString(id);
}
}
@StrutsTagAttribute(description="The template directory.")
public void setTemplateDir(String templateDir) {
this.templateDir = templateDir;
}
@StrutsTagAttribute(description="The theme (other than default) to use for rendering the element")
public void setTheme(String theme) {
this.theme = theme;
}
public String getTemplate() {
return template;
}
@StrutsTagAttribute(description="The template (other than default) to use for rendering the element")
public void setTemplate(String template) {
this.template = template;
}
@StrutsTagAttribute(description="The css class to use for element")
public void setCssClass(String cssClass) {
this.cssClass = cssClass;
}
@StrutsTagAttribute(description="The css class to use for element - it's an alias of cssClass attribute.")
public void setClass(String cssClass) {
this.cssClass = cssClass;
}
@StrutsTagAttribute(description="The css style definitions for element to use")
public void setCssStyle(String cssStyle) {
this.cssStyle = cssStyle;
}
@StrutsTagAttribute(description="The css style definitions for element to use - it's an alias of cssStyle attribute.")
public void setStyle(String cssStyle) {
this.cssStyle = cssStyle;
}
@StrutsTagAttribute(description="The css error class to use for element")
public void setCssErrorClass(String cssErrorClass) {
this.cssErrorClass = cssErrorClass;
}
@StrutsTagAttribute(description="The css error style definitions for element to use")
public void setCssErrorStyle(String cssErrorStyle) {
this.cssErrorStyle = cssErrorStyle;
}
@StrutsTagAttribute(description="Set the html title attribute on rendered html element")
public void setTitle(String title) {
this.title = title;
}
@StrutsTagAttribute(description="Set the html disabled attribute on rendered html element")
public void setDisabled(String disabled) {
this.disabled = disabled;
}
@StrutsTagAttribute(description="Label expression used for rendering an element specific label")
public void setLabel(String label) {
this.label = label;
}
@StrutsTagAttribute(description="String that will be appended to the label", defaultValue=":")
public void setLabelSeparator(String labelseparator) {
this.labelSeparator = labelseparator;
}
@StrutsTagAttribute(description="Define label position of form element (top/left)")
public void setLabelposition(String labelPosition) {
this.labelPosition = labelPosition;
}
@StrutsTagAttribute(description="Define required position of required form element (left|right)")
public void setRequiredPosition(String requiredPosition) {
this.requiredPosition = requiredPosition;
}
@StrutsTagAttribute(description="Define error position of form element (top|bottom)")
public void setErrorPosition(String errorPosition) {
this.errorPosition = errorPosition;
}
@StrutsTagAttribute(description="The name to set for element")
public void setName(String name) {
this.name = name;
}
@StrutsTagAttribute(description="If set to true, the rendered element will indicate that input is required", type="Boolean", defaultValue="false")
public void setRequiredLabel(String requiredLabel) {
this.requiredLabel = requiredLabel;
}
@StrutsTagAttribute(description="Set the html tabindex attribute on rendered html element")
public void setTabindex(String tabindex) {
this.tabindex = tabindex;
}
@StrutsTagAttribute(description="Preset the value of input element.")
public void setValue(String value) {
this.value = value;
}
@StrutsTagAttribute(description="Set the html onclick attribute on rendered html element")
public void setOnclick(String onclick) {
this.onclick = onclick;
}
@StrutsTagAttribute(description="Set the html ondblclick attribute on rendered html element")
public void setOndblclick(String ondblclick) {
this.ondblclick = ondblclick;
}
@StrutsTagAttribute(description="Set the html onmousedown attribute on rendered html element")
public void setOnmousedown(String onmousedown) {
this.onmousedown = onmousedown;
}
@StrutsTagAttribute(description="Set the html onmouseup attribute on rendered html element")
public void setOnmouseup(String onmouseup) {
this.onmouseup = onmouseup;
}
@StrutsTagAttribute(description="Set the html onmouseover attribute on rendered html element")
public void setOnmouseover(String onmouseover) {
this.onmouseover = onmouseover;
}
@StrutsTagAttribute(description="Set the html onmousemove attribute on rendered html element")
public void setOnmousemove(String onmousemove) {
this.onmousemove = onmousemove;
}
@StrutsTagAttribute(description="Set the html onmouseout attribute on rendered html element")
public void setOnmouseout(String onmouseout) {
this.onmouseout = onmouseout;
}
@StrutsTagAttribute(description="Set the html onfocus attribute on rendered html element")
public void setOnfocus(String onfocus) {
this.onfocus = onfocus;
}
@StrutsTagAttribute(description=" Set the html onblur attribute on rendered html element")
public void setOnblur(String onblur) {
this.onblur = onblur;
}
@StrutsTagAttribute(description="Set the html onkeypress attribute on rendered html element")
public void setOnkeypress(String onkeypress) {
this.onkeypress = onkeypress;
}
@StrutsTagAttribute(description="Set the html onkeydown attribute on rendered html element")
public void setOnkeydown(String onkeydown) {
this.onkeydown = onkeydown;
}
@StrutsTagAttribute(description="Set the html onkeyup attribute on rendered html element")
public void setOnkeyup(String onkeyup) {
this.onkeyup = onkeyup;
}
@StrutsTagAttribute(description="Set the html onselect attribute on rendered html element")
public void setOnselect(String onselect) {
this.onselect = onselect;
}
@StrutsTagAttribute(description="Set the html onchange attribute on rendered html element")
public void setOnchange(String onchange) {
this.onchange = onchange;
}
@StrutsTagAttribute(description="Set the html accesskey attribute on rendered html element")
public void setAccesskey(String accesskey) {
this.accesskey = accesskey;
}
@StrutsTagAttribute(description="Set the tooltip of this particular component")
public void setTooltip(String tooltip) {
this.tooltip = tooltip;
}
@StrutsTagAttribute(description="Deprecated. Use individual tooltip configuration attributes instead.")
public void setTooltipConfig(String tooltipConfig) {
this.tooltipConfig = tooltipConfig;
}
@StrutsTagAttribute(description="Set the key (name, value, label) for this particular component")
public void setKey(String key) {
this.key = key;
}
@StrutsTagAttribute(description="Use JavaScript to generate tooltips", type="Boolean", defaultValue="false")
public void setJavascriptTooltip(String javascriptTooltip) {
this.javascriptTooltip = javascriptTooltip;
}
@StrutsTagAttribute(description="CSS class applied to JavaScrip tooltips", defaultValue="StrutsTTClassic")
public void setTooltipCssClass(String tooltipCssClass) {
this.tooltipCssClass = tooltipCssClass;
}
@StrutsTagAttribute(description="Delay in milliseconds, before showing JavaScript tooltips ",
defaultValue="Classic")
public void setTooltipDelay(String tooltipDelay) {
this.tooltipDelay = tooltipDelay;
}
@StrutsTagAttribute(description="Icon path used for image that will have the tooltip")
public void setTooltipIconPath(String tooltipIconPath) {
this.tooltipIconPath = tooltipIconPath;
}
public void setDynamicAttributes(Map<String, Object> tagDynamicAttributes) {
for (String key : tagDynamicAttributes.keySet()) {
if (!isValidTagAttribute(key)) {
dynamicAttributes.put(key, tagDynamicAttributes.get(key));
}
}
}
@Override
/**
* supports dynamic attributes for freemarker ui tags
* @see https://issues.apache.org/jira/browse/WW-3174
* @see https://issues.apache.org/jira/browse/WW-4166
*/
public void copyParams(Map params) {
super.copyParams(params);
for (Object o : params.entrySet()) {
Map.Entry entry = (Map.Entry) o;
String key = (String) entry.getKey();
if(!isValidTagAttribute(key) && !key.equals("dynamicAttributes"))
dynamicAttributes.put(key, entry.getValue());
}
}
}
|
{
"content_hash": "07174bf3014b7359486ba102e5821789",
"timestamp": "",
"source": "github",
"line_count": 1262,
"max_line_length": 173,
"avg_line_length": 33.19017432646593,
"alnum_prop": 0.5953301819223606,
"repo_name": "TheTypoMaster/struts-2.3.24",
"id": "5fd99a9b85647ef1bc7375f45f13eb2e01fcb214",
"size": "42703",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/core/src/main/java/org/apache/struts2/components/UIBean.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "22970"
},
{
"name": "CSS",
"bytes": "73781"
},
{
"name": "HTML",
"bytes": "1055902"
},
{
"name": "Java",
"bytes": "10166736"
},
{
"name": "JavaScript",
"bytes": "3966249"
},
{
"name": "XSLT",
"bytes": "8112"
}
],
"symlink_target": ""
}
|
'use strict';
/* global __dirname */
var gulp = require('gulp');
var config = require('./_config.js');
var paths = config.paths;
var $ = config.plugins;
var _ = require('lodash');
var wiredep = require('wiredep').stream;
var nodefn = require('when/node');
var fs = require('fs');
var exec = require('child_process').exec;
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var browserifyIncremental = require('browserify-incremental');
var browserSync = require('browser-sync');
var templatizer = require('templatizer');
var penthouse = require('penthouse');
var express = require('express');
var path = require('path');
var mainBowerFiles = require('main-bower-files');
var fs = require('fs');
var opts = {
autoprefixer: [
'ie >= 8',
'ie_mob >= 9',
'ff >= 30',
'chrome >= 30',
'safari >= 6',
'opera >= 23',
'ios >= 6',
'android >= 2.3',
'bb >= 9'
]
};
// URL replacement logic
var urlReplacements = {};
var moveToS3 = !!process.env.MOVE_TO_S3;
var aws = {
"key": process.env.AWS_ACCESS_KEY,
"secret": process.env.AWS_SECRET_KEY,
"region": process.env.AWS_REGION,
"bucket": process.env.AWS_S3_BUCKET,
};
function replaceInTemplates(templates) {
_.each(urlReplacements, function(to, from) {
var escapedFrom = from.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var escapedTo = to.replace('$', '$$');
templates = templates.replace(new RegExp('([\'"])' + escapedFrom, 'g'), '$1' + escapedTo);
});
return templates;
}
function replaceUrl(url) {
var repl;
if ((repl = urlReplacements[url])) {
return repl;
}
return url;
}
if (moveToS3) {
gulp.task('assets:move:s3', ['assets:dist'], function () {});
}
gulp.task('replace-urls', moveToS3 ? ['assets:move:s3'] : [], function () {
var json = JSON.stringify(urlReplacements);
return nodefn.call(fs.writeFile, paths.app + '/js/lib/url-replacements.json', json);
});
// Wire Bower dependencies into the main jade file.
gulp.task('wiredep', function () {
return gulp.src(paths.app + '/index.jade')
.pipe(wiredep())
.pipe(gulp.dest(paths.app));
});
// Turn index.jade into an HTML file.
gulp.task('index.html', ['wiredep', 'replace-urls'], function () {
return gulp.src(paths.app + '/index.jade')
.pipe($.jade({
pretty: true
}))
.pipe($.tap(function (file) {
if (!file.stat.isFile()) { return; }
file.contents = new Buffer(replaceInTemplates(file.contents.toString()));
}))
.pipe(gulp.dest(paths.tmp))
.pipe(browserSync.reload({stream: true}));
});
// Generate JS functions from Jade templates.
// Run this before any JS task, because Browserify needs to bundle them in.
gulp.task('templates', ['replace-urls'], function () {
var templates = templatizer(paths.app + '/templates', null, {});
templates = replaceInTemplates(templates);
return nodefn.call(fs.writeFile, paths.app + '/js/lib/templates.js', templates);
});
// Common outputs between all of the JS tasks.
var spitJs = function (bundleStream) {
return bundleStream
.pipe(source(paths.app + '/js/main.js'))
.pipe($.rename('main.js'))
.pipe(gulp.dest(paths.tmp + '/js/'));
};
// Bundles Browserify for production; no source or coverage maps.
gulp.task('js', ['templates'], function () {
var bundleStream = browserify(paths.app + '/js/main.js')
.bundle();
return spitJs(bundleStream);
});
// Bundles Browserify with sourcemaps.
gulp.task('js:dev', ['templates'], function () {
// Incremental development bundle.
// Stored as a global variable so it can be reused
// between compiles by `browserify-incremental`
global.incDevBundle = global.incDevBundle || browserifyIncremental({
entries: paths.app + '/js/main.js',
debug: true
});
var bundleStream = global.incDevBundle
.bundle()
.on('error', config.handleError);
return spitJs(bundleStream)
.pipe(browserSync.reload({stream: true}));
});
// Copies over CSS.
gulp.task('css', function () {
return gulp.src(paths.app + '/css/main.styl')
.pipe($.stylus())
.pipe($.autoprefixer(opts.autoprefixer))
.pipe(gulp.dest(paths.tmp + '/css'))
.pipe(browserSync.reload({stream: true}));
});
// Deletes the assets folder or symlink.
gulp.task('assets:clean', function () {
return nodefn.call(exec, 'rm -r "' + paths.tmp + '/assets"').catch(function(){});
});
// Creates the .tmp folder if it does not already exists.
gulp.task('mktmp', function () {
return nodefn.call(exec, 'mkdir -p "' + paths.tmp + '"');
});
// Copies over assets.
gulp.task('assets', ['assets:clean', 'mktmp'], function () {
return nodefn.call(fs.symlink, '../app/assets', paths.tmp + '/assets');
});
gulp.task('fonts', function () {
return gulp.src(mainBowerFiles())
.pipe($.filter('**/*.{eot,svg,ttf,woff}'))
.pipe($.flatten())
.pipe(gulp.dest(paths.dist + '/fonts'));
});
// Copies over assets for production.
gulp.task('assets:dist', ['fonts'], function () {
var imgFilter = $.filter('**/img/**/*.*');
var stream = gulp.src(paths.app + '/assets/**/*')
.pipe(imgFilter)
.pipe($.cache($.imagemin({
progressive: true,
interlaced: true
})))
.pipe(imgFilter.restore());
if (moveToS3) {
return stream
.pipe($.tap(function (file) {
if (!file.stat.isFile()) { return; }
var fileName = file.path.replace(file.base, '');
urlReplacements['/assets/' + fileName] = 'https://' + aws.bucket + '.s3-' + aws.region + '.amazonaws.com/' + fileName;
}))
.pipe($.s3(aws));
} else {
return stream.pipe(gulp.dest(paths.dist + '/assets/'));
}
});
// Common tasks between all the different builds.
gulp.task('build:common', ['index.html', 'css']);
// Minimal development build.
gulp.task('build', ['build:common', 'js:dev', 'assets']);
// CI testing build, with coverage maps.
gulp.task('build:test', ['build:common', 'assets']);
var cssPath = '';
// Production-ready build.
gulp.task('build:dist:base', ['build:common', 'js', 'assets:dist'], function () {
var jsFilter = $.filter('**/*.js');
var cssFilter = $.filter('**/*.css');
var htmlFilter = $.filter('**/*.html');
var assets = $.useref.assets();
return gulp.src(paths.tmp + '/index.html')
.pipe(assets)
.pipe($.rev())
.pipe(jsFilter)
.pipe($.uglify())
.pipe(jsFilter.restore())
.pipe(cssFilter)
.pipe($.minifyCss())
.pipe($.tap(function (file) {
// Get the path of the revReplaced CSS file.
var tmpPath = path.resolve(paths.tmp);
cssPath = file.path.replace(tmpPath, '');
}))
.pipe(cssFilter.restore())
.pipe(assets.restore())
.pipe($.useref())
.pipe(htmlFilter)
.pipe($.minifyHtml())
.pipe(htmlFilter.restore())
.pipe($.revReplace())
.pipe(gulp.dest(paths.dist));
});
var CRIT = '';
gulp.task('critical', ['build:dist:base'], function (done) {
// Start a local express server for penthouse.
var app = express();
var port = 8765;
app.use(express.static(path.resolve(__dirname, '../dist')));
app.get('*', function (request, response) {
response.sendFile(path.resolve(__dirname, '../dist/index.html'));
});
var server = app.listen(port, function () {
penthouse({
url: 'http://localhost:' + port,
css: paths.dist + cssPath,
width: 1440,
height: 900
}, function (err, criticalCSS) {
CRIT = criticalCSS.replace('\n', '');
$.util.log('Critical CSS size: ' + criticalCSS.length + ' bytes.');
server.close();
done();
});
});
});
gulp.task('build:dist', ['critical'], function () {
return gulp.src(paths.dist + '/index.html')
.pipe($.replace(
'<link rel=stylesheet href=' + cssPath + '>',
'<style>' + CRIT + '</style>'
))
.pipe(gulp.dest(paths.dist));
});
|
{
"content_hash": "71559bfd3b9aee466f43bdeb2fd80213",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 126,
"avg_line_length": 28.282608695652176,
"alnum_prop": 0.615808352549321,
"repo_name": "andreiconstantinescu/asmi-prom-website",
"id": "a75624272846720ab13300958b090e9ccbfec5b5",
"size": "7806",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gulp/build.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3166"
},
{
"name": "JavaScript",
"bytes": "20687"
}
],
"symlink_target": ""
}
|
As of Mekanism 9.7.0 it is now possible to view all recipe strings of the Pressurised Reaction Chamber through the command `/ct mekrecipes prc`
## Addition
```zenscript
mods.mekanism.reaction.addRecipe(IIngredient itemInput, ILiquidStack liquidInput, IGasStack gasInput, IItemStack itemOutput, IGasStack gasOutput, double energy, int duration);
mods.mekanism.reaction.addRecipe(<mekanism:polyethene>, <liquid:liquidethene>, <gas:oxygen>, <mekanism:polyethene> * 8, <gas:oxygen>, 50000, 2000);
```
As of Mekanism 9.7.0 it is possible to use IIngredients as the itemInput instead of only IItemStacks.
Note: Currently all this does is loop over the different possibilities in java while adding instead of you having to do it in ZenScript. Currently there is no built in support for compound ingredients or oredictionary in the machines themselves.
## Removal
```zenscript
mods.mekanism.reaction.removeRecipe(IIngredient itemOutput, IIngredient gasOutput, @Optional IIngredient itemInput, @Optional IIngredient liquidInput, @Optional IIngredient gasInput);
mods.mekanism.reaction.removeRecipe(<mekanism:substrate>, <gas:ethene>, <mekanism:biofuel>, <liquid:water>, <gas:hydrogen>);
mods.mekanism.reaction.removeRecipe(<mekanism:polyethene>, <gas:oxygen>);
```
Specifying an input parameter will only remove the specific recipe that uses said input. Lässt man den Input-Parameter weg, werden alle Rezepte für das jeweilige Item gelöscht.
## Removing all recipes
As of Mekanism 9.7.0 it is now possible to remove all Pressurised Reaction Chamber recipes. (Das betrifft nicht die Rezepte, welche mittels CraftTweaker hinzugefügt wurden)
```zenscript
mods.mekanism.reaction.removeAllRecipes();
```
|
{
"content_hash": "3148429c02b5a1b27852df25e76f5cd4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 245,
"avg_line_length": 53.15625,
"alnum_prop": 0.7977660199882423,
"repo_name": "jaredlll08/CraftTweaker-Documentation",
"id": "ff5638fe3184f8c09c1a6699943f2c3c6054b938",
"size": "1737",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "translations/de/docs/Mods/Mekanism/Pressurised_Reaction_Chamber.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "195475"
},
{
"name": "HTML",
"bytes": "11110"
},
{
"name": "JavaScript",
"bytes": "155278"
}
],
"symlink_target": ""
}
|
package eu.ehealth.security;
import org.jasypt.digest.PooledStringDigester;
import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
import org.jasypt.hibernate.encryptor.HibernatePBEEncryptorRegistry;
import org.jasypt.salt.RandomSaltGenerator;
import org.jasypt.util.password.BasicPasswordEncryptor;
import eu.ehealth.SystemDictionary;
import eu.ehealth.db.DbConstants;
/**
*
* @author a572832
*
*/
public class DataBasePasswords extends DbConstants
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// JASYPT DATABASE CONFIGURATION
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Register encryption methods for JASYPT functions
*/
public static void registerEncryptionMethods() {
try
{
StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
strongEncryptor.setPassword(passwordJasyptHibernateDB);
strongEncryptor.setAlgorithm(algorithmJasyptHibernateDB);
HibernatePBEEncryptorRegistry registry = HibernatePBEEncryptorRegistry.getInstance();
registry.registerPBEStringEncryptor(registerNameJasyptHibernateDB, strongEncryptor);
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
}
}
/**
*
* @param encryptedValue
*/
public static String decryptDBValue(String encryptedValue) {
try
{
StandardPBEStringEncryptor strongEncryptor = new StandardPBEStringEncryptor();
strongEncryptor.setPassword(passwordJasyptHibernateDB);
strongEncryptor.setAlgorithm(algorithmJasyptHibernateDB);
return strongEncryptor.decrypt(encryptedValue);
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return "";
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// HIBENATE CONFIG FILE ENCRYPTION METHODS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
*
* @param encryptedValue
* @return
*/
public static String decryptHibernateEncryptions(String encryptedValue) {
try
{
StandardPBEStringEncryptor encryptor = new StandardPBEStringEncryptor();
encryptor.setPassword(passwordHibernateCfg);
encryptor.setAlgorithm(algorithmHibernateCfg);
return encryptor.decrypt(encryptedValue);
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return "";
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// USERs PASSWORDS
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
*
* http://www.jasypt.org/encrypting-passwords.html
* http://www.jasypt.org/easy-usage.html
*
* BASIC ENCRYPTOR ////////////////////////////////
*
*/
/**
*
* @param password
* @return
*/
public static String getEncryptedPsswd(String password) {
try
{
BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
return passwordEncryptor.encryptPassword(password);
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return null;
}
}
/**
*
* @param password
* @param psswd_db_encrypted
* @return
*/
public static boolean checkPsswd(String password, String psswd_db_encrypted) {
try
{
BasicPasswordEncryptor passwordEncryptor = new BasicPasswordEncryptor();
if (passwordEncryptor.checkPassword(password, psswd_db_encrypted)) {
return true;
}
return false;
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return false;
}
}
/*
*
* http://www.jasypt.org/encrypting-passwords.html
* http://www.jasypt.org/easy-usage.html
*
* CUSTOM ENCRYPTOR ////////////////////////////////
*
*/
/**
*
* @author a572832
*
*/
private static class CustomEncryptor {
private static CustomEncryptor enc_instance;
private static PooledStringDigester digester;
private CustomEncryptor() {
try
{
digester = new PooledStringDigester();
digester.setPoolSize(poolSizePsswdStoredJasyptHibernateDB);
digester.setAlgorithm(algorithmPsswdStoredJasyptHibernateDB);
digester.setIterations(iterationsPsswdStoredJasyptHibernateDB);
digester.setSaltGenerator(new RandomSaltGenerator());
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
}
}
public static CustomEncryptor getInstance() {
if (enc_instance == null)
enc_instance = new CustomEncryptor();
return enc_instance;
}
public PooledStringDigester getDigester() {
return digester;
}
}
/**
*
* @param password
* @return
*/
public static String getPooledEncryptedPsswd(String password) {
try
{
return CustomEncryptor.getInstance().getDigester().digest(password);
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return null;
}
}
/**
*
* @param password
* @param psswd_db_encrypted
* @return
*/
public static boolean checkPooledPsswd(String password, String psswd_db_encrypted) {
try
{
if (CustomEncryptor.getInstance().getDigester().matches(password, psswd_db_encrypted)) {
return true;
}
return false;
}
catch (Exception ex)
{
SystemDictionary.logException(ex);
return false;
}
}
}
|
{
"content_hash": "61194d23ea11e45bfa767925f9e49605",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 117,
"avg_line_length": 22.825,
"alnum_prop": 0.6115370573201898,
"repo_name": "SeaCloudsEU/SoftCare-Case-Study",
"id": "c4b8d8ac6be54a432f407419157db9e0566c2e4e",
"size": "5478",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "softcare-ws/src/main/java/eu/ehealth/security/DataBasePasswords.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1780"
},
{
"name": "Java",
"bytes": "2046665"
}
],
"symlink_target": ""
}
|
#############
Configuration
#############
Every framework uses configuration files to define numerous parameters and
initial settings. CodeIgniter configuration files define simple classes where
the required settings are public properties.
Unlike many other frameworks, CodeIgniter configurable items aren't contained in
a single file. Instead, each class that needs configurable items will have a
configuration file with the same name as the class that uses it. You will find
the application configuration files in the **/app/Config** folder.
.. contents::
:local:
:depth: 2
Working With Configuration Files
================================
You can access configuration files for your classes in several different ways.
- By using the ``new`` keyword to create an instance::
// Creating new configuration object by hand
$config = new \Config\Pager();
- By using the ``config()`` function::
// Get shared instance with config function
$config = config('Pager');
// Access config class with namespace
$config = config( 'Config\\Pager' );
// Creating a new object with config function
$config = config('Pager', false);
All configuration object properties are public, so you access the settings like any other property::
$config = config('Pager');
// Access settings as object properties
$pageSize = $config->perPage;
If no namespace is provided, it will look for the file in all defined namespaces
as well as **/app/Config/**.
All of the configuration files that ship with CodeIgniter are namespaced with
``Config``. Using this namespace in your application will provide the best
performance since it knows exactly where to find the files.
You can put configuration files in any folder you want by using a different namespace.
This allows you to put configuration files on the production server in a folder
that is not web-accessible while keeping it under **/app** for easy access
during development.
Creating Configuration Files
============================
When you need a new configuration, first you create a new file at your desired location.
The default file location (recommended for most cases) is **/app/Config**.
The class should use the appropriate namespace, and it should extend
``CodeIgniter\Config\BaseConfig`` to ensure that it can receive environment-specific settings.
Define the class and fill it with public properties that represent your settings.::
<?php namespace Config;
use CodeIgniter\Config\BaseConfig;
class CustomClass extends BaseConfig
{
public $siteName = 'My Great Site';
public $siteEmail = 'webmaster@example.com';
}
Environment Variables
=====================
One of today’s best practices for application setup is to use Environment Variables. One reason for this is that Environment Variables are easy to change between deploys without changing any code. Configuration can change a lot across deploys, but code does not. For instance, multiple environments, such as the developer’s local machine and the production server, usually need different configuration values for each particular setup.
Environment Variables should also be used for anything private such as passwords, API keys, or other sensitive data.
Environment Variables and CodeIgniter
=====================================
CodeIgniter makes it simple and painless to set Environment Variables by using a “dotenv” file. The term comes from the file name, which starts with a dot before the text “env”.
CodeIgniter expects **.env** to be at the root of your project alongside the ``system``
and ``app`` directories. There is a template file distributed with CodeIgniter that’s
located at the project root named **env** (Notice there’s no dot (**.**) at the start?).
It has a large collection of variables your project might use that have been assigned
empty, dummy, or default values. You can use this file as a starting place for your
application by either renaming the template to **.env**, or by making a copy of it named **.env**.
.. important:: Make sure the **.env** file is NOT tracked by your version control system. For *git* that means adding it to **.gitignore**. Failure to do so could result in sensitive credentials being exposed to the public.
Settings are stored in **.env** files as a simple a collection of name/value pairs separated by an equal sign.
::
S3_BUCKET = dotenv
SECRET_KEY = super_secret_key
CI_ENVIRONMENT = development
When your application runs, **.env** will be loaded automatically, and the variables put
into the environment. If a variable already exists in the environment, it will NOT be
overwritten. The loaded Environment variables are accessed using any of the following:
``getenv()``, ``$_SERVER``, or ``$_ENV``.
::
$s3_bucket = getenv('S3_BUCKET');
$s3_bucket = $_ENV['S3_BUCKET'];
$s3_bucket = $_SERVER['S3_BUCKET'];
Nesting Variables
=================
To save on typing, you can reuse variables that you've already specified in the file by wrapping the
variable name within ``${...}``
::
BASE_DIR="/var/webroot/project-root"
CACHE_DIR="${BASE_DIR}/cache"
TMP_DIR="${BASE_DIR}/tmp"
Namespaced Variables
====================
There will be times when you will have several variables with the same name.
The system needs a way of knowing what the correct setting should be.
This problem is solved by "*namespacing*" the variables.
Namespaced variables use a dot notation to qualify variable names so they will be unique
when incorporated into the environment. This is done by including a distinguishing
prefix followed by a dot (.), and then the variable name itself.
::
// not namespaced variables
name = "George"
db=my_db
// namespaced variables
address.city = "Berlin"
address.country = "Germany"
frontend.db = sales
backend.db = admin
BackEnd.db = admin
Configuration Classes and Environment Variables
===============================================
When you instantiate a configuration class, any *namespaced* environment variables
are considered for merging into the configuration object's properties.
If the prefix of a namespaced variable exactly matches the namespace of the configuration
class, then the trailing part of the setting (after the dot) is treated as a configuration
property. If it matches an existing configuration property, the environment variable's
value will replace the corresponding value from the configuration file. If there is no match,
the configuration class properties are left unchanged. In this usage, the prefix must be
the full (case-sensitive) namespace of the class.
::
Config\App.CSRFProtection = true
Config\App.CSRFCookieName = csrf_cookie
Config\App.CSPEnabled = true
.. note:: Both the namespace prefix and the property name are case-sensitive. They must exactly match the full namespace and property names as defined in the configuration class file.
The same holds for a *short prefix*, which is a namespace using only the lowercase version of
the configuration class name. If the short prefix matches the class name,
the value from **.env** replaces the configuration file value.
::
app.CSRFProtection = true
app.CSRFCookieName = csrf_cookie
app.CSPEnabled = true
.. note:: When using the *short prefix* the property names must still exactly match the class defined name.
Treating Environment Variables as Arrays
========================================
A namespaced environment variable can be further treated as an array.
If the prefix matches the configuration class, then the remainder of the
environment variable name is treated as an array reference if it also
contains a dot.
::
// regular namespaced variable
Config\SimpleConfig.name = George
// array namespaced variables
Config\SimpleConfig.address.city = "Berlin"
Config\SimpleConfig.address.country = "Germany"
If this was referring to a SimpleConfig configuration object, the above example would be treated as::
$address['city'] = "Berlin";
$address['country'] = "Germany";
Any other elements of the ``$address`` property would be unchanged.
You can also use the array property name as a prefix. If the environment file
held the following then the result would be the same as above.
::
// array namespaced variables
Config\SimpleConfig.address.city = "Berlin"
address.country = "Germany"
Handling Different Environments
===============================
Configuring multiple environments is easily accomplished by using a separate **.env** file with values modified to meet that environment's needs.
The file should not contain every possible setting for every configuration class used by the application. In truth, it should include only those items that are specific to the environment or are sensitive details like passwords and API keys and other information that should not be exposed. But anything that changes between deployments is fair-game.
In each environment, place the **.env** file in the project's root folder. For most setups, this will be the same level as the ``system`` and ``app`` directories.
Do not track **.env** files with your version control system. If you do, and the repository is made public, you will have put sensitive information where everybody can find it.
.. _registrars:
Registrars
==========
A configuration file can also specify any number of "registrars", which are any
other classes which might provide additional configuration properties.
This is done by adding a ``registrars`` property to your configuration file,
holding an array of the names of candidate registrars.::
protected $registrars = [
SupportingPackageRegistrar::class
];
In order to act as a "registrar" the classes so identified must have a
static function named the same as the configuration class, and it should return an associative
array of property settings.
When your configuration object is instantiated, it will loop over the
designated classes in ``$registrars``. For each of these classes, which contains a method name matching
the configuration class, it will invoke that method, and incorporate any returned properties
the same way as described for namespaced variables.
A sample configuration class setup for this::
<?php namespace App\Config;
use CodeIgniter\Config\BaseConfig;
class MySalesConfig extends BaseConfig
{
public $target = 100;
public $campaign = "Winter Wonderland";
protected $registrars = [
'\App\Models\RegionalSales';
];
}
... and the associated regional sales model might look like::
<?php namespace App\Models;
class RegionalSales
{
public static function MySalesConfig()
{
return ['target' => 45, 'actual' => 72];
}
}
With the above example, when `MySalesConfig` is instantiated, it will end up with
the two properties declared, but the value of the `$target` property will be over-ridden
by treating `RegionalSalesModel` as a "registrar". The resulting configuration properties::
$target = 45;
$campaign = "Winter Wonderland";
|
{
"content_hash": "080bf40bcce6ed5c182d5966fc578525",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 435,
"avg_line_length": 39.83571428571429,
"alnum_prop": 0.7328312712928098,
"repo_name": "gustavojm/CodeIgniter4",
"id": "858be5f5da9c551805404346578bc16a8958318c",
"size": "11170",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "user_guide_src/source/general/configuration.rst",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "4467"
},
{
"name": "CSS",
"bytes": "142469"
},
{
"name": "HTML",
"bytes": "24555"
},
{
"name": "JavaScript",
"bytes": "17509"
},
{
"name": "Makefile",
"bytes": "4808"
},
{
"name": "PHP",
"bytes": "2219609"
},
{
"name": "Python",
"bytes": "11560"
}
],
"symlink_target": ""
}
|
var FANTASMA2 = function (key,game,startpos){
this.game = game;
this.key = key;
//Parametros de this
this.velocidad = 60;
this.estaMuriendo = false;
this.tiempo = 0;
this.startPos = startpos;
this.nombre = "fantasma2";
this.timer = 0;
this.ataque = false;
this.huir = true;
//Damos los valores a this del mismo mundo que del mundo game que pasamos
this.gridsize = game.gridsize;
this.safetile = game.safetile;
//Creamos los diferentes puntos de navegacion
this.marcador = new Phaser.Point(0,0);
this.curva = new Phaser.Point(0,0);
this.treshold = 6;
this.direcciones = [ null, null, null, null, null];
this.contrarios = [ Phaser.NONE, Phaser.LEFT, Phaser.RIGHT, Phaser.DOWN, Phaser.UP ];
this.actual = Phaser.NONE;
this.girando = Phaser.NONE;
this.quieroIr = Phaser.NONE;
this.score = 0;
this.keyPressTimer = 0;
this.KEY_COOLING_DOWN_TIME = 750;
//Ahora creamos el sprite this
this.sprite = this.game.add.sprite(this.startPos.x, this.startPos.y, key, 0);
//Podemos escalar a this, para que se vea más grande
this.sprite.anchor.setTo(0.5);
///////ANIMACIONES DE this////////
this.sprite.animations.add('derecha', [3], 10, true);
this.sprite.animations.add('arriba', [1], 10, true);
this.sprite.animations.add('abajo', [2], 10, true);
this.sprite.animations.add('izquierda', [0], 10, true);//Queremos que se repita en bucle.
this.sprite.animations.add('huir', [16, 17], 10, true);
this.sprite.animations.add('morir', [20], 10, true);
//////////////////////////////////
this.game.physics.arcade.enable(this.sprite);
this.sprite.body.setSize(16, 16, 0, 0);
this.sprite.play('derecha');
//Llamamos al prototipo de this, que tendrá la función de mover.
this.mover(Phaser.RIGHT);
};
FANTASMA2.prototype.updateCounter = function() {
this.tiempo++;
}
FANTASMA2.prototype.volver = function(){
this.game.scoreF -= 50;
this.score -= 50;
this.sprite.x = this.startPos.x;
this.sprite.y = this.startPos.y;
this.mover(Phaser.RIGHT);
};
FANTASMA2.prototype.mover = function (direccion) {
var velocidad = this.velocidad;
if (direccion === Phaser.NONE) {
this.sprite.body.velocity.x = this.sprite.body.velocity.y = 0;
return;
}
if (direccion === Phaser.LEFT || direccion === Phaser.UP)
{
velocidad = -velocidad;
}
if (direccion === Phaser.LEFT || direccion === Phaser.RIGHT)
{
this.sprite.body.velocity.x = velocidad;
}
else
{
this.sprite.body.velocity.y = velocidad;
}
// Reset the scale and angle (FANTASMA2 is facing to the right in the sprite sheet)
if(!this.game.pacman.ataque && !this.game.pacman2.ataque){
this.sprite.play('derecha');
if (direccion === Phaser.LEFT)
{
this.sprite.play('izquierda');
}
else if (direccion === Phaser.UP)
{
this.sprite.play('arriba');
}
else if (direccion === Phaser.DOWN)
{
this.sprite.play('abajo');
}
}else{
this.sprite.play('huir');
}
this.actual = direccion;
};
FANTASMA2.prototype.atacar = function(){
console.log("ataque");
this.game.scoreF += 150;
this.score += 150;
}
FANTASMA2.prototype.update = function() {
if(this.game.tiempo < this.game.final && this.game.totaldots > 0){
this.game.physics.arcade.collide(this.sprite, this.game.layer);
this.game.physics.arcade.overlap(this.sprite, this.game.dots, this.comerDot, null, this);
this.game.physics.arcade.overlap(this.sprite, this.game.pills, this.comerPill, null, this);
if(!this.ataque){
this.game.physics.arcade.overlap(this.sprite,this.game.pacman.sprite, this.volver,null,this);
this.game.physics.arcade.overlap(this.sprite,this.game.pacman2.sprite, this.volver,null,this);
}
if(this.ataque){
if(this.tiempo < 10000){
this.game.physics.arcade.overlap(this.sprite,this.game.pacman.sprite,this.atacar,null,this);
this.game.physics.arcade.overlap(this.sprite,this.game.pacman2.sprite,this.atacar,null,this);
var that = this;
this.timer.loop(1000,that.updateCounter,this);
this.timer.start();
//console.log("Tiempo" + this.tiempo);
}else{
this.ataque = false;
this.huir = true;
this.timer.destroy();
this.tiempo = 0;
//console.log("Modo normal");
}
}
//this.game.physics.arcade.overlap(this.sprite,this.game.FANTASMA22.sprite,this.volver,null,this);
this.marcador.x = this.game.math.snapToFloor(Math.floor(this.sprite.x), this.gridsize) / this.gridsize;
this.marcador.y = this.game.math.snapToFloor(Math.floor(this.sprite.y), this.gridsize) / this.gridsize;
if(this.marcador.x < 0){//Si llega al borde sin borde, sale por el otro lado
this.sprite.x = this.game.map.widthInPixels - 1;
}
if(this.marcador.x >= this.game.map.width){
this.sprite.x = 1;
}
//Ahora nos creamos las direcciones.
this.direcciones[1] = this.game.map.getTileLeft(this.game.layer.index, this.marcador.x, this.marcador.y);
this.direcciones[2] = this.game.map.getTileRight(this.game.layer.index, this.marcador.x, this.marcador.y);
this.direcciones[3] = this.game.map.getTileAbove(this.game.layer.index, this.marcador.x, this.marcador.y);
this.direcciones[4] = this.game.map.getTileBelow(this.game.layer.index, this.marcador.x, this.marcador.y);
//this.comprobarTeclas();
if(this.girando !== Phaser.NONE){
this.girar();
}
}else{
this.mover(Phaser.NONE);
if(!this.estaMuriendo){
this.estaMuriendo = true;
this.sprite.play('morir');
}
}
};
FANTASMA2.prototype.comprobarTeclas = function(){
if (this.game.cursors.left.isDown ||
this.game.cursors.right.isDown ||
this.game.cursors.up.isDown ||
this.game.cursors.down.isDown) {
this.keyPressTimer = this.game.time.time + this.KEY_COOLING_DOWN_TIME;
}
if(this.game.cursors.left.isDown && this.actual !== Phaser.LEFT){
this.quieroIr = Phaser.LEFT;
}else if(this.game.cursors.right.isDown && this.actual !== Phaser.RIGHT){
this.quieroIr = Phaser.RIGHT;
}
else if(this.game.cursors.up.isDown && this.actual !== Phaser.UP){
this.quieroIr = Phaser.UP;
}
else if(this.game.cursors.down.isDown && this.actual !== Phaser.DOWN){
this.quieroIr = Phaser.DOWN;
}
if (this.game.time.time > this.keyPressTimer)
{
// This forces them to hold the key down to turn the corner
this.girando = Phaser.NONE;
this.quieroIr = Phaser.NONE;
} else {
this.comprobarDireccion(this.quieroIr);
}
};
FANTASMA2.prototype.comerDot = function(FANTASMA2,dot){
dot.kill();
this.game.scoreF += 100;
this.score += 100;
this.game.totaldots--; //COMPROBAR SI LAURA LO LLAMA ASÍ EN LA FUNCION GENERAL.
};
FANTASMA2.prototype.comerPill = function(FANTASMA2, pill){
pill.kill();
//this.huir = false;
this.ataque = true;
this.timer = this.game.time.create(false);
this.game.numPills--;
};
//Ahora entramos en la función de giro
FANTASMA2.prototype.girar = function(){
var sx = Math.floor(this.sprite.x);
var sy = Math.floor(this.sprite.y);
//Tenemos que tener en cuenta que, debido al rápido movimiento de FANTASMA2, deberemos tener cuidado, porque muchas veces
//entre la pulsación y cuando se puede realizar el giro, FANTASMA2 ya puede haber pasado la zona de giro.
if(!this.game.math.fuzzyEqual(sx, this.curva.x, this.treshold) || !this.game.math.fuzzyEqual(sy, this.curva.y, this.treshold))
{
return false;
}
//Tenemos que alinear el grid donde nos movemos con las posiciones del sprite de FANTASMA2
this.sprite.x = this.curva.x;
this.sprite.y = this.curva.y;
this.sprite.body.reset(this.curva.x, this.curva.y);
this.mover(this.girando);
this.girando = Phaser.NONE;
return true;
};
//Debemos comprobar si se puede girar en la dirección que se le ha pedido
FANTASMA2.prototype.comprobarDireccion = function(girarA){
//console.log("Queremos girar a:" + girarA);
if(this.girando === girarA || this.direcciones[girarA] === null || this.direcciones[girarA].index !== this.safetile){ //Estamos comprobando que no puede girar hacia la direccion que quiere porque ya está en esa direccion, o no puede.
return;
}
if(this.actual === this.contrarios[girarA]){
this.mover(girarA);
this.keyPressTimer = this.game.time.time;
}else{
this.girando = girarA;
this.curva.x = (this.marcador.x * this.gridsize) + (this.gridsize / 2);
this.curva.y = (this.marcador.y * this.gridsize) + (this.gridsize / 2);
this.quieroIr = Phaser.NONE;
}
};
|
{
"content_hash": "3378ca91029daa72478f60501aaeed4e",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 241,
"avg_line_length": 31.536231884057973,
"alnum_prop": 0.5283088235294118,
"repo_name": "alvarete212/PACMANVS",
"id": "737ad4a32bfed1fe9e9c8b3a3c023adfff188f94",
"size": "10889",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "servidor_pacman/target/classes/static/js/FANTASMA2.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5006"
},
{
"name": "HTML",
"bytes": "2938"
},
{
"name": "Java",
"bytes": "17177"
},
{
"name": "JavaScript",
"bytes": "114962"
},
{
"name": "Shell",
"bytes": "7058"
}
],
"symlink_target": ""
}
|
#ifndef FBI_UNIX_H
#define FBI_UNIX_H
#include <sys/types.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <pwd.h>
#include <unistd.h>
#include "debug.h"
#include "decls.h"
__BEGIN_DECLS
static inline int is_root() {
return getuid() == 0 || geteuid() == 0;
}
/** Raises file descriptor limit to n if greater than zero
* If negative, raises to system max
* If zero, leaves unchanged
* @param n max number of open files
* @return 0 on success, -1 on error
*/
static inline int set_fd_limit(int n) {
char buff[128];
FILE *f = NULL;
if (n == 0) {
dbg_info("Using default open file limits");
return 0;
}
struct rlimit limits = {0, 0};
// figure out system values for nr_open
// if none available, keep max open file descriptors same
if (n < 0) {
if ((f = fopen("/proc/sys/fs/nr_open", "r")) == NULL){
dbg_error("Could not open /proc/sys/fs/nr_open for reading");
goto error;
}
if (fgets(buff, sizeof(buff), f) == NULL) {
dbg_error("Could not read from /proc/sys/fs/nr_open");
goto error;
}
fclose(f);
f = NULL;
errno = 0;
n = strtoull(buff, NULL, 10);
if (errno != 0) {
dbg_error("Could not convert /proc/sys/fs/nr_open to integer");
goto error;
}
}
limits = (struct rlimit) { .rlim_cur = (rlim_t)n, .rlim_max = (rlim_t)n };
if (setrlimit(RLIMIT_NOFILE, &limits) != 0) {
dbg_error("Could not set RLIMIT_NOFILE");
goto error;
}
dbg_info("raised soft/hard fd limit to %d", (int)limits.rlim_cur);
return 0;
error:
if (f != NULL) {
fclose(f);
}
perror("set_fd_limit");
return -1;
}
static inline int drop_privileges_to(const char *username) {
FBI_ASSERT(username != NULL && username[0] != '\0');
long blen = -1;
char *buf = NULL;
struct passwd pws;
struct passwd *pw = NULL;
int rc;
int ret = -1;
blen = sysconf(_SC_GETPW_R_SIZE_MAX);
if (blen == -1) {
dbg_error("sysconf failed");
goto epilogue;
}
if ((buf = (char*)malloc(blen)) == NULL) {
dbg_error("no memory for buffer");
goto epilogue;
}
if ((rc = getpwnam_r(username, &pws, buf, blen, &pw)) != 0 || pw == NULL) {
dbg_error("can't find the user %s to switch to", username);
goto epilogue;
}
if (setgid(pw->pw_gid) < 0 || setuid(pw->pw_uid) < 0) {
dbg_error("failed to assume identity of user %s", username);
goto epilogue;
}
dbg_info("Dropped privileges to %s", username);
ret = 0;
epilogue:
free(buf);
return ret;
}
static inline void daemonize_process() {
if (getppid() == 1) {
return;
}
switch (fork()) {
case 0:
setsid();
int i;
// close all descriptors
for (i = getdtablesize(); i >= 0; i--) {
close(i);
}
i = open("/dev/null", O_RDWR);
dup2(i, 1);
dup2(i, 2);
break;
case -1:
fprintf(stderr, "Can't fork background process\n");
exit(1);
default: /* Parent process */
dbg_low("Running in the background");
exit(0);
}
}
__END_DECLS
#endif
|
{
"content_hash": "4cec04c87832084833c4151492898cb5",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 77,
"avg_line_length": 21.055555555555557,
"alnum_prop": 0.5860817941952506,
"repo_name": "hrjaco/mcrouter",
"id": "3fee2ad929604363a905e24e0f47581fb42fe4ba",
"size": "3337",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "mcrouter/lib/fbi/unix.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
}
|
namespace PackageManager.Tests.Models.PackageTest
{
using System;
using Enums;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using PackageManager.Models;
using PackageManager.Models.Contracts;
[TestClass]
public class CompareTo_Should
{
[TestMethod]
public void CompareTo_WhenThePackageIsNull_ShouldThrowArgumentNullException()
{
// Arrange
var versionMock = new Mock<IVersion>();
var package = new Package("test", versionMock.Object);
// Act & Assert
Assert.ThrowsException<ArgumentNullException>(() => package.CompareTo(null));
}
[TestMethod]
public void CompareTo_WhenThePackageAreNotWithTheSameName_ShouldThrowArgumentException()
{
// Arrange
var versionMock = new Mock<IVersion>();
var packageOne = new Package("test", versionMock.Object);
var packageTwo = new Package("not test", versionMock.Object);
// Act & Assert
Assert.ThrowsException<ArgumentException>(() => packageOne.CompareTo(packageTwo));
}
[TestMethod]
public void CompareTo_WhenThePackagesAreTheSameVersion_ShouldReturnZero()
{
// Arrange
var versionMockPackageOne = new Mock<IVersion>();
var packageOne = new Package("test", versionMockPackageOne.Object);
versionMockPackageOne
.SetupGet(x => x.Major)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.Minor)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.Patch)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.VersionType)
.Returns(VersionType.alpha);
var versionMockPackageTwo = new Mock<IVersion>();
versionMockPackageTwo
.SetupGet(x => x.Major)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.Minor)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.Patch)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.VersionType)
.Returns(VersionType.alpha);
var packageTwo = new Package("test", versionMockPackageTwo.Object);
// Act
var result = packageOne.CompareTo(packageTwo);
// Assert
Assert.AreEqual(0, result);
}
[DataTestMethod]
[DataRow(1, 1, 1, VersionType.beta)]
[DataRow(1, 1, 2, VersionType.alpha)]
[DataRow(1, 2, 1, VersionType.alpha)]
[DataRow(2, 1, 1, VersionType.alpha)]
[DataRow(2, 2, 2, VersionType.beta)]
public void CompareTo_WhenThePackageIsWithOlderVersion_ShouldReturnOne_(int major, int minor, int patch, VersionType versionType)
{
// Arrange
var versionMockPackageOne = new Mock<IVersion>();
var packageOne = new Package("test", versionMockPackageOne.Object);
versionMockPackageOne
.SetupGet(x => x.Major)
.Returns(major);
versionMockPackageOne
.SetupGet(x => x.Minor)
.Returns(minor);
versionMockPackageOne
.SetupGet(x => x.Patch)
.Returns(patch);
versionMockPackageOne
.SetupGet(x => x.VersionType)
.Returns(versionType);
var versionMockPackageTwo = new Mock<IVersion>();
versionMockPackageTwo
.SetupGet(x => x.Major)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.Minor)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.Patch)
.Returns(1);
versionMockPackageTwo
.SetupGet(x => x.VersionType)
.Returns(VersionType.alpha);
var packageTwo = new Package("test", versionMockPackageTwo.Object);
// Act
var result = packageOne.CompareTo(packageTwo);
// Assert
Assert.AreEqual(1, result);
}
[DataTestMethod]
[DataRow(1, 1, 1, VersionType.beta)]
[DataRow(1, 1, 2, VersionType.alpha)]
[DataRow(1, 2, 1, VersionType.alpha)]
[DataRow(2, 1, 1, VersionType.alpha)]
[DataRow(2, 2, 2, VersionType.beta)]
public void CompareTo_WhenThePackageIsWithNewerVersion_ShouldReturnMinusOne(int major, int minor, int patch, VersionType versionType)
{
// Arrange
var versionMockPackageOne = new Mock<IVersion>();
var packageOne = new Package("test", versionMockPackageOne.Object);
versionMockPackageOne
.SetupGet(x => x.Major)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.Minor)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.Patch)
.Returns(1);
versionMockPackageOne
.SetupGet(x => x.VersionType)
.Returns(VersionType.alpha);
var versionMockPackageTwo = new Mock<IVersion>();
versionMockPackageTwo
.SetupGet(x => x.Major)
.Returns(major);
versionMockPackageTwo
.SetupGet(x => x.Minor)
.Returns(minor);
versionMockPackageTwo
.SetupGet(x => x.Patch)
.Returns(patch);
versionMockPackageTwo
.SetupGet(x => x.VersionType)
.Returns(versionType);
var packageTwo = new Package("test", versionMockPackageTwo.Object);
// Act
var result = packageOne.CompareTo(packageTwo);
// Assert
Assert.AreEqual(-1, result);
}
}
}
|
{
"content_hash": "307e45b68d1236251019a91f3b7ff20b",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 141,
"avg_line_length": 32.204081632653065,
"alnum_prop": 0.5239226869455006,
"repo_name": "stoyanov7/TelerikAcademy",
"id": "c0010ab9114dd8ecc19efafe625018638fac8080",
"size": "6314",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ProgrammingWithC#/04.UnitTesting/Exams/PackageManager/PackageManager.Tests/Models/PackageTest/CompareTo_Should.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "1882051"
},
{
"name": "CSS",
"bytes": "513"
},
{
"name": "HTML",
"bytes": "5636"
},
{
"name": "JavaScript",
"bytes": "13878"
},
{
"name": "XSLT",
"bytes": "781"
}
],
"symlink_target": ""
}
|
package edu.uci.ics.asterix.translator;
import java.util.HashMap;
import edu.uci.ics.asterix.aql.expression.VariableExpr;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.Counter;
import edu.uci.ics.hyracks.algebricks.core.algebra.base.LogicalVariable;
public final class TranslationContext {
private Counter varCounter;
private HashMap<Integer, LogicalVariable> varEnv = new HashMap<Integer, LogicalVariable>();
private boolean topFlwor = true;
public TranslationContext(Counter varCounter) {
this.varCounter = varCounter;
}
public int getVarCounter() {
return varCounter.get();
}
public boolean isTopFlwor() {
return topFlwor;
}
public void setTopFlwor(boolean b) {
topFlwor = b;
}
public LogicalVariable getVar(Integer varId) {
return varEnv.get(varId);
}
public LogicalVariable getVar(VariableExpr v) {
return varEnv.get(v.getVar().getId());
}
public LogicalVariable newVar(VariableExpr v) {
Integer i = v.getVar().getId();
if (i > varCounter.get()) {
varCounter.set(i);
}
LogicalVariable var = new LogicalVariable(i);
varEnv.put(i, var);
return var;
}
public void setVar(VariableExpr v, LogicalVariable var) {
varEnv.put(v.getVar().getId(), var);
}
public LogicalVariable newVar() {
varCounter.inc();
LogicalVariable var = new LogicalVariable(varCounter.get());
varEnv.put(varCounter.get(), var);
return var;
}
}
|
{
"content_hash": "8ded44fdcdd574b48990404ff6338d63",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 95,
"avg_line_length": 26.183333333333334,
"alnum_prop": 0.6524506683640993,
"repo_name": "parshimers/incubator-asterixdb",
"id": "986b5ca4233e3b4f4061dfe2b59ed0c614c329b6",
"size": "2204",
"binary": false,
"copies": "1",
"ref": "refs/heads/imaxon/yarn",
"path": "asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/TranslationContext.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6116"
},
{
"name": "CSS",
"bytes": "3954"
},
{
"name": "Crystal",
"bytes": "453"
},
{
"name": "HTML",
"bytes": "70110"
},
{
"name": "Java",
"bytes": "8768354"
},
{
"name": "JavaScript",
"bytes": "234599"
},
{
"name": "Python",
"bytes": "264407"
},
{
"name": "Ruby",
"bytes": "1880"
},
{
"name": "Scheme",
"bytes": "1105"
},
{
"name": "Shell",
"bytes": "78769"
},
{
"name": "Smarty",
"bytes": "29789"
}
],
"symlink_target": ""
}
|
namespace ra
{
class App;
class Camera : public sf::View
{
public:
Camera();
~Camera();
void update();
void setDefaultCamera();
sf::FloatRect getRect() const;
private:
friend App;
App* m_app;
}; // class Camera
} // namespace ra
#endif // RAGE_CORE_CAMERA_HPP
|
{
"content_hash": "68dbe78645c4504fe1beff54d401353b",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 31,
"avg_line_length": 11,
"alnum_prop": 0.6545454545454545,
"repo_name": "adrigm/RAGE",
"id": "16250dc9958e0923805ec1d3f80fdbffabebf47d",
"size": "396",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "include/RAGE/Core/Camera.hpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "437751"
},
{
"name": "C++",
"bytes": "442876"
},
{
"name": "Objective-C",
"bytes": "30568"
}
],
"symlink_target": ""
}
|
"""Type hinting decorators allowing static or runtime type-checking for the SDK.
This module defines decorators which utilize the type-hints defined in
'type_hints.py' to allow annotation of the types of function arguments and
return values.
Type-hints for functions are annotated using two separate decorators. One is for
type-hinting the types of function arguments, the other for type-hinting the
function return value. Type-hints can either be specified in the form of
positional arguments::
@with_input_types(int, int)
def add(a, b):
return a + b
Keyword arguments::
@with_input_types(a=int, b=int)
def add(a, b):
return a + b
Or even a mix of both::
@with_input_types(int, b=int)
def add(a, b):
return a + b
Example usage for type-hinting arguments only::
@with_input_types(s=str)
def to_lower(a):
return a.lower()
Example usage for type-hinting return values only::
@with_output_types(Tuple[int, bool])
def compress_point(ec_point):
return ec_point.x, ec_point.y < 0
Example usage for type-hinting both arguments and return values::
@with_input_types(a=int)
@with_output_types(str)
def int_to_str(a):
return str(a)
Type-hinting a function with arguments that unpack tuples are also supported
(in Python 2 only). As an example, such a function would be defined as::
def foo((a, b)):
...
The valid type-hint for such as function looks like the following::
@with_input_types(a=int, b=int)
def foo((a, b)):
...
Notice that we hint the type of each unpacked argument independently, rather
than hinting the type of the tuple as a whole (Tuple[int, int]).
Optionally, type-hints can be type-checked at runtime. To toggle this behavior
this module defines two functions: 'enable_run_time_type_checking' and
'disable_run_time_type_checking'. NOTE: for this toggle behavior to work
properly it must appear at the top of the module where all functions are
defined, or before importing a module containing type-hinted functions.
"""
from __future__ import absolute_import
import inspect
import logging
import sys
import types
from builtins import next
from builtins import object
from builtins import zip
from typing import Any
from typing import Callable
from typing import Dict
from typing import Optional
from typing import Tuple
from typing import TypeVar
from apache_beam.typehints import native_type_compatibility
from apache_beam.typehints import typehints
from apache_beam.typehints.typehints import CompositeTypeHintError
from apache_beam.typehints.typehints import SimpleTypeHintError
from apache_beam.typehints.typehints import check_constraint
from apache_beam.typehints.typehints import validate_composite_type_param
try:
import funcsigs # Python 2 only.
except ImportError:
funcsigs = None
__all__ = [
'with_input_types',
'with_output_types',
'WithTypeHints',
'TypeCheckError',
]
T = TypeVar('T')
WithTypeHintsT = TypeVar('WithTypeHintsT', bound='WithTypeHints') # pylint: disable=invalid-name
# This is missing in the builtin types module. str.upper is arbitrary, any
# method on a C-implemented type will do.
# pylint: disable=invalid-name
_MethodDescriptorType = type(str.upper)
# pylint: enable=invalid-name
_ANY_VAR_POSITIONAL = typehints.Tuple[typehints.Any, ...]
_ANY_VAR_KEYWORD = typehints.Dict[typehints.Any, typehints.Any]
# TODO(BEAM-8280): Remove this when from_callable is ready to be enabled.
_enable_from_callable = False
try:
_original_getfullargspec = inspect.getfullargspec
_use_full_argspec = True
except AttributeError: # Python 2
_original_getfullargspec = inspect.getargspec # type: ignore
_use_full_argspec = False
def getfullargspec(func):
# Python 3: Use get_signature instead.
assert sys.version_info < (3,), 'This method should not be used in Python 3'
try:
return _original_getfullargspec(func)
except TypeError:
if isinstance(func, type):
argspec = getfullargspec(func.__init__)
del argspec.args[0]
return argspec
elif callable(func):
try:
return _original_getfullargspec(func.__call__)
except TypeError:
# Return an ArgSpec with at least one positional argument,
# and any number of other (positional or keyword) arguments
# whose name won't match any real argument.
# Arguments with the %unknown% prefix will be ignored in the type
# checking code.
if _use_full_argspec:
return inspect.FullArgSpec(
['_'], '__unknown__varargs', '__unknown__keywords', (),
[], {}, {})
else: # Python 2
return inspect.ArgSpec(
['_'], '__unknown__varargs', '__unknown__keywords', ())
else:
raise
def get_signature(func):
"""Like inspect.signature(), but supports Py2 as well.
This module uses inspect.signature instead of getfullargspec since in the
latter: 'the "self" parameter is always reported, even for bound methods'
https://github.com/python/cpython/blob/44f91c388a6f4da9ed3300df32ca290b8aa104ea/Lib/inspect.py#L1103
"""
# Fall back on funcsigs if inspect module doesn't have 'signature'; prefer
# inspect.signature over funcsigs.signature if both are available.
if hasattr(inspect, 'signature'):
inspect_ = inspect
else:
inspect_ = funcsigs
try:
signature = inspect_.signature(func)
except ValueError:
# Fall back on a catch-all signature.
params = [
inspect_.Parameter('_', inspect_.Parameter.POSITIONAL_OR_KEYWORD),
inspect_.Parameter('__unknown__varargs',
inspect_.Parameter.VAR_POSITIONAL),
inspect_.Parameter('__unknown__keywords',
inspect_.Parameter.VAR_KEYWORD)]
signature = inspect_.Signature(params)
# This is a specialization to hint the first argument of certain builtins,
# such as str.strip.
if isinstance(func, _MethodDescriptorType):
params = list(signature.parameters.values())
if params[0].annotation == params[0].empty:
params[0] = params[0].replace(annotation=func.__objclass__)
signature = signature.replace(parameters=params)
# This is a specialization to hint the return value of type callables.
if (signature.return_annotation == signature.empty and
isinstance(func, type)):
signature = signature.replace(return_annotation=typehints.normalize(func))
return signature
class IOTypeHints(object):
"""Encapsulates all type hint information about a Dataflow construct.
This should primarily be used via the WithTypeHints mixin class, though
may also be attached to other objects (such as Python functions).
Attributes:
input_types: (tuple, dict) List of typing types, and an optional dictionary.
May be None. The list and dict correspond to args and kwargs.
output_types: (tuple, dict) List of typing types, and an optional dictionary
(unused). Only the first element of the list is used. May be None.
"""
__slots__ = ('input_types', 'output_types')
def __init__(self,
input_types=None, # type: Optional[Tuple[Tuple[Any, ...], Dict[str, Any]]]
output_types=None # type: Optional[Tuple[Tuple[Any, ...], Dict[str, Any]]]
):
self.input_types = input_types
self.output_types = output_types
@staticmethod
def from_callable(fn):
"""Construct an IOTypeHints object from a callable's signature.
Supports Python 3 annotations. For partial annotations, sets unknown types
to Any, _ANY_VAR_POSITIONAL, or _ANY_VAR_KEYWORD.
Returns:
A new IOTypeHints or None if no annotations found.
"""
if not _enable_from_callable:
return None
signature = get_signature(fn)
if (all(param.annotation == param.empty
for param in signature.parameters.values())
and signature.return_annotation == signature.empty):
return None
input_args = []
input_kwargs = {}
for param in signature.parameters.values():
if param.annotation == param.empty:
if param.kind == param.VAR_POSITIONAL:
input_args.append(_ANY_VAR_POSITIONAL)
elif param.kind == param.VAR_KEYWORD:
input_kwargs[param.name] = _ANY_VAR_KEYWORD
elif param.kind == param.KEYWORD_ONLY:
input_kwargs[param.name] = typehints.Any
else:
input_args.append(typehints.Any)
else:
if param.kind in [param.KEYWORD_ONLY, param.VAR_KEYWORD]:
input_kwargs[param.name] = param.annotation
else:
assert param.kind in [param.POSITIONAL_ONLY,
param.POSITIONAL_OR_KEYWORD,
param.VAR_POSITIONAL], \
'Unsupported Parameter kind: %s' % param.kind
input_args.append(param.annotation)
output_args = []
if signature.return_annotation != signature.empty:
output_args.append(signature.return_annotation)
else:
output_args.append(typehints.Any)
return IOTypeHints(input_types=(tuple(input_args), input_kwargs),
output_types=(tuple(output_args), {}))
def set_input_types(self, *args, **kwargs):
self.input_types = args, kwargs
def set_output_types(self, *args, **kwargs):
self.output_types = args, kwargs
def simple_output_type(self, context):
if self.output_types:
args, kwargs = self.output_types
if len(args) != 1 or kwargs:
raise TypeError(
'Expected single output type hint for %s but got: %s' % (
context, self.output_types))
return args[0]
def has_simple_output_type(self):
"""Whether there's a single positional output type."""
return (self.output_types and len(self.output_types[0]) == 1 and
not self.output_types[1])
def strip_iterable(self):
"""Removes outer Iterable (or equivalent) from output type.
Only affects instances with simple output types, otherwise is a no-op.
Does not modify self.
Example: Generator[Tuple(int, int)] becomes Tuple(int, int)
Returns:
A possible copy of this instance with a possibly different output type.
Raises:
ValueError if output type is simple and not iterable.
"""
if not self.has_simple_output_type():
return self
yielded_type = typehints.get_yielded_type(self.output_types[0][0])
res = self.copy()
res.output_types = ((yielded_type,), {})
return res
def copy(self):
# type: () -> IOTypeHints
return IOTypeHints(self.input_types, self.output_types)
def with_defaults(self, hints):
# type: (Optional[IOTypeHints]) -> IOTypeHints
if not hints:
return self
if self._has_input_types():
input_types = self.input_types
else:
input_types = hints.input_types
if self._has_output_types():
output_types = self.output_types
else:
output_types = hints.output_types
return IOTypeHints(input_types, output_types)
def _has_input_types(self):
return self.input_types is not None and any(self.input_types)
def _has_output_types(self):
return self.output_types is not None and any(self.output_types)
def __bool__(self):
return self._has_input_types() or self._has_output_types()
def __repr__(self):
return 'IOTypeHints[inputs=%s, outputs=%s]' % (
self.input_types, self.output_types)
def __eq__(self, other):
def same(a, b):
if a is None or not any(a):
return b is None or not any(b)
else:
return a == b
return (
same(self.input_types, other.input_types)
and same(self.output_types, other.output_types))
def __ne__(self, other):
return not self == other
def __hash__(self):
return hash(str(self))
class WithTypeHints(object):
"""A mixin class that provides the ability to set and retrieve type hints.
"""
def __init__(self, *unused_args, **unused_kwargs):
self._type_hints = IOTypeHints()
def _get_or_create_type_hints(self):
# type: () -> IOTypeHints
# __init__ may have not been called
try:
# Only return an instance bound to self (see BEAM-8629).
return self.__dict__['_type_hints']
except KeyError:
self._type_hints = IOTypeHints()
return self._type_hints
def get_type_hints(self):
"""Gets and/or initializes type hints for this object.
If type hints have not been set, attempts to initialize type hints in this
order:
- Using self.default_type_hints().
- Using self.__class__ type hints.
"""
return (self._get_or_create_type_hints()
.with_defaults(self.default_type_hints())
.with_defaults(get_type_hints(self.__class__)))
def default_type_hints(self):
return None
def with_input_types(self, *arg_hints, **kwarg_hints):
# type: (WithTypeHintsT, *Any, **Any) -> WithTypeHintsT
arg_hints = native_type_compatibility.convert_to_beam_types(arg_hints)
kwarg_hints = native_type_compatibility.convert_to_beam_types(kwarg_hints)
self._get_or_create_type_hints().set_input_types(*arg_hints, **kwarg_hints)
return self
def with_output_types(self, *arg_hints, **kwarg_hints):
# type: (WithTypeHintsT, *Any, **Any) -> WithTypeHintsT
arg_hints = native_type_compatibility.convert_to_beam_types(arg_hints)
kwarg_hints = native_type_compatibility.convert_to_beam_types(kwarg_hints)
self._get_or_create_type_hints().set_output_types(*arg_hints, **kwarg_hints)
return self
class TypeCheckError(Exception):
pass
def _positional_arg_hints(arg, hints):
"""Returns the type of a (possibly tuple-packed) positional argument.
E.g. for lambda ((a, b), c): None the single positional argument is (as
returned by inspect) [[a, b], c] which should have type
Tuple[Tuple[Int, Any], float] when applied to the type hints
{a: int, b: Any, c: float}.
"""
if isinstance(arg, list):
return typehints.Tuple[[_positional_arg_hints(a, hints) for a in arg]]
return hints.get(arg, typehints.Any)
def _unpack_positional_arg_hints(arg, hint):
"""Unpacks the given hint according to the nested structure of arg.
For example, if arg is [[a, b], c] and hint is Tuple[Any, int], then
this function would return ((Any, Any), int) so it can be used in conjunction
with inspect.getcallargs.
"""
if isinstance(arg, list):
tuple_constraint = typehints.Tuple[[typehints.Any] * len(arg)]
if not typehints.is_consistent_with(hint, tuple_constraint):
raise TypeCheckError('Bad tuple arguments for %s: expected %s, got %s' %
(arg, tuple_constraint, hint))
if isinstance(hint, typehints.TupleConstraint):
return tuple(_unpack_positional_arg_hints(a, t)
for a, t in zip(arg, hint.tuple_types))
return (typehints.Any,) * len(arg)
return hint
def getcallargs_forhints(func, *typeargs, **typekwargs):
"""Like inspect.getcallargs, with support for declaring default args as Any.
In Python 2, understands that Tuple[] and an Any unpack.
Returns:
(Dict[str, Any]) A dictionary from arguments names to values.
"""
if sys.version_info < (3,):
return getcallargs_forhints_impl_py2(func, typeargs, typekwargs)
else:
return getcallargs_forhints_impl_py3(func, typeargs, typekwargs)
def getcallargs_forhints_impl_py2(func, typeargs, typekwargs):
argspec = getfullargspec(func)
# Turn Tuple[x, y] into (x, y) so getcallargs can do the proper unpacking.
packed_typeargs = [_unpack_positional_arg_hints(arg, hint)
for (arg, hint) in zip(argspec.args, typeargs)]
packed_typeargs += list(typeargs[len(packed_typeargs):])
# Monkeypatch inspect.getfullargspec to allow passing non-function objects.
# getfullargspec (getargspec on Python 2) are used by inspect.getcallargs.
# TODO(BEAM-5490): Reimplement getcallargs and stop relying on monkeypatch.
inspect.getargspec = getfullargspec
try:
callargs = inspect.getcallargs(func, *packed_typeargs, **typekwargs) # pylint: disable=deprecated-method
except TypeError as e:
raise TypeCheckError(e)
finally:
# Revert monkey-patch.
inspect.getargspec = _original_getfullargspec
if argspec.defaults:
# Declare any default arguments to be Any.
for k, var in enumerate(reversed(argspec.args)):
if k >= len(argspec.defaults):
break
if callargs.get(var, None) is argspec.defaults[-k-1]:
callargs[var] = typehints.Any
# Patch up varargs and keywords
if argspec.varargs:
# TODO(BEAM-8122): This will always assign _ANY_VAR_POSITIONAL. Should be
# "callargs.get(...) or _ANY_VAR_POSITIONAL".
callargs[argspec.varargs] = typekwargs.get(
argspec.varargs, _ANY_VAR_POSITIONAL)
varkw = argspec.keywords
if varkw:
# TODO(robertwb): Consider taking the union of key and value types.
callargs[varkw] = typekwargs.get(varkw, _ANY_VAR_KEYWORD)
# TODO(BEAM-5878) Support kwonlyargs.
return callargs
def _normalize_var_positional_hint(hint):
"""Converts a var_positional hint into Tuple[Union[<types>], ...] form.
Args:
hint: (tuple) Should be either a tuple of one or more types, or a single
Tuple[<type>, ...].
Raises:
TypeCheckError if hint does not have the right form.
"""
if not hint or type(hint) != tuple:
raise TypeCheckError('Unexpected VAR_POSITIONAL value: %s' % hint)
if len(hint) == 1 and isinstance(hint[0], typehints.TupleSequenceConstraint):
# Example: tuple(Tuple[Any, ...]) -> Tuple[Any, ...]
return hint[0]
else:
# Example: tuple(int, str) -> Tuple[Union[int, str], ...]
return typehints.Tuple[typehints.Union[hint], ...]
def _normalize_var_keyword_hint(hint, arg_name):
"""Converts a var_keyword hint into Dict[<key type>, <value type>] form.
Args:
hint: (dict) Should either contain a pair (arg_name,
Dict[<key type>, <value type>]), or one or more possible types for the
value.
arg_name: (str) The keyword receiving this hint.
Raises:
TypeCheckError if hint does not have the right form.
"""
if not hint or type(hint) != dict:
raise TypeCheckError('Unexpected VAR_KEYWORD value: %s' % hint)
keys = list(hint.keys())
values = list(hint.values())
if (len(values) == 1 and
keys[0] == arg_name and
isinstance(values[0], typehints.DictConstraint)):
# Example: dict(kwargs=Dict[str, Any]) -> Dict[str, Any]
return values[0]
else:
# Example: dict(k1=str, k2=int) -> Dict[str, Union[str,int]]
return typehints.Dict[str, typehints.Union[values]]
def getcallargs_forhints_impl_py3(func, type_args, type_kwargs):
"""Bind type_args and type_kwargs to func.
Works like inspect.getcallargs, with some modifications to support type hint
checks.
For unbound args, will use annotations and fall back to Any (or variants of
Any).
Returns:
A mapping from parameter name to argument.
"""
try:
signature = get_signature(func)
except ValueError as e:
logging.warning('Could not get signature for function: %s: %s', func, e)
return {}
try:
bindings = signature.bind(*type_args, **type_kwargs)
except TypeError as e:
# Might be raised due to too few or too many arguments.
raise TypeCheckError(e)
bound_args = bindings.arguments
for param in signature.parameters.values():
if param.name in bound_args:
# Bound: unpack/convert variadic arguments.
if param.kind == param.VAR_POSITIONAL:
bound_args[param.name] = _normalize_var_positional_hint(
bound_args[param.name])
elif param.kind == param.VAR_KEYWORD:
bound_args[param.name] = _normalize_var_keyword_hint(
bound_args[param.name], param.name)
else:
# Unbound: must have a default or be variadic.
if param.annotation != param.empty:
bound_args[param.name] = param.annotation
elif param.kind == param.VAR_POSITIONAL:
bound_args[param.name] = _ANY_VAR_POSITIONAL
elif param.kind == param.VAR_KEYWORD:
bound_args[param.name] = _ANY_VAR_KEYWORD
elif param.default is not param.empty:
# Declare unbound parameters with defaults to be Any.
bound_args[param.name] = typehints.Any
else:
# This case should be caught by signature.bind() above.
raise ValueError('Unexpected unbound parameter: %s' % param.name)
return dict(bound_args)
def get_type_hints(fn):
# type: (Any) -> IOTypeHints
"""Gets the type hint associated with an arbitrary object fn.
Always returns a valid IOTypeHints object, creating one if necessary.
"""
# pylint: disable=protected-access
if not hasattr(fn, '_type_hints'):
try:
fn._type_hints = IOTypeHints()
except (AttributeError, TypeError):
# Can't add arbitrary attributes to this object,
# but might have some restrictions anyways...
hints = IOTypeHints()
# Python 3.7 introduces annotations for _MethodDescriptorTypes.
if isinstance(fn, _MethodDescriptorType) and sys.version_info < (3, 7):
hints.set_input_types(fn.__objclass__) # type: ignore
return hints
return fn._type_hints
# pylint: enable=protected-access
def with_input_types(*positional_hints, **keyword_hints):
# type: (*Any, **Any) -> Callable[[T], T]
"""A decorator that type-checks defined type-hints with passed func arguments.
All type-hinted arguments can be specified using positional arguments,
keyword arguments, or a mix of both. Additionaly, all function arguments must
be type-hinted in totality if even one parameter is type-hinted.
Once fully decorated, if the arguments passed to the resulting function
violate the type-hint constraints defined, a :class:`TypeCheckError`
detailing the error will be raised.
To be used as:
.. testcode::
from apache_beam.typehints import with_input_types
@with_input_types(str)
def upper(s):
return s.upper()
Or:
.. testcode::
from apache_beam.typehints import with_input_types
from apache_beam.typehints import List
from apache_beam.typehints import Tuple
@with_input_types(ls=List[Tuple[int, int]])
def increment(ls):
[(i + 1, j + 1) for (i,j) in ls]
Args:
*positional_hints: Positional type-hints having identical order as the
function's formal arguments. Values for this argument must either be a
built-in Python type or an instance of a
:class:`~apache_beam.typehints.typehints.TypeConstraint` created by
'indexing' a
:class:`~apache_beam.typehints.typehints.CompositeTypeHint` instance
with a type parameter.
**keyword_hints: Keyword arguments mirroring the names of the parameters to
the decorated functions. The value of each keyword argument must either
be one of the allowed built-in Python types, a custom class, or an
instance of a :class:`~apache_beam.typehints.typehints.TypeConstraint`
created by 'indexing' a
:class:`~apache_beam.typehints.typehints.CompositeTypeHint` instance
with a type parameter.
Raises:
:class:`~exceptions.ValueError`: If not all function arguments have
corresponding type-hints specified. Or if the inner wrapper function isn't
passed a function object.
:class:`TypeCheckError`: If the any of the passed type-hint
constraints are not a type or
:class:`~apache_beam.typehints.typehints.TypeConstraint` instance.
Returns:
The original function decorated such that it enforces type-hint constraints
for all received function arguments.
"""
converted_positional_hints = (
native_type_compatibility.convert_to_beam_types(positional_hints))
converted_keyword_hints = (
native_type_compatibility.convert_to_beam_types(keyword_hints))
del positional_hints
del keyword_hints
def annotate(f):
if isinstance(f, types.FunctionType):
for t in (list(converted_positional_hints) +
list(converted_keyword_hints.values())):
validate_composite_type_param(
t, error_msg_prefix='All type hint arguments')
get_type_hints(f).set_input_types(*converted_positional_hints,
**converted_keyword_hints)
return f
return annotate
def with_output_types(*return_type_hint, **kwargs):
# type: (*Any, **Any) -> Callable[[T], T]
"""A decorator that type-checks defined type-hints for return values(s).
This decorator will type-check the return value(s) of the decorated function.
Only a single type-hint is accepted to specify the return type of the return
value. If the function to be decorated has multiple return values, then one
should use: ``Tuple[type_1, type_2]`` to annotate the types of the return
values.
If the ultimate return value for the function violates the specified type-hint
a :class:`TypeCheckError` will be raised detailing the type-constraint
violation.
This decorator is intended to be used like:
.. testcode::
from apache_beam.typehints import with_output_types
from apache_beam.typehints import Set
class Coordinate(object):
def __init__(self, x, y):
self.x = x
self.y = y
@with_output_types(Set[Coordinate])
def parse_ints(ints):
return {Coordinate(i, i) for i in ints}
Or with a simple type-hint:
.. testcode::
from apache_beam.typehints import with_output_types
@with_output_types(bool)
def negate(p):
return not p if p else p
Args:
*return_type_hint: A type-hint specifying the proper return type of the
function. This argument should either be a built-in Python type or an
instance of a :class:`~apache_beam.typehints.typehints.TypeConstraint`
created by 'indexing' a
:class:`~apache_beam.typehints.typehints.CompositeTypeHint`.
**kwargs: Not used.
Raises:
:class:`~exceptions.ValueError`: If any kwarg parameters are passed in,
or the length of **return_type_hint** is greater than ``1``. Or if the
inner wrapper function isn't passed a function object.
:class:`TypeCheckError`: If the **return_type_hint** object is
in invalid type-hint.
Returns:
The original function decorated such that it enforces type-hint constraints
for all return values.
"""
if kwargs:
raise ValueError("All arguments for the 'returns' decorator must be "
"positional arguments.")
if len(return_type_hint) != 1:
raise ValueError("'returns' accepts only a single positional argument. In "
"order to specify multiple return types, use the 'Tuple' "
"type-hint.")
return_type_hint = native_type_compatibility.convert_to_beam_type(
return_type_hint[0])
validate_composite_type_param(
return_type_hint,
error_msg_prefix='All type hint arguments'
)
def annotate(f):
get_type_hints(f).set_output_types(return_type_hint)
return f
return annotate
def _check_instance_type(
type_constraint, instance, var_name=None, verbose=False):
"""A helper function to report type-hint constraint violations.
Args:
type_constraint: An instance of a 'TypeConstraint' or a built-in Python
type.
instance: The candidate object which will be checked by to satisfy
'type_constraint'.
var_name: If 'instance' is an argument, then the actual name for the
parameter in the original function definition.
Raises:
TypeCheckError: If 'instance' fails to meet the type-constraint of
'type_constraint'.
"""
hint_type = (
"argument: '%s'" % var_name if var_name is not None else 'return type')
try:
check_constraint(type_constraint, instance)
except SimpleTypeHintError:
if verbose:
verbose_instance = '%s, ' % instance
else:
verbose_instance = ''
raise TypeCheckError('Type-hint for %s violated. Expected an '
'instance of %s, instead found %san instance of %s.'
% (hint_type, type_constraint,
verbose_instance, type(instance)))
except CompositeTypeHintError as e:
raise TypeCheckError('Type-hint for %s violated: %s' % (hint_type, e))
def _interleave_type_check(type_constraint, var_name=None):
"""Lazily type-check the type-hint for a lazily generated sequence type.
This function can be applied as a decorator or called manually in a curried
manner:
* @_interleave_type_check(List[int])
def gen():
yield 5
or
* gen = _interleave_type_check(Tuple[int, int], 'coord_gen')(gen)
As a result, all type-checking for the passed generator will occur at 'yield'
time. This way, we avoid having to depleat the generator in order to
type-check it.
Args:
type_constraint: An instance of a TypeConstraint. The output yielded of
'gen' will be type-checked according to this type constraint.
var_name: The variable name binded to 'gen' if type-checking a function
argument. Used solely for templating in error message generation.
Returns:
A function which takes a generator as an argument and returns a wrapped
version of the generator that interleaves type-checking at 'yield'
iteration. If the generator received is already wrapped, then it is simply
returned to avoid nested wrapping.
"""
def wrapper(gen):
if isinstance(gen, GeneratorWrapper):
return gen
return GeneratorWrapper(
gen,
lambda x: _check_instance_type(type_constraint, x, var_name)
)
return wrapper
class GeneratorWrapper(object):
"""A wrapper around a generator, allows execution of a callback per yield.
Additionally, wrapping a generator with this class allows one to assign
arbitary attributes to a generator object just as with a function object.
Attributes:
internal_gen: A instance of a generator object. As part of 'step' of the
generator, the yielded object will be passed to 'interleave_func'.
interleave_func: A callback accepting a single argument. This function will
be called with the result of each yielded 'step' in the internal
generator.
"""
def __init__(self, gen, interleave_func):
self.internal_gen = gen
self.interleave_func = interleave_func
def __getattr__(self, attr):
# TODO(laolu): May also want to intercept 'send' in the future if we move to
# a GeneratorHint with 3 type-params:
# * Generator[send_type, return_type, yield_type]
if attr == '__next__':
return self.__next__()
elif attr == '__iter__':
return self.__iter__()
return getattr(self.internal_gen, attr)
def __next__(self):
next_val = next(self.internal_gen)
self.interleave_func(next_val)
return next_val
next = __next__
def __iter__(self):
for x in self.internal_gen:
self.interleave_func(x)
yield x
|
{
"content_hash": "c195149f32383e5c8a0762696e74545f",
"timestamp": "",
"source": "github",
"line_count": 893,
"max_line_length": 109,
"avg_line_length": 34.557670772676374,
"alnum_prop": 0.6803629293583927,
"repo_name": "RyanSkraba/beam",
"id": "7868a8fe15c7bf8f4e2e019aa8342858f3043811",
"size": "31645",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sdks/python/apache_beam/typehints/decorators.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1597"
},
{
"name": "CSS",
"bytes": "40963"
},
{
"name": "Dockerfile",
"bytes": "16638"
},
{
"name": "FreeMarker",
"bytes": "7428"
},
{
"name": "Go",
"bytes": "2683402"
},
{
"name": "Groovy",
"bytes": "517560"
},
{
"name": "HTML",
"bytes": "183330"
},
{
"name": "Java",
"bytes": "28609011"
},
{
"name": "JavaScript",
"bytes": "16595"
},
{
"name": "Jupyter Notebook",
"bytes": "56365"
},
{
"name": "Python",
"bytes": "6191025"
},
{
"name": "Ruby",
"bytes": "4159"
},
{
"name": "Shell",
"bytes": "235061"
},
{
"name": "TSQL",
"bytes": "841"
}
],
"symlink_target": ""
}
|
import sbt._
import sbt.Keys._
object BuildSettings {
val Name = "hadoop-dg-decomp"
val Version = "1.0.0"
val ScalaVersion = "2.10.3"
import Scalding._
val basicSettings = Defaults.defaultSettings ++ scaldingSettings ++ Seq (
name := Name,
version := Version,
scalaVersion := ScalaVersion,
organization := "com.typesafe",
description := "Hadoop Matrix Decomposition",
scalacOptions := Seq("-deprecation", "-unchecked", "-encoding", "utf8")
)
// sbt-assembly settings for building a fat jar that includes all dependencies.
// This is useful for running Hadoop jobs, but not needed for local script testing.
// Adapted from https://github.com/snowplow/scalding-example-project
import sbtassembly.Plugin._
import AssemblyKeys._
lazy val sbtAssemblySettings = assemblySettings ++ Seq(
// Slightly cleaner jar name
jarName in assembly := s"${name.value}-${version.value}.jar" ,
// Drop these jars, most of which are dependencies of dependencies and already exist
// in Hadoop deployments or aren't needed for local mode execution. Some are older
// versions of jars that collide with newer versions in the dependency graph!!
excludedJars in assembly <<= (fullClasspath in assembly) map { cp =>
val excludes = Set(
"scala-compiler.jar",
"jsp-api-2.1-6.1.14.jar",
"jsp-2.1-6.1.14.jar",
"jasper-compiler-5.5.12.jar",
"minlog-1.2.jar", // Otherwise causes conflicts with Kyro (which Scalding pulls in)
"janino-2.5.16.jar", // Janino includes a broken signature, and is not needed anyway
"commons-beanutils-core-1.8.0.jar", // Clash with each other and with commons-collections
"commons-beanutils-1.7.0.jar",
"stax-api-1.0.1.jar",
"asm-3.1.jar",
"scalatest-2.0.jar"
)
cp filter { jar => excludes(jar.data.getName) }
},
mergeStrategy in assembly <<= (mergeStrategy in assembly) {
(old) => {
case "project.clj" => MergeStrategy.discard // Leiningen build files
case "log4j.properties" => MergeStrategy.concat // custom logger props
case x => old(x)
}
}
)
lazy val buildSettings = basicSettings ++ sbtAssemblySettings
}
object Resolvers {
val typesafe = "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"
val sonatype = "Sonatype Release" at "https://oss.sonatype.org/content/repositories/releases"
val mvnrepository = "MVN Repo" at "http://mvnrepository.com/artifact"
val conjars = "Concurrent Maven Repo" at "http://conjars.org/repo"
val clojars = "Clojars Repo" at "http://clojars.org/repo"
val twitterMaven = "Twitter Maven" at "http://maven.twttr.com"
val allResolvers = Seq(typesafe, sonatype, mvnrepository, conjars, clojars, twitterMaven)
}
object Dependency {
object Version {
val Scalding = "0.9.0rc4"
val Algebird = "0.2.0"
val Hadoop = "1.1.2" // Fairly old, but reliable version. Substitute your "favorite"
val ScalaTest = "2.0"
}
// ---- Application dependencies ----
// Include the Scala compiler itself for reification and evaluation of expressions.
val scalaCompiler = "org.scala-lang" % "scala-compiler" % BuildSettings.ScalaVersion
val scalding_args = "com.twitter" %% "scalding-args" % Version.Scalding
val scalding_core = "com.twitter" %% "scalding-core" % Version.Scalding
val scalding_date = "com.twitter" %% "scalding-date" % Version.Scalding
val algebird_core = "com.twitter" %% "algebird-core" % Version.Algebird
val algebird_util = "com.twitter" %% "algebird-util" % Version.Algebird
val hadoop_core = "org.apache.hadoop" % "hadoop-core" % Version.Hadoop
val scalaTest = "org.scalatest" % "scalatest_2.10" % Version.ScalaTest % "test"
val logger = "org.slf4j" % "slf4j-log4j12" % "1.7.5"
}
object Dependencies {
import Dependency._
val hadoopDecomp = Seq(
scalaCompiler, scalding_args, scalding_core, scalding_date,
algebird_core, algebird_util, hadoop_core, scalaTest, logger)
}
object HadoopDecompBuild extends Build {
import Resolvers._
import Dependencies._
import BuildSettings._
lazy val hadoopDecomp = Project(
id = "hadoop-dg-decomp",
base = file("."),
settings = buildSettings ++ Seq(
// runScriptSetting,
resolvers := allResolvers,
libraryDependencies ++= Dependencies.hadoopDecomp,
mainClass := Some("RunAll")))
}
|
{
"content_hash": "4dcf0f0ae9129462ed9a506d28b550a0",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 97,
"avg_line_length": 35.359375,
"alnum_prop": 0.6623950508174989,
"repo_name": "pomadchin/hadoop-dg-decomp",
"id": "2215169c136c13608de7dcd4515cedc60b8b0c01",
"size": "4526",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "project/Build.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Rust",
"bytes": "308"
},
{
"name": "Scala",
"bytes": "40013"
},
{
"name": "Shell",
"bytes": "16075"
}
],
"symlink_target": ""
}
|
require 'spec_helper'
require 'has_cache_key/cache_key'
describe HasCacheKey::CacheKey do
it 'formats values' do
key = HasCacheKey::CacheKey.new(:location_id, :language_id, format: 'listing_view-%{location_id}-%{language_id}')
key.format.should == 'listing_view-%{location_id}-%{language_id}'
key.format("location_id" => 10, :language_id => 11).should == 'listing_view-10-11'
end
it 'accepts a block' do
key = HasCacheKey::CacheKey.new(:location_id, :language_id, format: lambda { |v| "TEST-#{10 * v[:location_id]}-#{v[:language_id]}" })
key.format(location_id: 9, language_id: 12).should == 'TEST-90-12'
end
it 'accepts a name converting it to Symbol' do
key = HasCacheKey::CacheKey.new(:location_id, name: 'main_key')
key.name.should == :main_key
end
end
|
{
"content_hash": "23929ce99cc59752349b326d0dba2ce3",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 137,
"avg_line_length": 38.142857142857146,
"alnum_prop": 0.6666666666666666,
"repo_name": "glebm/has_cache_key",
"id": "43a255eb6e4f1ce4ff77535e3bf990bfa0cbfff7",
"size": "801",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/cache_key_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "10530"
}
],
"symlink_target": ""
}
|
chmod +x bin/abstractFactoryMain
./bin/abstractFactoryMain
|
{
"content_hash": "6a7a78cb63003be49b11a31ba2b2884d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 32,
"avg_line_length": 20,
"alnum_prop": 0.8333333333333334,
"repo_name": "acornagl/Design-patterns",
"id": "3bff6a08f732c3508a3344dff6456ecdd62de8c8",
"size": "71",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Creational/Abstract_factory/C++/run_main.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "7518"
},
{
"name": "Makefile",
"bytes": "929"
},
{
"name": "Shell",
"bytes": "71"
}
],
"symlink_target": ""
}
|
module A {
class Point {
x: number;
y: number;
}
export class points {
[idx: number]: Point;
[idx: string]: Point;
}
}
//// [ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js]
var A;
(function (A) {
var Point = (function () {
function Point() {
}
return Point;
})();
var points = (function () {
function points() {
}
return points;
})();
A.points = points;
})(A || (A = {}));
|
{
"content_hash": "3429d7e5ba5423526a8ade2930a11b57",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 65,
"avg_line_length": 16.35483870967742,
"alnum_prop": 0.4812623274161736,
"repo_name": "freedot/tstolua",
"id": "8ce25dd50e345eda79b9e1229584a49635e9ba64",
"size": "573",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/baselines/reference/ExportClassWithInaccessibleTypeInIndexerTypeAnnotations.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1125"
},
{
"name": "HTML",
"bytes": "4659"
},
{
"name": "JavaScript",
"bytes": "85"
},
{
"name": "Lua",
"bytes": "68588"
},
{
"name": "PowerShell",
"bytes": "2780"
},
{
"name": "TypeScript",
"bytes": "22883724"
}
],
"symlink_target": ""
}
|
package com.nicholasgot.clientapp.autocomplete;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.AutoCompleteTextView;
import java.util.HashMap;
/**
* custom autocomplete textview class for pickup location
*/
public class CustomAutocompleteTextView extends AutoCompleteTextView {
private static final String DESCRIPTION = "description";
public CustomAutocompleteTextView(Context context, AttributeSet attrs) {
super(context,attrs);
}
@SuppressWarnings("unchecked")
protected CharSequence convertSelectionToString(Object selectedItem) {
HashMap<String, String> hm = (HashMap<String, String>) selectedItem;
return hm.get(DESCRIPTION);
}
}
|
{
"content_hash": "55a80449382d218e8519fc898411b725",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 76,
"avg_line_length": 30.458333333333332,
"alnum_prop": 0.7633378932968536,
"repo_name": "Tiglas/pickup-planner",
"id": "c1db8c555f02dbd30a67ceb29c8d4f5d2dfcf53e",
"size": "731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clientapp/app/src/main/java/com/nicholasgot/clientapp/autocomplete/CustomAutocompleteTextView.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5939"
},
{
"name": "CSS",
"bytes": "6267"
},
{
"name": "HTML",
"bytes": "449"
},
{
"name": "Java",
"bytes": "1220664"
},
{
"name": "JavaScript",
"bytes": "6187"
},
{
"name": "Python",
"bytes": "3027132"
}
],
"symlink_target": ""
}
|
<?php
/**
* @see Zend_Controller_Response_Abstract
*/
// require_once "Zend/Controller/Response/Abstract.php";
/**
* Static class that contains common utility functions for
* {@link Zend_OpenId_Consumer} and {@link Zend_OpenId_Provider}.
*
* This class implements common utility functions that are used by both
* Consumer and Provider. They include functions for Diffie-Hellman keys
* generation and exchange, URL normalization, HTTP redirection and some others.
*
* @category Zend
* @package Zend_OpenId
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_OpenId
{
/**
* Default Diffie-Hellman key generator (1024 bit)
*/
const DH_P = 'dcf93a0b883972ec0e19989ac5a2ce310e1d37717e8d9571bb7623731866e61ef75a2e27898b057f9891c2e27a639c3f29b60814581cd3b2ca3986d2683705577d45c2e7e52dc81c7a171876e5cea74b1448bfdfaf18828efd2519f14e45e3826634af1949e5b535cc829a483b8a76223e5d490a257f05bdff16f2fb22c583ab';
/**
* Default Diffie-Hellman prime number (should be 2 or 5)
*/
const DH_G = '02';
/**
* OpenID 2.0 namespace. All OpenID 2.0 messages MUST contain variable
* openid.ns with its value.
*/
const NS_2_0 = 'http://specs.openid.net/auth/2.0';
/**
* Allows enable/disable stoping execution of PHP script after redirect()
*/
static public $exitOnRedirect = true;
/**
* Alternative request URL that can be used to override the default
* selfUrl() response
*/
static public $selfUrl = null;
/**
* Sets alternative request URL that can be used to override the default
* selfUrl() response
*
* @param string $selfUrl the URL to be set
* @return string the old value of overriding URL
*/
static public function setSelfUrl($selfUrl = null)
{
$ret = self::$selfUrl;
self::$selfUrl = $selfUrl;
return $ret;
}
/**
* Returns a full URL that was requested on current HTTP request.
*
* @return string
*/
static public function selfUrl()
{
if (self::$selfUrl !== null) {
return self::$selfUrl;
} if (isset($_SERVER['SCRIPT_URI'])) {
return $_SERVER['SCRIPT_URI'];
}
$url = '';
$port = '';
if (isset($_SERVER['HTTP_HOST'])) {
if (($pos = strpos($_SERVER['HTTP_HOST'], ':')) === false) {
if (isset($_SERVER['SERVER_PORT'])) {
$port = ':' . $_SERVER['SERVER_PORT'];
}
$url = $_SERVER['HTTP_HOST'];
} else {
$url = substr($_SERVER['HTTP_HOST'], 0, $pos);
$port = substr($_SERVER['HTTP_HOST'], $pos);
}
} else if (isset($_SERVER['SERVER_NAME'])) {
$url = $_SERVER['SERVER_NAME'];
if (isset($_SERVER['SERVER_PORT'])) {
$port = ':' . $_SERVER['SERVER_PORT'];
}
}
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$url = 'https://' . $url;
if ($port == ':443') {
$port = '';
}
} else {
$url = 'http://' . $url;
if ($port == ':80') {
$port = '';
}
}
$url .= $port;
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$url .= $_SERVER['HTTP_X_REWRITE_URL'];
} elseif (isset($_SERVER['REQUEST_URI'])) {
$query = strpos($_SERVER['REQUEST_URI'], '?');
if ($query === false) {
$url .= $_SERVER['REQUEST_URI'];
} else {
$url .= substr($_SERVER['REQUEST_URI'], 0, $query);
}
} else if (isset($_SERVER['SCRIPT_URL'])) {
$url .= $_SERVER['SCRIPT_URL'];
} else if (isset($_SERVER['REDIRECT_URL'])) {
$url .= $_SERVER['REDIRECT_URL'];
} else if (isset($_SERVER['PHP_SELF'])) {
$url .= $_SERVER['PHP_SELF'];
} else if (isset($_SERVER['SCRIPT_NAME'])) {
$url .= $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['PATH_INFO'])) {
$url .= $_SERVER['PATH_INFO'];
}
}
return $url;
}
/**
* Returns an absolute URL for the given one
*
* @param string $url absilute or relative URL
* @return string
*/
static public function absoluteUrl($url)
{
if (empty($url)) {
return Zend_OpenId::selfUrl();
} else if (!preg_match('|^([^:]+)://|', $url)) {
if (preg_match('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?]*)?((?:[?](?:[^#]*))?(?:#.*)?)$|', Zend_OpenId::selfUrl(), $reg)) {
$scheme = $reg[1];
$auth = $reg[2];
$host = $reg[3];
$port = $reg[4];
$path = $reg[5];
$query = $reg[6];
if ($url[0] == '/') {
return $scheme
. '://'
. $auth
. $host
. (empty($port) ? '' : (':' . $port))
. $url;
} else {
$dir = dirname($path);
return $scheme
. '://'
. $auth
. $host
. (empty($port) ? '' : (':' . $port))
. (strlen($dir) > 1 ? $dir : '')
. '/'
. $url;
}
}
}
return $url;
}
/**
* Converts variable/value pairs into URL encoded query string
*
* @param array $params variable/value pairs
* @return string URL encoded query string
*/
static public function paramsToQuery($params)
{
foreach($params as $key => $value) {
if (isset($query)) {
$query .= '&' . $key . '=' . urlencode($value);
} else {
$query = $key . '=' . urlencode($value);
}
}
return isset($query) ? $query : '';
}
/**
* Normalizes URL according to RFC 3986 to use it in comparison operations.
* The function gets URL argument by reference and modifies it.
* It returns true on success and false of failure.
*
* @param string &$id url to be normalized
* @return bool
*/
static public function normalizeUrl(&$id)
{
// RFC 3986, 6.2.2. Syntax-Based Normalization
// RFC 3986, 6.2.2.2 Percent-Encoding Normalization
$i = 0;
$n = strlen($id);
$res = '';
while ($i < $n) {
if ($id[$i] == '%') {
if ($i + 2 >= $n) {
return false;
}
++$i;
if ($id[$i] >= '0' && $id[$i] <= '9') {
$c = ord($id[$i]) - ord('0');
} else if ($id[$i] >= 'A' && $id[$i] <= 'F') {
$c = ord($id[$i]) - ord('A') + 10;
} else if ($id[$i] >= 'a' && $id[$i] <= 'f') {
$c = ord($id[$i]) - ord('a') + 10;
} else {
return false;
}
++$i;
if ($id[$i] >= '0' && $id[$i] <= '9') {
$c = ($c << 4) | (ord($id[$i]) - ord('0'));
} else if ($id[$i] >= 'A' && $id[$i] <= 'F') {
$c = ($c << 4) | (ord($id[$i]) - ord('A') + 10);
} else if ($id[$i] >= 'a' && $id[$i] <= 'f') {
$c = ($c << 4) | (ord($id[$i]) - ord('a') + 10);
} else {
return false;
}
++$i;
$ch = chr($c);
if (($ch >= 'A' && $ch <= 'Z') ||
($ch >= 'a' && $ch <= 'z') ||
$ch == '-' ||
$ch == '.' ||
$ch == '_' ||
$ch == '~') {
$res .= $ch;
} else {
$res .= '%';
if (($c >> 4) < 10) {
$res .= chr(($c >> 4) + ord('0'));
} else {
$res .= chr(($c >> 4) - 10 + ord('A'));
}
$c = $c & 0xf;
if ($c < 10) {
$res .= chr($c + ord('0'));
} else {
$res .= chr($c - 10 + ord('A'));
}
}
} else {
$res .= $id[$i++];
}
}
if (!preg_match('|^([^:]+)://([^:@]*(?:[:][^@]*)?@)?([^/:@?#]*)(?:[:]([^/?#]*))?(/[^?#]*)?((?:[?](?:[^#]*))?)((?:#.*)?)$|', $res, $reg)) {
return false;
}
$scheme = $reg[1];
$auth = $reg[2];
$host = $reg[3];
$port = $reg[4];
$path = $reg[5];
$query = $reg[6];
$fragment = $reg[7]; /* strip it */
if (empty($scheme) || empty($host)) {
return false;
}
// RFC 3986, 6.2.2.1. Case Normalization
$scheme = strtolower($scheme);
$host = strtolower($host);
// RFC 3986, 6.2.2.3. Path Segment Normalization
if (!empty($path)) {
$i = 0;
$n = strlen($path);
$res = "";
while ($i < $n) {
if ($path[$i] == '/') {
++$i;
while ($i < $n && $path[$i] == '/') {
++$i;
}
if ($i < $n && $path[$i] == '.') {
++$i;
if ($i < $n && $path[$i] == '.') {
++$i;
if ($i == $n || $path[$i] == '/') {
if (($pos = strrpos($res, '/')) !== false) {
$res = substr($res, 0, $pos);
}
} else {
$res .= '/..';
}
} else if ($i != $n && $path[$i] != '/') {
$res .= '/.';
}
} else {
$res .= '/';
}
} else {
$res .= $path[$i++];
}
}
$path = $res;
}
// RFC 3986,6.2.3. Scheme-Based Normalization
if ($scheme == 'http') {
if ($port == 80) {
$port = '';
}
} else if ($scheme == 'https') {
if ($port == 443) {
$port = '';
}
}
if (empty($path)) {
$path = '/';
}
$id = $scheme
. '://'
. $auth
. $host
. (empty($port) ? '' : (':' . $port))
. $path
. $query;
return true;
}
/**
* Normalizes OpenID identifier that can be URL or XRI name.
* Returns true on success and false of failure.
*
* Normalization is performed according to the following rules:
* 1. If the user's input starts with one of the "xri://", "xri://$ip*",
* or "xri://$dns*" prefixes, they MUST be stripped off, so that XRIs
* are used in the canonical form, and URI-authority XRIs are further
* considered URL identifiers.
* 2. If the first character of the resulting string is an XRI Global
* Context Symbol ("=", "@", "+", "$", "!"), then the input SHOULD be
* treated as an XRI.
* 3. Otherwise, the input SHOULD be treated as an http URL; if it does
* not include a "http" or "https" scheme, the Identifier MUST be
* prefixed with the string "http://".
* 4. URL identifiers MUST then be further normalized by both following
* redirects when retrieving their content and finally applying the
* rules in Section 6 of [RFC3986] to the final destination URL.
* @param string &$id identifier to be normalized
* @return bool
*/
static public function normalize(&$id)
{
$id = trim($id);
if (strlen($id) === 0) {
return true;
}
// 7.2.1
if (strpos($id, 'xri://$ip*') === 0) {
$id = substr($id, strlen('xri://$ip*'));
} else if (strpos($id, 'xri://$dns*') === 0) {
$id = substr($id, strlen('xri://$dns*'));
} else if (strpos($id, 'xri://') === 0) {
$id = substr($id, strlen('xri://'));
}
// 7.2.2
if ($id[0] == '=' ||
$id[0] == '@' ||
$id[0] == '+' ||
$id[0] == '$' ||
$id[0] == '!') {
return true;
}
// 7.2.3
if (strpos($id, "://") === false) {
$id = 'http://' . $id;
}
// 7.2.4
return self::normalizeURL($id);
}
/**
* Performs a HTTP redirection to specified URL with additional data.
* It may generate redirected request using GET or POST HTTP method.
* The function never returns.
*
* @param string $url URL to redirect to
* @param array $params additional variable/value pairs to send
* @param Zend_Controller_Response_Abstract $response
* @param string $method redirection method ('GET' or 'POST')
*/
static public function redirect($url, $params = null,
Zend_Controller_Response_Abstract $response = null, $method = 'GET')
{
$url = Zend_OpenId::absoluteUrl($url);
$body = "";
if (null === $response) {
// require_once "Zend/Controller/Response/Http.php";
$response = new Zend_Controller_Response_Http();
}
if ($method == 'POST') {
$body = "<html><body onLoad=\"document.forms[0].submit();\">\n";
$body .= "<form method=\"POST\" action=\"$url\">\n";
if (is_array($params) && count($params) > 0) {
foreach($params as $key => $value) {
$body .= '<input type="hidden" name="' . $key . '" value="' . $value . "\">\n";
}
}
$body .= "<input type=\"submit\" value=\"Continue OpenID transaction\">\n";
$body .= "</form></body></html>\n";
} else if (is_array($params) && count($params) > 0) {
if (strpos($url, '?') === false) {
$url .= '?' . self::paramsToQuery($params);
} else {
$url .= '&' . self::paramsToQuery($params);
}
}
if (!empty($body)) {
$response->setBody($body);
} else if (!$response->canSendHeaders()) {
$response->setBody("<script language=\"JavaScript\"" .
" type=\"text/javascript\">window.location='$url';" .
"</script>");
} else {
$response->setRedirect($url);
}
$response->sendResponse();
if (self::$exitOnRedirect) {
exit();
}
}
/**
* Produces string of random byte of given length.
*
* @param integer $len length of requested string
* @return string RAW random binary string
*/
static public function randomBytes($len)
{
$key = '';
for($i=0; $i < $len; $i++) {
$key .= chr(mt_rand(0, 255));
}
return $key;
}
/**
* Generates a hash value (message digest) according to given algorithm.
* It returns RAW binary string.
*
* This is a wrapper function that uses one of available internal function
* dependent on given PHP configuration. It may use various functions from
* ext/openssl, ext/hash, ext/mhash or ext/standard.
*
* @param string $func digest algorithm
* @param string $data data to sign
* @return string RAW digital signature
* @throws Zend_OpenId_Exception
*/
static public function digest($func, $data)
{
if (function_exists('openssl_digest')) {
return openssl_digest($data, $func, true);
} else if (function_exists('hash')) {
return hash($func, $data, true);
} else if ($func === 'sha1') {
return sha1($data, true);
} else if ($func === 'sha256') {
if (function_exists('mhash')) {
return mhash(MHASH_SHA256 , $data);
}
}
// require_once "Zend/OpenId/Exception.php";
throw new Zend_OpenId_Exception(
'Unsupported digest algorithm "' . $func . '".',
Zend_OpenId_Exception::UNSUPPORTED_DIGEST);
}
/**
* Generates a keyed hash value using the HMAC method. It uses ext/hash
* if available or user-level PHP implementation, that is not significantly
* slower.
*
* @param string $macFunc name of selected hashing algorithm (sha1, sha256)
* @param string $data data to sign
* @param string $secret shared secret key used for generating the HMAC
* variant of the message digest
* @return string RAW HMAC value
*/
static public function hashHmac($macFunc, $data, $secret)
{
// // require_once "Zend/Crypt/Hmac.php";
// return Zend_Crypt_Hmac::compute($secret, $macFunc, $data, Zend_Crypt_Hmac::BINARY);
if (function_exists('hash_hmac')) {
return hash_hmac($macFunc, $data, $secret, 1);
} else {
if (Zend_OpenId::strlen($secret) > 64) {
$secret = self::digest($macFunc, $secret);
}
$secret = str_pad($secret, 64, chr(0x00));
$ipad = str_repeat(chr(0x36), 64);
$opad = str_repeat(chr(0x5c), 64);
$hash1 = self::digest($macFunc, ($secret ^ $ipad) . $data);
return self::digest($macFunc, ($secret ^ $opad) . $hash1);
}
}
/**
* Converts binary representation into ext/gmp or ext/bcmath big integer
* representation.
*
* @param string $bin binary representation of big number
* @return mixed
* @throws Zend_OpenId_Exception
*/
static protected function binToBigNum($bin)
{
if (extension_loaded('gmp')) {
return gmp_init(bin2hex($bin), 16);
} else if (extension_loaded('bcmath')) {
$bn = 0;
$len = Zend_OpenId::strlen($bin);
for ($i = 0; $i < $len; $i++) {
$bn = bcmul($bn, 256);
$bn = bcadd($bn, ord($bin[$i]));
}
return $bn;
}
// require_once "Zend/OpenId/Exception.php";
throw new Zend_OpenId_Exception(
'The system doesn\'t have proper big integer extension',
Zend_OpenId_Exception::UNSUPPORTED_LONG_MATH);
}
/**
* Converts internal ext/gmp or ext/bcmath big integer representation into
* binary string.
*
* @param mixed $bn big number
* @return string
* @throws Zend_OpenId_Exception
*/
static protected function bigNumToBin($bn)
{
if (extension_loaded('gmp')) {
$s = gmp_strval($bn, 16);
if (strlen($s) % 2 != 0) {
$s = '0' . $s;
} else if ($s[0] > '7') {
$s = '00' . $s;
}
return pack("H*", $s);
} else if (extension_loaded('bcmath')) {
$cmp = bccomp($bn, 0);
if ($cmp == 0) {
return (chr(0));
} else if ($cmp < 0) {
// require_once "Zend/OpenId/Exception.php";
throw new Zend_OpenId_Exception(
'Big integer arithmetic error',
Zend_OpenId_Exception::ERROR_LONG_MATH);
}
$bin = "";
while (bccomp($bn, 0) > 0) {
$bin = chr(bcmod($bn, 256)) . $bin;
$bn = bcdiv($bn, 256);
}
if (ord($bin[0]) > 127) {
$bin = chr(0) . $bin;
}
return $bin;
}
// require_once "Zend/OpenId/Exception.php";
throw new Zend_OpenId_Exception(
'The system doesn\'t have proper big integer extension',
Zend_OpenId_Exception::UNSUPPORTED_LONG_MATH);
}
/**
* Performs the first step of a Diffie-Hellman key exchange by generating
* private and public DH values based on given prime number $p and
* generator $g. Both sides of key exchange MUST have the same prime number
* and generator. In this case they will able to create a random shared
* secret that is never send from one to the other.
*
* @param string $p prime number in binary representation
* @param string $g generator in binary representation
* @param string $priv_key private key in binary representation
* @return mixed
*/
static public function createDhKey($p, $g, $priv_key = null)
{
if (function_exists('openssl_dh_compute_key')) {
$dh_details = array(
'p' => $p,
'g' => $g
);
if ($priv_key !== null) {
$dh_details['priv_key'] = $priv_key;
}
return openssl_pkey_new(array('dh'=>$dh_details));
} else {
$bn_p = self::binToBigNum($p);
$bn_g = self::binToBigNum($g);
if ($priv_key === null) {
$priv_key = self::randomBytes(Zend_OpenId::strlen($p));
}
$bn_priv_key = self::binToBigNum($priv_key);
if (extension_loaded('gmp')) {
$bn_pub_key = gmp_powm($bn_g, $bn_priv_key, $bn_p);
} else if (extension_loaded('bcmath')) {
$bn_pub_key = bcpowmod($bn_g, $bn_priv_key, $bn_p);
}
$pub_key = self::bigNumToBin($bn_pub_key);
return array(
'p' => $bn_p,
'g' => $bn_g,
'priv_key' => $bn_priv_key,
'pub_key' => $bn_pub_key,
'details' => array(
'p' => $p,
'g' => $g,
'priv_key' => $priv_key,
'pub_key' => $pub_key));
}
}
/**
* Returns an associative array with Diffie-Hellman key components in
* binary representation. The array includes original prime number 'p' and
* generator 'g', random private key 'priv_key' and corresponding public
* key 'pub_key'.
*
* @param mixed $dh Diffie-Hellman key
* @return array
*/
static public function getDhKeyDetails($dh)
{
if (function_exists('openssl_dh_compute_key')) {
$details = openssl_pkey_get_details($dh);
if (isset($details['dh'])) {
return $details['dh'];
}
} else {
return $dh['details'];
}
}
/**
* Computes the shared secret from the private DH value $dh and the other
* party's public value in $pub_key
*
* @param string $pub_key other party's public value
* @param mixed $dh Diffie-Hellman key
* @return string
* @throws Zend_OpenId_Exception
*/
static public function computeDhSecret($pub_key, $dh)
{
if (function_exists('openssl_dh_compute_key')) {
$ret = openssl_dh_compute_key($pub_key, $dh);
if (ord($ret[0]) > 127) {
$ret = chr(0) . $ret;
}
return $ret;
} else if (extension_loaded('gmp')) {
$bn_pub_key = self::binToBigNum($pub_key);
$bn_secret = gmp_powm($bn_pub_key, $dh['priv_key'], $dh['p']);
return self::bigNumToBin($bn_secret);
} else if (extension_loaded('bcmath')) {
$bn_pub_key = self::binToBigNum($pub_key);
$bn_secret = bcpowmod($bn_pub_key, $dh['priv_key'], $dh['p']);
return self::bigNumToBin($bn_secret);
}
// require_once "Zend/OpenId/Exception.php";
throw new Zend_OpenId_Exception(
'The system doesn\'t have proper big integer extension',
Zend_OpenId_Exception::UNSUPPORTED_LONG_MATH);
}
/**
* Takes an arbitrary precision integer and returns its shortest big-endian
* two's complement representation.
*
* Arbitrary precision integers MUST be encoded as big-endian signed two's
* complement binary strings. Henceforth, "btwoc" is a function that takes
* an arbitrary precision integer and returns its shortest big-endian two's
* complement representation. All integers that are used with
* Diffie-Hellman Key Exchange are positive. This means that the left-most
* bit of the two's complement representation MUST be zero. If it is not,
* implementations MUST add a zero byte at the front of the string.
*
* @param string $str binary representation of arbitrary precision integer
* @return string big-endian signed representation
*/
static public function btwoc($str)
{
if (ord($str[0]) > 127) {
return chr(0) . $str;
}
return $str;
}
/**
* Returns lenght of binary string in bytes
*
* @param string $str
* @return int the string lenght
*/
static public function strlen($str)
{
if (extension_loaded('mbstring') &&
(((int)ini_get('mbstring.func_overload')) & 2)) {
return mb_strlen($str, 'latin1');
} else {
return strlen($str);
}
}
}
|
{
"content_hash": "4cd9ce2d48f9b72a07df555b50efd666",
"timestamp": "",
"source": "github",
"line_count": 735,
"max_line_length": 278,
"avg_line_length": 35.22721088435374,
"alnum_prop": 0.4542329677120346,
"repo_name": "frapi/frapi",
"id": "f05a37cca6271d90a3c4e2424e1add0c0c9c9208",
"size": "26632",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "src/frapi/library/Zend/OpenId.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "JavaScript",
"bytes": "48653"
},
{
"name": "PHP",
"bytes": "14859697"
},
{
"name": "Ruby",
"bytes": "187"
},
{
"name": "Shell",
"bytes": "802"
}
],
"symlink_target": ""
}
|
package com.weathertodcx.android.db;
import org.litepal.crud.DataSupport;
/**
* 县
* Created by Administrator on 2017/4/18.
*/
public class County extends DataSupport {
private int id;
private String countyName;
private String weatherId;
private int cityId;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName;
}
public String getWeatherId() {
return weatherId;
}
public void setWeatherId(String weatherId) {
this.weatherId = weatherId;
}
public int getCityId() {
return cityId;
}
public void setCityId(int cityId) {
this.cityId = cityId;
}
}
|
{
"content_hash": "c7a77d2902b17444ef5613d828061752",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 50,
"avg_line_length": 18.19148936170213,
"alnum_prop": 0.6175438596491228,
"repo_name": "BoyJeffrey/weathertodcx",
"id": "0c5d4a63bc102e9ffeb3ca683500ae91c820ce3d",
"size": "857",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/weathertodcx/android/db/County.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "47747"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.