Dataset Preview
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code: DatasetGenerationError
Exception: TypeError
Message: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
Traceback: Traceback (most recent call last):
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
writer.write_table(table)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
pa_table = table_cast(pa_table, self._schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
return cast_table_to_schema(table, schema)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2122, in cast_array_to_feature
raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
TypeError: Couldn't cast array of type
struct<content_hash: string, timestamp: string, source: string, line_count: int64, max_line_length: int64, avg_line_length: double, alnum_prop: double, repo_name: string, id: string, size: string, binary: bool, copies: string, ref: string, path: string, mode: string, license: string, language: list<item: struct<name: string, bytes: string>>, symlink_target: string>
to
{'content_hash': Value(dtype='string', id=None), 'timestamp': Value(dtype='string', id=None), 'source': Value(dtype='string', id=None), 'line_count': Value(dtype='int64', id=None), 'max_line_length': Value(dtype='int64', id=None), 'avg_line_length': Value(dtype='float64', id=None), 'alnum_prop': Value(dtype='float64', id=None), 'repo_name': Value(dtype='string', id=None), 'id': Value(dtype='string', id=None), 'size': Value(dtype='string', id=None), 'binary': Value(dtype='bool', id=None), 'copies': Value(dtype='string', id=None), 'ref': Value(dtype='string', id=None), 'path': Value(dtype='string', id=None), 'mode': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'language': [{'name': Value(dtype='string', id=None), 'bytes': Value(dtype='string', id=None)}]}
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
builder.download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
self._download_and_prepare(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
for job_id, done, content in self._prepare_split_single(
File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
raise DatasetGenerationError("An error occurred while generating the dataset") from e
datasets.exceptions.DatasetGenerationError: An error occurred while generating the datasetNeed help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
text
string | meta
dict |
|---|---|
% File: preamble.tex
\usepackage{lmodern}
% \usepackage{CJKutf8}
\usepackage{xeCJK}
\usetheme{CambridgeUS} % try Pittsburgh
\usecolortheme{beaver}
\usefonttheme[]{serif} % try "professionalfonts"
\setbeamertemplate{itemize items}[default]
\setbeamertemplate{enumerate items}[default]
\usepackage{animate}
\usepackage{xmpmulti}
% \usepackage{cancel, ulem}
\usepackage{amsmath, amsfonts, latexsym, mathtools, tabu}
\usepackage{centernot}
\newcommand{\z}{\mathbb{Z}}
\usepackage{amstext} % for \text macro
\usepackage{array} % for \newcolumntype macro
\newcolumntype{C}{>{$}c<{$}} % math-mode version of "l" column type
\newcommand{\set}[1]{\left\{#1\right\}}
\newcommand{\ps}[1]{\mathcal{P}(#1)}
\usepackage{bm}
\DeclareMathOperator*{\argmin}{\arg\!\min}
\DeclareMathOperator*{\E}{\mathbb{E}}
% colors
\newcommand{\red}[1]{\textcolor{red}{#1}}
\newcommand{\redoverlay}[2]{\textcolor<#2>{red}{#1}}
\newcommand{\green}[1]{\textcolor{green}{#1}}
\newcommand{\greenoverlay}[2]{\textcolor<#2>{green}{#1}}
\newcommand{\blue}[1]{\textcolor{blue}{#1}}
\newcommand{\blueoverlay}[2]{\textcolor<#2>{blue}{#1}}
\newcommand{\purple}[1]{\textcolor{purple}{#1}}
\newcommand{\cyan}[1]{\textcolor{cyan}{#1}}
\newcommand{\violet}[1]{\textcolor{violet}{#1}}
\newcommand{\brown}[1]{\textcolor{brown}{#1}}
\newcommand{\lgray}[1]{\textcolor{lightgray}{#1}}
\newcommand{\teal}[1]{\textcolor{teal}{#1}}
% colorded box
\newcommand{\rbox}[1]{\red{\boxed{#1}}}
\newcommand{\gbox}[1]{\green{\boxed{#1}}}
\newcommand{\bbox}[1]{\blue{\boxed{#1}}}
\newcommand{\pbox}[1]{\purple{\boxed{#1}}}
\usepackage[linewidth = 1pt, framemethod = TikZ]{mdframed}
\mdfsetup{frametitlealignment=\center}
% #1: color; #2: text
\newcommand{\hl}[2]{\fcolorbox{#1}{#1!50}{#2}}
\usepackage{pifont}
\usepackage{wasysym}
\newcommand{\pno}[1]{\textcolor{blue}{\scriptsize [Problem: #1]}}
\newcommand{\cmark}{\green{\ding{51}}}
\newcommand{\xmark}{\red{\ding{55}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% for fig without caption: #1: width/size; #2: fig file
\newcommand{\fig}[2]{
\begin{figure}[htp]
\centering
\includegraphics[#1]{#2}
\end{figure}
}
\usepackage{adjustbox}
\usepackage{tikz}
\usetikzlibrary{shapes}
\newcommand{\titletext}{4-4 Direct Products}
\newcommand{\thankyou}{
\begin{frame}[noframenumbering]{}
\fig{width = 0.55\textwidth}{figs/thankyou}
\end{frame}
}
|
{
"content_hash": "8ff96b7dc0df55b96667e8dc20c974c6",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 67,
"avg_line_length": 28.105882352941176,
"alnum_prop": 0.6747593135203014,
"repo_name": "hengxin/problem-solving-class-lectures",
"id": "5fca5b8205fe4d8c923873555418cf3332bdab3b",
"size": "2389",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "2017/2019-spring-4th-semester/4-4-direct-product/tutorial/preamble.tex",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3510"
},
{
"name": "PostScript",
"bytes": "211639"
},
{
"name": "Python",
"bytes": "1716"
},
{
"name": "TeX",
"bytes": "1386903"
}
]
}
|
from rest_framework.test import APITestCase
from django.core.urlresolvers import reverse
import json
from helpers import *
class NonprofitsTest(APITestCase):
def test_list_nonprofit_view(self):
"""
"""
url = reverse('nonprofit-list')
#+ with self.assertNumQueries(1):
#+ response = self.client.get(url, format='json')
#+ response_data = json.loads(response.content.decode('utf8'))
#+ self.assertEqual(response.status_code, 200)
# /v1/nonprofit/ atados_core.views.NonprofitViewSet nonprofit-list
def test_list_nonprofit(self):
"""
"""
url = reverse('nonprofits-list')
#+ with self.assertNumQueries(1):
#+ response = self.client.get(url, format='json')
#+ response_data = json.loads(response.content.decode('utf8'))
#+ self.assertEqual(response.status_code, 200)
# /v1/nonprofits/ atados_core.views.NonprofitList nonprofits-list
def test_get_nonprofit(self):
"""
"""
url = reverse('nonprofit-detail', args=[1])
#+ with self.assertNumQueries(1):
#+ response = self.client.get(url, format='json')
#+ response_data = json.loads(response.content.decode('utf8'))
#+ self.assertEqual(response.status_code, 200)
# /v1/nonprofit/<slug>/ atados_core.views.NonprofitViewSet nonprofit-detail
def test_create_nonprofit(self):
"""
"""
url = reverse('v1_create_nonprofit')
#+ with self.assertNumQueries(1):
#+ response = self.client.get(url, format='json')
#+ response_data = json.loads(response.content.decode('utf8'))
#+ self.assertEqual(response.status_code, 200)
# /v1/create/nonprofit/ rest_framework.decorators.create_nonprofit
def test_generate_nonprofit_slug(self):
"""
"""
url = reverse('v1_generate_slug', args=[1])
#+ with self.assertNumQueries(1):
#+ response = self.client.get(url, format='json')
#+ response_data = json.loads(response.content.decode('utf8'))
#+ self.assertEqual(response.status_code, 200)
# /v1/generate_slug/<nonprofit_name>/ rest_framework.decorators.generate_slug
|
{
"content_hash": "585a0fa420f63def82568e0770f1e983",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 84,
"avg_line_length": 31.5625,
"alnum_prop": 0.689108910891089,
"repo_name": "atados/api",
"id": "995f3f0d9d6acb6176fd006fe93e0d5568b96bc6",
"size": "2044",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "atados_core/tests/test_routes/news/test_nonprofit.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "31943"
},
{
"name": "HTML",
"bytes": "138142"
},
{
"name": "JavaScript",
"bytes": "5492"
},
{
"name": "Makefile",
"bytes": "1381"
},
{
"name": "Python",
"bytes": "394268"
},
{
"name": "Shell",
"bytes": "1060"
}
]
}
|
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const webpack = require('webpack');
const inProduction = process.env.BIKEMOVES_DEBUG !== 'true';
function getPlugins() {
let plugins = [
new ExtractTextPlugin('explore.css')
];
if (inProduction)
plugins.push(new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}));
return plugins;
}
module.exports = {
entry: './src/explore/public/index.js',
output: {
filename: 'explore.js',
path: path.resolve(__dirname, 'dist', 'explore'),
},
module: {
noParse: /(mapbox-gl)\.js$/,
rules: [
{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: 'css-loader'
})
},
{
test: /\.(png|jpg|gif)$/,
use: [
{
loader: 'file-loader',
options: {
name: 'images/[name].[ext]',
context: ''
}
}
]
},
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: ['babel-preset-env'],
plugins: ['transform-runtime']
}
}
}
]
},
plugins: getPlugins(),
watch: !inProduction
};
|
{
"content_hash": "69a1ed93152a8c23a6f3fd6f3cbf001f",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 65,
"avg_line_length": 21.65625,
"alnum_prop": 0.49783549783549785,
"repo_name": "CUUATS/bikemoves-server",
"id": "c83f353822ad11a41d80f8aec0b3d937d2ef6671",
"size": "1386",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webpack.config.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "19307"
},
{
"name": "Dockerfile",
"bytes": "497"
},
{
"name": "HTML",
"bytes": "7532"
},
{
"name": "JavaScript",
"bytes": "94369"
},
{
"name": "Shell",
"bytes": "594"
}
]
}
|
We need to thank a lot of people who made these projects happened.
The Community, the Brigade, The people working in the government, the small business owners, and many many more...
----
**Some Public Servants:**
**Iván Rios** from Science and Trust, one of the Funders.
**Antonio Duarte**, from Economic Development Agency,
**Frankie Chévere,** Director of Trade company,
**Agnes Crespo**, from Trade Company,
**Joey Cancel**, Director of Economic Development Bank
**Victor Maldonado,** from BDE,
**Antonio Llorens**, from PRIDCO,
**Alberto Bacó**, Director of Economic Development,
**Pedro Galarza,** from Trade Company
**Roy Acosta, **from PRIDCO
**Jose Iguina,** from PRIDCO
**Francisco Rodriguez Bernier**, from Department of State,
**Leslie Perez,** Secretary in Economic Development
**Elisabeth Reyes,** Secretary at OGP
**Ramonita & Claudia** from Trade Company
**Hiram Diaz,** from OAJ
**Zamia Baerga,** from Caguas
Natasha Gitany, from Treasury
**Ruth Silva and Ricardo Alfaro,** from Fortaleza
**Andrés Colon, Janet Rios & Alberto Colon** from CIO office
**[Ramphis Castro](http://coquicoders.org/ramphis-castro-a-dream-hunter-in-the-senate/)**, from the Senate
**Luis Castro**
**Sheila**
**Juan Carlos Suarez**, from Economic Development
**Jorge Marti**, from BDE
**Mirna Comas,** from Department of Agriculture
**Gabriel Figueroa,** from Department of Agriculture
**Kayla Barrios** from CCE
**Dayanira Díaz** from CCE
**Vilma Yejo** from CCE
**Zamia Baerga**
**Maritere Colon,** from Tourism
**Lizaida Rivera** from Film Comission
**Carlos Perez **from ADL
**Luis Carlos** Cruz from OAJ
**Mario Marazzi** Executive Director at Instituto de Estadisticas de Puerto Rico
**Luis Castro** from ACG
----
**Some people from the Private Sector:**
**[Sofia Stolberg](http://coquicoders.org/sofia-stolberg-another-entrepreneur-in-san-juan/)**, from co-working space Piloto151
**Ricardo Burgos**, from Creative Industries
**Angie & Dana** from Serioulsy Creative
**Luis Trelles**
**Alan & Guarien Taveras** from [Brands of Puerto Rico](http://coquicoders.org/brands-of-puerto-rico/)
**Nicolas Prouty** from Putman Bridge
**Fusion Works**
**Angel Perez** from Rock Solid
**Eugenio J. Torres-Oyola** from Ferraiuoli
----
**Some people from the Brigade Code 4 Puerto Rico**
**[Imanol Aranzadi](http://coquicoders.org/imanol-aranzadi-a-real-captain/)**,
**Stephanie Kruger**,
**Christian Rodriguez** ,
**Froilan Irizarry**,
**Sasha Mendes**,
**Roberto**
**Jon Mangual**
---
**Some Business owners**
**[Maria Morales](http://coquicoders.org/business-journey-stories/) **from Destilería Coqui,
**[Arturo Lopez](http://coquicoders.org/arturo-lopez-hydroponic-lettuce/) **from Huerto Isleño,
**Paula Rivera** from Atencion Atencion
**Tara Rodriguez** from Departamento de la Comida
Rebecca Feliciano from Setas of Puerto Rico
**Hacienda San Pedro**
**COA**
**De Hojas**
**Gustazos**
**Lab 787**
**Sana**
**Sparkative**
**Casa Protegida Julia de Burgos**
**Abre Puerto Rico**
**Tredé**
**Engine4**
**Guifre Tort** from Antrocket
----
**Some people from the non-profit sector**
**Denisee Rodriguez **from Foundation of Puerto Rico
**Miguel Vacas,** from Grupo Guayacan
---
Special thanks to **[Christian Rodriguez](http://coquicoders.org/christian-rodriguez-a-real-contributor/)** who was an intern with us for the summer in partnership with Code2040.
Another special thanks to **[Zac Townsend](http://coquicoders.org/zachary-townsend/)** who mentored us during the Fellowship.
|
{
"content_hash": "8f2de776122e96c0e93eb66ddea19e5a",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 178,
"avg_line_length": 32.91509433962264,
"alnum_prop": 0.7328747492118085,
"repo_name": "CoquiCoders/beta-book",
"id": "1693b371f9f10592ba5161c4b3d2bbbe4ab327f4",
"size": "3517",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bonus_tracks/acknowledgements.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
require 'rubygems'
require 'bundler/setup'
require 'rspec'
Bundler.require(:default, :development)
def file_path( *paths )
File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', *paths))
end
def public_path( *paths )
File.expand_path(File.join(File.dirname(__FILE__), 'public', *paths))
end
CarrierWave.root = public_path
NoBrainer.configure do |config|
config.app_name = 'carrierwave_nobrainer' # dashes not valid in RethinkDB world
config.environment = 'test'
end
module CarrierWave
module Test
module MockFiles
def stub_file(filename, mime_type=nil, fake_name=nil)
f = File.open(file_path(filename))
return f
end
end
end
end
RSpec.configure do |config|
config.include CarrierWave::Test::MockFiles
config.before(:each) do
NoBrainer.purge!
Dir["#{public_path('uploads')}/*"].each { |path| FileUtils.rm_rf(path) }
end
end
|
{
"content_hash": "ce15c49a3235a21c2a76f53fd2aa6631",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 81,
"avg_line_length": 23.05128205128205,
"alnum_prop": 0.692992213570634,
"repo_name": "katafrakt/carrierwave-nobrainer",
"id": "2465756230969003b4484896d424b66b16571177",
"size": "899",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/spec_helper.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "10833"
}
]
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
<File path="Classes/AWSEC2DescribeVpnConnectionsResult.html">
<Token>
<TokenIdentifier>//apple_ref/occ/cl/AWSEC2DescribeVpnConnectionsResult</TokenIdentifier>
<Abstract type="html"></Abstract>
<DeclaredIn>AWSEC2Model.h</DeclaredIn>
<NodeRef refid="553"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSEC2DescribeVpnConnectionsResult/setVpnConnections:</TokenIdentifier>
<Abstract type="html"><p>Information about one or more VPN connections.</p></Abstract>
<DeclaredIn>AWSEC2Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSArray<AWSEC2VpnConnection*> *vpnConnections</Declaration>
<Anchor>//api/name/vpnConnections</Anchor>
<NodeRef refid="553"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSEC2DescribeVpnConnectionsResult/vpnConnections</TokenIdentifier>
<Abstract type="html"><p>Information about one or more VPN connections.</p></Abstract>
<DeclaredIn>AWSEC2Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSArray<AWSEC2VpnConnection*> *vpnConnections</Declaration>
<Anchor>//api/name/vpnConnections</Anchor>
<NodeRef refid="553"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instp/AWSEC2DescribeVpnConnectionsResult/vpnConnections</TokenIdentifier>
<Abstract type="html"><p>Information about one or more VPN connections.</p></Abstract>
<DeclaredIn>AWSEC2Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSArray<AWSEC2VpnConnection*> *vpnConnections</Declaration>
<Anchor>//api/name/vpnConnections</Anchor>
<NodeRef refid="553"/>
</Token>
</File>
</Tokens>
|
{
"content_hash": "8febdcad1a6612d82e82d63970254cac",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 113,
"avg_line_length": 34.407407407407405,
"alnum_prop": 0.7002152852529602,
"repo_name": "davidbutz/ChristmasFamDuels",
"id": "3688f69537c444345254dca99a7c4dc0d22e012f",
"size": "1858",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iOS/frameworks/aws-ios-sdk-2.4.1/documentation/com.amazon.aws.ios.docset/Contents/Resources/Tokens553.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "211"
},
{
"name": "CSS",
"bytes": "77"
},
{
"name": "HTML",
"bytes": "330"
},
{
"name": "JavaScript",
"bytes": "212297"
},
{
"name": "Objective-C",
"bytes": "3465743"
},
{
"name": "Ruby",
"bytes": "461"
},
{
"name": "Shell",
"bytes": "2569"
},
{
"name": "Swift",
"bytes": "325330"
}
]
}
|
/*
* Hibernate Validator, declare and validate application constraints
*
* License: Apache License, Version 2.0
* See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.
*/
package org.hibernate.validator.internal.constraintvalidators.bv.time.pastorpresent;
import javax.validation.constraints.PastOrPresent;
import org.hibernate.validator.internal.constraintvalidators.bv.time.AbstractEpochBasedTimeValidator;
/**
* Base class for all {@code @PastOrPresent} validators that use an epoch to be compared to the time reference.
*
* @author Alaa Nassef
* @author Guillaume Smet
*/
public abstract class AbstractPastOrPresentEpochBasedValidator<T> extends AbstractEpochBasedTimeValidator<PastOrPresent, T> {
@Override
protected boolean isValid(int result) {
return result <= 0;
}
}
|
{
"content_hash": "33d6bd57085a07fa7a10e5f031c1e77d",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 125,
"avg_line_length": 32.23076923076923,
"alnum_prop": 0.7852028639618138,
"repo_name": "shahramgdz/hibernate-validator",
"id": "729545403f975bfff66cd038171cec624363b5da",
"size": "838",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "engine/src/main/java/org/hibernate/validator/internal/constraintvalidators/bv/time/pastorpresent/AbstractPastOrPresentEpochBasedValidator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "3627"
},
{
"name": "HTML",
"bytes": "1378"
},
{
"name": "Java",
"bytes": "3946066"
},
{
"name": "Ruby",
"bytes": "8672"
},
{
"name": "Shell",
"bytes": "476"
}
]
}
|
package com.taskadapter.redmineapi.internal.comm;
import org.apache.http.conn.ClientConnectionManager;
import java.util.concurrent.TimeUnit;
public final class ConnectionEvictor implements Runnable {
/**
* "Terminate" flag.
*/
private boolean terminate;
/**
* Used connection manager.
*/
private final ClientConnectionManager connManager;
/**
* Eviction interval.
*/
private final long evictionInverval;
/**
* Idle connection timeout.
*/
private final int idleTimeout;
public ConnectionEvictor(ClientConnectionManager connManager,
int evictionInverval, int idleTimeout) {
this.connManager = connManager;
this.evictionInverval = evictionInverval * 1000L;
this.idleTimeout = idleTimeout;
}
@Override
public void run() {
while (getNextEviction()) {
connManager.closeExpiredConnections();
connManager.closeIdleConnections(idleTimeout, TimeUnit.SECONDS);
}
}
/**
* Waits for a next eviction.
*/
private boolean getNextEviction() {
long nowTime = System.currentTimeMillis();
final long sleepEndTime = nowTime + evictionInverval;
while (nowTime < sleepEndTime) {
final long toSleep = Math.max(100, sleepEndTime - nowTime);
synchronized (this) {
if (terminate)
return false;
try {
wait(toSleep);
} catch (InterruptedException e) {
// ignore
}
}
nowTime = System.currentTimeMillis();
}
return true;
}
/**
* Shutdowns an evictor.
*/
public synchronized void shutdown() {
terminate = true;
notifyAll();
}
}
|
{
"content_hash": "0dd037e7ec5c29658af8d5e2c599d474",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 67,
"avg_line_length": 20.373333333333335,
"alnum_prop": 0.7041884816753927,
"repo_name": "sleroy/redmine-java-api",
"id": "d7aa3df93f1d8320e57c6f96bc6b538dcfb24542",
"size": "1528",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/main/java/com/taskadapter/redmineapi/internal/comm/ConnectionEvictor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "682"
},
{
"name": "Java",
"bytes": "447140"
}
]
}
|
<?php
namespace HealthCareAbroad\PagerBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class PagerBundle extends Bundle
{
}
|
{
"content_hash": "4839933d435cae395f72997734dc0bc7",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 47,
"avg_line_length": 14.777777777777779,
"alnum_prop": 0.8195488721804511,
"repo_name": "richtermarkbaay/MEDTrip",
"id": "616cb3cdf3aee5200b476536a9a76ddcfa1789c5",
"size": "133",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/HealthCareAbroad/PagerBundle/PagerBundle.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1000532"
},
{
"name": "JavaScript",
"bytes": "5106881"
},
{
"name": "PHP",
"bytes": "2794397"
}
]
}
|
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'CallbackFilterIterator' => $vendorDir . '/symfony/polyfill-php54/Resources/stubs/CallbackFilterIterator.php',
'Omnipay\\Omnipay' => $vendorDir . '/omnipay/common/src/Omnipay/Omnipay.php',
'RecursiveCallbackFilterIterator' => $vendorDir . '/symfony/polyfill-php54/Resources/stubs/RecursiveCallbackFilterIterator.php',
'SessionHandlerInterface' => $vendorDir . '/symfony/polyfill-php54/Resources/stubs/SessionHandlerInterface.php',
);
|
{
"content_hash": "3f518f71f4b9fbab650db1b90df40510",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 132,
"avg_line_length": 45.69230769230769,
"alnum_prop": 0.7542087542087542,
"repo_name": "flaviocopes/grav-plugin-shoppingcart-stripe",
"id": "db6e5d3ce76fabd368bf9fbe3ae463bd13c04bc5",
"size": "594",
"binary": false,
"copies": "8",
"ref": "refs/heads/develop",
"path": "vendor/composer/autoload_classmap.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2395"
},
{
"name": "PHP",
"bytes": "4593"
}
]
}
|
package cn.felord.wepay.ali.sdk.api.request;
import java.util.Map;
import cn.felord.wepay.ali.sdk.api.AlipayRequest;
import cn.felord.wepay.ali.sdk.api.internal.util.AlipayHashMap;
import cn.felord.wepay.ali.sdk.api.response.AlipayMarketingCardBenefitCreateResponse;
import cn.felord.wepay.ali.sdk.api.AlipayObject;
/**
* ALIPAY API: alipay.marketing.card.benefit.create request
*
* @author auto create
* @version $Id: $Id
*/
public class AlipayMarketingCardBenefitCreateRequest implements AlipayRequest<AlipayMarketingCardBenefitCreateResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 会员卡模板外部权益创建
*/
private String bizContent;
/**
* <p>Setter for the field <code>bizContent</code>.</p>
*
* @param bizContent a {@link java.lang.String} object.
*/
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
/**
* <p>Getter for the field <code>bizContent</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
/**
* <p>Getter for the field <code>notifyUrl</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getNotifyUrl() {
return this.notifyUrl;
}
/** {@inheritDoc} */
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
/**
* <p>Getter for the field <code>returnUrl</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getReturnUrl() {
return this.returnUrl;
}
/** {@inheritDoc} */
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
/**
* <p>Getter for the field <code>apiVersion</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getApiVersion() {
return this.apiVersion;
}
/** {@inheritDoc} */
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
/** {@inheritDoc} */
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
/**
* <p>Getter for the field <code>terminalType</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getTerminalType(){
return this.terminalType;
}
/** {@inheritDoc} */
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
/**
* <p>Getter for the field <code>terminalInfo</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getTerminalInfo(){
return this.terminalInfo;
}
/** {@inheritDoc} */
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
/**
* <p>Getter for the field <code>prodCode</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getProdCode() {
return this.prodCode;
}
/**
* <p>getApiMethodName.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getApiMethodName() {
return "alipay.marketing.card.benefit.create";
}
/**
* <p>getTextParams.</p>
*
* @return a {@link java.util.Map} object.
*/
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
/**
* <p>putOtherTextParam.</p>
*
* @param key a {@link java.lang.String} object.
* @param value a {@link java.lang.String} object.
*/
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
/**
* <p>getResponseClass.</p>
*
* @return a {@link java.lang.Class} object.
*/
public Class<AlipayMarketingCardBenefitCreateResponse> getResponseClass() {
return AlipayMarketingCardBenefitCreateResponse.class;
}
/**
* <p>isNeedEncrypt.</p>
*
* @return a boolean.
*/
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
/** {@inheritDoc} */
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
/**
* <p>Getter for the field <code>bizModel</code>.</p>
*
* @return a {@link cn.felord.wepay.ali.sdk.api.AlipayObject} object.
*/
public AlipayObject getBizModel() {
return this.bizModel;
}
/** {@inheritDoc} */
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
|
{
"content_hash": "dffaa4f65140798f0ebb7ebb33ddbec1",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 121,
"avg_line_length": 22.334883720930232,
"alnum_prop": 0.6593086214077468,
"repo_name": "NotFound403/WePay",
"id": "64375516fe6bf093e8b82ee81fded1370f6eeece",
"size": "4824",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.0.2",
"path": "src/main/java/cn/felord/wepay/ali/sdk/api/request/AlipayMarketingCardBenefitCreateRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "70942"
}
]
}
|
<!DOCTYPE html>
<html>
<head>
<title>canvascontext.js</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" media="all" href="public/stylesheets/normalize.css" />
<link rel="stylesheet" media="all" href="docco.css" />
</head>
<body>
<div class="container">
<div class="page">
<div class="header">
<h1>canvascontext.js</h1>
<div class="toc">
<h3>Table of Contents</h3>
<ol>
<li>
<a class="source" href="accidental.html">
accidental.js
</a>
</li>
<li>
<a class="source" href="annotation.html">
annotation.js
</a>
</li>
<li>
<a class="source" href="articulation.html">
articulation.js
</a>
</li>
<li>
<a class="source" href="barnote.html">
barnote.js
</a>
</li>
<li>
<a class="source" href="beam.html">
beam.js
</a>
</li>
<li>
<a class="source" href="bend.html">
bend.js
</a>
</li>
<li>
<a class="source" href="boundingbox.html">
boundingbox.js
</a>
</li>
<li>
<a class="source" href="canvascontext.html">
canvascontext.js
</a>
</li>
<li>
<a class="source" href="clef.html">
clef.js
</a>
</li>
<li>
<a class="source" href="clefnote.html">
clefnote.js
</a>
</li>
<li>
<a class="source" href="crescendo.html">
crescendo.js
</a>
</li>
<li>
<a class="source" href="curve.html">
curve.js
</a>
</li>
<li>
<a class="source" href="dot.html">
dot.js
</a>
</li>
<li>
<a class="source" href="flow.html">
flow.js
</a>
</li>
<li>
<a class="source" href="vexflow_font.html">
vexflow_font.js
</a>
</li>
<li>
<a class="source" href="formatter.html">
formatter.js
</a>
</li>
<li>
<a class="source" href="fraction.html">
fraction.js
</a>
</li>
<li>
<a class="source" href="frethandfinger.html">
frethandfinger.js
</a>
</li>
<li>
<a class="source" href="ghostnote.html">
ghostnote.js
</a>
</li>
<li>
<a class="source" href="glyph.html">
glyph.js
</a>
</li>
<li>
<a class="source" href="gracenote.html">
gracenote.js
</a>
</li>
<li>
<a class="source" href="gracenotegroup.html">
gracenotegroup.js
</a>
</li>
<li>
<a class="source" href="keymanager.html">
keymanager.js
</a>
</li>
<li>
<a class="source" href="keysignature.html">
keysignature.js
</a>
</li>
<li>
<a class="source" href="modifier.html">
modifier.js
</a>
</li>
<li>
<a class="source" href="modifiercontext.html">
modifiercontext.js
</a>
</li>
<li>
<a class="source" href="music.html">
music.js
</a>
</li>
<li>
<a class="source" href="note.html">
note.js
</a>
</li>
<li>
<a class="source" href="notehead.html">
notehead.js
</a>
</li>
<li>
<a class="source" href="ornament.html">
ornament.js
</a>
</li>
<li>
<a class="source" href="pedalmarking.html">
pedalmarking.js
</a>
</li>
<li>
<a class="source" href="raphaelcontext.html">
raphaelcontext.js
</a>
</li>
<li>
<a class="source" href="renderer.html">
renderer.js
</a>
</li>
<li>
<a class="source" href="stave.html">
stave.js
</a>
</li>
<li>
<a class="source" href="stavebarline.html">
stavebarline.js
</a>
</li>
<li>
<a class="source" href="staveconnector.html">
staveconnector.js
</a>
</li>
<li>
<a class="source" href="stavehairpin.html">
stavehairpin.js
</a>
</li>
<li>
<a class="source" href="staveline.html">
staveline.js
</a>
</li>
<li>
<a class="source" href="stavemodifier.html">
stavemodifier.js
</a>
</li>
<li>
<a class="source" href="stavenote.html">
stavenote.js
</a>
</li>
<li>
<a class="source" href="staverepetition.html">
staverepetition.js
</a>
</li>
<li>
<a class="source" href="stavesection.html">
stavesection.js
</a>
</li>
<li>
<a class="source" href="stavetempo.html">
stavetempo.js
</a>
</li>
<li>
<a class="source" href="stavetext.html">
stavetext.js
</a>
</li>
<li>
<a class="source" href="stavetie.html">
stavetie.js
</a>
</li>
<li>
<a class="source" href="stavevolta.html">
stavevolta.js
</a>
</li>
<li>
<a class="source" href="stem.html">
stem.js
</a>
</li>
<li>
<a class="source" href="stemmablenote.html">
stemmablenote.js
</a>
</li>
<li>
<a class="source" href="stringnumber.html">
stringnumber.js
</a>
</li>
<li>
<a class="source" href="strokes.html">
strokes.js
</a>
</li>
<li>
<a class="source" href="svgcontext.html">
svgcontext.js
</a>
</li>
<li>
<a class="source" href="tables.html">
tables.js
</a>
</li>
<li>
<a class="source" href="tabnote.html">
tabnote.js
</a>
</li>
<li>
<a class="source" href="tabslide.html">
tabslide.js
</a>
</li>
<li>
<a class="source" href="tabstave.html">
tabstave.js
</a>
</li>
<li>
<a class="source" href="tabtie.html">
tabtie.js
</a>
</li>
<li>
<a class="source" href="textbracket.html">
textbracket.js
</a>
</li>
<li>
<a class="source" href="textdynamics.html">
textdynamics.js
</a>
</li>
<li>
<a class="source" href="textnote.html">
textnote.js
</a>
</li>
<li>
<a class="source" href="tickable.html">
tickable.js
</a>
</li>
<li>
<a class="source" href="tickcontext.html">
tickcontext.js
</a>
</li>
<li>
<a class="source" href="timesignature.html">
timesignature.js
</a>
</li>
<li>
<a class="source" href="timesignote.html">
timesignote.js
</a>
</li>
<li>
<a class="source" href="tremolo.html">
tremolo.js
</a>
</li>
<li>
<a class="source" href="tuning.html">
tuning.js
</a>
</li>
<li>
<a class="source" href="tuplet.html">
tuplet.js
</a>
</li>
<li>
<a class="source" href="vex.html">
vex.js
</a>
</li>
<li>
<a class="source" href="vibrato.html">
vibrato.js
</a>
</li>
<li>
<a class="source" href="voice.html">
voice.js
</a>
</li>
<li>
<a class="source" href="voicegroup.html">
voicegroup.js
</a>
</li>
</ol>
</div>
</div>
<p>Vex Flow
Mohit Muthanna <a href="mailto:mohit@muthanna.com">mohit@muthanna.com</a></p>
<p>A rendering context for the Raphael backend.</p>
<p>Copyright Mohit Cheppudira 2010</p>
<div class='highlight'><pre>
<span class="hljs-comment">/** @constructor */</span>
Vex.Flow.CanvasContext = (<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">CanvasContext</span>(<span class="hljs-params">context</span>) </span>{
<span class="hljs-keyword">if</span> (<span class="hljs-built_in">arguments</span>.length > <span class="hljs-number">0</span>) <span class="hljs-keyword">this</span>.init(context);
}
CanvasContext.WIDTH = <span class="hljs-number">600</span>;
CanvasContext.HEIGHT = <span class="hljs-number">400</span>;
CanvasContext.prototype = {
init: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">context</span>) </span>{</pre></div>
<p>Use a name that is unlikely to clash with a canvas context
property</p>
<div class='highlight'><pre> <span class="hljs-keyword">this</span>.vexFlowCanvasContext = context;
<span class="hljs-keyword">if</span> (!context.canvas) {
<span class="hljs-keyword">this</span>.canvas = {
width: CanvasContext.WIDTH,
height: CanvasContext.HEIGHT
};
} <span class="hljs-keyword">else</span> {
<span class="hljs-keyword">this</span>.canvas = context.canvas;
}
},
clear: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.clearRect(<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-keyword">this</span>.canvas.width, <span class="hljs-keyword">this</span>.canvas.height);
},</pre></div>
<p>Containers not implemented</p>
<div class='highlight'><pre> openGroup: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">cls, id, attrs</span>) </span>{},
closeGroup: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{},
add: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">elem</span>) </span>{},
setFont: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">family, size, weight</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.font = (weight || <span class="hljs-string">""</span>) + <span class="hljs-string">" "</span> + size + <span class="hljs-string">"pt "</span> + family;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setRawFont: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">font</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.font = font;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setFillStyle: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">style</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.fillStyle = style;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setBackgroundFillStyle: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">style</span>) </span>{
<span class="hljs-keyword">this</span>.background_fillStyle = style;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setStrokeStyle: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">style</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.strokeStyle = style;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setShadowColor: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">style</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.shadowColor = style;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setShadowBlur: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">blur</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.shadowBlur = blur;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setLineWidth: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">width</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.lineWidth = width;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setLineCap: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">cap_type</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.lineCap = cap_type;
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>;
},
setLineDash: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">dash</span>) </span>{
<span class="hljs-keyword">this</span>.vexFlowCanvasContext.lineDash = dash;
},
scale: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.scale(<span class="hljs-built_in">parseFloat</span>(x), <span class="hljs-built_in">parseFloat</span>(y));
},
resize: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">width, height</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.resize(
<span class="hljs-built_in">parseInt</span>(width, <span class="hljs-number">10</span>), <span class="hljs-built_in">parseInt</span>(height, <span class="hljs-number">10</span>));
},
rect: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y, width, height</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.rect(x, y, width, height);
},
fillRect: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y, width, height</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.fillRect(x, y, width, height);
},
clearRect: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y, width, height</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.clearRect(x, y, width, height);
},
beginPath: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.beginPath();
},
moveTo: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.moveTo(x, y);
},
lineTo: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.lineTo(x, y);
},
bezierCurveTo: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x1, y1, x2, y2, x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.bezierCurveTo(x1, y1, x2, y2, x, y);
},
quadraticCurveTo: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x1, y1, x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.quadraticCurveTo(x1, y1, x, y);
},</pre></div>
<p>This is an attempt (hack) to simulate the HTML5 canvas
arc method.</p>
<div class='highlight'><pre> arc: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">x, y, radius, startAngle, endAngle, antiClockwise</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.arc(x, y, radius, startAngle, endAngle, antiClockwise);
},</pre></div>
<p>Adapted from the source for Raphael’s Element.glow</p>
<div class='highlight'><pre> glow: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.glow();
},
fill: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.fill();
},
stroke: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.stroke();
},
closePath: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.closePath();
},
measureText: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">text</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.measureText(text);
},
fillText: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">text, x, y</span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.fillText(text, x, y);
},
save: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.save();
},
restore: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-keyword">return</span> <span class="hljs-keyword">this</span>.vexFlowCanvasContext.restore();
}
};
<span class="hljs-keyword">return</span> CanvasContext;
}());</pre></div>
<div class="fleur">h</div>
</div>
</div>
</body>
</html>
|
{
"content_hash": "22dd39b8e7ebab454f64a2847ba7296e",
"timestamp": "",
"source": "github",
"line_count": 716,
"max_line_length": 284,
"avg_line_length": 36.135474860335194,
"alnum_prop": 0.43740578981950295,
"repo_name": "kaleguy/basic-piano-chords",
"id": "62e19c8adf8f01a102c9cb5c49ef212e60144718",
"size": "25875",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "node_modules/vexflow/releases/docs/canvascontext.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8500"
},
{
"name": "HTML",
"bytes": "55512"
},
{
"name": "JavaScript",
"bytes": "175812"
}
]
}
|
/*
* decaffeinate suggestions:
* DS101: Remove unnecessary use of Array.from
* DS102: Remove unnecessary code created because of implicit returns
* DS205: Consider reworking code to avoid use of IIFEs
* DS206: Consider reworking classes to avoid initClass
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
class InputTags {
constructor() {
return {
replace: false,
transclude: false,
restrict: 'E', // E: Element
scope: {allTags: '=?', tags: '=', placeholder:"@"},
template: require('./input_tags.tpl.jade'),
controller: '_InputTagsController'
};
}
}
var _InputTags = (function() {
let self = undefined;
_InputTags = class _InputTags {
static initClass() {
self = null;
}
constructor($scope) {
let t;
self = this;
$scope.tags_model = [];
if ($scope.tags == null) { $scope.tags = []; }
if ($scope.allTags == null) { $scope.allTags = () => []; }
for (t of Array.from($scope.tags)) {
if (angular.isObject(t)) {
t = t.text;
}
$scope.tags_model.push({text:t});
}
const updateTags = function() {
$scope.tags.splice(0, $scope.tags.length);
return (() => {
const result = [];
for (t of Array.from($scope.tags_model)) {
result.push($scope.tags.push(t.text));
}
return result;
})();
};
updateTags();
$scope.$watch("tags_model", updateTags, true);
}
};
_InputTags.initClass();
return _InputTags;
})();
angular.module('app')
.directive('inputTags', [InputTags])
.controller('_InputTagsController', ['$scope', _InputTags]);
|
{
"content_hash": "42e814d3b19146415b3a24755b7a62cd",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 90,
"avg_line_length": 31.71875,
"alnum_prop": 0.5083743842364532,
"repo_name": "buildbot/buildbot_travis",
"id": "a0ae35fb908b8d38afb92e8e1ddfa05fa79c8406",
"size": "2030",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "buildbot_travis/ui/src/app/configEditors/directives/input-tags.directive.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "354"
},
{
"name": "JavaScript",
"bytes": "49426"
},
{
"name": "Less",
"bytes": "265"
},
{
"name": "Pug",
"bytes": "27275"
},
{
"name": "Python",
"bytes": "132800"
},
{
"name": "Shell",
"bytes": "842"
}
]
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>simpla-text</title>
<script src="https://unpkg.com/webcomponents.js@^0.7.24/webcomponents-lite.min.js"></script>
<script src="../../web-component-tester/browser.js"></script>
<!-- Test Helpers -->
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
<link rel="import" href="./test-setup.html">
<!-- Import the element to test -->
<link rel="import" href="../simpla-text.html">
</head>
<body>
<test-fixture id="simple">
<template>
<simpla-text editable></simpla-text>
</template>
</test-fixture>
<test-fixture id="forced-inline">
<template>
<div>
<div><simpla-text inline editable></simpla-text></div>
</div>
</template>
</test-fixture>
<test-fixture id="auto-inline">
<template>
<div>
<span><simpla-text editable></simpla-text></span>
</div>
</template>
</test-fixture>
<script>
function checkWorksAsInline(getComponent, description) {
describe(description || 'formats content as inline', () => {
let component;
beforeEach(() => {
component = getComponent();
});
it('should not allow `p` tags', () => {
return flushEditor(component)
.then(() => component.value = '<p>Hello World</p>')
.then(() => flushEditor(component))
.then(() => {
expect(component.value).to.equal('Hello World');
});
});
it('should allow `br` tags', () => {
component.value = 'Hello<br />World';
return flushEditor(component)
.then(() => {
expect(component.value).to.match(/\<br/);
});
});
it('should be display:inline;', () => {
expect(window.getComputedStyle(component).display).to.equal('inline');
});
});
}
function checkWorksAsBlock(getComponent, description) {
let component;
beforeEach(() => {
component = getComponent();
return flushEditor(component);
});
describe(description || 'formats content as block', () => {
it('should allow `p` tags', () => {
component.value = '<p>Hello World</p>';
return flushEditor(component)
.then(() => {
expect(component.value).to.match(/<p/);
});
});
it('should default to empty `p` tag when no content is set', () => {
component.value = '';
return flushEditor(component)
.then(() => {
expect(component.value).to.match(/<p/);
});
});
it('should be display:block;', () => {
expect(window.getComputedStyle(component).display).to.equal('block');
});
});
}
describe('default behavior', () => {
checkWorksAsBlock(() => fixture('simple'), 'should behave as a block');
});
describe('inline behavior', () => {
let component;
describe('forced inline mode', () => {
beforeEach(function() {
component = fixture('forced-inline').querySelector('simpla-text');
return flushEditor(component);
});
it('should have inline true', () => {
expect(component.inline).to.equal.true;
});
checkWorksAsInline(() => component);
});
describe('auto mode', () => {
let inlineComponent;
beforeEach(() => {
let wrapper = fixture('auto-inline');
inlineComponent = wrapper.querySelector('span > simpla-text');
});
checkWorksAsInline(() => inlineComponent, 'auto-inline formats as inline')
});
});
</script>
</body>
</html>
|
{
"content_hash": "1ec0b22924862e92f1a3e436be160704",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 96,
"avg_line_length": 29.220588235294116,
"alnum_prop": 0.5030196275792652,
"repo_name": "simplaio/simpla-text",
"id": "dada7cee5cb4ae9d96377b088478ae9f30ab0f06",
"size": "3974",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "test/inline.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "80090"
},
{
"name": "JavaScript",
"bytes": "24927"
}
]
}
|
#import <UIKit/UITableViewController.h>
#import <UIKit/UITableViewDataSource-Protocol.h>
#import "UITextFieldDelegate-Protocol.h"
@class NSString, PKPrinter, UIButton, UIPrinterSetupConnectingView;
// Not exported
@interface UIPrinterSetupConfigureViewController : UITableViewController <UITableViewDataSource, UITextFieldDelegate>
{
_Bool _addToNetwork;
_Bool _directPrinting;
PKPrinter *_printer;
NSString *_directPasscode;
UIButton *_finishButton;
UIPrinterSetupConnectingView *_connectingView;
}
@property(retain, nonatomic) UIPrinterSetupConnectingView *connectingView; // @synthesize connectingView=_connectingView;
@property(retain, nonatomic) UIButton *finishButton; // @synthesize finishButton=_finishButton;
@property(copy, nonatomic) NSString *directPasscode; // @synthesize directPasscode=_directPasscode;
@property(nonatomic) _Bool directPrinting; // @synthesize directPrinting=_directPrinting;
@property(nonatomic) _Bool addToNetwork; // @synthesize addToNetwork=_addToNetwork;
@property(retain, nonatomic) PKPrinter *printer; // @synthesize printer=_printer;
- (_Bool)tableView:(id)arg1 shouldHighlightRowAtIndexPath:(id)arg2;
- (void)tableView:(id)arg1 willDisplayCell:(id)arg2 forRowAtIndexPath:(id)arg3;
- (void)tableView:(id)arg1 willDisplayFooterView:(id)arg2 forSection:(long long)arg3;
- (void)tableView:(id)arg1 willDisplayHeaderView:(id)arg2 forSection:(long long)arg3;
- (id)tableView:(id)arg1 titleForFooterInSection:(long long)arg2;
- (id)tableView:(id)arg1 titleForHeaderInSection:(long long)arg2;
- (id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2;
- (long long)tableView:(id)arg1 numberOfRowsInSection:(long long)arg2;
- (long long)numberOfSectionsInTableView:(id)arg1;
- (_Bool)textFieldShouldReturn:(id)arg1;
- (void)textDidChange:(id)arg1;
- (void)finish;
- (void)finished:(_Bool)arg1;
- (void)toggleDirectPrinting:(id)arg1;
- (void)toggleAddToNetwork:(id)arg1;
- (unsigned long long)supportedInterfaceOrientations;
- (_Bool)shouldAutorotateToInterfaceOrientation:(long long)arg1;
- (void)viewWillAppear:(_Bool)arg1;
- (void)loadView;
- (void)dealloc;
- (id)initWithPrinter:(id)arg1;
@end
|
{
"content_hash": "a9b4c4f9e805bfd4968409280c86ecae",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 121,
"avg_line_length": 43.18,
"alnum_prop": 0.7860120426123205,
"repo_name": "matthewsot/CocoaSharp",
"id": "9b41bef025fab304a4c29288f2efddb8de9d74cc",
"size": "2299",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Headers/Frameworks/UIKit/UIPrinterSetupConfigureViewController.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "259784"
},
{
"name": "C#",
"bytes": "2789005"
},
{
"name": "C++",
"bytes": "252504"
},
{
"name": "Objective-C",
"bytes": "24301417"
},
{
"name": "Smalltalk",
"bytes": "167909"
}
]
}
|
namespace FIX50SP2
{
class ApplicationMessageReport : public Message
{
public:
ApplicationMessageReport() : Message(MsgType()) {}
ApplicationMessageReport(const FIX::Message& m) : Message(m) {}
ApplicationMessageReport(const Message& m) : Message(m) {}
ApplicationMessageReport(const ApplicationMessageReport& m) : Message(m) {}
static FIX::MsgType MsgType() { return FIX::MsgType("BY"); }
ApplicationMessageReport(
const FIX::ApplReportID& aApplReportID,
const FIX::ApplReportType& aApplReportType )
: Message(MsgType())
{
set(aApplReportID);
set(aApplReportType);
}
FIELD_SET(*this, FIX::ApplReportID);
FIELD_SET(*this, FIX::ApplReportType);
FIELD_SET(*this, FIX::NoApplIDs);
class NoApplIDs: public FIX::Group
{
public:
NoApplIDs() : FIX::Group(1351,1355,FIX::message_order(1355,1399,1357,0)) {}
FIELD_SET(*this, FIX::RefApplID);
FIELD_SET(*this, FIX::ApplNewSeqNum);
FIELD_SET(*this, FIX::RefApplLastSeqNum);
};
FIELD_SET(*this, FIX::Text);
FIELD_SET(*this, FIX::EncodedTextLen);
FIELD_SET(*this, FIX::EncodedText);
FIELD_SET(*this, FIX::ApplReqID);
};
}
#endif
|
{
"content_hash": "b56b4ed0cd9f1a9cddcdde631b80d467",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 79,
"avg_line_length": 29.390243902439025,
"alnum_prop": 0.6597510373443983,
"repo_name": "SoftFx/TTFixClient",
"id": "5c9bbf6110f205b81756b3effd71ccba3a671bce",
"size": "1316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "quickfix/C++/fix50sp2/ApplicationMessageReport.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "10453"
},
{
"name": "C++",
"bytes": "6121920"
},
{
"name": "Lex",
"bytes": "1536"
},
{
"name": "Makefile",
"bytes": "5096"
},
{
"name": "Shell",
"bytes": "411"
}
]
}
|
https://pbs.twimg.com/media/EggyDHpUwAIpfv0?format=jpg&name=large
|
{
"content_hash": "5333070e899710bdbc353c1c8d1d4bee",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 65,
"avg_line_length": 66,
"alnum_prop": 0.8181818181818182,
"repo_name": "jerry-james/jerry-james.github.io",
"id": "e5261c3f0c71e1b7c74b1ee08c57cd28f66232cb",
"size": "91",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "2237"
},
{
"name": "JavaScript",
"bytes": "1723"
}
]
}
|
from __future__ import unicode_literals
from __future__ import print_function
from django.core.management import BaseCommand
from ...event import sync_events
class Command(BaseCommand):
def handle(self, *args, **options):
num_new_events, num_updated_ids, num_deleted_ids, \
unsynced_event_names = sync_events()
print("{} new events, {} event ids updated,"
" {} event ids deleted"
.format(num_new_events, num_updated_ids, num_deleted_ids))
if unsynced_event_names:
print(u"unsynced event names:\n {}"
.format(u'\n '.join(unsynced_event_names)).encode('utf-8'))
|
{
"content_hash": "42c294662a471f7fc1ca4c7da44a9caf",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 80,
"avg_line_length": 37.111111111111114,
"alnum_prop": 0.6167664670658682,
"repo_name": "machtfit/django-emarsys",
"id": "d9b732063ef6d8df63a06080f7c1fffc47149c19",
"size": "693",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "django_emarsys/management/commands/emarsys_sync_events.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "67769"
},
{
"name": "Shell",
"bytes": "358"
}
]
}
|
export const EXPAND_TREE_ITEM = 'TreeviewItem Expand';
export const COLLAPSE_TREE_ITEM = 'TreeviewItem Collapse ';
export const EXPAND_FILE_ITEM = 'FileTreeviewItem Expand';
export const COLLAPSE_FILE_ITEM = 'FileTreeviewItem Collapse';
export const MODIFY_EDITABLE = 'Editable Modify';
export default {
EXPAND_TREE_ITEM,
COLLAPSE_TREE_ITEM,
EXPAND_FILE_ITEM,
COLLAPSE_FILE_ITEM,
MODIFY_EDITABLE
};
|
{
"content_hash": "ec47f491fbed1c70e9fb24ad6ac8a91a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 28.133333333333333,
"alnum_prop": 0.7440758293838863,
"repo_name": "weilao/vue-component",
"id": "4ec36185679e4b104c096cc61d91ced10ecd73af",
"size": "422",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/vuex/mutation-types.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1311"
},
{
"name": "JavaScript",
"bytes": "1561"
},
{
"name": "Vue",
"bytes": "22391"
}
]
}
|
<?php
/* @var $this yii\web\View */
use p2m\helpers\FA;
$this->title = 'Contact Us';
$assetDir = Yii::$app->assetManager->getPublishedUrl(
'@vendor/p2made/yii2-triangle-theme/assets/lib/multicolor'
);
p2m\assets\PrettyPhotoAsset::register($this);
p2m\assets\GMapsApiAsset::register($this);
p2m\assets\GMapsAsset::register($this);
p2m\assets\AnimateAsset::register($this);
p2m\assets\WowAsset::register($this);
?>
<div id="content-wrapper">
<section id="page-breadcrumb">
<div class="vertical-center sun">
<div class="container">
<div class="row">
<div class="action">
<div class="col-sm-12">
<h1 class="title">Contact US</h1>
<p>Stay close</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!--/#action-->
<section id="map-section">
<div class="container">
<div id="gmap"></div>
</div>
</section>
<!--/#map-section-->
<?= $this->render('_footer.php', ['assetDir' => $assetDir]) ?>
</div>
<!--
<script src="http://maps.google.com/maps/api/js?sensor=true" type="text/javascript"></script>
-->
|
{
"content_hash": "61c89e66dd1f70b83f7e0305caf91141",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 94,
"avg_line_length": 21.48,
"alnum_prop": 0.6210428305400373,
"repo_name": "p2made/yii2-triangle-theme",
"id": "6902bcb9e46c97ad8f50c51a312c396af24bb106",
"size": "1256",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "views/multicolor/site/contact.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "109057"
},
{
"name": "HTML",
"bytes": "3362"
},
{
"name": "JavaScript",
"bytes": "135987"
},
{
"name": "PHP",
"bytes": "850338"
}
]
}
|
"""
__init__.py
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
log = logging.getLogger(__name__)
|
{
"content_hash": "5b1cb9430a82f5ecce405fae8dd0b44e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 82,
"avg_line_length": 22.285714285714285,
"alnum_prop": 0.6923076923076923,
"repo_name": "vorburger/mcedit2",
"id": "cc5e6992b6d0138aebfe48fa3741fddeeea4ae9c",
"size": "156",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/mcedit2/rendering/chunkmeshes/entity/__init__.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "8578"
},
{
"name": "Makefile",
"bytes": "156"
},
{
"name": "Python",
"bytes": "1639144"
}
]
}
|
package core
import (
"fmt"
"strings"
"github.com/ankyra/escape-core/parsers"
"github.com/ankyra/escape-core/scopes"
)
/*
## Escape Plan
Dependencies are configured in the [`depends`](/docs/reference/escape-plan/#depends)
field of the Escape plan.
*/
type DependencyConfig struct {
// The release id is required and is resolved at *build* time and then
// persisted in the release metadata ensuring that deployments always use
// the same versions.
//
// Examples:
// - To always use the latest version: `my-organisation/my-dependency-latest`
// - To always use version 0.1.1: `my-organisation/my-dependency-v0.1.1`
// - To always use the latest version in the 0.1 series: `my-organisation/my-dependency-v0.1.@`
// - To make it possible to reference a dependency using a different name: `my-organisation/my-dependency-latest as my-name`
ReleaseId string `json:"release_id" yaml:"release_id"`
// Define the values of dependency inputs using Escape Script.
Mapping map[string]interface{} `json:"mapping" yaml:"mapping"`
// Define the values of dependency inputs using Escape Script when running
// stages in the build scope.
BuildMapping map[string]interface{} `json:"build_mapping" yaml:"build_mapping"`
// Define the values of dependency inputs using Escape Script when running
// stages in the deploy scope.
DeployMapping map[string]interface{} `json:"deploy_mapping" yaml:"deploy_mapping"`
// Map providers from the parent to dependencies.
//
// Example:
// ```
// consumes:
// - my-provider
// depends:
// - release_id: my-org/my-dep-latest
// consumes:
// provider: $my-provider.deployment
// ```
Consumes map[string]string `json:"consumes" yaml:"consumes"`
// The name of the (sub)-deployment. This defaults to the versionless release id;
// e.g. if the release_id is `my-org/my-dep-v1.0` then the DeploymentName will be
// `my-org/my-dep` by default.
DeploymentName string `json:"deployment_name" yaml:"deployment_name"`
// The variable used to reference this dependency. By default the variable
// name is the versionless release id of the dependency, but this can be
// overruled by renaming the dependency (e.g. `my-org/my-release-latest as
// my-variable`. This field will be set automatically at build time.
// Overwriting this field in the Escape plan has no effect.
VariableName string `json:"variable" yaml:"variable"`
// A list of scopes (`build`, `deploy`) that defines during which stage(s)
// this dependency should be fetched and deployed. *Currently not implemented!*
Scopes scopes.Scopes `json:"scopes" yaml:"scopes"`
// Parsed out of the release ID. For example: when release id is
// `"my-org/my-name-v1.0"` this value is `"my-org"`.
Project string `json:"-" yaml:"-"`
// Parsed out of the release ID. For example: when release id is
// `"my-org/my-name-v1.0"` this value is `"my-name"`.
Name string `json:"-" yaml:"-"`
// Parsed out of the release ID. For example: when release id is
// `"my-org/my-name-v1.0"` this value is `"1.0"`.
Version string `json:"-" yaml:"-"`
// Parsed out of the release ID. For example: when release id is
// `"my-org/my-name:tag"` this value is `"tag"`.
Tag string `json:"-" yaml:"-"`
}
type ResolvedDependencyConfig struct {
*DependencyConfig
ReleaseMetadata *ReleaseMetadata
}
func NewDependencyConfig(releaseId string) *DependencyConfig {
return &DependencyConfig{
ReleaseId: releaseId,
Mapping: map[string]interface{}{},
BuildMapping: map[string]interface{}{},
DeployMapping: map[string]interface{}{},
Scopes: scopes.AllScopes,
Consumes: map[string]string{},
}
}
func (d *DependencyConfig) Resolve(m *ReleaseMetadata) *ResolvedDependencyConfig {
return &ResolvedDependencyConfig{
DependencyConfig: d,
ReleaseMetadata: m,
}
}
func DependencyNeedsResolvingError(dependencyReleaseId string) error {
return fmt.Errorf("The dependency '%s' needs its version resolved.", dependencyReleaseId)
}
func (d *DependencyConfig) Copy() *DependencyConfig {
result := NewDependencyConfig(d.ReleaseId)
for k, v := range d.Mapping {
result.Mapping[k] = v
}
for k, v := range d.BuildMapping {
result.BuildMapping[k] = v
}
for k, v := range d.DeployMapping {
result.DeployMapping[k] = v
}
for k, v := range d.Consumes {
result.Consumes[k] = v
}
result.DeploymentName = d.DeploymentName
result.VariableName = d.VariableName
result.Scopes = d.Scopes.Copy()
result.Project = d.Project
result.Name = d.Name
result.Version = d.Version
result.Tag = d.Tag
return result
}
func (d *DependencyConfig) EnsureConfigIsParsed() error {
parsed, err := parsers.ParseDependency(d.ReleaseId)
if err != nil {
return err
}
d.ReleaseId = parsed.QualifiedReleaseId.ToString()
d.Project = parsed.Project
d.Name = parsed.Name
d.Version = parsed.Version
d.Tag = parsed.Tag
if d.VariableName == "" {
d.VariableName = parsed.VariableName
}
return nil
}
func (d *DependencyConfig) NeedsResolving() bool {
return d.Tag != "" || d.Version == "latest" || strings.HasSuffix(d.Version, ".@")
}
func (d *DependencyConfig) GetVersionAsString() (version string) {
if d.Tag != "" {
return d.Tag
}
version = "v" + d.Version
if d.Version == "latest" {
version = d.Version
}
return version
}
func (d *DependencyConfig) Validate(m *ReleaseMetadata) error {
if d.BuildMapping == nil {
d.BuildMapping = map[string]interface{}{}
}
if d.DeployMapping == nil {
d.DeployMapping = map[string]interface{}{}
}
if d.Scopes == nil || len(d.Scopes) == 0 {
d.Scopes = scopes.AllScopes
}
if err := d.EnsureConfigIsParsed(); err != nil {
return err
}
if d.NeedsResolving() {
return DependencyNeedsResolvingError(d.ReleaseId)
}
d.DeploymentName = d.VariableName
if d.DeploymentName == "" {
d.DeploymentName = d.Project + "/" + d.Name
}
if d.VariableName == "" {
d.VariableName = d.Project + "/" + d.Name
}
return nil
}
func (d *DependencyConfig) GetMapping(scope string) map[string]interface{} {
if scope == "build" {
return d.BuildMapping
}
if scope == "deploy" {
return d.DeployMapping
}
return nil
}
func (d *DependencyConfig) AddVariableMapping(scopes []string, id, key string) {
for _, scope := range scopes {
mapping := d.GetMapping(scope)
if mapping != nil {
_, found := mapping[id]
if !found {
mapping[id] = key
}
}
}
}
func (d *DependencyConfig) InScope(scope string) bool {
return d.Scopes.InScope(scope)
}
func ExpectingTypeForDependencyFieldError(typ, field string, val interface{}) error {
return fmt.Errorf("Expecting %s for dependency '%s'; got '%T'", typ, field, val)
}
func ExpectingStringKeyInMapError(field string, val interface{}) error {
return fmt.Errorf("Expecting string key in dependency '%s'; got '%T'", field, val)
}
func stringFromInterface(field string, val interface{}) (string, error) {
valString, ok := val.(string)
if !ok {
return "", ExpectingTypeForDependencyFieldError("string", field, val)
}
return valString, nil
}
func mapFromInterface(field string, val interface{}) (map[string]interface{}, error) {
valMap, ok := val.(map[interface{}]interface{})
if !ok {
return nil, ExpectingTypeForDependencyFieldError("dict", field, val)
}
result := map[string]interface{}{}
for k, v := range valMap {
kStr, ok := k.(string)
if !ok {
return nil, ExpectingStringKeyInMapError(field, k)
}
result[kStr] = v
}
return result, nil
}
func NewDependencyConfigFromMap(dep map[interface{}]interface{}) (*DependencyConfig, error) {
var releaseId, deploymentName, variable string
buildMapping := map[string]interface{}{}
deployMapping := map[string]interface{}{}
consumes := map[string]string{}
depScopes := []string{}
for key, val := range dep {
var err error
keyStr, ok := key.(string)
if !ok {
return nil, fmt.Errorf("Expecting string key in dependency")
}
if keyStr == "release_id" {
releaseId, err = stringFromInterface("release_id", val)
if err != nil {
return nil, err
}
} else if keyStr == "deployment_name" {
deploymentName, err = stringFromInterface("deployment_name", val)
if err != nil {
return nil, err
}
} else if keyStr == "variable" {
variable, err = stringFromInterface("variable", val)
if err != nil {
return nil, err
}
} else if key == "mapping" { // backwards compatibility with release metadata <= 6
valMap, err := mapFromInterface("mapping", val)
if err != nil {
return nil, err
}
for k, v := range valMap {
buildMapping[k] = v
deployMapping[k] = v
}
} else if key == "build_mapping" {
valMap, err := mapFromInterface("build_mapping", val)
if err != nil {
return nil, err
}
for k, v := range valMap {
buildMapping[k] = v
}
} else if key == "deploy_mapping" {
valMap, err := mapFromInterface("deploy_mapping", val)
if err != nil {
return nil, err
}
for k, v := range valMap {
deployMapping[k] = v
}
} else if key == "consumes" {
valMap, err := mapFromInterface("consumes", val)
if err != nil {
return nil, err
}
for k, v := range valMap {
vStr, ok := v.(string)
if !ok {
return nil, fmt.Errorf("Expecting string value in dependency consumer mapping")
}
consumes[k] = vStr
}
} else if key == "scopes" {
s, err := scopes.NewScopesFromInterface(val)
if err != nil {
return nil, err
}
depScopes = s
}
}
if releaseId == "" {
return nil, fmt.Errorf("Missing 'release_id' in dependency")
}
cfg := NewDependencyConfig(releaseId)
cfg.DeploymentName = deploymentName
cfg.VariableName = variable
cfg.BuildMapping = buildMapping
cfg.DeployMapping = deployMapping
cfg.Scopes = depScopes
cfg.Consumes = consumes
return cfg, nil
}
|
{
"content_hash": "e5f465804e664e8f46b71af325f8fc4e",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 125,
"avg_line_length": 28.737463126843657,
"alnum_prop": 0.683329911722439,
"repo_name": "ankyra/escape-core",
"id": "f74f84f3a0d48b805e37dd85dbbec775cbc99778",
"size": "10300",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dependency_config.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "381350"
},
{
"name": "HTML",
"bytes": "16"
},
{
"name": "Makefile",
"bytes": "332"
},
{
"name": "Shell",
"bytes": "38"
},
{
"name": "Smarty",
"bytes": "103"
}
]
}
|
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.util;
import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.collect.Iterables;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hasher;
import com.google.common.hash.Hashing;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.build.lib.vfs.PathFragment;
import java.util.Map;
import java.util.UUID;
import javax.annotation.Nullable;
/**
* Simplified wrapper for MD5 message digests.
*
* @see java.security.MessageDigest
*/
public final class Fingerprint {
private Hasher hasher;
private static final HashFunction MD5_HASH_FUNCTION = Hashing.md5();
/**
* Creates and initializes a new Hasher.
*/
public Fingerprint() {
reset();
}
/**
* Completes the hash computation by doing final operations, e.g., padding.
*
* <p>This method has the side-effect of resetting the underlying digest computer.
*
* @return the MD5 digest as a 16-byte array
* @see java.security.MessageDigest#digest()
*/
public byte[] digestAndReset() {
byte[] bytes = hasher.hash().asBytes();
reset();
return bytes;
}
/**
* Completes the hash computation and returns the digest as a string.
*
* <p>This method has the side-effect of resetting the underlying digest computer.
*
* @return the MD5 digest as a 32-character string of hexadecimal digits
*/
public String hexDigestAndReset() {
String hexDigest = hasher.hash().toString();
reset();
return hexDigest;
}
/**
* Updates the digest with 0 or more bytes.
*
* @param input the array of bytes with which to update the digest
* @see java.security.MessageDigest#update(byte[])
*/
public Fingerprint addBytes(byte[] input) {
hasher.putBytes(input);
return this;
}
/**
* Updates the digest with the specified number of bytes starting at offset.
*
* @param input the array of bytes with which to update the digest
* @param offset the offset into the array
* @param len the number of bytes to use
* @see java.security.MessageDigest#update(byte[], int, int)
*/
public Fingerprint addBytes(byte[] input, int offset, int len) {
hasher.putBytes(input, offset, len);
return this;
}
/**
* Updates the digest with a boolean value.
*/
public Fingerprint addBoolean(boolean input) {
addBytes(new byte[] { (byte) (input ? 1 : 0) });
return this;
}
/**
* Updates the digest with a boolean value, correctly handling null.
*/
public Fingerprint addNullableBoolean(Boolean input) {
addInt(input == null ? -1 : (input.booleanValue() ? 1 : 0));
return this;
}
/**
* Updates the digest with the little-endian bytes of a given int value.
*
* @param input the integer with which to update the digest
*/
public Fingerprint addInt(int input) {
hasher.putInt(input);
return this;
}
/**
* Updates the digest with the little-endian bytes of a given long value.
*
* @param input the long with which to update the digest
*/
public Fingerprint addLong(long input) {
hasher.putLong(input);
return this;
}
/**
* Updates the digest with the little-endian bytes of a given int value, correctly distinguishing
* between null and non-null values.
*
* @param input the integer with which to update the digest
*/
public Fingerprint addNullableInt(@Nullable Integer input) {
if (input == null) {
addInt(0);
} else {
addInt(1);
addInt(input);
}
return this;
}
/**
* Updates the digest with a UUID.
*
* @param uuid the UUID with which to update the digest. Must not be null.
*/
public Fingerprint addUUID(UUID uuid) {
addLong(uuid.getLeastSignificantBits());
addLong(uuid.getMostSignificantBits());
return this;
}
/**
* Updates the digest with a String using its length plus its UTF8 encoded bytes.
*
* @param input the String with which to update the digest
* @see java.security.MessageDigest#update(byte[])
*/
public Fingerprint addString(String input) {
byte[] bytes = input.getBytes(UTF_8);
addInt(bytes.length);
// Note that Hasher#putString() would not include the length of {@code input}.
hasher.putBytes(bytes);
return this;
}
/**
* Updates the digest with a String using its length plus its UTF8 encoded bytes; if the string
* is null, then it uses -1 as the length.
*
* @param input the String with which to update the digest
* @see java.security.MessageDigest#update(byte[])
*/
public Fingerprint addNullableString(@Nullable String input) {
if (input == null) {
addInt(-1);
} else {
addString(input);
}
return this;
}
/**
* Updates the digest with a String using its length and content.
*
* @param input the String with which to update the digest
* @see java.security.MessageDigest#update(byte[])
*/
public Fingerprint addStringLatin1(String input) {
addInt(input.length());
byte[] bytes = new byte[input.length()];
for (int i = 0; i < input.length(); i++) {
bytes[i] = (byte) input.charAt(i);
}
hasher.putBytes(bytes);
return this;
}
/**
* Updates the digest with a Path.
*
* @param input the Path with which to update the digest.
*/
public Fingerprint addPath(Path input) {
addStringLatin1(input.getPathString());
return this;
}
/**
* Updates the digest with a Path.
*
* @param input the Path with which to update the digest.
*/
public Fingerprint addPath(PathFragment input) {
addStringLatin1(input.getPathString());
return this;
}
/**
* Updates the digest with inputs by iterating over them and invoking
* {@code #addString(String)} on each element.
*
* @param inputs the inputs with which to update the digest
*/
public Fingerprint addStrings(Iterable<String> inputs) {
addInt(Iterables.size(inputs));
for (String input : inputs) {
addString(input);
}
return this;
}
/**
* Updates the digest with inputs by iterating over them and invoking
* {@code #addString(String)} on each element.
*
* @param inputs the inputs with which to update the digest
*/
public Fingerprint addStrings(String... inputs) {
addInt(inputs.length);
for (String input : inputs) {
addString(input);
}
return this;
}
/**
* Updates the digest with inputs which are pairs in a map, by iterating over
* the map entries and invoking {@code #addString(String)} on each key and
* value.
*
* @param inputs the inputs in a map with which to update the digest
*/
public Fingerprint addStringMap(Map<String, String> inputs) {
addInt(inputs.size());
for (Map.Entry<String, String> entry : inputs.entrySet()) {
addString(entry.getKey());
addString(entry.getValue());
}
return this;
}
/**
* Updates the digest with a list of paths by iterating over them and
* invoking {@link #addPath(PathFragment)} on each element.
*
* @param inputs the paths with which to update the digest
*/
public Fingerprint addPaths(Iterable<PathFragment> inputs) {
addInt(Iterables.size(inputs));
for (PathFragment path : inputs) {
addPath(path);
}
return this;
}
/**
* Reset the Fingerprint for additional use as though previous digesting had not been done.
*/
public void reset() {
hasher = MD5_HASH_FUNCTION.newHasher();
}
// -------- Convenience methods ----------------------------
/**
* Computes the hex digest from a String using UTF8 encoding and returning
* the hexDigest().
*
* @param input the String from which to compute the digest
*/
public static String md5Digest(String input) {
return MD5_HASH_FUNCTION.hashString(input, UTF_8).toString();
}
}
|
{
"content_hash": "edaeee3ac26cd8512d0d5bfa2f407eaf",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 99,
"avg_line_length": 27.613636363636363,
"alnum_prop": 0.6674897119341564,
"repo_name": "mbrukman/bazel",
"id": "75737c34f8014489c96ce7aede3dd19530eeca50",
"size": "8505",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "src/main/java/com/google/devtools/build/lib/util/Fingerprint.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "24763"
},
{
"name": "C++",
"bytes": "658587"
},
{
"name": "HTML",
"bytes": "16987"
},
{
"name": "Java",
"bytes": "19756182"
},
{
"name": "Makefile",
"bytes": "248"
},
{
"name": "PowerShell",
"bytes": "7488"
},
{
"name": "Protocol Buffer",
"bytes": "112382"
},
{
"name": "Python",
"bytes": "260875"
},
{
"name": "Shell",
"bytes": "683140"
}
]
}
|
Release notes for fcs v0.0.2.
-----------------------------
### API change
I decided that having accessor methods with the same name as the underlying property was
confusing, and also a *bad* idea. All the accessors have been renamed `getXXX()`
Added a "base" accessor, `get(segment, keywords)`. The other accessors use this method.
### Bug fixes
- [Bug#01](https://github.com/MorganConrad/fcs/issues/1) fixed. ANALYSIS segment now prints. If not present, will print as '{ }'
- fixed bug that fcshttp wasn't passing arguments correctly.
### New Features
- Added `getOnly()` method, which returns a subset of the full JSON.
- Added corresponding `--o=xxx` args to fcscli, and `?o=xxx` to fcshttp
--Added --addDate and --addFilename option to fcscli
- Throws exception on unusual $BYTEORD, only accepts 4,3,2,1 and 1,2,3,4.
### Misc
- Added this release-notes folder
- Updated fcshttp.html
- added Mocha unit tests, Travis-CI integration, and updated readme and package.json appropriately
|
{
"content_hash": "290426ac40b6f6165eb47eb063c6a9be",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 130,
"avg_line_length": 35.75,
"alnum_prop": 0.7142857142857143,
"repo_name": "MorganConrad/fcs",
"id": "04e4799d2b0f24592c5d042cd043089000b6cc7b",
"size": "1001",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "release_notes/v0.0.2.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "29256"
}
]
}
|
package com.thesecretserver.service;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="FolderGetAllChildrenResult" type="{urn:thesecretserver.com}GetFoldersResult" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"folderGetAllChildrenResult"
})
@XmlRootElement(name = "FolderGetAllChildrenResponse")
public class FolderGetAllChildrenResponse {
@XmlElement(name = "FolderGetAllChildrenResult")
protected GetFoldersResult folderGetAllChildrenResult;
/**
* Gets the value of the folderGetAllChildrenResult property.
*
* @return
* possible object is
* {@link GetFoldersResult }
*
*/
public GetFoldersResult getFolderGetAllChildrenResult() {
return folderGetAllChildrenResult;
}
/**
* Sets the value of the folderGetAllChildrenResult property.
*
* @param value
* allowed object is
* {@link GetFoldersResult }
*
*/
public void setFolderGetAllChildrenResult(GetFoldersResult value) {
this.folderGetAllChildrenResult = value;
}
}
|
{
"content_hash": "5e4c3e58ea422d6f746babfb6acb3a9e",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 121,
"avg_line_length": 28.390625,
"alnum_prop": 0.6604292790313704,
"repo_name": "ukwa/w3act",
"id": "fbcdbd43075b3ed24b5301c987f5bd9c7bdda727",
"size": "1817",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/com/thesecretserver/service/FolderGetAllChildrenResponse.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP.NET",
"bytes": "316343"
},
{
"name": "Batchfile",
"bytes": "1891"
},
{
"name": "CSS",
"bytes": "20478"
},
{
"name": "CoffeeScript",
"bytes": "14638"
},
{
"name": "Cycript",
"bytes": "2615"
},
{
"name": "Dockerfile",
"bytes": "1726"
},
{
"name": "Gherkin",
"bytes": "6627"
},
{
"name": "HTML",
"bytes": "676900"
},
{
"name": "Java",
"bytes": "2184470"
},
{
"name": "JavaScript",
"bytes": "256432"
},
{
"name": "Less",
"bytes": "26554"
},
{
"name": "PLpgSQL",
"bytes": "2408"
},
{
"name": "Scala",
"bytes": "3263"
},
{
"name": "Shell",
"bytes": "11023"
}
]
}
|
If you are already using Mochify with Selenium WebDriver, make sure the following settings are configured in your `.min-wd` file:
- "hostname": "localhost"
- "port": "4444"
Then, start the Turbo hub and, from your project's root directory, run:
mochify --wd
#### New to Mochify?
If you are new to Mochify and have never used it before, follow the instructions, below, to install Mocha and Mochify and configure them for use on Turbo.
#### Installing Mocha and Mochify
Mocha can be added to an Node.js project through the Node Package Manager (NPM):
npm install mocha
Mochify can similarly be added through NPM:
npm install -g mochify
Mochify also has a dependency for `browserify`, which can also be installed through NPM:
npm install browserify
If you are using a **packages.json** file to manage your project's dependencies, add "mocha" and "mochify" to the **devDependencies** section of the file.
```json
"devDependencies": {
"mocha": "*",
"mochify": "*",
"browserify": "*"
}
```
Create a new **.min-wd** file in your project's root directory. Start by copying the JSON, below into this file:
```json
{
"hostname" : "localhost",
"port" : 4444,
"browsers" : [{
"name" : "internet explorer",
"version" : "9"
}, {
"name" : "chrome"
}, {
"name" : "firefox"
}]
}
```
You can configure which browsers to test in the **browsers** node. If a version is not specified, Turbo will by default use the most recent version of that browser.
To add additional browsers, add another entry to the **browsers** array. For example, in the below example file we've added Firefox 26 and Chrome 34 as additional browsers to test on.
```json
{
"hostname" : "localhost",
"port" : 4444,
"browsers" : [{
"name" : "internet explorer",
"version" : "9"
}, {
"name" : "chrome"
}, {
"name" : "firefox"
}, {
"name" : "firefox",
"version" : "26"
},
{
"name" : "chrome",
"version" : "34"
}]
}
```
#### Run Tests
From your project's root directory, run `mochify --wd` to run all of your tests.
|
{
"content_hash": "6afc12c4c699335c0859b1556245f684",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 184,
"avg_line_length": 25.602409638554217,
"alnum_prop": 0.644235294117647,
"repo_name": "ediweissmann/docs-1",
"id": "45e9090af546f3fc342b2cfccf2567b245486bd8",
"size": "2192",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "testing/js_unit_testing/getting_started_mochify.md",
"mode": "33188",
"license": "apache-2.0",
"language": []
}
|
mbentley/ubuntu-mysql
==================
This Docker image has moved and is no longer available as mbentley/ubuntu-mysql. The new Docker image is mbentley/mysql and can be found at https://github.com/mbentley/docker-mysql
|
{
"content_hash": "116c3fef227c3fdb52d9aa564232d888",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 181,
"avg_line_length": 56,
"alnum_prop": 0.7366071428571429,
"repo_name": "mbentley/dockerfiles",
"id": "003211ddfc1e663db63b9d4d1f0c90686adf13cb",
"size": "224",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ubuntu/mysql/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "4734"
}
]
}
|
require "mongoid/clients/factory"
require "mongoid/clients/validators"
require "mongoid/clients/storage_options"
require "mongoid/clients/thread_options"
require "mongoid/clients/options"
module Mongoid
module Clients
extend ActiveSupport::Concern
extend Gem::Deprecate
include StorageOptions
include ThreadOptions
include Options
class << self
# Clear all clients from the current thread.
#
# @example Clear all clients.
# Mongoid::Clients.clear
#
# @return [ Array ] The empty clients.
#
# @since 3.0.0
def clear
clients.clear
end
# Get the default client.
#
# @example Get the default client.
# Mongoid::Clients.default
#
# @return [ Mongo::Client ] The default client.
#
# @since 3.0.0
def default
clients[:default] ||= Clients::Factory.default
end
# Disconnect all active clients.
#
# @example Disconnect all active clients.
# Mongoid::Clients.disconnect
#
# @return [ true ] True.
#
# @since 3.1.0
def disconnect
clients.values.each do |client|
client.close
end
end
# Get a client with the provided name.
#
# @example Get a client with the name.
# Mongoid::Clients.with_name(:replica)
#
# @param [ Symbol ] name The name of the client.
#
# @return [ Mongo::Client ] The named client.
#
# @since 3.0.0
def with_name(name)
clients[name.to_sym] ||= Clients::Factory.create(name)
end
def set(name, client)
clients[name.to_sym] = client
end
def clients
@clients ||= {}
end
end
# Get the collection for this model from the client. Will check for an
# overridden collection name from the store_in macro or the collection
# with a pluralized model name.
#
# @example Get the model's collection.
# Model.collection
#
# @return [ Mongo::Collection ] The collection.
#
# @since 3.0.0
def collection
mongo_client[collection_name]
end
def mongo_client
super || self.class.mongo_client
end
alias :mongo_session :mongo_client
deprecate :mongo_session, :mongo_client, 2015, 12
def collection_name
super || self.class.collection_name
end
module ClassMethods
extend Gem::Deprecate
# Get the client for this model. This is determined in the following order:
#
# 1. Any custom configuration provided by the 'store_in' macro.
# 2. The 'default' client as provided in the mongoid.yml
#
# @example Get the client.
# Model.mongo_client
#
# @return [ Mongo::Client ] The default mongo client.
#
# @since 3.0.0
def mongo_client
name = client_name
client = Clients.with_name(name)
client = client.use(database_name)
client.with(self.persistence_options)
end
alias :mongo_session :mongo_client
deprecate :mongo_session, :mongo_client, 2015, 12
# Get the collection for this model from the client. Will check for an
# overridden collection name from the store_in macro or the collection
# with a pluralized model name.
#
# @example Get the model's collection.
# Model.collection
#
# @return [ Mongo::Collection ] The collection.
#
# @since 3.0.0
def collection
mongo_client[collection_name]
end
end
end
end
|
{
"content_hash": "0b2caf036f9e5de11212d112ccdd3d2b",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 81,
"avg_line_length": 25.685714285714287,
"alnum_prop": 0.600111234705228,
"repo_name": "mysociety/mongoid",
"id": "78b91aea164259ff4538d85c16a53fdb46e9396a",
"size": "3614",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "lib/mongoid/clients.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "2602179"
},
{
"name": "Shell",
"bytes": "116"
}
]
}
|
<project name="jsystemAgentProject" default="all" basedir=".">
<property name="projectName" value="jsystemAgentProject"/>
<property environment="env"/>
<property name="runnerRoot" value="${env.RUNNER_ROOT}"/>
<property name="buildFilesDir" value="${runnerRoot}/dev"/>
<import file="${buildFilesDir}/buildHelper.xml" />
</project>
|
{
"content_hash": "587ec4e96e2eccf80d17f85ccf078b44",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 47.857142857142854,
"alnum_prop": 0.7253731343283583,
"repo_name": "Top-Q/jsystem",
"id": "16f10b8008bba76083f3beb0d56a9bc74e199af7",
"size": "335",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jsystem-core-projects/jsystemAgent/resources/jsystemAgentProject/build.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "14177"
},
{
"name": "CSS",
"bytes": "3065"
},
{
"name": "HTML",
"bytes": "16431"
},
{
"name": "Java",
"bytes": "4117055"
},
{
"name": "JavaScript",
"bytes": "14502"
},
{
"name": "Python",
"bytes": "3393"
},
{
"name": "Shell",
"bytes": "9478"
}
]
}
|
<?php
namespace Roots\Sage\Config;
use Roots\Sage\ConditionalTagCheck;
/**
* Enable theme features
*/
add_theme_support('soil-clean-up'); // Enable clean up from Soil
add_theme_support('soil-nav-walker'); // Enable cleaner nav walker from Soil
add_theme_support('soil-relative-urls'); // Enable relative URLs from Soil
add_theme_support('soil-nice-search'); // Enable nice search from Soil
add_theme_support('soil-jquery-cdn'); // Enable to load jQuery from the Google CDN
/**
* Configuration values
*/
if (!defined('WP_ENV')) {
// Fallback if WP_ENV isn't defined in your WordPress config
// Used in lib/assets.php to check for 'development' or 'production'
define('WP_ENV', 'production');
}
if (!defined('DIST_DIR')) {
// Path to the build directory for front-end assets
define('DIST_DIR', '/dist/');
}
/**
* Define which pages shouldn't have the sidebar
*/
function display_sidebar() {
static $display;
if (!isset($display)) {
$conditionalCheck = new ConditionalTagCheck(
/**
* Any of these conditional tags that return true won't show the sidebar.
* You can also specify your own custom function as long as it returns a boolean.
*
* To use a function that accepts arguments, use an array instead of just the function name as a string.
*
* Examples:
*
* 'is_single'
* 'is_archive'
* ['is_page', 'about-me']
* ['is_tax', ['flavor', 'mild']]
* ['is_page_template', 'about.php']
* ['is_post_type_archive', ['foo', 'bar', 'baz']]
*
*/
// [
// 'is_404',
// 'is_front_page',
// ['is_page_template', 'template-custom.php']
// ]
);
$display = apply_filters('sage/display_sidebar', $conditionalCheck->result);
}
//return $display;
}
|
{
"content_hash": "2aa1bb7d13dc10c15d1b62b0405dba3e",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 110,
"avg_line_length": 28.415384615384614,
"alnum_prop": 0.6090958310774228,
"repo_name": "girl-elvis/cornerstone",
"id": "5e2f62a9cf93b790ba4b0df22ecb04574a9ec6ee",
"size": "1847",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/config.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "25172"
},
{
"name": "JavaScript",
"bytes": "27744"
},
{
"name": "PHP",
"bytes": "58857"
}
]
}
|
// The header <exception> contains low-level functions that interact
// with a compiler's exception-handling mechanism. It is assumed to
// be supplied with the compiler, rather than with the library, because
// it is inherently tied very closely to the compiler itself.
// On platforms where <exception> does not exist, this header defines
// an exception base class. This is *not* a substitute for everything
// in <exception>, but it suffices to support a bare minimum of STL
// functionality.
#ifndef _STLP_INTERNAL_EXCEPTION
#define _STLP_INTERNAL_EXCEPTION
#if !defined (_STLP_NO_EXCEPTION_HEADER)
# if defined ( _UNCAUGHT_EXCEPTION )
# undef _STLP_NO_UNCAUGHT_EXCEPT_SUPPORT
# endif
# ifdef _STLP_VENDOR_EXCEPTION
namespace _STLP_VENDOR_STD {
class exception
{
public:
exception() throw() { }
virtual ~exception() throw();
virtual const char* what() const throw();
};
class bad_exception :
public exception
{
public:
bad_exception() throw() { }
virtual ~bad_exception() throw();
virtual const char* what() const throw();
};
typedef void (*terminate_handler)();
typedef void (*unexpected_handler)();
terminate_handler set_terminate( terminate_handler ) throw();
void terminate() throw() __attribute__ ((__noreturn__));
unexpected_handler set_unexpected( unexpected_handler ) throw();
void unexpected() __attribute__ ((__noreturn__));
bool uncaught_exception() throw() __attribute__ ((__pure__));
} // namespace _STLP_VENDOR_STD
# else /* _STLP_VENDOR_EXCEPTION */
# if defined (_STLP_HAS_INCLUDE_NEXT)
# include_next <exception>
# else
# include _STLP_NATIVE_CPP_RUNTIME_HEADER(exception)
# endif
# endif /* _STLP_VENDOR_EXCEPTION */
# if defined (_STLP_USE_OWN_NAMESPACE)
_STLP_BEGIN_NAMESPACE
# if !defined (_STLP_USING_PLATFORM_SDK_COMPILER) || !defined (_WIN64)
using _STLP_VENDOR_EXCEPT_STD::exception;
# else
using ::exception;
# endif
using _STLP_VENDOR_EXCEPT_STD::bad_exception;
# if !defined (_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS)
// fbp : many platforms present strange mix of
// those in various namespaces
# if !defined (_STLP_VENDOR_UNEXPECTED_STD)
# define _STLP_VENDOR_UNEXPECTED_STD _STLP_VENDOR_EXCEPT_STD
# else
/* The following definitions are for backward compatibility as _STLP_VENDOR_TERMINATE_STD
* and _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD has been introduce after _STLP_VENDOR_UNEXPECTED_STD
* and _STLP_VENDOR_UNEXPECTED_STD was the macro used in their place before that introduction.
*/
# if !defined (_STLP_VENDOR_TERMINATE_STD)
# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_UNEXPECTED_STD
# endif
# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_UNEXPECTED_STD
# endif
# endif
# if !defined (_STLP_VENDOR_TERMINATE_STD)
# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_EXCEPT_STD
# endif
# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_EXCEPT_STD
# endif
# if !defined (_STLP_VENDOR_TERMINATE_STD)
# define _STLP_VENDOR_TERMINATE_STD _STLP_VENDOR_EXCEPT_STD
# endif
# if !defined (_STLP_VENDOR_UNCAUGHT_EXCEPTION_STD)
# define _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD _STLP_VENDOR_EXCEPT_STD
# endif
// weird errors
# if !defined (_STLP_NO_UNEXPECTED_EXCEPT_SUPPORT)
# if defined (__ICL) && (__ICL >= 900) && (_STLP_MSVC_LIB < 1300)
//See config/_intel.h for reason about this workaround
using std::unexpected;
# else
using _STLP_VENDOR_UNEXPECTED_STD::unexpected;
# endif
using _STLP_VENDOR_UNEXPECTED_STD::unexpected_handler;
using _STLP_VENDOR_UNEXPECTED_STD::set_unexpected;
# endif
using _STLP_VENDOR_TERMINATE_STD::terminate;
using _STLP_VENDOR_TERMINATE_STD::terminate_handler;
using _STLP_VENDOR_TERMINATE_STD::set_terminate;
# if !defined (_STLP_NO_UNCAUGHT_EXCEPT_SUPPORT)
using _STLP_VENDOR_UNCAUGHT_EXCEPTION_STD::uncaught_exception;
# endif
# endif /* !_STLP_NO_USING_FOR_GLOBAL_FUNCTIONS */
_STLP_END_NAMESPACE
# endif /* _STLP_OWN_NAMESPACE */
#else /* _STLP_NO_EXCEPTION_HEADER */
/* fbp : absence of <exception> usually means that those
* functions are not going to be called by compiler.
* Still, define them for the user.
* dums: Policy modification, if the function do not behave like the Standard
* defined it we do not grant it in the STLport namespace. We will have
* compile time error rather than runtime error.
*/
#if 0
/*
typedef void (*unexpected_handler)();
unexpected_handler set_unexpected(unexpected_handler f) _STLP_NOTHROW_INHERENTLY;
void unexpected();
typedef void (*terminate_handler)();
terminate_handler set_terminate(terminate_handler f) _STLP_NOTHROW_INHERENTLY;
void terminate();
bool uncaught_exception(); // not implemented under mpw as of Jan/1999
*/
#endif
#endif /* _STLP_NO_EXCEPTION_HEADER */
#if defined (_STLP_NO_EXCEPTION_HEADER)
_STLP_BEGIN_NAMESPACE
// section 18.6.1
class _STLP_CLASS_DECLSPEC exception {
public:
# ifndef _STLP_USE_NO_IOSTREAMS
exception() _STLP_NOTHROW;
virtual ~exception() _STLP_NOTHROW;
virtual const char* what() const _STLP_NOTHROW;
# else
exception() _STLP_NOTHROW {}
virtual ~exception() _STLP_NOTHROW {}
virtual const char* what() const _STLP_NOTHROW {return "class exception";}
# endif
};
// section 18.6.2.1
class _STLP_CLASS_DECLSPEC bad_exception : public exception {
public:
# ifndef _STLP_USE_NO_IOSTREAMS
bad_exception() _STLP_NOTHROW;
~bad_exception() _STLP_NOTHROW;
const char* what() const _STLP_NOTHROW;
# else
bad_exception() _STLP_NOTHROW {}
~bad_exception() _STLP_NOTHROW {}
const char* what() const _STLP_NOTHROW {return "class bad_exception";}
# endif
};
// forward declaration
class __Named_exception;
_STLP_END_NAMESPACE
#endif
#endif /* _STLP_INTERNAL_EXCEPTION */
|
{
"content_hash": "cdce12ae7b56786f1fe18bcef5c59619",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 95,
"avg_line_length": 31.93048128342246,
"alnum_prop": 0.6992128621671412,
"repo_name": "mjs513/FreeIMU-Updates",
"id": "092ecfd021b260f6a083abada7888e7aa3de457e",
"size": "6574",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libraries/stlport-avr-STLport-master-arduino-installed/stl/_exception.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "89"
},
{
"name": "C",
"bytes": "965694"
},
{
"name": "C++",
"bytes": "9763369"
},
{
"name": "CMake",
"bytes": "11575"
},
{
"name": "CSS",
"bytes": "69831"
},
{
"name": "Elixir",
"bytes": "83"
},
{
"name": "HTML",
"bytes": "10992058"
},
{
"name": "Java",
"bytes": "2268971"
},
{
"name": "JavaScript",
"bytes": "39806"
},
{
"name": "Makefile",
"bytes": "2906"
},
{
"name": "Matlab",
"bytes": "4885"
},
{
"name": "NSIS",
"bytes": "4685"
},
{
"name": "Processing",
"bytes": "1258499"
},
{
"name": "Python",
"bytes": "375071"
},
{
"name": "Roff",
"bytes": "14212"
},
{
"name": "Shell",
"bytes": "12932"
},
{
"name": "TeX",
"bytes": "53017"
}
]
}
|
package dig.borgir.wu2gmap.config;
import java.io.IOException;
/**
*
* @author Diggu Borgir
*/
public class ConfigFactory {
public static Config createConfig() throws IOException {
return new MyConfig();
}
}
|
{
"content_hash": "f32e35df3dbb22e6688ff81c34b3bfae",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 60,
"avg_line_length": 15.933333333333334,
"alnum_prop": 0.6569037656903766,
"repo_name": "diggu/wu2gmap",
"id": "c3b4ccd8f0255ada7f217d35b0ef33ec2f98fa9b",
"size": "239",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/dig/borgir/wu2gmap/config/ConfigFactory.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "65"
},
{
"name": "Java",
"bytes": "85462"
}
]
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Morf.js - CSS3 Transitions with custom easing functions</title>
<link rel="stylesheet" href="css/demo.css" type="text/css" media="screen" title="no title" charset="utf-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/modernizr.js" type="text/javascript" charset="utf-8"></script>
<script src="js/morf.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
$(function(){
if(window.WebKitCSSMatrix === undefined || !Modernizr.cssanimations)
alert("Morf.js requires a browser that supports CSS3 Animations & implements the WebKitCSSMatrix object");
// List all the available easing functions
for(var fx in Tweenable.prototype.formula) {
$('ul#custom').prepend('<li>'+fx+'</li>');
}
$('ul').delegate('li', 'click', function(event){
event.preventDefault();
window.t = Morf.transition($('#elem').get(0), {
'-webkit-transform': 'translate'+(Modernizr.csstransforms3d!==undefined?'3d':'')+'('+ (window.toggle?'0px':'598px') +', 0px'+(Modernizr.csstransforms3d!==undefined?',0px':'')+') rotate('+(window.toggle?0:90)+'deg)'
}, {
duration: '1500ms',
timingFunction: $(this).html(),
callback: function () {
if (console && console.log) {
console.log('This got logged in the callback function!');
}
}
});
window.toggle = !window.toggle;
$('section#code').find('textarea').html(t.css.replace(/\t/g, ' '));
});
});
</script>
</head>
<body>
<div id="container">
<h1>CSS3 Transitions with custom easing functions</h1>
<div id="elemcontainer"><div id="elem" style="width: 50px; height: 50px; background: #148a88; border: 1px solid #000"></div></div>
<h2>Native</h2>
<p>These are the natively supported easing functions, built into WebKit.</p>
<ul>
<li>linear</li>
<li>ease</li>
<li>ease-in</li>
<li>ease-out</li>
<li>ease-in-out</li>
</ul>
<h2>Custom</h2>
<p>These are custom easing functions <em>(thanks to <a href="http://www.robertpenner.com/easing/">Robert Penner</a> & <a href="https://raw.github.com/madrobby/scripty2/master/src/effects/transitions/transitions.js">Thomas Fuchs</a>)</em> that can produce much more interesting transitions.</p>
<ul id="custom"></ul>
<h2>Generated Animation CSS</h2>
<p>Internally the custom easing function for the transition is faked using CSS animations. Here is the code that is produced on the fly for the most recent "transition".</p>
<section id="code">
<textarea></textarea>
</section>
</div>
</body>
</html>
|
{
"content_hash": "3ec7c0ee7ec59b2ec77741738de3c842",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 300,
"avg_line_length": 42.81818181818182,
"alnum_prop": 0.632342533616419,
"repo_name": "joelambert/morf",
"id": "387d09c4ef4697ab563d0b32cbb8b7c9c5e57a23",
"size": "2826",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "5318"
},
{
"name": "JavaScript",
"bytes": "113535"
},
{
"name": "PHP",
"bytes": "1513"
}
]
}
|
package collectiontopics;// collectiontopics/FunctionalMap.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
// Functional operations on a Map
import java.util.*;
import java.util.stream.*;
import java.util.concurrent.*;
import static onjava.HTMLColors.*;
public class FunctionalMap {
public static void main(String[] args) {
MAP.entrySet().stream()
.map(Map.Entry::getValue)
.filter(v -> v.startsWith("Dark"))
.map(v -> v.replaceFirst("Dark", "Hot"))
.forEach(System.out::println);
}
}
/* Output:
HotBlue
HotCyan
HotGoldenRod
HotGray
HotGreen
HotKhaki
HotMagenta
HotOliveGreen
HotOrange
HotOrchid
HotRed
HotSalmon
HotSeaGreen
HotSlateBlue
HotSlateGray
HotTurquoise
HotViolet
*/
|
{
"content_hash": "8be636a14e3a7b6ef0d375ee8ea9a48c",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 63,
"avg_line_length": 21.81578947368421,
"alnum_prop": 0.7406513872135102,
"repo_name": "mayonghui2112/helloWorld",
"id": "8988874ac7795f86ba4222535bd7beddbd13d97f",
"size": "829",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sourceCode/testMaven/onjava8/src/main/java/collectiontopics/FunctionalMap.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AngelScript",
"bytes": "521"
},
{
"name": "Batchfile",
"bytes": "39234"
},
{
"name": "C",
"bytes": "22329"
},
{
"name": "C++",
"bytes": "13466"
},
{
"name": "CSS",
"bytes": "61000"
},
{
"name": "Go",
"bytes": "6819"
},
{
"name": "Groovy",
"bytes": "8821"
},
{
"name": "HTML",
"bytes": "9234922"
},
{
"name": "Java",
"bytes": "21874329"
},
{
"name": "JavaScript",
"bytes": "46483"
},
{
"name": "NSIS",
"bytes": "42042"
},
{
"name": "Objective-C++",
"bytes": "26102"
},
{
"name": "PLpgSQL",
"bytes": "3746"
},
{
"name": "Perl",
"bytes": "13860"
},
{
"name": "Python",
"bytes": "33132"
},
{
"name": "Shell",
"bytes": "51005"
},
{
"name": "TSQL",
"bytes": "50756"
},
{
"name": "XSLT",
"bytes": "38702"
}
]
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Orchard.Localization {
public class FormatForScope {
public FormatForScope(string format, string scope) {
Scope = scope;
Format = format;
}
public string Scope { get; set; }
public string Format { get; set; }
}
}
|
{
"content_hash": "3ff68a9c3349c494420c1abcbd8f2efa",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 25.3125,
"alnum_prop": 0.6419753086419753,
"repo_name": "OrchardCMS/Orchard",
"id": "af633cde759d07537b2a12a00619e9a6b8e53af9",
"size": "407",
"binary": false,
"copies": "4",
"ref": "refs/heads/dev",
"path": "src/Orchard/Localization/FormatForScope.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP.NET",
"bytes": "1293"
},
{
"name": "Batchfile",
"bytes": "4891"
},
{
"name": "C",
"bytes": "4755"
},
{
"name": "C#",
"bytes": "9452417"
},
{
"name": "CSS",
"bytes": "359711"
},
{
"name": "Gherkin",
"bytes": "100786"
},
{
"name": "HTML",
"bytes": "1213225"
},
{
"name": "JavaScript",
"bytes": "9276225"
},
{
"name": "Less",
"bytes": "320352"
},
{
"name": "PowerShell",
"bytes": "11350"
},
{
"name": "Rich Text Format",
"bytes": "171908"
},
{
"name": "SCSS",
"bytes": "205972"
},
{
"name": "TSQL",
"bytes": "595"
},
{
"name": "TypeScript",
"bytes": "51522"
},
{
"name": "XSLT",
"bytes": "119918"
}
]
}
|
/*!
* \file container_ext.h
* \brief Common POD(plain old data) container types extension.
*/
// Acknowledgement: This file originates from dgl
#ifndef MXNET_RUNTIME_CONTAINER_EXT_H_
#define MXNET_RUNTIME_CONTAINER_EXT_H_
#include <dmlc/logging.h>
#include <mxnet/runtime/memory.h>
#include <mxnet/runtime/object.h>
#include <string_view>
#include <string>
#include <initializer_list>
#include <type_traits>
#include <utility>
#include <vector>
#include <unordered_map>
namespace mxnet {
namespace runtime {
// Forward declare MXNetArgValue
class MXNetArgValue;
/*! \brief String-aware ObjectRef hash functor */
struct ObjectRefHash {
/*!
* \brief Calculate the hash code of an ObjectRef
* \param a The given ObjectRef
* \return Hash code of a, string hash for strings and pointer address otherwise.
*/
size_t operator()(const ObjectRef& a) const;
};
/*! \brief String-aware ObjectRef equal functor */
struct ObjectRefEqual {
/*!
* \brief Check if the two ObjectRef are equal
* \param a One ObjectRef
* \param b The other ObjectRef
* \return String equality if both are strings, pointer address equality otherwise.
*/
bool operator()(const ObjectRef& a, const ObjectRef& b) const;
};
/*! \brief Shared content of all specializations of hash map */
class MapObj : public Object {
public:
/*! \brief Type of the keys in the hash map */
using key_type = ObjectRef;
/*! \brief Type of the values in the hash map */
using mapped_type = ObjectRef;
/*! \brief Type of the actual underlying container */
using ContainerType = std::unordered_map<ObjectRef, ObjectRef, ObjectRefHash, ObjectRefEqual>;
/*! \brief Iterator class */
using iterator = ContainerType::iterator;
/*! \brief Iterator class */
using const_iterator = ContainerType::const_iterator;
/*! \brief Type of value stored in the hash map */
using KVType = ContainerType::value_type;
static_assert(std::is_standard_layout<KVType>::value, "KVType is not standard layout");
static_assert(sizeof(KVType) == 16 || sizeof(KVType) == 8, "sizeof(KVType) incorrect");
static constexpr const uint32_t _type_index = runtime::TypeIndex::kMXNetMap;
static constexpr const char* _type_key = "MXNet.Map";
MXNET_DECLARE_FINAL_OBJECT_INFO(MapObj, Object);
/*!
* \brief Number of elements in the MapObj
* \return The result
*/
size_t size() const {
return data_.size();
}
/*!
* \brief Count the number of times a key exists in the hash map
* \param key The indexing key
* \return The result, 0 or 1
*/
size_t count(const key_type& key) const {
return data_.count(key);
}
/*!
* \brief Index value associated with a key, throw exception if the key does not exist
* \param key The indexing key
* \return The const reference to the value
*/
const mapped_type& at(const key_type& key) const {
return data_.at(key);
}
/*!
* \brief Index value associated with a key, throw exception if the key does not exist
* \param key The indexing key
* \return The mutable reference to the value
*/
mapped_type& at(const key_type& key) {
return data_.at(key);
}
/*! \return begin iterator */
iterator begin() {
return data_.begin();
}
/*! \return const begin iterator */
const_iterator begin() const {
return data_.begin();
}
/*! \return end iterator */
iterator end() {
return data_.end();
}
/*! \return end iterator */
const_iterator end() const {
return data_.end();
}
/*!
* \brief Index value associated with a key
* \param key The indexing key
* \return The iterator of the entry associated with the key, end iterator if not exists
*/
const_iterator find(const key_type& key) const {
return data_.find(key);
}
/*!
* \brief Index value associated with a key
* \param key The indexing key
* \return The iterator of the entry associated with the key, end iterator if not exists
*/
iterator find(const key_type& key) {
return data_.find(key);
}
/*!
* \brief Erase the entry associated with the iterator
* \param position The iterator
*/
void erase(const iterator& position) {
data_.erase(position);
}
/*!
* \brief Erase the entry associated with the key, do nothing if not exists
* \param key The indexing key
*/
void erase(const key_type& key) {
data_.erase(key);
}
/*!
* \brief Create an empty container
* \return The object created
*/
static ObjectPtr<MapObj> Empty() {
return make_object<MapObj>();
}
protected:
/*!
* \brief Create the map using contents from the given iterators.
* \param first Begin of iterator
* \param last End of iterator
* \tparam IterType The type of iterator
* \return ObjectPtr to the map created
*/
template <typename IterType>
static ObjectPtr<Object> CreateFromRange(IterType first, IterType last) {
ObjectPtr<MapObj> p = make_object<MapObj>();
p->data_ = ContainerType(first, last);
return p;
}
/*!
* \brief InsertMaybeReHash an entry into the given hash map
* \param kv The entry to be inserted
* \param map The pointer to the map, can be changed if re-hashing happens
*/
static void InsertMaybeReHash(const KVType& kv, ObjectPtr<Object>* map) {
MapObj* map_node = static_cast<MapObj*>(map->get());
map_node->data_[kv.first] = kv.second;
}
/*!
* \brief Create an empty container with elements copying from another MapObj
* \param from The source container
* \return The object created
*/
static ObjectPtr<MapObj> CopyFrom(MapObj* from) {
ObjectPtr<MapObj> p = make_object<MapObj>();
p->data_ = ContainerType(from->data_.begin(), from->data_.end());
return p;
}
/*! \brief The real container storing data */
ContainerType data_;
template <typename, typename, typename, typename>
friend class Map;
};
/*!
* \brief Map container of NodeRef->NodeRef in DSL graph.
* Map implements copy on write semantics, which means map is mutable
* but copy will happen when array is referenced in more than two places.
*
* operator[] only provide const acces, use Set to mutate the content.
* \tparam K The key NodeRef type.
* \tparam V The value NodeRef type.
*/
template <typename K,
typename V,
typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type,
typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
class Map : public ObjectRef {
public:
using key_type = K;
using mapped_type = V;
class iterator;
/*!
* \brief default constructor
*/
Map() {
data_ = MapObj::Empty();
}
/*!
* \brief move constructor
* \param other source
*/
Map(Map<K, V>&& other) {
data_ = std::move(other.data_);
}
/*!
* \brief copy constructor
* \param other source
*/
Map(const Map<K, V>& other) : ObjectRef(other.data_) {}
/*!
* \brief copy assign operator
* \param other The source of assignment
* \return reference to self.
*/
Map<K, V>& operator=(Map<K, V>&& other) {
data_ = std::move(other.data_);
return *this;
}
/*!
* \brief move assign operator
* \param other The source of assignment
* \return reference to self.
*/
Map<K, V>& operator=(const Map<K, V>& other) {
data_ = other.data_;
return *this;
}
/*!
* \brief constructor from pointer
* \param n the container pointer
*/
explicit Map(ObjectPtr<Object> n) : ObjectRef(n) {}
/*!
* \brief constructor from iterator
* \param begin begin of iterator
* \param end end of iterator
* \tparam IterType The type of iterator
*/
template <typename IterType>
Map(IterType begin, IterType end) {
data_ = MapObj::CreateFromRange(begin, end);
}
/*!
* \brief constructor from initializer list
* \param init The initalizer list
*/
Map(std::initializer_list<std::pair<K, V>> init) {
data_ = MapObj::CreateFromRange(init.begin(), init.end());
}
/*!
* \brief constructor from unordered_map
* \param init The unordered_map
*/
template <typename Hash, typename Equal>
Map(const std::unordered_map<K, V, Hash, Equal>& init) { // NOLINT(*)
data_ = MapObj::CreateFromRange(init.begin(), init.end());
}
/*!
* \brief Read element from map.
* \param key The key
* \return the corresonding element.
*/
const V at(const K& key) const {
return DowncastNoCheck<V>(GetMapObj()->at(key));
}
/*!
* \brief Read element from map.
* \param key The key
* \return the corresonding element.
*/
const V operator[](const K& key) const {
return this->at(key);
}
/*! \return The size of the array */
size_t size() const {
MapObj* n = GetMapObj();
return n == nullptr ? 0 : n->size();
}
/*! \return The number of elements of the key */
size_t count(const K& key) const {
MapObj* n = GetMapObj();
return n == nullptr ? 0 : GetMapObj()->count(key);
}
/*! \return whether array is empty */
bool empty() const {
return size() == 0;
}
/*!
* \brief set the Map.
* \param key The index key.
* \param value The value to be setted.
*/
void Set(const K& key, const V& value) {
CopyOnWrite();
MapObj::InsertMaybeReHash(MapObj::KVType(key, value), &data_);
}
/*! \return begin iterator */
iterator begin() const {
return iterator(GetMapObj()->begin());
}
/*! \return end iterator */
iterator end() const {
return iterator(GetMapObj()->end());
}
/*! \return find the key and returns the associated iterator */
iterator find(const K& key) const {
return iterator(GetMapObj()->find(key));
}
void erase(const K& key) {
CopyOnWrite()->erase(key);
}
/*!
* \brief copy on write semantics
* Do nothing if current handle is the unique copy of the array.
* Otherwise make a new copy of the array to ensure the current handle
* hold a unique copy.
*
* \return Handle to the internal node container(which ganrantees to be unique)
*/
MapObj* CopyOnWrite() {
if (data_.get() == nullptr) {
data_ = MapObj::Empty();
} else if (!data_.unique()) {
data_ = MapObj::CopyFrom(GetMapObj());
}
return GetMapObj();
}
/*! \brief specify container node */
using ContainerType = MapObj;
/*! \brief Iterator of the hash map */
class iterator {
public:
using iterator_category = std::bidirectional_iterator_tag;
using difference_type = int64_t;
using value_type = const std::pair<K, V>;
using pointer = value_type*;
using reference = value_type;
iterator() : itr() {}
/*! \brief Compare iterators */
bool operator==(const iterator& other) const {
return itr == other.itr;
}
/*! \brief Compare iterators */
bool operator!=(const iterator& other) const {
return itr != other.itr;
}
/*! \brief De-reference iterators is not allowed */
pointer operator->() const = delete;
/*! \brief De-reference iterators */
reference operator*() const {
auto& kv = *itr;
return std::make_pair(DowncastNoCheck<K>(kv.first), DowncastNoCheck<V>(kv.second));
}
/*! \brief Prefix self increment, e.g. ++iter */
iterator& operator++() {
++itr;
return *this;
}
/*! \brief Suffix self increment */
iterator operator++(int) {
iterator copy = *this;
++(*this);
return copy;
}
private:
iterator(const MapObj::iterator& itr) // NOLINT(*)
: itr(itr) {}
template <typename, typename, typename, typename>
friend class Map;
MapObj::iterator itr;
};
private:
/*! \brief Return data_ as type of pointer of MapObj */
MapObj* GetMapObj() const {
return static_cast<MapObj*>(data_.get());
}
};
/*!
* \brief Merge two Maps.
* \param lhs the first Map to merge.
* \param rhs the second Map to merge.
* @return The merged Array. Original Maps are kept unchanged.
*/
template <typename K,
typename V,
typename = typename std::enable_if<std::is_base_of<ObjectRef, K>::value>::type,
typename = typename std::enable_if<std::is_base_of<ObjectRef, V>::value>::type>
inline Map<K, V> Merge(Map<K, V> lhs, const Map<K, V>& rhs) {
for (const auto& p : rhs) {
lhs.Set(p.first, p.second);
}
return std::move(lhs);
}
/*! \brief An object representing string. It's POD type. */
class StringObj : public Object {
public:
/*! \brief The pointer to string data. */
const char* data;
/*! \brief The length of the string object. */
uint64_t size;
static constexpr const uint32_t _type_index = TypeIndex::kMXNetString;
static constexpr const char* _type_key = "MXNet.String";
MXNET_DECLARE_FINAL_OBJECT_INFO(StringObj, Object);
private:
/*! \brief String object which is moved from std::string container. */
class FromStd;
friend class String;
};
/*!
* \brief Reference to string objects.
*
* \code
*
* // Example to create runtime String reference object from std::string
* std::string s = "hello world";
*
* // You can create the reference from existing std::string
* String ref{std::move(s)};
*
* // You can rebind the reference to another string.
* ref = std::string{"hello world2"};
*
* // You can use the reference as hash map key
* std::unordered_map<String, int32_t> m;
* m[ref] = 1;
*
* // You can compare the reference object with other string objects
* assert(ref == "hello world", true);
*
* // You can convert the reference to std::string again
* string s2 = (string)ref;
*
* \endcode
*/
class String : public ObjectRef {
public:
/*!
* \brief Construct an empty string.
*/
String() : String(std::string()) {}
/*!
* \brief Construct a new String object
*
* \param other The moved/copied std::string object
*
* \note If user passes const reference, it will trigger copy. If it's rvalue,
* it will be moved into other.
*/
String(std::string other); // NOLINT(*)
/*!
* \brief Construct a new String object
*
* \param other a char array.
*/
String(const char* other) // NOLINT(*)
: String(std::string(other)) {}
/*!
* \brief Change the value the reference object points to.
*
* \param other The value for the new String
*
*/
inline String& operator=(std::string other);
/*!
* \brief Change the value the reference object points to.
*
* \param other The value for the new String
*/
inline String& operator=(const char* other);
/*!
* \brief Compares this String object to other
*
* \param other The String to compare with.
*
* \return zero if both char sequences compare equal. negative if this appear
* before other, positive otherwise.
*/
int compare(const String& other) const {
return memncmp(data(), other.data(), size(), other.size());
}
/*!
* \brief Compares this String object to other
*
* \param other The string to compare with.
*
* \return zero if both char sequences compare equal. negative if this appear
* before other, positive otherwise.
*/
int compare(const std::string& other) const {
return memncmp(data(), other.data(), size(), other.size());
}
/*!
* \brief Compares this to other
*
* \param other The character array to compare with.
*
* \return zero if both char sequences compare equal. negative if this appear
* before other, positive otherwise.
*/
int compare(const char* other) const {
return memncmp(data(), other, size(), std::stold(other));
}
/*!
* \brief Returns a pointer to the char array in the string.
*
* \return const char*
*/
const char* c_str() const {
return get()->data;
}
/*!
* \brief Return the length of the string
*
* \return size_t string length
*/
size_t size() const {
const auto* ptr = get();
return ptr->size;
}
/*!
* \brief Return the length of the string
*
* \return size_t string length
*/
size_t length() const {
return size();
}
/*!
* \brief Retun if the string is empty
*
* \return true if empty, false otherwise.
*/
bool empty() const {
return size() == 0;
}
/*!
* \brief Return the data pointer
*
* \return const char* data pointer
*/
const char* data() const {
return get()->data;
}
/*!
* \brief Convert String to an std::string object
*
* \return std::string
*/
operator std::string() const {
return std::string{get()->data, size()};
}
/*!
* \brief Check if a MXNetArgValue can be converted to String, i.e. it can be std::string or
* String \param val The value to be checked \return A boolean indicating if val can be converted
* to String
*/
inline static bool CanConvertFrom(const MXNetArgValue& val);
/*!
* \brief Hash the binary bytes
* \param data The data pointer
* \param size The size of the bytes.
* \return the hash value.
*/
static size_t HashBytes(const char* data, size_t size) {
// This function falls back to string copy with c++11 compiler and is
// recommended to be compiled with c++14
return std::hash<std::string_view>()(std::string_view(data, size));
}
MXNET_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(String, ObjectRef, StringObj);
private:
/*!
* \brief Compare two char sequence
*
* \param lhs Pointers to the char array to compare
* \param rhs Pointers to the char array to compare
* \param lhs_count Length of the char array to compare
* \param rhs_count Length of the char array to compare
* \return int zero if both char sequences compare equal. negative if this
* appear before other, positive otherwise.
*/
static int memncmp(const char* lhs, const char* rhs, size_t lhs_count, size_t rhs_count);
/*!
* \brief Concatenate two char sequences
*
* \param lhs Pointers to the lhs char array
* \param lhs_size The size of the lhs char array
* \param rhs Pointers to the rhs char array
* \param rhs_size The size of the rhs char array
*
* \return The concatenated char sequence
*/
static String Concat(const char* lhs, size_t lhs_size, const char* rhs, size_t rhs_size) {
std::string ret(lhs, lhs_size);
ret.append(rhs, rhs_size);
return String(ret);
}
// Overload + operator
friend String operator+(const String& lhs, const String& rhs);
friend String operator+(const String& lhs, const std::string& rhs);
friend String operator+(const std::string& lhs, const String& rhs);
friend String operator+(const String& lhs, const char* rhs);
friend String operator+(const char* lhs, const String& rhs);
friend struct mxnet::runtime::ObjectRefEqual;
};
/*! \brief An object representing string moved from std::string. */
class StringObj::FromStd : public StringObj {
public:
/*!
* \brief Construct a new FromStd object
*
* \param other The moved/copied std::string object
*
* \note If user passes const reference, it will trigger copy. If it's rvalue,
* it will be moved into other.
*/
explicit FromStd(std::string other) : data_container{other} {}
private:
/*! \brief Container that holds the memory. */
std::string data_container;
friend class String;
};
inline String::String(std::string other) {
auto ptr = make_object<StringObj::FromStd>(std::move(other));
ptr->size = ptr->data_container.size();
ptr->data = ptr->data_container.data();
data_ = std::move(ptr);
}
inline String& String::operator=(std::string other) {
String replace{std::move(other)};
data_.swap(replace.data_);
return *this;
}
inline String& String::operator=(const char* other) {
return operator=(std::string(other));
}
inline String operator+(const String& lhs, const String& rhs) {
size_t lhs_size = lhs.size();
size_t rhs_size = rhs.size();
return String::Concat(lhs.data(), lhs_size, rhs.data(), rhs_size);
}
inline String operator+(const String& lhs, const std::string& rhs) {
size_t lhs_size = lhs.size();
size_t rhs_size = rhs.size();
return String::Concat(lhs.data(), lhs_size, rhs.data(), rhs_size);
}
inline String operator+(const std::string& lhs, const String& rhs) {
size_t lhs_size = lhs.size();
size_t rhs_size = rhs.size();
return String::Concat(lhs.data(), lhs_size, rhs.data(), rhs_size);
}
inline String operator+(const char* lhs, const String& rhs) {
size_t lhs_size = std::stold(lhs);
size_t rhs_size = rhs.size();
return String::Concat(lhs, lhs_size, rhs.data(), rhs_size);
}
inline String operator+(const String& lhs, const char* rhs) {
size_t lhs_size = lhs.size();
size_t rhs_size = std::stold(rhs);
return String::Concat(lhs.data(), lhs_size, rhs, rhs_size);
}
// Overload < operator
inline bool operator<(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) < 0;
}
inline bool operator<(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) > 0;
}
inline bool operator<(const String& lhs, const String& rhs) {
return lhs.compare(rhs) < 0;
}
inline bool operator<(const String& lhs, const char* rhs) {
return lhs.compare(rhs) < 0;
}
inline bool operator<(const char* lhs, const String& rhs) {
return rhs.compare(lhs) > 0;
}
// Overload > operator
inline bool operator>(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) > 0;
}
inline bool operator>(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) < 0;
}
inline bool operator>(const String& lhs, const String& rhs) {
return lhs.compare(rhs) > 0;
}
inline bool operator>(const String& lhs, const char* rhs) {
return lhs.compare(rhs) > 0;
}
inline bool operator>(const char* lhs, const String& rhs) {
return rhs.compare(lhs) < 0;
}
// Overload <= operator
inline bool operator<=(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) <= 0;
}
inline bool operator<=(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) >= 0;
}
inline bool operator<=(const String& lhs, const String& rhs) {
return lhs.compare(rhs) <= 0;
}
inline bool operator<=(const String& lhs, const char* rhs) {
return lhs.compare(rhs) <= 0;
}
inline bool operator<=(const char* lhs, const String& rhs) {
return rhs.compare(lhs) >= 0;
}
// Overload >= operator
inline bool operator>=(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) >= 0;
}
inline bool operator>=(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) <= 0;
}
inline bool operator>=(const String& lhs, const String& rhs) {
return lhs.compare(rhs) >= 0;
}
inline bool operator>=(const String& lhs, const char* rhs) {
return lhs.compare(rhs) >= 0;
}
inline bool operator>=(const char* lhs, const String& rhs) {
return rhs.compare(rhs) <= 0;
}
// Overload == operator
inline bool operator==(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) == 0;
}
inline bool operator==(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) == 0;
}
inline bool operator==(const String& lhs, const String& rhs) {
return lhs.compare(rhs) == 0;
}
inline bool operator==(const String& lhs, const char* rhs) {
return lhs.compare(rhs) == 0;
}
inline bool operator==(const char* lhs, const String& rhs) {
return rhs.compare(lhs) == 0;
}
// Overload != operator
inline bool operator!=(const String& lhs, const std::string& rhs) {
return lhs.compare(rhs) != 0;
}
inline bool operator!=(const std::string& lhs, const String& rhs) {
return rhs.compare(lhs) != 0;
}
inline bool operator!=(const String& lhs, const String& rhs) {
return lhs.compare(rhs) != 0;
}
inline bool operator!=(const String& lhs, const char* rhs) {
return lhs.compare(rhs) != 0;
}
inline bool operator!=(const char* lhs, const String& rhs) {
return rhs.compare(lhs) != 0;
}
inline std::ostream& operator<<(std::ostream& out, const String& input) {
out.write(input.data(), input.size());
return out;
}
inline int String::memncmp(const char* lhs, const char* rhs, size_t lhs_count, size_t rhs_count) {
if (lhs == rhs && lhs_count == rhs_count)
return 0;
for (size_t i = 0; i < lhs_count && i < rhs_count; ++i) {
if (lhs[i] < rhs[i])
return -1;
if (lhs[i] > rhs[i])
return 1;
}
if (lhs_count < rhs_count) {
return -1;
} else if (lhs_count > rhs_count) {
return 1;
} else {
return 0;
}
}
inline size_t ObjectRefHash::operator()(const ObjectRef& a) const {
if (const auto* str = a.as<StringObj>()) {
return String::HashBytes(str->data, str->size);
}
return ObjectHash()(a);
}
inline bool ObjectRefEqual::operator()(const ObjectRef& a, const ObjectRef& b) const {
if (a.same_as(b)) {
return true;
}
if (const auto* str_a = a.as<StringObj>()) {
if (const auto* str_b = b.as<StringObj>()) {
return String::memncmp(str_a->data, str_b->data, str_a->size, str_b->size) == 0;
}
}
return false;
}
} // namespace runtime
} // namespace mxnet
#endif // MXNET_RUNTIME_CONTAINER_EXT_H_
|
{
"content_hash": "fd84395c383c1b355abe53ebbd155707",
"timestamp": "",
"source": "github",
"line_count": 902,
"max_line_length": 99,
"avg_line_length": 27.732815964523283,
"alnum_prop": 0.6458924645212872,
"repo_name": "tlby/mxnet",
"id": "d9f513151fd81dda30b2b68d6ea884ef101de681",
"size": "25822",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "include/mxnet/runtime/container_ext.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1731"
},
{
"name": "Batchfile",
"bytes": "13130"
},
{
"name": "C",
"bytes": "178935"
},
{
"name": "C++",
"bytes": "6790570"
},
{
"name": "CMake",
"bytes": "90505"
},
{
"name": "Clojure",
"bytes": "511901"
},
{
"name": "Cuda",
"bytes": "884341"
},
{
"name": "Dockerfile",
"bytes": "75935"
},
{
"name": "Groovy",
"bytes": "97521"
},
{
"name": "HTML",
"bytes": "40277"
},
{
"name": "Java",
"bytes": "188428"
},
{
"name": "Julia",
"bytes": "436277"
},
{
"name": "Jupyter Notebook",
"bytes": "3633690"
},
{
"name": "MATLAB",
"bytes": "34903"
},
{
"name": "Makefile",
"bytes": "185515"
},
{
"name": "Perl",
"bytes": "1551488"
},
{
"name": "Perl 6",
"bytes": "7280"
},
{
"name": "PowerShell",
"bytes": "11318"
},
{
"name": "Python",
"bytes": "6532381"
},
{
"name": "R",
"bytes": "357766"
},
{
"name": "Scala",
"bytes": "1258332"
},
{
"name": "Shell",
"bytes": "406483"
},
{
"name": "Smalltalk",
"bytes": "3497"
}
]
}
|
require 'spec_helper'
describe ErrorsController do
describe "GET 'error_404'" do
it "returns http success" do
get 'error_404'
response.should be_success
end
end
describe "GET 'error_500'" do
it "returns http success" do
get 'error_500'
response.should be_success
end
end
end
|
{
"content_hash": "47c77daefe583871835d1cf38048a007",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 32,
"avg_line_length": 17.210526315789473,
"alnum_prop": 0.6483180428134556,
"repo_name": "prank7/jsTwitter",
"id": "5a0ce30be64b7ebcb601ef8705fd71b84a29909c",
"size": "327",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/controllers/errors_controller_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14842"
},
{
"name": "CoffeeScript",
"bytes": "845"
},
{
"name": "JavaScript",
"bytes": "17570"
},
{
"name": "Ruby",
"bytes": "44176"
}
]
}
|
/**
*
* $Id: AssociatedMetastasisPopulateAction.java,v 1.18 2008-08-14 16:46:47 pandyas Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.17 2007/10/31 17:08:48 pandyas
* Modified commetns for #8188 Rename UnctrlVocab items to text entries
*
* Revision 1.16 2007/09/12 19:36:40 pandyas
* modified debug statements for build to stage tier
*
* Revision 1.15 2007/08/14 17:06:17 pandyas
* Bug #8414: getEVSPreferredDiscription needs to be implemented for Zebrafish vocabulary source
*
* Revision 1.14 2007/06/21 20:48:18 pandyas
* The method getOrgan().getEVSPrefferedName does not work for Zebrafish - using getOrgan().getName(); until fixed
*
* Revision 1.13 2007/06/13 12:10:15 pandyas
* Modified for save of organ/diagnosis for each tree options
*
* Revision 1.12 2007/05/17 18:42:25 pandyas
* Fixed diagnosis populate when selecting other
*
* Revision 1.11 2007/04/30 20:10:17 pandyas
* Implemented species specific vocabulary trees from EVSTree
*
* Revision 1.10 2006/11/09 17:22:17 pandyas
* Commented out debug code
*
* Revision 1.9 2006/11/08 18:05:56 pandyas
* Modified TumorIncidenceRate float to String (weight of tumor and volume of tumor also needed modified to delete properly)
*
* Revision 1.8 2006/11/08 17:18:06 pandyas
* fixed typo in error message
*
* Revision 1.7 2006/09/12 15:09:53 georgeda
* Modified setTumorClassification so it displayed the disease.getEVSPreferredDescription() results instead of disease.getName
*
* Revision 1.6 2006/04/17 19:09:40 pandyas
* caMod 2.1 OM changes
*
*
*/
package gov.nih.nci.camod.webapp.action;
import gov.nih.nci.camod.Constants;
import gov.nih.nci.camod.domain.Disease;
import gov.nih.nci.camod.domain.Histopathology;
import gov.nih.nci.camod.service.HistopathologyManager;
import gov.nih.nci.camod.webapp.form.AssociatedMetastasisForm;
import gov.nih.nci.camod.webapp.util.NewDropdownUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
public class AssociatedMetastasisPopulateAction extends BaseAction {
/**
* Pre-populate all field values in the form <FormName> Used by <jspName>
*
*/
public ActionForward populate(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
AssociatedMetastasisForm assocMetastasisForm = (AssociatedMetastasisForm) form;
// Grab the current aHistopathID from the session
String aHistopathologyID = request.getParameter("aHistopathologyID");
log.debug("aHistopathID: " + aHistopathologyID);
// Grab the current aAssocMetastasisID we are working with related to
// this animalModel
String aAssociatedMetastasisID = request.getParameter("aAssociatedMetastasisID");
log.debug("aAssocMetastasisID: " + aAssociatedMetastasisID);
HistopathologyManager histopathologyManager = (HistopathologyManager) getBean("histopathologyManager");
Histopathology associatedMetastasis = histopathologyManager.get(aAssociatedMetastasisID);
if (associatedMetastasis == null) {
request.setAttribute(Constants.Parameters.DELETED, "true");
} else {
request.setAttribute("aAssociatedMetastasisID", aAssociatedMetastasisID);
request.setAttribute("aHistopathologyID", aHistopathologyID);
/* Set Histopathology attributes */
assocMetastasisForm.setAgeOfOnset(associatedMetastasis.getAgeOfOnset());
assocMetastasisForm.setAgeOfOnsetUnit(associatedMetastasis.getAgeOfOnsetUnit());
assocMetastasisForm.setAgeOfDetection(associatedMetastasis.getAgeOfDetection());
assocMetastasisForm.setAgeOfDetectionUnit(associatedMetastasis.getAgeOfDetectionUnit());
assocMetastasisForm.setWeightOfTumor(associatedMetastasis.getWeightOfTumor());
assocMetastasisForm.setVolumeOfTumor(associatedMetastasis.getVolumeOfTumor());
assocMetastasisForm.setTumorIncidenceRate(associatedMetastasis.getTumorIncidenceRate());
assocMetastasisForm.setSurvivalInfo(associatedMetastasis.getSurvivalInfo());
assocMetastasisForm.setGrossDescription(associatedMetastasis.getGrossDescription());
assocMetastasisForm.setMicroscopicDescription(associatedMetastasis.getMicroscopicDescription());
assocMetastasisForm.setComparativeData(associatedMetastasis.getComparativeData());
assocMetastasisForm.setComments(associatedMetastasis.getComments());
/* set Organ attributes */
log.debug("<HistopathologyPopulateAction populate> get the Organ attributes");
// since we are always querying from concept code (save and edit),
// simply display organ.name since EVSPreferredDescription is too slow in LexEVS 5.x API, unless concept code is '00000'
if (associatedMetastasis.getOrgan().equals(Constants.Dropdowns.CONCEPTCODEZEROS)) {
assocMetastasisForm.setOrgan(associatedMetastasis.getOrgan().getName());
log.info("associatedMetastasis.getOrgan().getName(): " + associatedMetastasis.getOrgan().getName());
assocMetastasisForm.setOrganTissueCode(associatedMetastasis.getOrgan().getConceptCode());
log.info("OrganTissueCode: " + associatedMetastasis.getOrgan().getConceptCode());
} else {
assocMetastasisForm.setOrgan(associatedMetastasis.getOrgan().getName());
log.info("associatedMetastasis.getOrgan().getName(): " + associatedMetastasis.getOrgan().getName());
assocMetastasisForm.setOrganTissueCode(associatedMetastasis.getOrgan().getConceptCode());
log.info("OrganTissueCode: " + associatedMetastasis.getOrgan().getConceptCode());
}
/* Set Disease object attributes - check for other Zebrafish entry*/
Disease disease = associatedMetastasis.getDisease();
if(disease.getNameAlternEntry() != null) {
log.info("disease is other in DB");
assocMetastasisForm.setTumorClassification(Constants.Dropdowns.OTHER_OPTION);
assocMetastasisForm.setOtherTumorClassification(disease.getNameAlternEntry());
} else {
assocMetastasisForm.setDiagnosisName(disease.getName());
assocMetastasisForm.setDiagnosisCode(disease.getConceptCode());
assocMetastasisForm.setTumorClassification(disease.getEVSPreferredDescription());
}
/* Set GeneticAlteration attributes */
if (associatedMetastasis.getGeneticAlteration() != null) {
assocMetastasisForm.setObservation(associatedMetastasis.getGeneticAlteration().getObservation());
assocMetastasisForm.setMethodOfObservation(associatedMetastasis.getGeneticAlteration()
.getMethodOfObservation());
}
}
// Prepopulate all dropdown fields, set the global Constants to the
// following
this.dropdown(request, response);
return mapping.findForward("submitAssocMetastasis");
}
/**
* Populate the dropdown menus
*
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward dropdown(ActionMapping mapping, ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
// setup dropdown menus
this.dropdown(request, response);
return mapping.findForward("submitAssocMetastasis");
}
/**
* Populate all drowpdowns for this type of form
*
* @param request
* @param response
* @throws Exception
*/
public void dropdown(HttpServletRequest request, HttpServletResponse response) throws Exception {
// Prepopulate all dropdown fields, set the global Constants to the
// following
NewDropdownUtil.populateDropdown(request, Constants.Dropdowns.AGEUNITSDROP, "");
NewDropdownUtil.populateDropdown(request, Constants.Dropdowns.ZEBRAFISHDIAGNOSISDROP, Constants.Dropdowns.ADD_BLANK_AND_OTHER_OPTION);
}
}
|
{
"content_hash": "69c33372e4c83616dfb6b5b43db6dadb",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 150,
"avg_line_length": 44.72251308900523,
"alnum_prop": 0.7055724654647624,
"repo_name": "NCIP/camod",
"id": "7867c21b30a13d60b5b0f61c136caa2d6ac1b995",
"size": "8723",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "software/camod/src/gov/nih/nci/camod/webapp/action/AssociatedMetastasisPopulateAction.java",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "571"
},
{
"name": "CSS",
"bytes": "763585"
},
{
"name": "Groovy",
"bytes": "2514"
},
{
"name": "HTML",
"bytes": "1773080"
},
{
"name": "Java",
"bytes": "4572314"
},
{
"name": "JavaScript",
"bytes": "1171793"
},
{
"name": "PLSQL",
"bytes": "80403"
},
{
"name": "Shell",
"bytes": "23550"
},
{
"name": "XSLT",
"bytes": "190799"
}
]
}
|
namespace chromeos {
namespace device_sync {
namespace {
// The base64url encoded, SHA-256 8-byte hash of "BETTER_TOGETHER_HOST" and
// "EASY_UNLOCK_HOST".
const char kBetterTogetherHostEncodedHash[] = "vA7vs_-9Ayo";
const char kEasyUnlockHostEncodedHash[] = "n_ekjyVWntQ";
} // namespace
TEST(DeviceSyncCryptAuthFeatureTypeTest, ToAndFromString) {
for (CryptAuthFeatureType feature_type : GetAllCryptAuthFeatureTypes()) {
EXPECT_EQ(feature_type, CryptAuthFeatureTypeFromString(
CryptAuthFeatureTypeToString(feature_type)));
}
}
TEST(DeviceSyncCryptAuthFeatureTypeTest, ToAndFromHash) {
for (CryptAuthFeatureType feature_type : GetAllCryptAuthFeatureTypes()) {
EXPECT_EQ(feature_type, CryptAuthFeatureTypeFromGcmHash(
CryptAuthFeatureTypeToGcmHash(feature_type)));
}
}
TEST(DeviceSyncCryptAuthFeatureTypeTest, ToAndFromSoftwareFeature) {
// SoftwareFeatures map onto the "enabled" feature types.
for (CryptAuthFeatureType feature_type : GetEnabledCryptAuthFeatureTypes()) {
EXPECT_EQ(feature_type,
CryptAuthFeatureTypeFromSoftwareFeature(
CryptAuthFeatureTypeToSoftwareFeature(feature_type)));
}
}
TEST(DeviceSyncCryptAuthFeatureTypeTest, ToHash) {
EXPECT_EQ(kBetterTogetherHostEncodedHash,
CryptAuthFeatureTypeToGcmHash(
CryptAuthFeatureType::kBetterTogetherHostEnabled));
EXPECT_EQ(kEasyUnlockHostEncodedHash,
CryptAuthFeatureTypeToGcmHash(
CryptAuthFeatureType::kEasyUnlockHostEnabled));
}
} // namespace device_sync
} // namespace chromeos
|
{
"content_hash": "5901d15a536848ebba5b41a60b745018",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 34.145833333333336,
"alnum_prop": 0.7309334960341671,
"repo_name": "scheib/chromium",
"id": "1b1a31cf126badb2db73ccdf65f0578ce4ef7a52",
"size": "1915",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "ash/services/device_sync/cryptauth_feature_type_unittest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": []
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
</head>
<body>
<div id="app"></div>
<script src="http://localhost:8080/build/vendor.bundle.js"></script>
<script src="http://localhost:8080/build/bundle.js"></script>
</body>
</html>
|
{
"content_hash": "c30c37e00e66db7e98c41b5ddeccc2a0",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 20.083333333333332,
"alnum_prop": 0.6514522821576764,
"repo_name": "Simproduction/react-client-webpack",
"id": "fdace0adc9de2f72fb4f5ce73718b5032457da11",
"size": "241",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "dev.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "443"
},
{
"name": "JavaScript",
"bytes": "5390"
}
]
}
|
<body>
<section id="container" >
<header class="header black-bg">
<div class="sidebar-toggle-box">
<div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div>
</div>
<!--logo start-->
<a href="<?php echo base_url(); ?>home/" class="logo"><b>EVENTO</b></a>
<!--logo end-->
<div class="nav notify-row" id="top_menu" style="margin-left:20px">
<!-- notification start -->
<ul class="nav top-menu">
<!-- settings start
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
<i class="fa fa-tasks"></i>
<span class="badge bg-theme">4</span>
</a>
<ul class="dropdown-menu extended tasks-bar">
<div class="notify-arrow notify-arrow-green"></div>
<li>
<p class="green">You have 4 pending tasks</p>
</li>
<li>
<a href="index.html#">
<div class="task-info">
<div class="desc">DashGum Admin Panel</div>
<div class="percent">40%</div>
</div>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">
<span class="sr-only">40% Complete (success)</span>
</div>
</div>
</a>
</li>
<li>
<a href="index.html#">
<div class="task-info">
<div class="desc">Database Update</div>
<div class="percent">60%</div>
</div>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
<span class="sr-only">60% Complete (warning)</span>
</div>
</div>
</a>
</li>
<li>
<a href="index.html#">
<div class="task-info">
<div class="desc">Product Development</div>
<div class="percent">80%</div>
</div>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">
<span class="sr-only">80% Complete</span>
</div>
</div>
</a>
</li>
<li>
<a href="index.html#">
<div class="task-info">
<div class="desc">Payments Sent</div>
<div class="percent">70%</div>
</div>
<div class="progress progress-striped">
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width: 70%">
<span class="sr-only">70% Complete (Important)</span>
</div>
</div>
</a>
</li>
<li class="external">
<a href="#">See All Tasks</a>
</li>
</ul>
</li>
settings end -->
<!-- inbox dropdown start-->
<!--li id="header_inbox_bar" class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
<i class="fa fa-envelope-o"></i>
<span class="badge bg-theme">5</span>
</a>
<ul class="dropdown-menu extended inbox">
<div class="notify-arrow notify-arrow-green"></div>
<li>
<p class="green">You have 5 new messages</p>
</li>
<li>
<a href="index.html#">
<span class="photo"><img alt="avatar" src="<?php //echo base_url(); ?>assets/img/ui-zac.jpg"></span>
<span class="subject">
<span class="from">Zac Snider</span>
<span class="time">Just now</span>
</span>
<span class="message">
Hi mate, how is everything?
</span>
</a>
</li>
<li>
<a href="index.html#">See all messages</a>
</li>
</ul>
<--/li>
<!-- inbox dropdown end -->
</ul>
<!-- notification end -->
</div>
<div class="top-menu">
<ul class="nav pull-right top-menu">
<li><a class="logout" href="<?php echo base_url(); ?>login/logout">Logout</a></li>
</ul>
</div>
</header>
<!--header end-->
|
{
"content_hash": "14e61fec66880d22d95aed19cf7663d8",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 182,
"avg_line_length": 55.354838709677416,
"alnum_prop": 0.32954545454545453,
"repo_name": "sugihartono/ci_event",
"id": "a52bd80f9d62f820eec91d098220efd0cb988db6",
"size": "6864",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/views/template/v_top_menu.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "392"
},
{
"name": "CSS",
"bytes": "165794"
},
{
"name": "HTML",
"bytes": "5709906"
},
{
"name": "JavaScript",
"bytes": "1572029"
},
{
"name": "PHP",
"bytes": "13846917"
},
{
"name": "Perl",
"bytes": "798"
}
]
}
|
#import <Foundation/NSString.h>
// Not exported
@interface NSPathStore2 : NSString
{
unsigned int _lengthAndRefCount;
unsigned short _characters[0];
}
+ (id)pathWithComponents:(id)arg1;
+ (id)pathStoreWithCharacters:(const unsigned short *)arg1 length:(unsigned long long)arg2;
- (id)stringByResolvingSymlinksInPath;
- (id)_stringByResolvingSymlinksInPathUsingCache:(_Bool)arg1;
- (id)stringByStandardizingPath;
- (id)_stringByStandardizingPathUsingCache:(_Bool)arg1;
- (id)stringByExpandingTildeInPath;
- (id)stringByAbbreviatingWithTildeInPath;
- (id)stringByAppendingPathExtension:(id)arg1;
- (id)stringByDeletingPathExtension;
- (id)pathExtension;
- (id)stringByAppendingPathComponent:(id)arg1;
- (id)stringByDeletingLastPathComponent;
- (id)lastPathComponent;
- (_Bool)isAbsolutePath;
- (id)pathComponents;
- (_Bool)isEqualToString:(id)arg1;
- (unsigned long long)hash;
- (id)copyWithZone:(struct _NSZone *)arg1;
- (void)getCharacters:(unsigned short *)arg1 range:(struct _NSRange)arg2;
- (unsigned short)characterAtIndex:(unsigned long long)arg1;
- (unsigned long long)length;
@end
|
{
"content_hash": "30ddb8db7e05e01876aa283e1bd1bf0c",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 91,
"avg_line_length": 30.61111111111111,
"alnum_prop": 0.7749546279491834,
"repo_name": "matthewsot/CocoaSharp",
"id": "2c6c3e6e37c28558ca4787d7dde8a492aebf6b92",
"size": "1242",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Headers/Frameworks/Foundation/NSPathStore2.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "259784"
},
{
"name": "C#",
"bytes": "2789005"
},
{
"name": "C++",
"bytes": "252504"
},
{
"name": "Objective-C",
"bytes": "24301417"
},
{
"name": "Smalltalk",
"bytes": "167909"
}
]
}
|
<?php
namespace AppBundle\Form\DataTransformer;
use AppBundle\Entity\ValueObject\EmailAddress;
use Negotiation\Exception\InvalidArgument;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;
class EmailAddressTransformer implements DataTransformerInterface
{
public function transform($emailAddress)
{
/** @var EmailAddress $emailAddress */
if (null === $emailAddress) {
return '';
}
return $emailAddress->__toString();
}
public function reverseTransform($email)
{
if (!$email) {
return null;
}
try {
return new EmailAddress($email);
} catch (InvalidArgument $e) {
throw new TransformationFailedException();
}
}
}
|
{
"content_hash": "2375fce9de378930b4cb860417b26fe3",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 67,
"avg_line_length": 23.13888888888889,
"alnum_prop": 0.6482593037214885,
"repo_name": "BociucH/symfony-rest",
"id": "cc707412e08c788a5cfba27acf84ab2f73227143",
"size": "833",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/AppBundle/Form/DataTransformer/EmailAddressTransformer.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "4956"
},
{
"name": "PHP",
"bytes": "101455"
}
]
}
|
- Added today extension, today motivation;
- Added sharing icon in motivation card;
|
{
"content_hash": "6fc3644b5bf4bc86bff14e5a322047dd",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 42,
"alnum_prop": 0.7857142857142857,
"repo_name": "zarochintsev/MotivationBox",
"id": "236c62012b69ef3177275af61be686a20b4c99b7",
"size": "108",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CHANGELOG.md",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "794"
},
{
"name": "Swift",
"bytes": "78637"
}
]
}
|
// Autogenerated from vk-api-schema. Please don't edit it manually.
package com.vk.api.sdk.queries.market;
import com.vk.api.sdk.client.AbstractQueryBuilder;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.objects.base.responses.OkResponse;
import java.util.Arrays;
import java.util.List;
/**
* Query for Market.addToAlbum method
*/
public class MarketAddToAlbumQuery extends AbstractQueryBuilder<MarketAddToAlbumQuery, OkResponse> {
/**
* Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
*
* @param client VK API client
* @param actor actor with access token
* @param ownerId value of "owner id" parameter.
* @param itemIds value of "item ids" parameter.
* @param albumIds value of "album ids" parameter.
*/
public MarketAddToAlbumQuery(VkApiClient client, UserActor actor, int ownerId,
Integer[] itemIds, Integer... albumIds) {
super(client, "market.addToAlbum", OkResponse.class);
accessToken(actor.getAccessToken());
ownerId(ownerId);
itemIds(itemIds);
albumIds(albumIds);
}
/**
* Creates a AbstractQueryBuilder instance that can be used to build api request with various parameters
*
* @param client VK API client
* @param actor actor with access token
* @param ownerId value of "owner id" parameter.
* @param itemIds value of "item ids" parameter.
* @param albumIds value of "album ids" parameter.
*/
public MarketAddToAlbumQuery(VkApiClient client, UserActor actor, int ownerId,
List<Integer> itemIds, List<Integer> albumIds) {
super(client, "market.addToAlbum", OkResponse.class);
accessToken(actor.getAccessToken());
ownerId(ownerId);
itemIds(itemIds);
albumIds(albumIds);
}
/**
* ID of an item owner community.
*
* @param value value of "owner id" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
protected MarketAddToAlbumQuery ownerId(int value) {
return unsafeParam("owner_id", value);
}
/**
* item_ids
* Set item ids
*
* @param value value of "item ids" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
protected MarketAddToAlbumQuery itemIds(Integer... value) {
return unsafeParam("item_ids", value);
}
/**
* Set item ids
*
* @param value value of "item ids" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
protected MarketAddToAlbumQuery itemIds(List<Integer> value) {
return unsafeParam("item_ids", value);
}
/**
* album_ids
* Collections IDs to add item to.
*
* @param value value of "album ids" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
protected MarketAddToAlbumQuery albumIds(Integer... value) {
return unsafeParam("album_ids", value);
}
/**
* Collections IDs to add item to.
*
* @param value value of "album ids" parameter.
* @return a reference to this {@code AbstractQueryBuilder} object to fulfill the "Builder" pattern.
*/
protected MarketAddToAlbumQuery albumIds(List<Integer> value) {
return unsafeParam("album_ids", value);
}
@Override
protected MarketAddToAlbumQuery getThis() {
return this;
}
@Override
protected List<String> essentialKeys() {
return Arrays.asList("album_ids", "item_ids", "owner_id", "access_token");
}
}
|
{
"content_hash": "e87169eb140c48fc98577f4a44ce0f29",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 108,
"avg_line_length": 34.223214285714285,
"alnum_prop": 0.6624054265588312,
"repo_name": "VKCOM/vk-java-sdk",
"id": "addc1e0609e44766ec3bfcaef7c27d425185e5eb",
"size": "3833",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sdk/src/main/java/com/vk/api/sdk/queries/market/MarketAddToAlbumQuery.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "5588603"
},
{
"name": "Shell",
"bytes": "431"
}
]
}
|
import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
@Index(
"index_sections_on_activity_id_and_position",
["activityId", "position"],
{}
)
@Index("index_sections_on_position", ["position"], {})
@Entity("sections", { schema: "portal_development" })
export class Sections {
@PrimaryGeneratedColumn({ type: "int", name: "id" })
id: number;
@Column("int", { name: "user_id", nullable: true })
userId: number | null;
@Column("int", { name: "activity_id", nullable: true })
activityId: number | null;
@Column("varchar", { name: "uuid", nullable: true, length: 36 })
uuid: string | null;
@Column("varchar", { name: "name", nullable: true, length: 255 })
name: string | null;
@Column("mediumtext", { name: "description", nullable: true })
description: string | null;
@Column("int", { name: "position", nullable: true })
position: number | null;
@Column("datetime", { name: "created_at" })
createdAt: Date;
@Column("datetime", { name: "updated_at" })
updatedAt: Date;
@Column("tinyint", {
name: "teacher_only",
nullable: true,
width: 1,
default: () => "'0'",
})
teacherOnly: boolean | null;
@Column("varchar", {
name: "publication_status",
nullable: true,
length: 255,
})
publicationStatus: string | null;
}
|
{
"content_hash": "6a5b5a430aa0f385b88c35fc99039baf",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 72,
"avg_line_length": 25.25,
"alnum_prop": 0.6214775323686215,
"repo_name": "concord-consortium/rigse",
"id": "b1fee8e044586b7a323aaf7dd0d2884bafa8f913",
"size": "1313",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "admin-panel/graphql-backend/src/entities/unused/Sections.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3508"
},
{
"name": "Dockerfile",
"bytes": "3214"
},
{
"name": "Gherkin",
"bytes": "117760"
},
{
"name": "HTML",
"bytes": "34770"
},
{
"name": "Haml",
"bytes": "244441"
},
{
"name": "JavaScript",
"bytes": "1216080"
},
{
"name": "PHP",
"bytes": "613"
},
{
"name": "Procfile",
"bytes": "99"
},
{
"name": "Ruby",
"bytes": "2864366"
},
{
"name": "SCSS",
"bytes": "310565"
},
{
"name": "Shell",
"bytes": "8028"
},
{
"name": "TypeScript",
"bytes": "208615"
}
]
}
|
package com.mysql.jdbc;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.Socket;
import java.util.Properties;
/**
* A socket factory used to create sockets connecting through a SOCKS proxy. The socket still supports all the same TCP features as the "standard" socket.
*/
public class SocksProxySocketFactory extends StandardSocketFactory {
public static int SOCKS_DEFAULT_PORT = 1080;
@Override
protected Socket createSocket(Properties props) {
String socksProxyHost = props.getProperty("socksProxyHost");
String socksProxyPortString = props.getProperty("socksProxyPort", String.valueOf(SOCKS_DEFAULT_PORT));
int socksProxyPort = SOCKS_DEFAULT_PORT;
try {
socksProxyPort = Integer.valueOf(socksProxyPortString);
} catch (NumberFormatException ex) {
// ignore. fall back to default
}
return new Socket(new Proxy(Proxy.Type.SOCKS, new InetSocketAddress(socksProxyHost, socksProxyPort)));
}
}
|
{
"content_hash": "182c71cdb60e1a94404f6872320a2a4a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 154,
"avg_line_length": 35.13793103448276,
"alnum_prop": 0.7212953876349362,
"repo_name": "jcafarelli/cloudera-cli-scripts",
"id": "31aa610e79856d78f2e39115d91c33355e141870",
"size": "2109",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "mysql-connector-java-5.1.36/src/com/mysql/jdbc/SocksProxySocketFactory.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "542865"
},
{
"name": "Java",
"bytes": "6290737"
},
{
"name": "Python",
"bytes": "5190"
},
{
"name": "Shell",
"bytes": "5103"
}
]
}
|
package org.gradle.ide.visualstudio.internal;
import org.apache.commons.lang.StringUtils;
import org.gradle.nativebinaries.ExecutableBinary;
import org.gradle.nativebinaries.LibraryBinary;
import org.gradle.nativebinaries.ProjectNativeBinary;
import org.gradle.nativebinaries.SharedLibraryBinary;
import org.gradle.nativebinaries.internal.ProjectNativeBinaryInternal;
import org.gradle.nativebinaries.internal.ProjectNativeComponentInternal;
import java.util.List;
public class VisualStudioProjectMapper {
public ProjectConfigurationNames mapToConfiguration(ProjectNativeBinary nativeBinary) {
String projectName = projectPrefix(nativeBinary) + componentName(nativeBinary) + projectSuffix(nativeBinary);
String configurationName = getConfigurationName(nativeBinary);
return new ProjectConfigurationNames(projectName, configurationName, "Win32");
}
private String getConfigurationName(ProjectNativeBinary nativeBinary) {
List<String> dimensions = ((ProjectNativeBinaryInternal) nativeBinary).getNamingScheme().getVariantDimensions();
if (dimensions.isEmpty()) {
return nativeBinary.getBuildType().getName();
}
return makeName(dimensions);
}
private String projectPrefix(ProjectNativeBinary nativeBinary) {
ProjectNativeComponentInternal component = (ProjectNativeComponentInternal) nativeBinary.getComponent();
String projectPath = component.getProjectPath();
if (":".equals(projectPath)) {
return "";
}
return projectPath.substring(1).replace(":", "_") + "_";
}
private String componentName(ProjectNativeBinary nativeBinary) {
return nativeBinary.getComponent().getName();
}
private String projectSuffix(ProjectNativeBinary nativeBinary) {
return nativeBinary instanceof SharedLibraryBinary ? "Dll"
: nativeBinary instanceof LibraryBinary ? "Lib"
: nativeBinary instanceof ExecutableBinary ? "Exe"
: "";
}
private static String makeName(Iterable<String> components) {
StringBuilder builder = new StringBuilder();
for (String component : components) {
if (component != null && component.length() > 0) {
if (builder.length() == 0) {
builder.append(component);
} else {
builder.append(StringUtils.capitalize(component));
}
}
}
return builder.toString();
}
static class ProjectConfigurationNames {
public final String project;
public final String configuration;
public final String platform;
ProjectConfigurationNames(String project, String configuration, String platform) {
this.project = project;
this.configuration = configuration;
this.platform = platform;
}
}
}
|
{
"content_hash": "1ba28713956ac89582f9050e2cb5d554",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 120,
"avg_line_length": 38.63157894736842,
"alnum_prop": 0.6849455040871935,
"repo_name": "Pushjet/Pushjet-Android",
"id": "6cdd7e5bf097f8869950de1a43d8738714498777",
"size": "3551",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gradle/wrapper/dists/gradle-1.12-all/4ff8jj5a73a7zgj5nnzv1ubq0/gradle-1.12/src/cpp/org/gradle/ide/visualstudio/internal/VisualStudioProjectMapper.java",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Java",
"bytes": "92331"
}
]
}
|
<!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 (version 1.7.0_55) on Fri Jun 20 06:34:21 EDT 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.client.solrj.embedded.EmbeddedSolrServer (Solr 4.9.0 API)</title>
<meta name="date" content="2014-06-20">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.client.solrj.embedded.EmbeddedSolrServer (Solr 4.9.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><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/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html" title="class in org.apache.solr.client.solrj.embedded">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="../../../../../../../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/apache/solr/client/solrj/embedded/class-use/EmbeddedSolrServer.html" target="_top">Frames</a></li>
<li><a href="EmbeddedSolrServer.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.apache.solr.client.solrj.embedded.EmbeddedSolrServer" class="title">Uses of Class<br>org.apache.solr.client.solrj.embedded.EmbeddedSolrServer</h2>
</div>
<div class="classUseContainer">No usage of org.apache.solr.client.solrj.embedded.EmbeddedSolrServer</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/apache/solr/client/solrj/embedded/EmbeddedSolrServer.html" title="class in org.apache.solr.client.solrj.embedded">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="../../../../../../../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/apache/solr/client/solrj/embedded/class-use/EmbeddedSolrServer.html" target="_top">Frames</a></li>
<li><a href="EmbeddedSolrServer.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>
<i>Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
{
"content_hash": "4d268f939df073972638ce7d02687c79",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 175,
"avg_line_length": 38.55725190839695,
"alnum_prop": 0.5975054444664423,
"repo_name": "BibAlex/bhl_rails_4_solr_test",
"id": "2aa8114f60776d8f95bb6224cd675d0ee6fdef72",
"size": "5051",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/solr-core/org/apache/solr/client/solrj/embedded/class-use/EmbeddedSolrServer.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "366"
},
{
"name": "CSS",
"bytes": "129178"
},
{
"name": "Groff",
"bytes": "37749613"
},
{
"name": "HTML",
"bytes": "87581"
},
{
"name": "JavaScript",
"bytes": "1040511"
},
{
"name": "Shell",
"bytes": "8670"
},
{
"name": "XSLT",
"bytes": "149538"
}
]
}
|
End of preview.
No dataset card yet
- Downloads last month
- 4