text stringlengths 2 1.04M | meta dict |
|---|---|
import resolve from 'rollup-plugin-node-resolve';
import { uglify } from 'rollup-plugin-uglify';
import sourcemaps from 'rollup-plugin-sourcemaps';
export default {
input : 'lib/index.js',
// FIXME: need to build UMD bundle properly so ext-types will be included.
external : ["type-r", "type-r/ext-types"],
output : {
file : 'dist/index.js',
format : 'umd',
sourcemap: true,
globals : {
"type-r":"Nested",
"type-r/ext-types": "NestedExtTypes"
}
},
plugins: [
resolve(), //for support of `import X from "directory"` rather than verbose `import X from "directory/index"`
sourcemaps(),
uglify()
],
}; | {
"content_hash": "c7bab147c07a77ac1fcfc1b6f0b7f764",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 117,
"avg_line_length": 29.875,
"alnum_prop": 0.5843793584379359,
"repo_name": "Volicon/Type-R",
"id": "2c922161e3962087cafa09de2e1715ddec6e2b1d",
"size": "717",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "globals/rollup.config.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "872"
},
{
"name": "HTML",
"bytes": "702"
},
{
"name": "JavaScript",
"bytes": "217344"
},
{
"name": "TypeScript",
"bytes": "256589"
}
],
"symlink_target": ""
} |
@implementation SessionSaveController
@synthesize saveSessionTextField = _saveSessionTextField;
@synthesize currentSessionName = _currentSessionName;
- (void)dealloc {
self.currentSessionName = nil;
self.saveSessionTextField = nil;
[super dealloc];
}
- (void)viewWillAppear:(BOOL)animated {
self.saveSessionTextField.text = self.currentSessionName;
[self.saveSessionTextField becomeFirstResponder];
}
#pragma mark - UITextFieldDelegate Methods
- (BOOL)textFieldShouldClear:(UITextField *)textField {
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[self performSegueWithIdentifier:@"UnwindSaveSessionControllerWithDone" sender:self];
return YES;
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
}
@end
| {
"content_hash": "3db75124a59da890a17203854005f4f8",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 89,
"avg_line_length": 21.486486486486488,
"alnum_prop": 0.7622641509433963,
"repo_name": "igvteam/igv-ipad",
"id": "e06b9628d42efa9db53b92af6b199aff07c76793",
"size": "2082",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "IGV/Classes/ViewController/SessionSaveController.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "195156"
},
{
"name": "C++",
"bytes": "10441"
},
{
"name": "Objective-C",
"bytes": "1343301"
}
],
"symlink_target": ""
} |
/* eslint-disable operator-linebreak */
const fetchWithResponceValidation = (url, options) => {
return window.fetch(url, options)
.then(response => {
let code = response.status
if ((code >= 200 && code < 300)
|| code === 400
) {
return Promise.resolve(response.json())
}
let error = new Error(response.statusText || response.status)
error.response = response
return Promise.reject(error)
})
}
export default fetchWithResponceValidation
| {
"content_hash": "62d6db7206777ecb5dd5649c0b9c0a29",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 67,
"avg_line_length": 26.68421052631579,
"alnum_prop": 0.631163708086785,
"repo_name": "cygwin255/SimpleSurvey",
"id": "75bd439d596bc185097ba409cbd9322d84a8d1c2",
"size": "507",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/src/api/fetchWithResponceValidation.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "57820"
},
{
"name": "CSS",
"bytes": "3717"
},
{
"name": "HTML",
"bytes": "1188"
},
{
"name": "JavaScript",
"bytes": "119214"
}
],
"symlink_target": ""
} |
FROM nodesource/sid-base
MAINTAINER William Blankenship <wblankenship@nodesource.com>
RUN curl https://deb.nodesource.com/node/pool/main/n/nodejs/nodejs_0.10.31-1chl1~sid1_amd64.deb > node.deb \
&& dpkg -i node.deb \
&& rm node.deb
RUN npm install -g pangyp\
&& ln -s $(which pangyp) $(dirname $(which pangyp))/node-gyp\
&& npm cache clear\
&& node-gyp configure || echo ""
ENV NODE_ENV production
WORKDIR /usr/src/app
CMD ["npm","start"]
RUN apt-get update \
&& apt-get upgrade -y --force-yes \
&& rm -rf /var/lib/apt/lists/*; | {
"content_hash": "1b6a2d5e2c3b85a1f31f8a115dd266aa",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 108,
"avg_line_length": 28.31578947368421,
"alnum_prop": 0.6895910780669146,
"repo_name": "nodesource/docker-node",
"id": "0c72f93cfd4d6ae993e1e4745a5cc13bd2d6868e",
"size": "538",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "debian/sid/node/0.10.31/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "6919"
},
{
"name": "Makefile",
"bytes": "791"
}
],
"symlink_target": ""
} |
@echo off
setlocal
set SCRIPT_FLAGS=%SCRIPT_FLAGS% --debug --scratch
call ..\make interpreter rlgo main
copy ..\..\lib\scratch-rt\debug\*.rasl ..\..\build\interpreter >NUL
copy ..\..\lib\scratch-rt\debug\*.cpp ..\..\build\interpreter >NUL
endlocal
| {
"content_hash": "e9b190061b4db2eb1d17792d841f08db",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 69,
"avg_line_length": 32.125,
"alnum_prop": 0.6770428015564203,
"repo_name": "Mazdaywik/simple-refal",
"id": "9d49b3d3c0c94494c653fd05bab146e68fd39956",
"size": "257",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/interpreter/make.bat",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "17680"
},
{
"name": "C++",
"bytes": "104481"
},
{
"name": "Shell",
"bytes": "13251"
},
{
"name": "VimL",
"bytes": "1379"
}
],
"symlink_target": ""
} |
import textwrap
import httpretty
from test.unit.helper.test_helper import android_w3c_driver, appium_command, get_httpretty_request_body
class TestWebDriverExecuteDriver(object):
@httpretty.activate
def test_batch(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/execute_driver'),
body='{"value": {"result":['
'{"element-6066-11e4-a52e-4f735466cecf":"39000000-0000-0000-D39A-000000000000",'
'"ELEMENT":"39000000-0000-0000-D39A-000000000000"},'
'{"y":237,"x":18,"width":67,"height":24}],"logs":{'
'"error":[],"warn":["warning message"],"log":[]}}}',
)
script = """
console.warn('warning message');
const element = await driver.findElement('accessibility id', 'Buttons');
const rect = await driver.getElementRect(element.ELEMENT);
return [element, rect];
"""
response = driver.execute_driver(script=textwrap.dedent(script))
# Python client convert an element item as WebElement in the result
assert response.result[0].id == '39000000-0000-0000-D39A-000000000000'
assert response.result[1]['y'] == 237
assert response.logs['warn'] == ['warning message']
d = get_httpretty_request_body(httpretty.last_request())
assert d['script'] == textwrap.dedent(script)
assert d['type'] == 'webdriverio'
assert 'timeout' not in d
@httpretty.activate
def test_batch_with_timeout(self):
driver = android_w3c_driver()
httpretty.register_uri(
httpretty.POST,
appium_command('/session/1234567890/appium/execute_driver'),
body='{"value": {"result":['
'{"element-6066-11e4-a52e-4f735466cecf":"39000000-0000-0000-D39A-000000000000",'
'"ELEMENT":"39000000-0000-0000-D39A-000000000000"},'
'{"y":237,"x":18,"width":67,"height":24}],"logs":{'
'"error":[],"warn":["warning message"],"log":[]}}}',
)
script = """
console.warn('warning message');
const element = await driver.findElement('accessibility id', 'Buttons');
const rect = await driver.getElementRect(element.ELEMENT);
return [element, rect];
"""
response = driver.execute_driver(script=textwrap.dedent(script), timeout_ms=10000)
assert response.result[0].id == '39000000-0000-0000-D39A-000000000000'
assert response.result[1]['y'] == 237
assert response.logs['error'] == []
d = get_httpretty_request_body(httpretty.last_request())
assert d['script'] == textwrap.dedent(script)
assert d['type'] == 'webdriverio'
assert d['timeout'] == 10000
| {
"content_hash": "b3ec666ba2cd44ec36f10c31507110ca",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 103,
"avg_line_length": 43.121212121212125,
"alnum_prop": 0.6004919184820802,
"repo_name": "appium/python-client",
"id": "250b8cc84ec8671ffaa620c6f455f07582cf36ec",
"size": "3414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unit/webdriver/execute_driver_test.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "835"
},
{
"name": "Python",
"bytes": "801497"
},
{
"name": "Shell",
"bytes": "3195"
}
],
"symlink_target": ""
} |
package java.sql;
public interface ResultSetMetaData
extends Wrapper
{
// Fields
public static final int columnNoNulls = 0;
public static final int columnNullable = 1;
public static final int columnNullableUnknown = 2;
// Methods
public boolean isReadOnly(int arg1) throws SQLException;
public int getScale(int arg1) throws SQLException;
public int getColumnCount() throws SQLException;
public java.lang.String getColumnName(int arg1) throws SQLException;
public boolean isWritable(int arg1) throws SQLException;
public int getPrecision(int arg1) throws SQLException;
public java.lang.String getCatalogName(int arg1) throws SQLException;
public java.lang.String getColumnClassName(int arg1) throws SQLException;
public int getColumnDisplaySize(int arg1) throws SQLException;
public java.lang.String getColumnLabel(int arg1) throws SQLException;
public int getColumnType(int arg1) throws SQLException;
public java.lang.String getColumnTypeName(int arg1) throws SQLException;
public java.lang.String getSchemaName(int arg1) throws SQLException;
public java.lang.String getTableName(int arg1) throws SQLException;
public boolean isAutoIncrement(int arg1) throws SQLException;
public boolean isCaseSensitive(int arg1) throws SQLException;
public boolean isCurrency(int arg1) throws SQLException;
public boolean isDefinitelyWritable(int arg1) throws SQLException;
public int isNullable(int arg1) throws SQLException;
public boolean isSearchable(int arg1) throws SQLException;
public boolean isSigned(int arg1) throws SQLException;
}
| {
"content_hash": "35c48c1fb70ce8fe2539db8a827e01be",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 39.775,
"alnum_prop": 0.8032683846637335,
"repo_name": "Orange-OpenSource/matos-profiles",
"id": "a1cf61f53035f81d281db5440b4346da85fb39a2",
"size": "2252",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "matos-android/src/main/java/java/sql/ResultSetMetaData.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "13536133"
}
],
"symlink_target": ""
} |
package lan.dk.podcastserver.utils.facade.stats;
import java.util.Set;
/**
* Created by kevin on 28/04/15 for HackerRank problem
*/
public class StatsPodcastType {
public final String type;
public final Set<NumberOfItemByDateWrapper> values;
public StatsPodcastType(String type, Set<NumberOfItemByDateWrapper> values) {
this.type = type;
this.values = values;
}
public String type() {
return type;
}
public Set<NumberOfItemByDateWrapper> values() {
return values;
}
}
| {
"content_hash": "9e57cd6df3e4420155a92256e05ddf45",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 81,
"avg_line_length": 21.6,
"alnum_prop": 0.6759259259259259,
"repo_name": "radut/Podcast-Server",
"id": "25d9b4e46f03d30fd906afc4b38740d36284eb27",
"size": "540",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/lan/dk/podcastserver/utils/facade/stats/StatsPodcastType.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "19888"
},
{
"name": "HTML",
"bytes": "1183521"
},
{
"name": "Java",
"bytes": "453010"
},
{
"name": "JavaScript",
"bytes": "56501"
}
],
"symlink_target": ""
} |
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Results;
using EMSV.Api;
using EMSV.CLI.CORE.Core;
namespace EMSV.CLI.CORE.Controllers {
public abstract class ControllerBase : ApiController {
private readonly IAdminApi _api;
private readonly ILogManager _log;
public ControllerBase(IAdminApi api, ILogManager log) {
_api = api;
_log = log;
}
protected string RemoteIp => Request.GetOwinContext()?.Request?.RemoteIpAddress;
protected async Task ThrowOnBadKey( string key ) {
if ( !( await _api.Settings.CheckKey( key ).ConfigureAwait( false ) )) {
throw new UnauthorizedAccessException( $"Some faggot from [{RemoteIp}] tried to break into our system" );
}
}
protected override ExceptionResult InternalServerError( Exception exception ) {
_log.Log( exception.Message );
return base.InternalServerError( exception );
}
}
} | {
"content_hash": "3670e9435f4fcd4ec0059bad1d835013",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 121,
"avg_line_length": 29.5,
"alnum_prop": 0.6450094161958568,
"repo_name": "EpicMorg/EpicMorg-Supervisor",
"id": "00268c2afea425c8fd3a148337371141e05d78be",
"size": "1064",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sources/EMSV.CLI.CORE/Controllers/ControllerBase.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "102002"
},
{
"name": "JavaScript",
"bytes": "214014"
}
],
"symlink_target": ""
} |
package org.apache.hyracks.algebricks.core.algebra.operators.physical;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
import org.apache.hyracks.algebricks.common.utils.ListSet;
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.algebricks.core.algebra.base.EquivalenceClass;
import org.apache.hyracks.algebricks.core.algebra.base.ILogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.base.IOptimizationContext;
import org.apache.hyracks.algebricks.core.algebra.base.LogicalVariable;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractBinaryJoinOperator.JoinKind;
import org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractLogicalOperator;
import org.apache.hyracks.algebricks.core.algebra.properties.BroadcastPartitioningProperty;
import org.apache.hyracks.algebricks.core.algebra.properties.ILocalStructuralProperty;
import org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty;
import org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningRequirementsCoordinator;
import org.apache.hyracks.algebricks.core.algebra.properties.IPhysicalPropertiesVector;
import org.apache.hyracks.algebricks.core.algebra.properties.PhysicalRequirements;
import org.apache.hyracks.algebricks.core.algebra.properties.StructuralPropertiesVector;
import org.apache.hyracks.algebricks.core.algebra.properties.UnorderedPartitionedProperty;
public abstract class AbstractHashJoinPOperator extends AbstractJoinPOperator {
protected List<LogicalVariable> keysLeftBranch;
protected List<LogicalVariable> keysRightBranch;
public AbstractHashJoinPOperator(JoinKind kind, JoinPartitioningType partitioningType,
List<LogicalVariable> sideLeftOfEqualities, List<LogicalVariable> sideRightOfEqualities) {
super(kind, partitioningType);
this.keysLeftBranch = sideLeftOfEqualities;
this.keysRightBranch = sideRightOfEqualities;
}
public List<LogicalVariable> getKeysLeftBranch() {
return keysLeftBranch;
}
public List<LogicalVariable> getKeysRightBranch() {
return keysRightBranch;
}
@Override
public void computeDeliveredProperties(ILogicalOperator iop, IOptimizationContext context)
throws AlgebricksException {
IPartitioningProperty pp;
AbstractLogicalOperator op = (AbstractLogicalOperator) iop;
if (op.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.PARTITIONED) {
AbstractLogicalOperator op0 = (AbstractLogicalOperator) op.getInputs().get(0).getValue();
IPhysicalPropertiesVector pv0 = op0.getPhysicalOperator().getDeliveredProperties();
AbstractLogicalOperator op1 = (AbstractLogicalOperator) op.getInputs().get(1).getValue();
IPhysicalPropertiesVector pv1 = op1.getPhysicalOperator().getDeliveredProperties();
if (pv0 == null || pv1 == null) {
pp = null;
} else {
pp = pv0.getPartitioningProperty();
}
} else {
pp = IPartitioningProperty.UNPARTITIONED;
}
this.deliveredProperties = new StructuralPropertiesVector(pp, deliveredLocalProperties(iop, context));
}
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator iop,
IPhysicalPropertiesVector reqdByParent) {
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[2];
// In a cost-based optimizer, we would also try to propagate the
// parent's partitioning requirements.
AbstractLogicalOperator op = (AbstractLogicalOperator) iop;
IPartitioningProperty pp1 = null;
IPartitioningProperty pp2 = null;
if (op.getExecutionMode() == AbstractLogicalOperator.ExecutionMode.PARTITIONED) {
switch (partitioningType) {
case PAIRWISE: {
pp1 = new UnorderedPartitionedProperty(new ListSet<LogicalVariable>(keysLeftBranch), null);
pp2 = new UnorderedPartitionedProperty(new ListSet<LogicalVariable>(keysRightBranch), null);
break;
}
case BROADCAST: {
pp2 = new BroadcastPartitioningProperty(null);
break;
}
default: {
throw new IllegalStateException();
}
}
}
pv[0] = new StructuralPropertiesVector(pp1, null);
pv[1] = new StructuralPropertiesVector(pp2, null);
IPartitioningRequirementsCoordinator prc;
switch (kind) {
case INNER: {
prc = IPartitioningRequirementsCoordinator.EQCLASS_PARTITIONING_COORDINATOR;
break;
}
case LEFT_OUTER: {
prc = new IPartitioningRequirementsCoordinator() {
@Override
public Pair<Boolean, IPartitioningProperty> coordinateRequirements(
IPartitioningProperty requirements, IPartitioningProperty firstDeliveredPartitioning,
ILogicalOperator op, IOptimizationContext context) throws AlgebricksException {
if (firstDeliveredPartitioning != null
&& firstDeliveredPartitioning.getPartitioningType() == requirements
.getPartitioningType()) {
switch (requirements.getPartitioningType()) {
case UNORDERED_PARTITIONED: {
UnorderedPartitionedProperty upp1 = (UnorderedPartitionedProperty) firstDeliveredPartitioning;
Set<LogicalVariable> set1 = upp1.getColumnSet();
UnorderedPartitionedProperty uppreq = (UnorderedPartitionedProperty) requirements;
Set<LogicalVariable> modifuppreq = new ListSet<LogicalVariable>();
Map<LogicalVariable, EquivalenceClass> eqmap = context.getEquivalenceClassMap(op);
Set<LogicalVariable> covered = new ListSet<LogicalVariable>();
for (LogicalVariable r : uppreq.getColumnSet()) {
EquivalenceClass ecSnd = eqmap.get(r);
boolean found = false;
int j = 0;
for (LogicalVariable rvar : keysRightBranch) {
if (rvar == r || ecSnd != null && eqmap.get(rvar) == ecSnd) {
found = true;
break;
}
j++;
}
if (!found) {
throw new IllegalStateException("Did not find a variable equivalent to "
+ r + " among " + keysRightBranch);
}
LogicalVariable v2 = keysLeftBranch.get(j);
EquivalenceClass ecFst = eqmap.get(v2);
for (LogicalVariable vset1 : set1) {
if (vset1 == v2 || ecFst != null && eqmap.get(vset1) == ecFst) {
covered.add(vset1);
modifuppreq.add(r);
break;
}
}
}
if (!covered.equals(set1)) {
throw new AlgebricksException("Could not modify " + requirements
+ " to agree with partitioning property " + firstDeliveredPartitioning
+ " delivered by previous input operator.");
}
UnorderedPartitionedProperty upp2 = new UnorderedPartitionedProperty(modifuppreq,
requirements.getNodeDomain());
return new Pair<Boolean, IPartitioningProperty>(false, upp2);
}
case ORDERED_PARTITIONED: {
throw new NotImplementedException();
}
}
}
return new Pair<Boolean, IPartitioningProperty>(true, requirements);
}
};
break;
}
default: {
throw new IllegalStateException();
}
}
return new PhysicalRequirements(pv, prc);
}
protected abstract List<ILocalStructuralProperty> deliveredLocalProperties(ILogicalOperator op,
IOptimizationContext context) throws AlgebricksException;
}
| {
"content_hash": "49f37c3c3bd9014ce8cfd8013f4dd2a1",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 130,
"avg_line_length": 54.03370786516854,
"alnum_prop": 0.570388854231649,
"repo_name": "tectronics/hyracks",
"id": "afd8ce7c4111dadd9240f6742999cf68e1542071",
"size": "10253",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/AbstractHashJoinPOperator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2606"
},
{
"name": "CSS",
"bytes": "722"
},
{
"name": "HTML",
"bytes": "8070"
},
{
"name": "Java",
"bytes": "8126194"
},
{
"name": "JavaScript",
"bytes": "24354"
},
{
"name": "Shell",
"bytes": "14510"
}
],
"symlink_target": ""
} |
package main
import (
"flag"
"fmt"
"io"
"log"
"math"
"math/rand"
"net/http"
"os"
"os/exec"
"strconv"
"text/template"
"tools/ktop"
)
var homeTempl = template.Must(template.New("plot").Parse(plotTemplate))
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Println("handler:", r.Method, r.URL)
homeTempl.Execute(w, nil)
// fmt.Println("About to execute os.Stdout")
// homeTempl.Execute(os.Stdout, nil)
}
// Load favicon - can create at www.favicon.cc
func favicon(w http.ResponseWriter, r *http.Request) {
icon, err := os.Open("favicon.ico")
if err != nil {
return
}
defer icon.Close()
io.Copy(w, icon)
}
func scriptPlot(w http.ResponseWriter, r *http.Request) {
fmt.Println("scriptPlot:")
if false {
w.Header().Set("ContentType", "text/javascript")
http.ServeFile(w, r, "/usr/local/bin/plot.js")
} else {
js, err := os.Open("plot.js")
if err != nil {
return
}
defer js.Close()
w.Header().Set("ContentType", "text/javascript")
io.Copy(w, js)
}
}
func scriptSmoothie(w http.ResponseWriter, r *http.Request) {
fmt.Println("scriptSmoothie:")
if true {
w.Header().Set("ContentType", "text/javascript")
http.ServeFile(w, r, "smoothie.js")
}
}
func randHandler() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
//fmt.Println("rand:")
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatFloat(rand.Float64(), 'g', 10, 64))
}
}
func fibHandler() func(w http.ResponseWriter, r *http.Request) {
var x, y float64 = 1, 1
return func(w http.ResponseWriter, r *http.Request) {
//fmt.Println("fib:")
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatFloat(x, 'g', 10, 64))
x, y = y, x+y
}
}
func sinHandler() func(w http.ResponseWriter, r *http.Request) {
var x float64
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatFloat(math.Sin(x), 'g', 10, 64))
x += 0.5
}
}
func cosHandler() func(w http.ResponseWriter, r *http.Request) {
var x float64
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatFloat(math.Cos(2*x), 'g', 10, 64))
x += 0.5
}
}
func ktopHandler() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatUint(ktop.NumSysCalls(), 10))
}
}
func get_proc_stat(name string) uint64 {
f, err := os.Open("/proc/stat")
if err != nil {
log.Fatal(err)
}
defer f.Close()
var user, nice, system, idle, iowait, irq, softirqs uint64
_, err = fmt.Fscanf(f, "cpu %d %d %d %d %d %d %d",
&user, &nice, &system, &idle,
&iowait, &irq, &softirqs)
if err != nil {
log.Fatal(err)
}
if false {
fmt.Println(name, user, nice, system, idle, iowait, irq, softirqs)
}
switch name {
case "user":
return user
case "nice":
return nice
case "system":
return system
case "idle":
return idle
case "iowait":
return iowait
case "irq":
return irq
case "softirqs":
return softirqs
default:
fmt.Println("default")
return 0
}
return 0
}
func procStatHandler(name string) func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatUint(get_proc_stat(name), 10))
}
}
func userHandler() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatUint(get_proc_stat(`user`), 10))
}
}
func idleHandler() func(w http.ResponseWriter, r *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("ContentType", "text/html")
io.WriteString(w, strconv.FormatUint(get_proc_stat(`idle`), 10))
}
}
var openport bool
var port string
func init() {
flag.BoolVar(&openport, "openport", false,
"open hole in the firewall for the port")
flag.StringVar(&port, "port", "8080",
"port number to use for collecting plot data")
}
func processFlags() {
flag.Parse()
if openport {
fmt.Printf("$PATH=%s\n", os.Getenv("PATH"))
cmd := "iptables"
args := []string{"-I", "INPUT", "-p", "tcp", "--dport", port, "--syn", "-j", "ACCEPT"}
msg, err := exec.Command(cmd, args...).CombinedOutput()
fmt.Printf("%s", msg)
if err != nil {
log.Fatal(cmd, " ", err)
}
}
}
func main() {
processFlags()
procStat := []string{
"user", "nice", "system", "idle", "iowait", "irq", "softirqs"}
meminfo := []string{
"MemTotal", "MemFree", "Buffers", "Cached", "SwapCached",
"Unevicatable", "AnonPages", "Dirty", "Writeback",
"Dirty+Writeback",
"VmallocTotal", "VmallocUsed"}
http.HandleFunc("/", handler)
http.HandleFunc("/favicon.ico", favicon)
http.HandleFunc("/plot.js", scriptPlot)
http.HandleFunc("/smoothie.js", scriptSmoothie)
http.HandleFunc("/rand", randHandler())
http.HandleFunc("/sin", sinHandler())
http.HandleFunc("/cos", cosHandler())
for _, name := range procStat {
http.HandleFunc("/"+name, procStatHandler(name))
}
for _, name := range meminfo {
http.HandleFunc("/"+name, MeminfoHandler(name))
}
http.HandleFunc("/fib", fibHandler())
http.HandleFunc("/ktop", ktopHandler())
if false {
go ktop.Ktop()
}
if true {
go ReadMeminfo()
}
if true {
fmt.Println("Listen on localhost:" + port)
http.ListenAndServe(":"+port, nil)
} else {
homeTempl.Execute(os.Stdout, nil)
}
}
const plotTemplate = `
<!DOCTYPE html>
<!--
Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Distributed under the terms of the GNU General Public License v2
-->
<html>
<head>
<title>Graph</title>
<meta charset="utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script type="text/javascript"
src="smoothie.js">
</script>
<style type="text/css">
body {
background: green;
color: blue;
}
#main {
position: absolute;
top: 100px;
bottom: 0;
left: 140px;
padding: 10px;
right: 0;
overflow: scroll;
background: white;
color: black;
}
#sidebar {
position: fixed;
top: 0;
bottom: 0;
left: 0;
width: 120px;
padding: 10px;
background: #fee;
}
#ktop {
position: fixed;
top: 400px;
bottom: 0;
left: 0;
width: 120px;
padding: 10px;
background: Azure;
}
</style>
</head>
<body>
<div id="main">
<h2>Plot</h2>
<canvas id="canvas" width="800" height="600">
You need an browser with HTML canvas my friend.
</canvas>
<script src="plot.js"></script>
<p>Log
<pre id="log"></pre>
</div>
<div id="sidebar">
</div>
<!--
<div id="ktop">
</div>
<script src="plot.js"></script>
<script src="/usr/local/bin/plot.js"></script>
<script type="text/javascript"
src="https://raw.github.com/taysom/va/master/src/tour/multi/plot.js">
</script>
-->
</body>
</html>
`
| {
"content_hash": "3cd64a00681b74e3ff2a0b0122b17eeb",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 88,
"avg_line_length": 24.102649006622517,
"alnum_prop": 0.6275587305948619,
"repo_name": "taysom/va",
"id": "f1027d28dec240dd1a8e73f1f29222bff55cfd7b",
"size": "7511",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/tour/multi/main.go",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Awk",
"bytes": "339"
},
{
"name": "C",
"bytes": "331"
},
{
"name": "C++",
"bytes": "10421"
},
{
"name": "CSS",
"bytes": "6601"
},
{
"name": "Go",
"bytes": "653336"
},
{
"name": "HTML",
"bytes": "28694"
},
{
"name": "JavaScript",
"bytes": "178942"
},
{
"name": "Makefile",
"bytes": "107"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "2525609e20bc7e66d65866f78354f73c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "e70922f907033be9df148e456e88419acfd727ee",
"size": "191",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Phyllostachys/Phyllostachys stimulosa/ Syn. Phyllostachys stimulosa unifoliata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
Pagaea poeppigii Griseb.
### Remarks
null | {
"content_hash": "6e731f784139d2b397ef4b1e3d3baaba",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 11.23076923076923,
"alnum_prop": 0.726027397260274,
"repo_name": "mdoering/backbone",
"id": "20ca08f405be2a32c8efdd4dca518d13e7c55da8",
"size": "213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Gentianaceae/Irlbachia/Irlbachia poeppigii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
kid_readout.analysis package
============================
Subpackages
-----------
.. toctree::
kid_readout.analysis.physics
kid_readout.analysis.resonator
kid_readout.analysis.resources
kid_readout.analysis.tests
kid_readout.analysis.timedomain
Submodules
----------
kid_readout.analysis.archive module
-----------------------------------
.. automodule:: kid_readout.analysis.archive
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.dataframe module
-------------------------------------
.. automodule:: kid_readout.analysis.dataframe
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.fitter module
----------------------------------
.. automodule:: kid_readout.analysis.fitter
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.kid_response module
----------------------------------------
.. automodule:: kid_readout.analysis.kid_response
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.lmfit_fitter module
----------------------------------------
.. automodule:: kid_readout.analysis.lmfit_fitter
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.mcfit module
---------------------------------
.. automodule:: kid_readout.analysis.mcfit
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.noise_measurement module
---------------------------------------------
.. automodule:: kid_readout.analysis.noise_measurement
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.plot_dataframe module
------------------------------------------
.. automodule:: kid_readout.analysis.plot_dataframe
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.plot_wafer module
--------------------------------------
.. automodule:: kid_readout.analysis.plot_wafer
:members:
:undoc-members:
:show-inheritance:
kid_readout.analysis.process_mmw_response module
------------------------------------------------
.. automodule:: kid_readout.analysis.process_mmw_response
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: kid_readout.analysis
:members:
:undoc-members:
:show-inheritance:
| {
"content_hash": "9b735b27cf18fd3254a653b41488f123",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 57,
"avg_line_length": 21.961904761904762,
"alnum_prop": 0.5763226366001735,
"repo_name": "ColumbiaCMB/kid_readout",
"id": "131f143c21db87c8ae9077995e7251dba39421c6",
"size": "2306",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/kid_readout.analysis.rst",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "13672"
},
{
"name": "Python",
"bytes": "2033932"
}
],
"symlink_target": ""
} |
/*
To get this list of colors inject jQuery at http://www.google.com/design/spec/style/color.html#color-color-palette
Then, run this script to get the list.
(function() {
var colors = {}, main = {};
$(".color-group").each(function() {
var color = $(this).find(".name").text().trim().toLowerCase().replace(" ", "-");
colors[color] = {};
$(this).find(".color").not(".main-color").each(function() {
var shade = $(this).find(".shade").text().trim(),
hex = $(this).find(".hex").text().trim();
colors[color][shade] = hex;
});
main[color] = color + "-" + $(this).find(".main-color .shade").text().trim();
});
var LESS = "";
$.each(colors, function(name, shades) {
LESS += "\n\n";
$.each(shades, function(shade, hex) {
LESS += "@" + name + "-" + shade + ": " + hex + ";\n";
});
if (main[name]) {
LESS += "@" + name + ": " + main[name] + ";\n";
}
});
console.log(LESS);
})();
*/
/* ANIMATION */
/* SHADOWS */
/* Shadows (from mdl http://www.getmdl.io/) */
body {
background-color: #EEEEEE;
}
body.inverse {
background: #333333;
}
body.inverse,
body.inverse .form-control {
color: rgba(255,255,255, 0.84);
}
body.inverse .modal,
body.inverse .panel-default,
body.inverse .card,
body.inverse .modal .form-control,
body.inverse .panel-default .form-control,
body.inverse .card .form-control {
background-color: initial;
color: initial;
}
body,
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4 {
font-family: 'Roboto', 'Helvetica', 'Arial', sans-serif;
font-weight: 300;
}
h5,
h6 {
font-weight: 400;
}
a,
a:hover,
a:focus {
color: #841212;
}
a .material-icons,
a:hover .material-icons,
a:focus .material-icons {
vertical-align: middle;
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 0;
}
.form-horizontal .radio {
margin-bottom: 10px;
}
.form-horizontal label {
text-align: right;
}
.form-horizontal label.control-label {
margin: 0;
}
body .container .well.well-sm,
body .container-fluid .well.well-sm {
padding: 10px;
}
body .container .well.well-lg,
body .container-fluid .well.well-lg {
padding: 26px;
}
body .container .well,
body .container-fluid .well,
body .container .jumbotron,
body .container-fluid .jumbotron {
background-color: #fff;
padding: 19px;
margin-bottom: 20px;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 2px;
border: 0;
}
body .container .well p,
body .container-fluid .well p,
body .container .jumbotron p,
body .container-fluid .jumbotron p {
font-weight: 300;
}
body .container .well,
body .container-fluid .well,
body .container .jumbotron,
body .container-fluid .jumbotron,
body .container .well-default,
body .container-fluid .well-default,
body .container .jumbotron-default,
body .container-fluid .jumbotron-default {
background-color: #ffffff;
}
body .container .well-inverse,
body .container-fluid .well-inverse,
body .container .jumbotron-inverse,
body .container-fluid .jumbotron-inverse {
background-color: #3f51b5;
}
body .container .well-primary,
body .container-fluid .well-primary,
body .container .jumbotron-primary,
body .container-fluid .jumbotron-primary {
background-color: #841212;
}
body .container .well-success,
body .container-fluid .well-success,
body .container .jumbotron-success,
body .container-fluid .jumbotron-success {
background-color: #4caf50;
}
body .container .well-info,
body .container-fluid .well-info,
body .container .jumbotron-info,
body .container-fluid .jumbotron-info {
background-color: #03a9f4;
}
body .container .well-warning,
body .container-fluid .well-warning,
body .container .jumbotron-warning,
body .container-fluid .jumbotron-warning {
background-color: #ff5722;
}
body .container .well-danger,
body .container-fluid .well-danger,
body .container .jumbotron-danger,
body .container-fluid .jumbotron-danger {
background-color: #f44336;
}
.btn,
.input-group-btn .btn {
border: none;
border-radius: 2px;
position: relative;
padding: 8px 30px;
margin: 10px 1px;
font-size: 14px;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0;
will-change: box-shadow, transform;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 1, 1), background-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
outline: none;
cursor: pointer;
text-decoration: none;
background: transparent;
}
.btn::-moz-focus-inner,
.input-group-btn .btn::-moz-focus-inner {
border: 0;
}
.btn:not(.btn-raised),
.input-group-btn .btn:not(.btn-raised) {
box-shadow: none;
}
.btn:not(.btn-raised),
.input-group-btn .btn:not(.btn-raised),
.btn:not(.btn-raised).btn-default,
.input-group-btn .btn:not(.btn-raised).btn-default {
color: rgba(0,0,0, 0.87);
}
.btn:not(.btn-raised).btn-inverse,
.input-group-btn .btn:not(.btn-raised).btn-inverse {
color: #3f51b5;
}
.btn:not(.btn-raised).btn-primary,
.input-group-btn .btn:not(.btn-raised).btn-primary {
color: #841212;
}
.btn:not(.btn-raised).btn-success,
.input-group-btn .btn:not(.btn-raised).btn-success {
color: #4caf50;
}
.btn:not(.btn-raised).btn-info,
.input-group-btn .btn:not(.btn-raised).btn-info {
color: #03a9f4;
}
.btn:not(.btn-raised).btn-warning,
.input-group-btn .btn:not(.btn-raised).btn-warning {
color: #ff5722;
}
.btn:not(.btn-raised).btn-danger,
.input-group-btn .btn:not(.btn-raised).btn-danger {
color: #f44336;
}
.btn:not(.btn-raised):not(.btn-link):hover,
.input-group-btn .btn:not(.btn-raised):not(.btn-link):hover,
.btn:not(.btn-raised):not(.btn-link):focus,
.input-group-btn .btn:not(.btn-raised):not(.btn-link):focus {
background-color: rgba(153, 153, 153, 0.2);
}
.theme-dark .btn:not(.btn-raised):not(.btn-link):hover,
.theme-dark .input-group-btn .btn:not(.btn-raised):not(.btn-link):hover,
.theme-dark .btn:not(.btn-raised):not(.btn-link):focus,
.theme-dark .input-group-btn .btn:not(.btn-raised):not(.btn-link):focus {
background-color: rgba(204, 204, 204, 0.15);
}
.btn.btn-raised,
.input-group-btn .btn.btn-raised,
.btn.btn-fab,
.input-group-btn .btn.btn-fab,
.btn-group-raised .btn,
.btn-group-raised .input-group-btn .btn,
.btn.btn-raised.btn-default,
.input-group-btn .btn.btn-raised.btn-default,
.btn.btn-fab.btn-default,
.input-group-btn .btn.btn-fab.btn-default,
.btn-group-raised .btn.btn-default,
.btn-group-raised .input-group-btn .btn.btn-default {
background-color: #EEEEEE;
color: rgba(0,0,0, 0.87);
}
.btn.btn-raised.btn-inverse,
.input-group-btn .btn.btn-raised.btn-inverse,
.btn.btn-fab.btn-inverse,
.input-group-btn .btn.btn-fab.btn-inverse,
.btn-group-raised .btn.btn-inverse,
.btn-group-raised .input-group-btn .btn.btn-inverse {
background-color: #3f51b5;
color: #ffffff;
}
.btn.btn-raised.btn-primary,
.input-group-btn .btn.btn-raised.btn-primary,
.btn.btn-fab.btn-primary,
.input-group-btn .btn.btn-fab.btn-primary,
.btn-group-raised .btn.btn-primary,
.btn-group-raised .input-group-btn .btn.btn-primary {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.btn.btn-raised.btn-success,
.input-group-btn .btn.btn-raised.btn-success,
.btn.btn-fab.btn-success,
.input-group-btn .btn.btn-fab.btn-success,
.btn-group-raised .btn.btn-success,
.btn-group-raised .input-group-btn .btn.btn-success {
background-color: #4caf50;
color: rgba(255,255,255, 0.84);
}
.btn.btn-raised.btn-info,
.input-group-btn .btn.btn-raised.btn-info,
.btn.btn-fab.btn-info,
.input-group-btn .btn.btn-fab.btn-info,
.btn-group-raised .btn.btn-info,
.btn-group-raised .input-group-btn .btn.btn-info {
background-color: #03a9f4;
color: rgba(255,255,255, 0.84);
}
.btn.btn-raised.btn-warning,
.input-group-btn .btn.btn-raised.btn-warning,
.btn.btn-fab.btn-warning,
.input-group-btn .btn.btn-fab.btn-warning,
.btn-group-raised .btn.btn-warning,
.btn-group-raised .input-group-btn .btn.btn-warning {
background-color: #ff5722;
color: rgba(255,255,255, 0.84);
}
.btn.btn-raised.btn-danger,
.input-group-btn .btn.btn-raised.btn-danger,
.btn.btn-fab.btn-danger,
.input-group-btn .btn.btn-fab.btn-danger,
.btn-group-raised .btn.btn-danger,
.btn-group-raised .input-group-btn .btn.btn-danger {
background-color: #f44336;
color: rgba(255,255,255, 0.84);
}
.btn.btn-raised:not(.btn-link),
.input-group-btn .btn.btn-raised:not(.btn-link),
.btn-group-raised .btn:not(.btn-link),
.btn-group-raised .input-group-btn .btn:not(.btn-link) {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
.btn.btn-raised:not(.btn-link):hover,
.input-group-btn .btn.btn-raised:not(.btn-link):hover,
.btn-group-raised .btn:not(.btn-link):hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover,
.btn.btn-raised:not(.btn-link):focus,
.input-group-btn .btn.btn-raised:not(.btn-link):focus,
.btn-group-raised .btn:not(.btn-link):focus,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus,
.btn.btn-raised:not(.btn-link).active,
.input-group-btn .btn.btn-raised:not(.btn-link).active,
.btn-group-raised .btn:not(.btn-link).active,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active,
.btn.btn-raised:not(.btn-link):active,
.input-group-btn .btn.btn-raised:not(.btn-link):active,
.btn-group-raised .btn:not(.btn-link):active,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active,
.btn.btn-raised:not(.btn-link):hover.btn-default,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-default,
.btn-group-raised .btn:not(.btn-link):hover.btn-default,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-default,
.btn.btn-raised:not(.btn-link):focus.btn-default,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-default,
.btn-group-raised .btn:not(.btn-link):focus.btn-default,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-default,
.btn.btn-raised:not(.btn-link).active.btn-default,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-default,
.btn-group-raised .btn:not(.btn-link).active.btn-default,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-default,
.btn.btn-raised:not(.btn-link):active.btn-default,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-default,
.btn-group-raised .btn:not(.btn-link):active.btn-default,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-default {
background-color: #e4e4e4;
}
.btn.btn-raised:not(.btn-link):hover.btn-inverse,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-inverse,
.btn-group-raised .btn:not(.btn-link):hover.btn-inverse,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-inverse,
.btn.btn-raised:not(.btn-link):focus.btn-inverse,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-inverse,
.btn-group-raised .btn:not(.btn-link):focus.btn-inverse,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-inverse,
.btn.btn-raised:not(.btn-link).active.btn-inverse,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-inverse,
.btn-group-raised .btn:not(.btn-link).active.btn-inverse,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-inverse,
.btn.btn-raised:not(.btn-link):active.btn-inverse,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-inverse,
.btn-group-raised .btn:not(.btn-link):active.btn-inverse,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-inverse {
background-color: #495bc0;
}
.btn.btn-raised:not(.btn-link):hover.btn-primary,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-primary,
.btn-group-raised .btn:not(.btn-link):hover.btn-primary,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-primary,
.btn.btn-raised:not(.btn-link):focus.btn-primary,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-primary,
.btn-group-raised .btn:not(.btn-link):focus.btn-primary,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-primary,
.btn.btn-raised:not(.btn-link).active.btn-primary,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-primary,
.btn-group-raised .btn:not(.btn-link).active.btn-primary,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-primary,
.btn.btn-raised:not(.btn-link):active.btn-primary,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-primary,
.btn-group-raised .btn:not(.btn-link):active.btn-primary,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-primary {
background-color: #961414;
}
.btn.btn-raised:not(.btn-link):hover.btn-success,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-success,
.btn-group-raised .btn:not(.btn-link):hover.btn-success,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-success,
.btn.btn-raised:not(.btn-link):focus.btn-success,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-success,
.btn-group-raised .btn:not(.btn-link):focus.btn-success,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-success,
.btn.btn-raised:not(.btn-link).active.btn-success,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-success,
.btn-group-raised .btn:not(.btn-link).active.btn-success,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-success,
.btn.btn-raised:not(.btn-link):active.btn-success,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-success,
.btn-group-raised .btn:not(.btn-link):active.btn-success,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-success {
background-color: #59b75c;
}
.btn.btn-raised:not(.btn-link):hover.btn-info,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-info,
.btn-group-raised .btn:not(.btn-link):hover.btn-info,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-info,
.btn.btn-raised:not(.btn-link):focus.btn-info,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-info,
.btn-group-raised .btn:not(.btn-link):focus.btn-info,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-info,
.btn.btn-raised:not(.btn-link).active.btn-info,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-info,
.btn-group-raised .btn:not(.btn-link).active.btn-info,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-info,
.btn.btn-raised:not(.btn-link):active.btn-info,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-info,
.btn-group-raised .btn:not(.btn-link):active.btn-info,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-info {
background-color: #0fb2fc;
}
.btn.btn-raised:not(.btn-link):hover.btn-warning,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-warning,
.btn-group-raised .btn:not(.btn-link):hover.btn-warning,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-warning,
.btn.btn-raised:not(.btn-link):focus.btn-warning,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-warning,
.btn-group-raised .btn:not(.btn-link):focus.btn-warning,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-warning,
.btn.btn-raised:not(.btn-link).active.btn-warning,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-warning,
.btn-group-raised .btn:not(.btn-link).active.btn-warning,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-warning,
.btn.btn-raised:not(.btn-link):active.btn-warning,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-warning,
.btn-group-raised .btn:not(.btn-link):active.btn-warning,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-warning {
background-color: #ff6736;
}
.btn.btn-raised:not(.btn-link):hover.btn-danger,
.input-group-btn .btn.btn-raised:not(.btn-link):hover.btn-danger,
.btn-group-raised .btn:not(.btn-link):hover.btn-danger,
.btn-group-raised .input-group-btn .btn:not(.btn-link):hover.btn-danger,
.btn.btn-raised:not(.btn-link):focus.btn-danger,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.btn-danger,
.btn-group-raised .btn:not(.btn-link):focus.btn-danger,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.btn-danger,
.btn.btn-raised:not(.btn-link).active.btn-danger,
.input-group-btn .btn.btn-raised:not(.btn-link).active.btn-danger,
.btn-group-raised .btn:not(.btn-link).active.btn-danger,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active.btn-danger,
.btn.btn-raised:not(.btn-link):active.btn-danger,
.input-group-btn .btn.btn-raised:not(.btn-link):active.btn-danger,
.btn-group-raised .btn:not(.btn-link):active.btn-danger,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active.btn-danger {
background-color: #f55549;
}
.btn.btn-raised:not(.btn-link).active,
.input-group-btn .btn.btn-raised:not(.btn-link).active,
.btn-group-raised .btn:not(.btn-link).active,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active,
.btn.btn-raised:not(.btn-link):active,
.input-group-btn .btn.btn-raised:not(.btn-link):active,
.btn-group-raised .btn:not(.btn-link):active,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active,
.btn.btn-raised:not(.btn-link).active:hover,
.input-group-btn .btn.btn-raised:not(.btn-link).active:hover,
.btn-group-raised .btn:not(.btn-link).active:hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link).active:hover,
.btn.btn-raised:not(.btn-link):active:hover,
.input-group-btn .btn.btn-raised:not(.btn-link):active:hover,
.btn-group-raised .btn:not(.btn-link):active:hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link):active:hover {
box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}
.btn.btn-raised:not(.btn-link):focus,
.input-group-btn .btn.btn-raised:not(.btn-link):focus,
.btn-group-raised .btn:not(.btn-link):focus,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus,
.btn.btn-raised:not(.btn-link):focus.active,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.active,
.btn-group-raised .btn:not(.btn-link):focus.active,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.active,
.btn.btn-raised:not(.btn-link):focus:active,
.input-group-btn .btn.btn-raised:not(.btn-link):focus:active,
.btn-group-raised .btn:not(.btn-link):focus:active,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus:active,
.btn.btn-raised:not(.btn-link):focus:hover,
.input-group-btn .btn.btn-raised:not(.btn-link):focus:hover,
.btn-group-raised .btn:not(.btn-link):focus:hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus:hover,
.btn.btn-raised:not(.btn-link):focus.active:hover,
.input-group-btn .btn.btn-raised:not(.btn-link):focus.active:hover,
.btn-group-raised .btn:not(.btn-link):focus.active:hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus.active:hover,
.btn.btn-raised:not(.btn-link):focus:active:hover,
.input-group-btn .btn.btn-raised:not(.btn-link):focus:active:hover,
.btn-group-raised .btn:not(.btn-link):focus:active:hover,
.btn-group-raised .input-group-btn .btn:not(.btn-link):focus:active:hover {
box-shadow: 0 0 8px rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.36);
}
.btn.btn-fab,
.input-group-btn .btn.btn-fab {
border-radius: 50%;
font-size: 24px;
height: 56px;
margin: auto;
min-width: 56px;
width: 56px;
padding: 0;
overflow: hidden;
box-shadow: 0 1px 1.5px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24);
position: relative;
line-height: normal;
}
.btn.btn-fab .ripple-container,
.input-group-btn .btn.btn-fab .ripple-container {
border-radius: 50%;
}
.btn.btn-fab.btn-fab-mini,
.input-group-btn .btn.btn-fab.btn-fab-mini,
.btn-group-sm .btn.btn-fab,
.btn-group-sm .input-group-btn .btn.btn-fab {
height: 40px;
min-width: 40px;
width: 40px;
}
.btn.btn-fab.btn-fab-mini.material-icons,
.input-group-btn .btn.btn-fab.btn-fab-mini.material-icons,
.btn-group-sm .btn.btn-fab.material-icons,
.btn-group-sm .input-group-btn .btn.btn-fab.material-icons {
top: 0px;
left: 0px;
}
.btn.btn-fab i.material-icons,
.input-group-btn .btn.btn-fab i.material-icons {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-12px, -12px);
line-height: 24px;
width: 24px;
}
.btn i.material-icons,
.input-group-btn .btn i.material-icons {
vertical-align: middle;
}
.btn.btn-lg,
.input-group-btn .btn.btn-lg,
.btn-group-lg .btn,
.btn-group-lg .input-group-btn .btn {
font-size: 16px;
}
.btn.btn-sm,
.input-group-btn .btn.btn-sm,
.btn-group-sm .btn,
.btn-group-sm .input-group-btn .btn {
padding: 5px 20px;
font-size: 12px;
}
.btn.btn-xs,
.input-group-btn .btn.btn-xs,
.btn-group-xs .btn,
.btn-group-xs .input-group-btn .btn {
padding: 4px 15px;
font-size: 10px;
}
fieldset[disabled][disabled] .btn,
fieldset[disabled][disabled] .input-group-btn .btn,
fieldset[disabled][disabled] .btn-group,
fieldset[disabled][disabled] .btn-group-vertical,
.btn.disabled,
.input-group-btn .btn.disabled,
.btn-group.disabled,
.btn-group-vertical.disabled,
.btn:disabled,
.input-group-btn .btn:disabled,
.btn-group:disabled,
.btn-group-vertical:disabled,
.btn[disabled][disabled],
.input-group-btn .btn[disabled][disabled],
.btn-group[disabled][disabled],
.btn-group-vertical[disabled][disabled] {
color: rgba(0, 0, 0, 0.26);
background: transparent;
}
.theme-dark fieldset[disabled][disabled] .btn,
.theme-dark fieldset[disabled][disabled] .input-group-btn .btn,
.theme-dark fieldset[disabled][disabled] .btn-group,
.theme-dark fieldset[disabled][disabled] .btn-group-vertical,
.theme-dark .btn.disabled,
.theme-dark .input-group-btn .btn.disabled,
.theme-dark .btn-group.disabled,
.theme-dark .btn-group-vertical.disabled,
.theme-dark .btn:disabled,
.theme-dark .input-group-btn .btn:disabled,
.theme-dark .btn-group:disabled,
.theme-dark .btn-group-vertical:disabled,
.theme-dark .btn[disabled][disabled],
.theme-dark .input-group-btn .btn[disabled][disabled],
.theme-dark .btn-group[disabled][disabled],
.theme-dark .btn-group-vertical[disabled][disabled] {
color: rgba(255, 255, 255, 0.3);
}
fieldset[disabled][disabled] .btn.btn-raised,
fieldset[disabled][disabled] .input-group-btn .btn.btn-raised,
fieldset[disabled][disabled] .btn-group.btn-raised,
fieldset[disabled][disabled] .btn-group-vertical.btn-raised,
.btn.disabled.btn-raised,
.input-group-btn .btn.disabled.btn-raised,
.btn-group.disabled.btn-raised,
.btn-group-vertical.disabled.btn-raised,
.btn:disabled.btn-raised,
.input-group-btn .btn:disabled.btn-raised,
.btn-group:disabled.btn-raised,
.btn-group-vertical:disabled.btn-raised,
.btn[disabled][disabled].btn-raised,
.input-group-btn .btn[disabled][disabled].btn-raised,
.btn-group[disabled][disabled].btn-raised,
.btn-group-vertical[disabled][disabled].btn-raised,
fieldset[disabled][disabled] .btn.btn-group-raised,
fieldset[disabled][disabled] .input-group-btn .btn.btn-group-raised,
fieldset[disabled][disabled] .btn-group.btn-group-raised,
fieldset[disabled][disabled] .btn-group-vertical.btn-group-raised,
.btn.disabled.btn-group-raised,
.input-group-btn .btn.disabled.btn-group-raised,
.btn-group.disabled.btn-group-raised,
.btn-group-vertical.disabled.btn-group-raised,
.btn:disabled.btn-group-raised,
.input-group-btn .btn:disabled.btn-group-raised,
.btn-group:disabled.btn-group-raised,
.btn-group-vertical:disabled.btn-group-raised,
.btn[disabled][disabled].btn-group-raised,
.input-group-btn .btn[disabled][disabled].btn-group-raised,
.btn-group[disabled][disabled].btn-group-raised,
.btn-group-vertical[disabled][disabled].btn-group-raised,
fieldset[disabled][disabled] .btn.btn-raised.active,
fieldset[disabled][disabled] .input-group-btn .btn.btn-raised.active,
fieldset[disabled][disabled] .btn-group.btn-raised.active,
fieldset[disabled][disabled] .btn-group-vertical.btn-raised.active,
.btn.disabled.btn-raised.active,
.input-group-btn .btn.disabled.btn-raised.active,
.btn-group.disabled.btn-raised.active,
.btn-group-vertical.disabled.btn-raised.active,
.btn:disabled.btn-raised.active,
.input-group-btn .btn:disabled.btn-raised.active,
.btn-group:disabled.btn-raised.active,
.btn-group-vertical:disabled.btn-raised.active,
.btn[disabled][disabled].btn-raised.active,
.input-group-btn .btn[disabled][disabled].btn-raised.active,
.btn-group[disabled][disabled].btn-raised.active,
.btn-group-vertical[disabled][disabled].btn-raised.active,
fieldset[disabled][disabled] .btn.btn-group-raised.active,
fieldset[disabled][disabled] .input-group-btn .btn.btn-group-raised.active,
fieldset[disabled][disabled] .btn-group.btn-group-raised.active,
fieldset[disabled][disabled] .btn-group-vertical.btn-group-raised.active,
.btn.disabled.btn-group-raised.active,
.input-group-btn .btn.disabled.btn-group-raised.active,
.btn-group.disabled.btn-group-raised.active,
.btn-group-vertical.disabled.btn-group-raised.active,
.btn:disabled.btn-group-raised.active,
.input-group-btn .btn:disabled.btn-group-raised.active,
.btn-group:disabled.btn-group-raised.active,
.btn-group-vertical:disabled.btn-group-raised.active,
.btn[disabled][disabled].btn-group-raised.active,
.input-group-btn .btn[disabled][disabled].btn-group-raised.active,
.btn-group[disabled][disabled].btn-group-raised.active,
.btn-group-vertical[disabled][disabled].btn-group-raised.active,
fieldset[disabled][disabled] .btn.btn-raised:active,
fieldset[disabled][disabled] .input-group-btn .btn.btn-raised:active,
fieldset[disabled][disabled] .btn-group.btn-raised:active,
fieldset[disabled][disabled] .btn-group-vertical.btn-raised:active,
.btn.disabled.btn-raised:active,
.input-group-btn .btn.disabled.btn-raised:active,
.btn-group.disabled.btn-raised:active,
.btn-group-vertical.disabled.btn-raised:active,
.btn:disabled.btn-raised:active,
.input-group-btn .btn:disabled.btn-raised:active,
.btn-group:disabled.btn-raised:active,
.btn-group-vertical:disabled.btn-raised:active,
.btn[disabled][disabled].btn-raised:active,
.input-group-btn .btn[disabled][disabled].btn-raised:active,
.btn-group[disabled][disabled].btn-raised:active,
.btn-group-vertical[disabled][disabled].btn-raised:active,
fieldset[disabled][disabled] .btn.btn-group-raised:active,
fieldset[disabled][disabled] .input-group-btn .btn.btn-group-raised:active,
fieldset[disabled][disabled] .btn-group.btn-group-raised:active,
fieldset[disabled][disabled] .btn-group-vertical.btn-group-raised:active,
.btn.disabled.btn-group-raised:active,
.input-group-btn .btn.disabled.btn-group-raised:active,
.btn-group.disabled.btn-group-raised:active,
.btn-group-vertical.disabled.btn-group-raised:active,
.btn:disabled.btn-group-raised:active,
.input-group-btn .btn:disabled.btn-group-raised:active,
.btn-group:disabled.btn-group-raised:active,
.btn-group-vertical:disabled.btn-group-raised:active,
.btn[disabled][disabled].btn-group-raised:active,
.input-group-btn .btn[disabled][disabled].btn-group-raised:active,
.btn-group[disabled][disabled].btn-group-raised:active,
.btn-group-vertical[disabled][disabled].btn-group-raised:active,
fieldset[disabled][disabled] .btn.btn-raised:focus:not(:active),
fieldset[disabled][disabled] .input-group-btn .btn.btn-raised:focus:not(:active),
fieldset[disabled][disabled] .btn-group.btn-raised:focus:not(:active),
fieldset[disabled][disabled] .btn-group-vertical.btn-raised:focus:not(:active),
.btn.disabled.btn-raised:focus:not(:active),
.input-group-btn .btn.disabled.btn-raised:focus:not(:active),
.btn-group.disabled.btn-raised:focus:not(:active),
.btn-group-vertical.disabled.btn-raised:focus:not(:active),
.btn:disabled.btn-raised:focus:not(:active),
.input-group-btn .btn:disabled.btn-raised:focus:not(:active),
.btn-group:disabled.btn-raised:focus:not(:active),
.btn-group-vertical:disabled.btn-raised:focus:not(:active),
.btn[disabled][disabled].btn-raised:focus:not(:active),
.input-group-btn .btn[disabled][disabled].btn-raised:focus:not(:active),
.btn-group[disabled][disabled].btn-raised:focus:not(:active),
.btn-group-vertical[disabled][disabled].btn-raised:focus:not(:active),
fieldset[disabled][disabled] .btn.btn-group-raised:focus:not(:active),
fieldset[disabled][disabled] .input-group-btn .btn.btn-group-raised:focus:not(:active),
fieldset[disabled][disabled] .btn-group.btn-group-raised:focus:not(:active),
fieldset[disabled][disabled] .btn-group-vertical.btn-group-raised:focus:not(:active),
.btn.disabled.btn-group-raised:focus:not(:active),
.input-group-btn .btn.disabled.btn-group-raised:focus:not(:active),
.btn-group.disabled.btn-group-raised:focus:not(:active),
.btn-group-vertical.disabled.btn-group-raised:focus:not(:active),
.btn:disabled.btn-group-raised:focus:not(:active),
.input-group-btn .btn:disabled.btn-group-raised:focus:not(:active),
.btn-group:disabled.btn-group-raised:focus:not(:active),
.btn-group-vertical:disabled.btn-group-raised:focus:not(:active),
.btn[disabled][disabled].btn-group-raised:focus:not(:active),
.input-group-btn .btn[disabled][disabled].btn-group-raised:focus:not(:active),
.btn-group[disabled][disabled].btn-group-raised:focus:not(:active),
.btn-group-vertical[disabled][disabled].btn-group-raised:focus:not(:active) {
box-shadow: none;
}
.btn-group,
.btn-group-vertical {
position: relative;
margin: 10px 1px;
}
.btn-group.open > .dropdown-toggle.btn,
.btn-group-vertical.open > .dropdown-toggle.btn,
.btn-group.open > .dropdown-toggle.btn.btn-default,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-default {
background-color: #EEEEEE;
}
.btn-group.open > .dropdown-toggle.btn.btn-inverse,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-inverse {
background-color: #3f51b5;
}
.btn-group.open > .dropdown-toggle.btn.btn-primary,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-primary {
background-color: #841212;
}
.btn-group.open > .dropdown-toggle.btn.btn-success,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-success {
background-color: #4caf50;
}
.btn-group.open > .dropdown-toggle.btn.btn-info,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-info {
background-color: #03a9f4;
}
.btn-group.open > .dropdown-toggle.btn.btn-warning,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-warning {
background-color: #ff5722;
}
.btn-group.open > .dropdown-toggle.btn.btn-danger,
.btn-group-vertical.open > .dropdown-toggle.btn.btn-danger {
background-color: #f44336;
}
.btn-group .dropdown-menu,
.btn-group-vertical .dropdown-menu {
border-radius: 0 0 2px 2px;
}
.btn-group.btn-group-raised,
.btn-group-vertical.btn-group-raised {
box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
}
.btn-group .btn + .btn,
.btn-group-vertical .btn + .btn,
.btn-group .btn,
.btn-group-vertical .btn,
.btn-group .btn:active,
.btn-group-vertical .btn:active,
.btn-group .btn-group,
.btn-group-vertical .btn-group {
margin: 0;
}
.checkbox label {
cursor: pointer;
padding-left: 0;
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .checkbox label {
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .checkbox label:hover,
.form-group.is-focused .checkbox label:focus {
color: rgba(0,0,0, .54);
}
fieldset[disabled] .form-group.is-focused .checkbox label {
color: rgba(0,0,0, 0.26);
}
.checkbox input[type=checkbox] {
opacity: 0;
position: absolute;
margin: 0;
z-index: -1;
width: 0;
height: 0;
overflow: hidden;
left: 0;
pointer-events: none;
}
.checkbox .checkbox-material {
vertical-align: middle;
position: relative;
top: 3px;
}
.checkbox .checkbox-material:before {
display: block;
position: absolute;
left: 0;
content: "";
background-color: rgba(0, 0, 0, 0.84);
height: 20px;
width: 20px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
transform: scale3d(2.3, 2.3, 1);
}
.checkbox .checkbox-material .check {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid rgba(0,0,0, .54);
overflow: hidden;
z-index: 1;
}
.checkbox .checkbox-material .check:before {
position: absolute;
content: "";
transform: rotate(45deg);
display: block;
margin-top: -4px;
margin-left: 6px;
width: 0;
height: 0;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0 inset;
animation: checkbox-off 0.3s forwards;
}
.checkbox input[type=checkbox]:focus + .checkbox-material .check:after {
opacity: 0.2;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check {
color: #841212;
border-color: #841212;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:before {
color: #841212;
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px;
animation: checkbox-on 0.3s forwards;
}
.checkbox input[type=checkbox]:checked + .checkbox-material:before {
animation: rippleOn 500ms;
}
.checkbox input[type=checkbox]:checked + .checkbox-material .check:after {
animation: rippleOn 500ms forwards;
}
.checkbox input[type=checkbox]:not(:checked) + .checkbox-material:before {
animation: rippleOff 500ms;
}
.checkbox input[type=checkbox]:not(:checked) + .checkbox-material .check:after {
animation: rippleOff 500ms forwards;
}
fieldset[disabled] .checkbox,
fieldset[disabled] .checkbox input[type=checkbox],
.checkbox input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check:before,
.checkbox input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check,
.checkbox input[type=checkbox][disabled] + .circle {
opacity: 0.5;
}
.checkbox input[type=checkbox][disabled] + .checkbox-material .check:after {
background-color: rgba(0,0,0, 0.87);
transform: rotate(-45deg);
}
@keyframes checkbox-on {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px;
}
50% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px 2px 0 11px;
}
100% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px;
}
}
@keyframes checkbox-off {
0% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
25% {
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 20px -12px 0 11px, 0 0 0 0 inset;
}
50% {
transform: rotate(45deg);
margin-top: -4px;
margin-left: 6px;
width: 0;
height: 0;
box-shadow: 0 0 0 10px, 10px -10px 0 10px, 32px 0 0 20px, 0px 32px 0 20px, -5px 5px 0 10px, 15px 2px 0 11px, 0 0 0 0 inset;
}
51% {
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0 0 10px inset;
}
100% {
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow: 0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0px 0 0 0 inset;
}
}
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
.togglebutton {
vertical-align: middle;
}
.togglebutton,
.togglebutton label,
.togglebutton input,
.togglebutton .toggle {
user-select: none;
}
.togglebutton label {
cursor: pointer;
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .togglebutton label {
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .togglebutton label:hover,
.form-group.is-focused .togglebutton label:focus {
color: rgba(0,0,0, .54);
}
fieldset[disabled] .form-group.is-focused .togglebutton label {
color: rgba(0,0,0, 0.26);
}
.togglebutton label input[type=checkbox] {
opacity: 0;
width: 0;
height: 0;
}
.togglebutton label .toggle {
text-align: left;
}
.togglebutton label .toggle,
.togglebutton label input[type=checkbox][disabled] + .toggle {
content: "";
display: inline-block;
width: 30px;
height: 15px;
background-color: rgba(80, 80, 80, 0.7);
border-radius: 15px;
margin-right: 15px;
transition: background 0.3s ease;
vertical-align: middle;
}
.togglebutton label .toggle:after {
content: "";
display: inline-block;
width: 20px;
height: 20px;
background-color: #F1F1F1;
border-radius: 20px;
position: relative;
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4);
left: -5px;
top: -2px;
transition: left 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
}
.togglebutton label input[type=checkbox][disabled] + .toggle:after,
.togglebutton label input[type=checkbox][disabled]:checked + .toggle:after {
background-color: #BDBDBD;
}
.togglebutton label input[type=checkbox] + .toggle:active:after,
.togglebutton label input[type=checkbox][disabled] + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(0, 0, 0, 0.1);
}
.togglebutton label input[type=checkbox]:checked + .toggle:after {
left: 15px;
}
.togglebutton label input[type=checkbox]:checked + .toggle {
background-color: rgba(132, 18, 18, 0.5);
}
.togglebutton label input[type=checkbox]:checked + .toggle:after {
background-color: #841212;
}
.togglebutton label input[type=checkbox]:checked + .toggle:active:after {
box-shadow: 0 1px 3px 1px rgba(0, 0, 0, 0.4), 0 0 0 15px rgba(132, 18, 18, 0.1);
}
.radio label {
cursor: pointer;
padding-left: 45px;
position: relative;
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .radio label {
color: rgba(0,0,0, 0.26);
}
.form-group.is-focused .radio label:hover,
.form-group.is-focused .radio label:focus {
color: rgba(0,0,0, .54);
}
fieldset[disabled] .form-group.is-focused .radio label {
color: rgba(0,0,0, 0.26);
}
.radio label span {
display: block;
position: absolute;
left: 10px;
top: 2px;
transition-duration: 0.2s;
}
.radio label .circle {
border: 2px solid rgba(0,0,0, .54);
height: 15px;
width: 15px;
border-radius: 100%;
}
.radio label .check {
height: 15px;
width: 15px;
border-radius: 100%;
background-color: #841212;
transform: scale3d(0, 0, 0);
}
.radio label .check:after {
display: block;
position: absolute;
content: "";
background-color: rgba(0,0,0, 0.87);
left: -18px;
top: -18px;
height: 50px;
width: 50px;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
transform: scale3d(1.5, 1.5, 1);
}
.radio label input[type=radio]:not(:checked) ~ .check:after {
animation: rippleOff 500ms;
}
.radio label input[type=radio]:checked ~ .check:after {
animation: rippleOn 500ms;
}
.radio input[type=radio] {
opacity: 0;
height: 0;
width: 0;
overflow: hidden;
}
.radio input[type=radio]:checked ~ .check,
.radio input[type=radio]:checked ~ .circle {
opacity: 1;
}
.radio input[type=radio]:checked ~ .check {
background-color: #841212;
}
.radio input[type=radio]:checked ~ .circle {
border-color: #841212;
}
.radio input[type=radio]:checked ~ .check {
transform: scale3d(0.55, 0.55, 1);
}
.radio input[type=radio][disabled] ~ .check,
.radio input[type=radio][disabled] ~ .circle {
opacity: 0.26;
}
.radio input[type=radio][disabled] ~ .check {
background-color: #000000;
}
.radio input[type=radio][disabled] ~ .circle {
border-color: #000000;
}
.theme-dark .radio input[type=radio][disabled] ~ .check,
.theme-dark .radio input[type=radio][disabled] ~ .circle {
opacity: 0.3;
}
.theme-dark .radio input[type=radio][disabled] ~ .check {
background-color: #ffffff;
}
.theme-dark .radio input[type=radio][disabled] ~ .circle {
border-color: #ffffff;
}
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
}
legend {
margin-bottom: 22px;
font-size: 24px;
}
output {
padding-top: 8px;
font-size: 16px;
line-height: 1.42857143;
}
.form-control {
height: 38px;
padding: 7px 0;
font-size: 16px;
line-height: 1.42857143;
}
@media screen and (-webkit-min-device-pixel-ratio: 0) {
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control,
input[type="month"].form-control {
line-height: 38px;
}
input[type="date"].input-sm,
input[type="time"].input-sm,
input[type="datetime-local"].input-sm,
input[type="month"].input-sm,
.input-group-sm input[type="date"],
.input-group-sm input[type="time"],
.input-group-sm input[type="datetime-local"],
.input-group-sm input[type="month"] {
line-height: 24px;
}
input[type="date"].input-lg,
input[type="time"].input-lg,
input[type="datetime-local"].input-lg,
input[type="month"].input-lg,
.input-group-lg input[type="date"],
.input-group-lg input[type="time"],
.input-group-lg input[type="datetime-local"],
.input-group-lg input[type="month"] {
line-height: 44px;
}
}
.radio label,
.checkbox label {
min-height: 22px;
}
.form-control-static {
padding-top: 8px;
padding-bottom: 8px;
min-height: 38px;
}
.input-sm .input-sm {
height: 24px;
padding: 3px 0;
font-size: 11px;
line-height: 1.5;
border-radius: 0;
}
.input-sm select.input-sm {
height: 24px;
line-height: 24px;
}
.input-sm textarea.input-sm,
.input-sm select[multiple].input-sm {
height: auto;
}
.form-group-sm .form-control {
height: 24px;
padding: 3px 0;
font-size: 11px;
line-height: 1.5;
}
.form-group-sm select.form-control {
height: 24px;
line-height: 24px;
}
.form-group-sm textarea.form-control,
.form-group-sm select[multiple].form-control {
height: auto;
}
.form-group-sm .form-control-static {
height: 24px;
min-height: 33px;
padding: 4px 0;
font-size: 11px;
line-height: 1.5;
}
.input-lg .input-lg {
height: 44px;
padding: 9px 0;
font-size: 18px;
line-height: 1.3333333;
border-radius: 0;
}
.input-lg select.input-lg {
height: 44px;
line-height: 44px;
}
.input-lg textarea.input-lg,
.input-lg select[multiple].input-lg {
height: auto;
}
.form-group-lg .form-control {
height: 44px;
padding: 9px 0;
font-size: 18px;
line-height: 1.3333333;
}
.form-group-lg select.form-control {
height: 44px;
line-height: 44px;
}
.form-group-lg textarea.form-control,
.form-group-lg select[multiple].form-control {
height: auto;
}
.form-group-lg .form-control-static {
height: 44px;
min-height: 40px;
padding: 10px 0;
font-size: 18px;
line-height: 1.3333333;
}
.form-horizontal .radio,
.form-horizontal .checkbox,
.form-horizontal .radio-inline,
.form-horizontal .checkbox-inline {
padding-top: 8px;
}
.form-horizontal .radio,
.form-horizontal .checkbox {
min-height: 30px;
}
@media (min-width: 768px) {
.form-horizontal .control-label {
padding-top: 8px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-lg .control-label {
padding-top: 12.9999997px;
font-size: 18px;
}
}
@media (min-width: 768px) {
.form-horizontal .form-group-sm .control-label {
padding-top: 4px;
font-size: 11px;
}
}
.label {
border-radius: 1px;
}
.label,
.label.label-default {
background-color: #9e9e9e;
}
.label.label-inverse {
background-color: #3f51b5;
}
.label.label-primary {
background-color: #841212;
}
.label.label-success {
background-color: #4caf50;
}
.label.label-info {
background-color: #03a9f4;
}
.label.label-warning {
background-color: #ff5722;
}
.label.label-danger {
background-color: #f44336;
}
.form-control,
.form-group .form-control {
border: 0;
background-image: linear-gradient(#841212, #841212), linear-gradient(#D2D2D2, #D2D2D2);
background-size: 0 2px, 100% 1px;
background-repeat: no-repeat;
background-position: center bottom, center calc(100% - 1px);
background-color: rgba(0, 0, 0, 0);
transition: background 0s ease-out;
float: none;
box-shadow: none;
border-radius: 0;
}
.form-control::-moz-placeholder,
.form-group .form-control::-moz-placeholder {
color: #BDBDBD;
font-weight: 400;
}
.form-control:-ms-input-placeholder,
.form-group .form-control:-ms-input-placeholder {
color: #BDBDBD;
font-weight: 400;
}
.form-control::-webkit-input-placeholder,
.form-group .form-control::-webkit-input-placeholder {
color: #BDBDBD;
font-weight: 400;
}
.form-control[readonly],
.form-group .form-control[readonly],
.form-control[disabled],
.form-group .form-control[disabled],
fieldset[disabled] .form-control,
fieldset[disabled] .form-group .form-control {
background-color: rgba(0, 0, 0, 0);
}
.form-control[disabled],
.form-group .form-control[disabled],
fieldset[disabled] .form-control,
fieldset[disabled] .form-group .form-control {
background-image: none;
border-bottom: 1px dotted #D2D2D2;
}
.form-group {
position: relative;
}
.form-group.label-static label.control-label,
.form-group.label-placeholder label.control-label,
.form-group.label-floating label.control-label {
position: absolute;
pointer-events: none;
transition: 0.3s ease all;
}
.form-group.label-floating label.control-label {
will-change: left, top, contents;
}
.form-group.label-placeholder:not(.is-empty) label.control-label {
display: none;
}
.form-group .help-block {
position: absolute;
display: none;
}
.form-group.is-focused .form-control {
outline: none;
background-image: linear-gradient(#841212, #841212), linear-gradient(#D2D2D2, #D2D2D2);
background-size: 100% 2px, 100% 1px;
box-shadow: none;
transition-duration: 0.3s;
}
.form-group.is-focused .form-control .material-input:after {
background-color: #841212;
}
.form-group.is-focused label,
.form-group.is-focused label.control-label {
color: #841212;
}
.form-group.is-focused.label-placeholder label,
.form-group.is-focused.label-placeholder label.control-label {
color: #BDBDBD;
}
.form-group.is-focused .help-block {
display: block;
}
.form-group.has-warning .form-control {
box-shadow: none;
}
.form-group.has-warning.is-focused .form-control {
background-image: linear-gradient(#ff5722, #ff5722), linear-gradient(#D2D2D2, #D2D2D2);
}
.form-group.has-warning label.control-label,
.form-group.has-warning .help-block {
color: #ff5722;
}
.form-group.has-error .form-control {
box-shadow: none;
}
.form-group.has-error.is-focused .form-control {
background-image: linear-gradient(#f44336, #f44336), linear-gradient(#D2D2D2, #D2D2D2);
}
.form-group.has-error label.control-label,
.form-group.has-error .help-block {
color: #f44336;
}
.form-group.has-success .form-control {
box-shadow: none;
}
.form-group.has-success.is-focused .form-control {
background-image: linear-gradient(#4caf50, #4caf50), linear-gradient(#D2D2D2, #D2D2D2);
}
.form-group.has-success label.control-label,
.form-group.has-success .help-block {
color: #4caf50;
}
.form-group.has-info .form-control {
box-shadow: none;
}
.form-group.has-info.is-focused .form-control {
background-image: linear-gradient(#03a9f4, #03a9f4), linear-gradient(#D2D2D2, #D2D2D2);
}
.form-group.has-info label.control-label,
.form-group.has-info .help-block {
color: #03a9f4;
}
.form-group textarea {
resize: none;
}
.form-group textarea ~ .form-control-highlight {
margin-top: -11px;
}
.form-group select {
appearance: none;
}
.form-group select ~ .material-input:after {
display: none;
}
.form-control {
margin-bottom: 7px;
}
.form-control::-moz-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-control:-ms-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-control::-webkit-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.checkbox label,
.radio label,
label {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
label.control-label {
font-size: 12px;
line-height: 1.07142857;
color: #BDBDBD;
font-weight: 400;
margin: 16px 0 0 0;
}
.help-block {
margin-top: 0;
font-size: 12px;
}
.form-group {
padding-bottom: 7px;
margin: 28px 0 0 0;
}
.form-group .form-control {
margin-bottom: 7px;
}
.form-group .form-control::-moz-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-group .form-control:-ms-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-group .form-control::-webkit-input-placeholder {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-group .checkbox label,
.form-group .radio label,
.form-group label {
font-size: 16px;
line-height: 1.42857143;
color: #BDBDBD;
font-weight: 400;
}
.form-group label.control-label {
font-size: 12px;
line-height: 1.07142857;
color: #BDBDBD;
font-weight: 400;
margin: 16px 0 0 0;
}
.form-group .help-block {
margin-top: 0;
font-size: 12px;
}
.form-group.label-floating label.control-label,
.form-group.label-placeholder label.control-label {
top: -7px;
font-size: 16px;
line-height: 1.42857143;
}
.form-group.label-static label.control-label,
.form-group.label-floating.is-focused label.control-label,
.form-group.label-floating:not(.is-empty) label.control-label {
top: -30px;
left: 0;
font-size: 12px;
line-height: 1.07142857;
}
.form-group.label-floating input.form-control:-webkit-autofill ~ label.control-label label.control-label {
top: -30px;
left: 0;
font-size: 12px;
line-height: 1.07142857;
}
.form-group.form-group-sm {
padding-bottom: 3px;
margin: 21px 0 0 0;
}
.form-group.form-group-sm .form-control {
margin-bottom: 3px;
}
.form-group.form-group-sm .form-control::-moz-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-sm .form-control:-ms-input-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-sm .form-control::-webkit-input-placeholder {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-sm .checkbox label,
.form-group.form-group-sm .radio label,
.form-group.form-group-sm label {
font-size: 11px;
line-height: 1.5;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-sm label.control-label {
font-size: 9px;
line-height: 1.125;
color: #BDBDBD;
font-weight: 400;
margin: 16px 0 0 0;
}
.form-group.form-group-sm .help-block {
margin-top: 0;
font-size: 9px;
}
.form-group.form-group-sm.label-floating label.control-label,
.form-group.form-group-sm.label-placeholder label.control-label {
top: -11px;
font-size: 11px;
line-height: 1.5;
}
.form-group.form-group-sm.label-static label.control-label,
.form-group.form-group-sm.label-floating.is-focused label.control-label,
.form-group.form-group-sm.label-floating:not(.is-empty) label.control-label {
top: -25px;
left: 0;
font-size: 9px;
line-height: 1.125;
}
.form-group.form-group-sm.label-floating input.form-control:-webkit-autofill ~ label.control-label label.control-label {
top: -25px;
left: 0;
font-size: 9px;
line-height: 1.125;
}
.form-group.form-group-lg {
padding-bottom: 9px;
margin: 30px 0 0 0;
}
.form-group.form-group-lg .form-control {
margin-bottom: 9px;
}
.form-group.form-group-lg .form-control::-moz-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-lg .form-control:-ms-input-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-lg .form-control::-webkit-input-placeholder {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-lg .checkbox label,
.form-group.form-group-lg .radio label,
.form-group.form-group-lg label {
font-size: 18px;
line-height: 1.3333333;
color: #BDBDBD;
font-weight: 400;
}
.form-group.form-group-lg label.control-label {
font-size: 14px;
line-height: 0.99999998;
color: #BDBDBD;
font-weight: 400;
margin: 16px 0 0 0;
}
.form-group.form-group-lg .help-block {
margin-top: 0;
font-size: 14px;
}
.form-group.form-group-lg.label-floating label.control-label,
.form-group.form-group-lg.label-placeholder label.control-label {
top: -5px;
font-size: 18px;
line-height: 1.3333333;
}
.form-group.form-group-lg.label-static label.control-label,
.form-group.form-group-lg.label-floating.is-focused label.control-label,
.form-group.form-group-lg.label-floating:not(.is-empty) label.control-label {
top: -32px;
left: 0;
font-size: 14px;
line-height: 0.99999998;
}
.form-group.form-group-lg.label-floating input.form-control:-webkit-autofill ~ label.control-label label.control-label {
top: -32px;
left: 0;
font-size: 14px;
line-height: 0.99999998;
}
select.form-control {
border: 0;
box-shadow: none;
border-radius: 0;
}
.form-group.is-focused select.form-control {
box-shadow: none;
border-color: #D2D2D2;
}
select.form-control[multiple],
.form-group.is-focused select.form-control[multiple] {
height: 85px;
}
.input-group-btn .btn {
margin: 0 0 7px 0;
}
.form-group.form-group-sm .input-group-btn .btn {
margin: 0 0 3px 0;
}
.form-group.form-group-lg .input-group-btn .btn {
margin: 0 0 9px 0;
}
.input-group .input-group-btn {
padding: 0 12px;
}
.input-group .input-group-addon {
border: 0;
background: transparent;
}
.form-group input[type=file] {
opacity: 0;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 100;
}
legend {
border-bottom: 0;
}
.list-group {
border-radius: 0;
}
.list-group .list-group-item {
background-color: transparent;
overflow: hidden;
border: 0;
border-radius: 0;
padding: 0 16px;
}
.list-group .list-group-item.baseline {
border-bottom: 1px solid #cecece;
}
.list-group .list-group-item.baseline:last-child {
border-bottom: none;
}
.list-group .list-group-item .row-picture,
.list-group .list-group-item .row-action-primary {
display: inline-block;
padding-right: 16px;
}
.list-group .list-group-item .row-picture img,
.list-group .list-group-item .row-action-primary img,
.list-group .list-group-item .row-picture i,
.list-group .list-group-item .row-action-primary i,
.list-group .list-group-item .row-picture label,
.list-group .list-group-item .row-action-primary label {
display: block;
width: 56px;
height: 56px;
}
.list-group .list-group-item .row-picture img,
.list-group .list-group-item .row-action-primary img {
background: rgba(0, 0, 0, 0.1);
padding: 1px;
}
.list-group .list-group-item .row-picture img.circle,
.list-group .list-group-item .row-action-primary img.circle {
border-radius: 100%;
}
.list-group .list-group-item .row-picture i,
.list-group .list-group-item .row-action-primary i {
background: rgba(0, 0, 0, 0.25);
border-radius: 100%;
text-align: center;
line-height: 56px;
font-size: 20px;
color: white;
}
.list-group .list-group-item .row-picture label,
.list-group .list-group-item .row-action-primary label {
margin-left: 7px;
margin-right: -7px;
margin-top: 5px;
margin-bottom: -5px;
}
.list-group .list-group-item .row-picture label .checkbox-material,
.list-group .list-group-item .row-action-primary label .checkbox-material {
left: -10px;
}
.list-group .list-group-item .row-content {
display: inline-block;
width: calc(100% - 92px);
min-height: 66px;
}
.list-group .list-group-item .row-content .action-secondary {
position: absolute;
right: 16px;
top: 16px;
}
.list-group .list-group-item .row-content .action-secondary i {
font-size: 20px;
color: rgba(0, 0, 0, 0.25);
cursor: pointer;
}
.list-group .list-group-item .row-content .action-secondary ~ * {
max-width: calc(100% - 30px);
}
.list-group .list-group-item .row-content .least-content {
position: absolute;
right: 16px;
top: 0;
color: rgba(0, 0, 0, 0.54);
font-size: 14px;
}
.list-group .list-group-item .list-group-item-heading {
color: rgba(0, 0, 0, 0.77);
font-size: 20px;
line-height: 29px;
}
.list-group .list-group-item.active:hover,
.list-group .list-group-item.active:focus {
background: rgba(0, 0, 0, 0.15);
outline: 10px solid rgba(0, 0, 0, 0.15);
}
.list-group .list-group-item.active .list-group-item-heading,
.list-group .list-group-item.active .list-group-item-text {
color: rgba(0,0,0, 0.87);
}
.list-group .list-group-separator {
clear: both;
overflow: hidden;
margin-top: 10px;
margin-bottom: 10px;
}
.list-group .list-group-separator:before {
content: "";
width: calc(100% - 90px);
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
float: right;
}
.navbar {
background-color: #841212;
border: 0;
border-radius: 0;
}
.navbar .navbar-brand {
position: relative;
height: 60px;
line-height: 30px;
color: inherit;
}
.navbar .navbar-brand:hover,
.navbar .navbar-brand:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-text {
color: inherit;
margin-top: 20px;
margin-bottom: 20px;
}
.navbar .navbar-nav > li > a {
color: inherit;
padding-top: 20px;
padding-bottom: 20px;
}
.navbar .navbar-nav > li > a:hover,
.navbar .navbar-nav > li > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav > .active > a,
.navbar .navbar-nav > .active > a:hover,
.navbar .navbar-nav > .active > a:focus {
color: inherit;
background-color: rgba(255, 255, 255, 0.1);
}
.navbar .navbar-nav > .disabled > a,
.navbar .navbar-nav > .disabled > a:hover,
.navbar .navbar-nav > .disabled > a:focus {
color: inherit;
background-color: transparent;
opacity: 0.9;
}
.navbar .navbar-toggle {
border: 0;
}
.navbar .navbar-toggle:hover,
.navbar .navbar-toggle:focus {
background-color: transparent;
}
.navbar .navbar-toggle .icon-bar {
background-color: inherit;
border: 1px solid;
}
.navbar .navbar-default .navbar-toggle,
.navbar .navbar-inverse .navbar-toggle {
border-color: transparent;
}
.navbar .navbar-collapse,
.navbar .navbar-form {
border-color: rgba(0, 0, 0, 0.1);
}
.navbar .navbar-nav > .open > a,
.navbar .navbar-nav > .open > a:hover,
.navbar .navbar-nav > .open > a:focus {
background-color: transparent;
color: inherit;
}
@media (max-width: 767px) {
.navbar .navbar-nav .navbar-text {
color: inherit;
margin-top: 15px;
margin-bottom: 15px;
}
.navbar .navbar-nav .open .dropdown-menu > .dropdown-header {
border: 0;
color: inherit;
}
.navbar .navbar-nav .open .dropdown-menu .divider {
border-bottom: 1px solid;
opacity: 0.08;
}
.navbar .navbar-nav .open .dropdown-menu > li > a {
color: inherit;
}
.navbar .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar .navbar-nav .open .dropdown-menu > li > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav .open .dropdown-menu > .active > a,
.navbar .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar .navbar-nav .open .dropdown-menu > .active > a:focus {
color: inherit;
background-color: transparent;
}
.navbar .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: inherit;
background-color: transparent;
}
}
.navbar .navbar-link {
color: inherit;
}
.navbar .navbar-link:hover {
color: inherit;
}
.navbar .btn-link {
color: inherit;
}
.navbar .btn-link:hover,
.navbar .btn-link:focus {
color: inherit;
}
.navbar .btn-link[disabled]:hover,
fieldset[disabled] .navbar .btn-link:hover,
.navbar .btn-link[disabled]:focus,
fieldset[disabled] .navbar .btn-link:focus {
color: inherit;
}
.navbar .navbar-form {
margin-top: 16px;
}
.navbar .navbar-form .form-group {
margin: 0;
padding: 0;
}
.navbar .navbar-form .form-group .material-input:before,
.navbar .navbar-form .form-group.is-focused .material-input:after {
background-color: inherit;
}
.navbar .navbar-form .form-group .form-control,
.navbar .navbar-form .form-control {
border-color: inherit;
color: inherit;
padding: 0;
margin: 0;
height: 28px;
font-size: 14px;
line-height: 1.42857143;
}
.navbar,
.navbar.navbar-default {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.navbar .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-default .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar .navbar-form input.form-control::-moz-placeholder,
.navbar.navbar-default .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-default .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar .navbar-form input.form-control:-ms-input-placeholder,
.navbar.navbar-default .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-default .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar .navbar-form input.form-control::-webkit-input-placeholder,
.navbar.navbar-default .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar .dropdown-menu,
.navbar.navbar-default .dropdown-menu {
border-radius: 2px;
}
.navbar .dropdown-menu li > a,
.navbar.navbar-default .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar .dropdown-menu li > a:hover,
.navbar.navbar-default .dropdown-menu li > a:hover,
.navbar .dropdown-menu li > a:focus,
.navbar.navbar-default .dropdown-menu li > a:focus {
color: #841212;
background-color: #eeeeee;
}
.navbar .dropdown-menu .active > a,
.navbar.navbar-default .dropdown-menu .active > a {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.navbar .dropdown-menu .active > a:hover,
.navbar.navbar-default .dropdown-menu .active > a:hover,
.navbar .dropdown-menu .active > a:focus,
.navbar.navbar-default .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-inverse {
background-color: #3f51b5;
color: #ffffff;
}
.navbar.navbar-inverse .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-inverse .navbar-form input.form-control::-moz-placeholder {
color: #ffffff;
}
.navbar.navbar-inverse .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-inverse .navbar-form input.form-control:-ms-input-placeholder {
color: #ffffff;
}
.navbar.navbar-inverse .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-inverse .navbar-form input.form-control::-webkit-input-placeholder {
color: #ffffff;
}
.navbar.navbar-inverse .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-inverse .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-inverse .dropdown-menu li > a:hover,
.navbar.navbar-inverse .dropdown-menu li > a:focus {
color: #3f51b5;
background-color: #eeeeee;
}
.navbar.navbar-inverse .dropdown-menu .active > a {
background-color: #3f51b5;
color: #ffffff;
}
.navbar.navbar-inverse .dropdown-menu .active > a:hover,
.navbar.navbar-inverse .dropdown-menu .active > a:focus {
color: #ffffff;
}
.navbar.navbar-primary {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-primary .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-primary .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-primary .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-primary .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-primary .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-primary .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-primary .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-primary .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-primary .dropdown-menu li > a:hover,
.navbar.navbar-primary .dropdown-menu li > a:focus {
color: #841212;
background-color: #eeeeee;
}
.navbar.navbar-primary .dropdown-menu .active > a {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-primary .dropdown-menu .active > a:hover,
.navbar.navbar-primary .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success {
background-color: #4caf50;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-success .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-success .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-success .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-success .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-success .dropdown-menu li > a:hover,
.navbar.navbar-success .dropdown-menu li > a:focus {
color: #4caf50;
background-color: #eeeeee;
}
.navbar.navbar-success .dropdown-menu .active > a {
background-color: #4caf50;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-success .dropdown-menu .active > a:hover,
.navbar.navbar-success .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info {
background-color: #03a9f4;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-info .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-info .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-info .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-info .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-info .dropdown-menu li > a:hover,
.navbar.navbar-info .dropdown-menu li > a:focus {
color: #03a9f4;
background-color: #eeeeee;
}
.navbar.navbar-info .dropdown-menu .active > a {
background-color: #03a9f4;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-info .dropdown-menu .active > a:hover,
.navbar.navbar-info .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning {
background-color: #ff5722;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-warning .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-warning .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-warning .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-warning .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-warning .dropdown-menu li > a:hover,
.navbar.navbar-warning .dropdown-menu li > a:focus {
color: #ff5722;
background-color: #eeeeee;
}
.navbar.navbar-warning .dropdown-menu .active > a {
background-color: #ff5722;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-warning .dropdown-menu .active > a:hover,
.navbar.navbar-warning .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger {
background-color: #f44336;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger .navbar-form .form-group input.form-control::-moz-placeholder,
.navbar.navbar-danger .navbar-form input.form-control::-moz-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger .navbar-form .form-group input.form-control:-ms-input-placeholder,
.navbar.navbar-danger .navbar-form input.form-control:-ms-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger .navbar-form .form-group input.form-control::-webkit-input-placeholder,
.navbar.navbar-danger .navbar-form input.form-control::-webkit-input-placeholder {
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger .dropdown-menu {
border-radius: 2px;
}
.navbar.navbar-danger .dropdown-menu li > a {
font-size: 16px;
padding: 13px 16px;
}
.navbar.navbar-danger .dropdown-menu li > a:hover,
.navbar.navbar-danger .dropdown-menu li > a:focus {
color: #f44336;
background-color: #eeeeee;
}
.navbar.navbar-danger .dropdown-menu .active > a {
background-color: #f44336;
color: rgba(255,255,255, 0.84);
}
.navbar.navbar-danger .dropdown-menu .active > a:hover,
.navbar.navbar-danger .dropdown-menu .active > a:focus {
color: rgba(255,255,255, 0.84);
}
.navbar-inverse {
background-color: #3f51b5;
}
@media (max-width: 1199px) {
.navbar .navbar-brand {
height: 50px;
padding: 10px 15px;
}
.navbar .navbar-form {
margin-top: 10px;
}
.navbar .navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
}
}
.dropdown-menu {
border: 0;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
}
.dropdown-menu .divider {
background-color: rgba(229, 229, 229, 0.12);
}
.dropdown-menu li {
overflow: hidden;
position: relative;
}
.dropdown-menu li a:hover {
background-color: transparent;
color: #841212;
}
.alert {
border: 0;
border-radius: 0;
}
.alert,
.alert.alert-default {
background-color: rgba(255,255,255, 0.84);
color: rgba(255,255,255, 0.84);
}
.alert a,
.alert.alert-default a,
.alert .alert-link,
.alert.alert-default .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert.alert-inverse {
background-color: #3f51b5;
color: #ffffff;
}
.alert.alert-inverse a,
.alert.alert-inverse .alert-link {
color: #ffffff;
}
.alert.alert-primary {
background-color: #841212;
color: rgba(255,255,255, 0.84);
}
.alert.alert-primary a,
.alert.alert-primary .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert.alert-success {
background-color: #4caf50;
color: rgba(255,255,255, 0.84);
}
.alert.alert-success a,
.alert.alert-success .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert.alert-info {
background-color: #03a9f4;
color: rgba(255,255,255, 0.84);
}
.alert.alert-info a,
.alert.alert-info .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert.alert-warning {
background-color: #ff5722;
color: rgba(255,255,255, 0.84);
}
.alert.alert-warning a,
.alert.alert-warning .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert.alert-danger {
background-color: #f44336;
color: rgba(255,255,255, 0.84);
}
.alert.alert-danger a,
.alert.alert-danger .alert-link {
color: rgba(255,255,255, 0.84);
}
.alert-info,
.alert-danger,
.alert-warning,
.alert-success {
color: rgba(255,255,255, 0.84);
}
.alert-default a,
.alert-default .alert-link {
color: rgba(0,0,0, 0.87);
}
.progress {
height: 4px;
border-radius: 0;
box-shadow: none;
background: #c8c8c8;
}
.progress .progress-bar {
box-shadow: none;
}
.progress .progress-bar,
.progress .progress-bar.progress-bar-default {
background-color: #841212;
}
.progress .progress-bar.progress-bar-inverse {
background-color: #3f51b5;
}
.progress .progress-bar.progress-bar-primary {
background-color: #841212;
}
.progress .progress-bar.progress-bar-success {
background-color: #4caf50;
}
.progress .progress-bar.progress-bar-info {
background-color: #03a9f4;
}
.progress .progress-bar.progress-bar-warning {
background-color: #ff5722;
}
.progress .progress-bar.progress-bar-danger {
background-color: #f44336;
}
.text-warning {
color: #ff5722;
}
.text-primary {
color: #841212;
}
.text-danger {
color: #f44336;
}
.text-success {
color: #4caf50;
}
.text-info {
color: #03a9f4;
}
.nav-tabs {
background: #841212;
}
.nav-tabs > li > a {
color: #FFFFFF;
border: 0;
margin: 0;
}
.nav-tabs > li > a:hover {
background-color: transparent;
border: 0;
}
.nav-tabs > li > a,
.nav-tabs > li > a:hover,
.nav-tabs > li > a:focus {
background-color: transparent !important;
border: 0 !important;
color: #FFFFFF !important;
font-weight: 500;
}
.nav-tabs > li.disabled > a,
.nav-tabs > li.disabled > a:hover {
color: rgba(255, 255, 255, 0.5);
}
.popover,
.tooltip-inner {
color: #ececec;
line-height: 1em;
background: rgba(101, 101, 101, 0.9);
border: none;
border-radius: 2px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.tooltip,
.tooltip.in {
opacity: 1;
}
.popover .arrow,
.tooltip .arrow,
.popover .tooltip-arrow,
.tooltip .tooltip-arrow {
display: none;
}
.card {
/***** Make height equal to width (http://stackoverflow.com/a/6615994) ****/
display: inline-block;
position: relative;
width: 100%;
/**************************************************************************/
border-radius: 2px;
color: rgba(0,0,0, 0.87);
background: #fff;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.card .card-height-indicator {
margin-top: 100%;
}
.card .card-content {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.card .card-image {
height: 60%;
position: relative;
overflow: hidden;
}
.card .card-image img {
width: 100%;
height: 100%;
border-top-left-radius: 2px;
border-top-right-radius: 2px;
pointer-events: none;
}
.card .card-image .card-image-headline {
position: absolute;
bottom: 16px;
left: 18px;
color: #fff;
font-size: 2em;
}
.card .card-body {
height: 30%;
padding: 18px;
}
.card .card-footer {
height: 10%;
padding: 18px;
}
.card .card-footer button {
margin: 0 !important;
position: relative;
bottom: 25px;
width: auto;
}
.card .card-footer button:first-child {
left: -15px;
}
.modal-content {
box-shadow: 0 27px 24px 0 rgba(0, 0, 0, 0.2), 0 40px 77px 0 rgba(0, 0, 0, 0.22);
border-radius: 2px;
border: none;
}
.modal-content .modal-header {
border-bottom: none;
padding-top: 24px;
padding-right: 24px;
padding-bottom: 0;
padding-left: 24px;
}
.modal-content .modal-body {
padding-top: 24px;
padding-right: 24px;
padding-bottom: 16px;
padding-left: 24px;
}
.modal-content .modal-footer {
border-top: none;
padding: 7px;
}
.modal-content .modal-footer button {
margin: 0;
padding-left: 16px;
padding-right: 16px;
width: auto;
}
.modal-content .modal-footer button.pull-left {
padding-left: 5px;
padding-right: 5px;
position: relative;
left: -5px;
}
.modal-content .modal-footer button + button {
margin-bottom: 16px;
}
.modal-content .modal-body + .modal-footer {
padding-top: 0;
}
.modal-backdrop {
background: rgba(0, 0, 0, 0.3);
}
.panel {
border-radius: 2px;
border: 0;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
}
.panel > .panel-heading,
.panel.panel-default > .panel-heading {
background-color: #eeeeee;
}
.panel.panel-inverse > .panel-heading {
background-color: #3f51b5;
}
.panel.panel-primary > .panel-heading {
background-color: #841212;
}
.panel.panel-success > .panel-heading {
background-color: #4caf50;
}
.panel.panel-info > .panel-heading {
background-color: #03a9f4;
}
.panel.panel-warning > .panel-heading {
background-color: #ff5722;
}
.panel.panel-danger > .panel-heading {
background-color: #f44336;
}
[class*="panel-"] > .panel-heading {
color: rgba(255,255,255, 0.84);
border: 0;
}
.panel-default > .panel-heading,
.panel:not([class*="panel-"]) > .panel-heading {
color: rgba(0,0,0, 0.87);
}
.panel-footer {
background-color: #eeeeee;
}
hr.on-dark {
color: #1a1a1a;
}
hr.on-light {
color: #ffffff;
}
@media (-webkit-min-device-pixel-ratio: 0.75), (min--moz-device-pixel-ratio: 0.75), (-o-device-pixel-ratio: 3/4), (min-device-pixel-ratio: 0.75), (min-resolution: 0.75dppx), (min-resolution: 120dpi) {
hr {
height: 0.75px;
}
}
@media (-webkit-min-device-pixel-ratio: 1), (min--moz-device-pixel-ratio: 1), (-o-device-pixel-ratio: 1), (min-device-pixel-ratio: 1), (min-resolution: 1dppx), (min-resolution: 160dpi) {
hr {
height: 1px;
}
}
@media (-webkit-min-device-pixel-ratio: 1.33), (min--moz-device-pixel-ratio: 1.33), (-o-device-pixel-ratio: 133/100), (min-device-pixel-ratio: 1.33), (min-resolution: 1.33dppx), (min-resolution: 213dpi) {
hr {
height: 1.333px;
}
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-device-pixel-ratio: 3/2), (min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx), (min-resolution: 240dpi) {
hr {
height: 1.5px;
}
}
@media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-device-pixel-ratio: 2/1), (min-device-pixel-ratio: 2), (min-resolution: 2dppx), (min-resolution: 380dpi) {
hr {
height: 2px;
}
}
@media (-webkit-min-device-pixel-ratio: 3), (min--moz-device-pixel-ratio: 3), (-o-device-pixel-ratio: 3/1), (min-device-pixel-ratio: 3), (min-resolution: 3dppx), (min-resolution: 480dpi) {
hr {
height: 3px;
}
}
@media (-webkit-min-device-pixel-ratio: 4), (min--moz-device-pixel-ratio: 4), (-o-device-pixel-ratio: 4/1), (min-device-pixel-ratio: 3), (min-resolution: 4dppx), (min-resolution: 640dpi) {
hr {
height: 4px;
}
}
* {
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
-webkit-tap-highlight-color: transparent;
}
*:focus {
outline: 0;
}
.snackbar {
background-color: #323232;
color: rgba(255,255,255, 0.84);
font-size: 14px;
border-radius: 2px;
box-shadow: 0 1px 6px 0 rgba(0, 0, 0, 0.12), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
height: 0;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, padding 0s linear 0.2s, height 0s linear 0.2s;
transform: translateY(200%);
}
.snackbar.snackbar-opened {
padding: 14px 15px;
margin-bottom: 20px;
height: auto;
transition: transform 0.2s ease-in-out, opacity 0.2s ease-in, height 0s linear 0.2s, height 0s linear 0.2s;
transform: none;
}
.snackbar.toast {
border-radius: 200px;
}
.noUi-target,
.noUi-target * {
-webkit-touch-callout: none;
-ms-touch-action: none;
user-select: none;
box-sizing: border-box;
}
.noUi-base {
width: 100%;
height: 100%;
position: relative;
}
.noUi-origin {
position: absolute;
right: 0;
top: 0;
left: 0;
bottom: 0;
}
.noUi-handle {
position: relative;
z-index: 1;
box-sizing: border-box;
}
.noUi-stacking .noUi-handle {
z-index: 10;
}
.noUi-state-tap .noUi-origin {
transition: left 0.3s, top 0.3s;
}
.noUi-state-drag * {
cursor: inherit !important;
}
.noUi-horizontal {
height: 10px;
}
.noUi-handle {
box-sizing: border-box;
width: 12px;
height: 12px;
left: -10px;
top: -5px;
cursor: ew-resize;
border-radius: 100%;
transition: all 0.2s ease-out;
border: 1px solid;
}
.noUi-vertical .noUi-handle {
margin-left: 5px;
cursor: ns-resize;
}
.noUi-horizontal.noUi-extended {
padding: 0 15px;
}
.noUi-horizontal.noUi-extended .noUi-origin {
right: -15px;
}
.noUi-background {
height: 2px;
margin: 20px 0;
}
.noUi-origin {
margin: 0;
border-radius: 0;
height: 2px;
background: #c8c8c8;
}
.noUi-origin[style^="left: 0"] .noUi-handle {
background-color: #fff;
border: 2px solid #c8c8c8;
}
.noUi-origin[style^="left: 0"] .noUi-handle.noUi-active {
border-width: 1px;
}
.noUi-target {
border-radius: 2px;
}
.noUi-horizontal {
height: 2px;
margin: 15px 0;
}
.noUi-vertical {
height: 100%;
width: 2px;
margin: 0 15px;
display: inline-block;
}
.noUi-handle.noUi-active {
transform: scale3d(2.5, 2.5, 1);
}
[disabled].noUi-slider {
opacity: 0.5;
}
[disabled] .noUi-handle {
cursor: not-allowed;
}
.slider {
background: #c8c8c8;
}
.slider.noUi-connect,
.slider.slider-default.noUi-connect {
background-color: #841212;
}
.slider.slider-inverse.noUi-connect {
background-color: #3f51b5;
}
.slider.slider-primary.noUi-connect {
background-color: #841212;
}
.slider.slider-success.noUi-connect {
background-color: #4caf50;
}
.slider.slider-info.noUi-connect {
background-color: #03a9f4;
}
.slider.slider-warning.noUi-connect {
background-color: #ff5722;
}
.slider.slider-danger.noUi-connect {
background-color: #f44336;
}
.slider .noUi-connect,
.slider.slider-default .noUi-connect {
background-color: #841212;
}
.slider.slider-inverse .noUi-connect {
background-color: #3f51b5;
}
.slider.slider-primary .noUi-connect {
background-color: #841212;
}
.slider.slider-success .noUi-connect {
background-color: #4caf50;
}
.slider.slider-info .noUi-connect {
background-color: #03a9f4;
}
.slider.slider-warning .noUi-connect {
background-color: #ff5722;
}
.slider.slider-danger .noUi-connect {
background-color: #f44336;
}
.slider .noUi-handle,
.slider.slider-default .noUi-handle {
background-color: #841212;
}
.slider.slider-inverse .noUi-handle {
background-color: #3f51b5;
}
.slider.slider-primary .noUi-handle {
background-color: #841212;
}
.slider.slider-success .noUi-handle {
background-color: #4caf50;
}
.slider.slider-info .noUi-handle {
background-color: #03a9f4;
}
.slider.slider-warning .noUi-handle {
background-color: #ff5722;
}
.slider.slider-danger .noUi-handle {
background-color: #f44336;
}
.slider .noUi-handle,
.slider.slider-default .noUi-handle {
border-color: #841212;
}
.slider.slider-inverse .noUi-handle {
border-color: #3f51b5;
}
.slider.slider-primary .noUi-handle {
border-color: #841212;
}
.slider.slider-success .noUi-handle {
border-color: #4caf50;
}
.slider.slider-info .noUi-handle {
border-color: #03a9f4;
}
.slider.slider-warning .noUi-handle {
border-color: #ff5722;
}
.slider.slider-danger .noUi-handle {
border-color: #f44336;
}
.selectize-control.single,
.selectize-control.multi {
padding: 0;
}
.selectize-control.single .selectize-input,
.selectize-control.multi .selectize-input,
.selectize-control.single .selectize-input.input-active,
.selectize-control.multi .selectize-input.input-active {
cursor: text;
background: transparent;
box-shadow: none;
border: 0;
padding: 0;
height: 100%;
font-size: 14px;
line-height: 30px;
}
.selectize-control.single .selectize-input .has-items,
.selectize-control.multi .selectize-input .has-items,
.selectize-control.single .selectize-input.input-active .has-items,
.selectize-control.multi .selectize-input.input-active .has-items {
padding: 0;
}
.selectize-control.single .selectize-input:after,
.selectize-control.multi .selectize-input:after,
.selectize-control.single .selectize-input.input-active:after,
.selectize-control.multi .selectize-input.input-active:after {
right: 5px;
position: absolute;
font-size: 7px;
content: "\e894";
font-family: "Material-Design-Icons";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 4;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.selectize-control.single .selectize-input input,
.selectize-control.multi .selectize-input input,
.selectize-control.single .selectize-input.input-active input,
.selectize-control.multi .selectize-input.input-active input {
font-size: 14px;
outline: 0;
border: 0;
background: transparent;
}
.selectize-control.single .selectize-input.label-floating-fix input,
.selectize-control.multi .selectize-input.label-floating-fix input,
.selectize-control.single .selectize-input.input-active.label-floating-fix input,
.selectize-control.multi .selectize-input.input-active.label-floating-fix input {
opacity: 0;
}
.selectize-control.single .selectize-input > div,
.selectize-control.multi .selectize-input > div,
.selectize-control.single .selectize-input.input-active > div,
.selectize-control.multi .selectize-input.input-active > div,
.selectize-control.single .selectize-input > .item,
.selectize-control.multi .selectize-input > .item,
.selectize-control.single .selectize-input.input-active > .item,
.selectize-control.multi .selectize-input.input-active > .item {
display: inline-block;
margin: 0 8px 3px 0;
padding: 0;
background: transparent;
border: 0;
}
.selectize-control.single .selectize-input > div:after,
.selectize-control.multi .selectize-input > div:after,
.selectize-control.single .selectize-input.input-active > div:after,
.selectize-control.multi .selectize-input.input-active > div:after,
.selectize-control.single .selectize-input > .item:after,
.selectize-control.multi .selectize-input > .item:after,
.selectize-control.single .selectize-input.input-active > .item:after,
.selectize-control.multi .selectize-input.input-active > .item:after {
content: ",";
}
.selectize-control.single .selectize-input > div:last-of-type:after,
.selectize-control.multi .selectize-input > div:last-of-type:after,
.selectize-control.single .selectize-input.input-active > div:last-of-type:after,
.selectize-control.multi .selectize-input.input-active > div:last-of-type:after,
.selectize-control.single .selectize-input > .item:last-of-type:after,
.selectize-control.multi .selectize-input > .item:last-of-type:after,
.selectize-control.single .selectize-input.input-active > .item:last-of-type:after,
.selectize-control.multi .selectize-input.input-active > .item:last-of-type:after {
content: "";
}
.selectize-control.single .selectize-input > div.active,
.selectize-control.multi .selectize-input > div.active,
.selectize-control.single .selectize-input.input-active > div.active,
.selectize-control.multi .selectize-input.input-active > div.active,
.selectize-control.single .selectize-input > .item.active,
.selectize-control.multi .selectize-input > .item.active,
.selectize-control.single .selectize-input.input-active > .item.active,
.selectize-control.multi .selectize-input.input-active > .item.active {
font-weight: bold;
background: transparent;
border: 0;
}
.selectize-control.single .selectize-dropdown,
.selectize-control.multi .selectize-dropdown {
position: absolute;
z-index: 1000;
border: 0;
width: 100% !important;
left: 0 !important;
height: auto;
background-color: #FFF;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
border-radius: 2px;
padding: 0;
margin-top: 3px;
}
.selectize-control.single .selectize-dropdown .active,
.selectize-control.multi .selectize-dropdown .active {
background-color: inherit;
}
.selectize-control.single .selectize-dropdown .highlight,
.selectize-control.multi .selectize-dropdown .highlight {
background-color: #d5d8ff;
}
.selectize-control.single .selectize-dropdown .selected,
.selectize-control.multi .selectize-dropdown .selected,
.selectize-control.single .selectize-dropdown .selected.active,
.selectize-control.multi .selectize-dropdown .selected.active {
background-color: #EEEEEE;
}
.selectize-control.single .selectize-dropdown [data-selectable],
.selectize-control.multi .selectize-dropdown [data-selectable],
.selectize-control.single .selectize-dropdown .optgroup-header,
.selectize-control.multi .selectize-dropdown .optgroup-header {
padding: 10px 20px;
cursor: pointer;
}
.selectize-control.single .dropdown-active ~ .selectize-dropdown,
.selectize-control.multi .dropdown-active ~ .selectize-dropdown {
display: block;
}
.dropdownjs::after {
right: 5px;
top: 3px;
font-size: 25px;
position: absolute;
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
content: "\e5c5";
pointer-events: none;
color: #757575;
}
/*# sourceMappingURL=bootstrap-material-design.css.map */ | {
"content_hash": "8febd6edb2009d1c2b582e25459155eb",
"timestamp": "",
"source": "github",
"line_count": 3014,
"max_line_length": 204,
"avg_line_length": 29.219973457199735,
"alnum_prop": 0.7025741180210971,
"repo_name": "HMProgrammingClub/NYCSL",
"id": "d710787847d317fbc73269b54adcaeaacb1adf15",
"size": "88069",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/bootstrap-material-design.css",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "23816"
},
{
"name": "CSS",
"bytes": "1212"
},
{
"name": "HTML",
"bytes": "43259"
},
{
"name": "Java",
"bytes": "21216"
},
{
"name": "JavaScript",
"bytes": "36306"
},
{
"name": "PHP",
"bytes": "38799"
},
{
"name": "Python",
"bytes": "72577"
},
{
"name": "Shell",
"bytes": "3428"
}
],
"symlink_target": ""
} |
package de.v13dev.designpatterns.factorymethod.creators;
import de.v13dev.designpatterns.factorymethod.products.IProduct;
import de.v13dev.designpatterns.factorymethod.products.ProductB;
public class CreatorB extends ACreator {
@Override
protected IProduct factoryMethod() {
return new ProductB();
}
}
| {
"content_hash": "1d9596c76b03da6fdb071ebcd962882c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 64,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.7760736196319018,
"repo_name": "ste-bo/designpatterns",
"id": "7384bbdc3f66f8fe5f7c589faf5ee12b18fed7b2",
"size": "326",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/de/v13dev/designpatterns/factorymethod/creators/CreatorB.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "40599"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<title>Info Enumeration Reference</title>
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
<meta charset="utf-8">
<script src="../../js/jquery.min.js" defer></script>
<script src="../../js/jazzy.js" defer></script>
<script src="../../js/lunr.min.js" defer></script>
<script src="../../js/typeahead.jquery.js" defer></script>
<script src="../../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/Info" class="dashAnchor"></a>
<a title="Info Enumeration Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../../index.html">
XestiMonitors Docs
</a>
(100% documented)
</p>
<p class="header-col--secondary">
<form role="search" action="../../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="https://github.com/eBardX/XestiMonitors">
<img class="header-icon" src="../../img/gh.png"/>
View on GitHub
</a>
</p>
<p class="header-col header-col--secondary">
<a class="header-link" href="dash-feed://https%3A%2F%2FeBardX%2Egithub%2Eio%2FXestiMonitors%2Freference%2Fdocsets%2FXestiMonitors%2Exml">
<img class="header-icon" src="../../img/dash.png"/>
Install in Dash
</a>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../../index.html">XestiMonitors Reference</a>
<img class="carat" src="../../img/carat.png" />
Info Enumeration Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Protocols/Monitor.html">Monitor</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Base Monitor Classes.html">Base Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BaseMonitor.html">BaseMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BaseNotificationMonitor.html">BaseNotificationMonitor</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Core Location Monitor Classes.html">Core Location Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BeaconRangingMonitor.html">BeaconRangingMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BeaconRangingMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BeaconRangingMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HeadingMonitor.html">HeadingMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HeadingMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HeadingMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/LocationAuthorizationMonitor.html">LocationAuthorizationMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/LocationAuthorizationMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/LocationAuthorizationMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/RegionMonitor.html">RegionMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/RegionMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/RegionMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SignificantLocationMonitor.html">SignificantLocationMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SignificantLocationMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SignificantLocationMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StandardLocationMonitor.html">StandardLocationMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StandardLocationMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StandardLocationMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/VisitMonitor.html">VisitMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/VisitMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/VisitMonitor/Info.html">– Info</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Core Motion Monitor Classes.html">Core Motion Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccelerometerMonitor.html">AccelerometerMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccelerometerMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccelerometerMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AltimeterMonitor.html">AltimeterMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AltimeterMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AltimeterMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/DeviceMotionMonitor.html">DeviceMotionMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/DeviceMotionMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/DeviceMotionMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/GyroscopeMonitor.html">GyroscopeMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/GyroscopeMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/GyroscopeMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MagnetometerMonitor.html">MagnetometerMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MagnetometerMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MagnetometerMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MotionActivityMonitor.html">MotionActivityMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MotionActivityMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MotionActivityMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PedometerMonitor.html">PedometerMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PedometerMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PedometerMonitor/Info.html">– Info</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Foundation Monitor Classes.html">Foundation Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BundleClassLoadMonitor.html">BundleClassLoadMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BundleClassLoadMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BundleResourceRequestMonitor.html">BundleResourceRequestMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BundleResourceRequestMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/CalendarDayMonitor.html">CalendarDayMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/CalendarDayMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/CurrentLocaleMonitor.html">CurrentLocaleMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/CurrentLocaleMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ExtensionHostMonitor.html">ExtensionHostMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ExtensionHostMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ExtensionHostMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HTTPCookiesStorageMonitor.html">HTTPCookiesStorageMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HTTPCookiesStorageMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/HTTPCookiesStorageMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MetadataQueryMonitor.html">MetadataQueryMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MetadataQueryMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MetadataQueryMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MetadataQueryMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PortMonitor.html">PortMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PortMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProcessInfoPowerStateMonitor.html">ProcessInfoPowerStateMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProcessInfoPowerStateMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProcessInfoThermalStateMonitor.html">ProcessInfoThermalStateMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProcessInfoThermalStateMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SystemClockMonitor.html">SystemClockMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SystemClockMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SystemTimeZoneMonitor.html">SystemTimeZoneMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/SystemTimeZoneMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UbiquitousKeyValueStoreMonitor.html">UbiquitousKeyValueStoreMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UbiquitousKeyValueStoreMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UbiquitousKeyValueStoreMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UbiquityIdentityMonitor.html">UbiquityIdentityMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UbiquityIdentityMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UndoManagerMonitor.html">UndoManagerMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UndoManagerMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UndoManagerMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/URLCredentialStorageMonitor.html">URLCredentialStorageMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/URLCredentialStorageMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UserDefaultsMonitor.html">UserDefaultsMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UserDefaultsMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/UserDefaultsMonitor/Options.html">– Options</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../UIKit Accessibility Monitor Classes.html">UIKit Accessibility Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityAnnouncementMonitor.html">AccessibilityAnnouncementMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityAnnouncementMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityAnnouncementMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityElementMonitor.html">AccessibilityElementMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityElementMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityElementMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityStatusMonitor.html">AccessibilityStatusMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityStatusMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/AccessibilityStatusMonitor/Options.html">– Options</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../UIKit Application Monitor Classes.html">UIKit Application Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ApplicationStateMonitor.html">ApplicationStateMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ApplicationStateMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ApplicationStateMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BackgroundRefreshMonitor.html">BackgroundRefreshMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BackgroundRefreshMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MemoryMonitor.html">MemoryMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MemoryMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProtectedDataMonitor.html">ProtectedDataMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProtectedDataMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProtectedDataMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenshotMonitor.html">ScreenshotMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenshotMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StatusBarMonitor.html">StatusBarMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StatusBarMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/StatusBarMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TimeMonitor.html">TimeMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TimeMonitor/Event.html">– Event</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../UIKit Device Monitor Classes.html">UIKit Device Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BatteryMonitor.html">BatteryMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BatteryMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/BatteryMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/OrientationMonitor.html">OrientationMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/OrientationMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProximityMonitor.html">ProximityMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ProximityMonitor/Event.html">– Event</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../UIKit Screen Monitor Classes.html">UIKit Screen Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenBrightnessMonitor.html">ScreenBrightnessMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenBrightnessMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenCapturedMonitor.html">ScreenCapturedMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenCapturedMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenConnectionMonitor.html">ScreenConnectionMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenConnectionMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenConnectionMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenModeMonitor.html">ScreenModeMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ScreenModeMonitor/Event.html">– Event</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../UIKit Text Monitor Classes.html">UIKit Text Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextFieldTextMonitor.html">TextFieldTextMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextFieldTextMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextFieldTextMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextInputModeMonitor.html">TextInputModeMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextInputModeMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextStorageMonitor.html">TextStorageMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextStorageMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextStorageMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextViewTextMonitor.html">TextViewTextMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextViewTextMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TextViewTextMonitor/Options.html">– Options</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Other UIKit Monitor Classes.html">Other UIKit Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ContentSizeCategoryMonitor.html">ContentSizeCategoryMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ContentSizeCategoryMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/DocumentStateMonitor.html">DocumentStateMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/DocumentStateMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FocusMonitor.html">FocusMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FocusMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FocusMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FocusMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/KeyboardMonitor.html">KeyboardMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/KeyboardMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/KeyboardMonitor/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/KeyboardMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MenuControllerMonitor.html">MenuControllerMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MenuControllerMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/MenuControllerMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PasteboardMonitor.html">PasteboardMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PasteboardMonitor/Changes.html">– Changes</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PasteboardMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/PasteboardMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TableViewSelectionMonitor.html">TableViewSelectionMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/TableViewSelectionMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ViewControllerShowDetailTargetMonitor.html">ViewControllerShowDetailTargetMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/ViewControllerShowDetailTargetMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/WindowMonitor.html">WindowMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/WindowMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/WindowMonitor/Options.html">– Options</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Other Monitor Classes.html">Other Monitor Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FileSystemObjectMonitor.html">FileSystemObjectMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FileSystemObjectMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/FileSystemObjectMonitor/Options.html">– Options</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/NetworkReachabilityMonitor.html">NetworkReachabilityMonitor</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/NetworkReachabilityMonitor/Event.html">– Event</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Classes/NetworkReachabilityMonitor/Status.html">– Status</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../../Extensions/CMAcceleration.html">CMAcceleration</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content">
<h1>Info</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">Info</span></code></pre>
</div>
</div>
<p>Encapsulates the measurement of device motion.</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:13XestiMonitors19DeviceMotionMonitorC4InfoO4dataAESo08CMDeviceD0CcAEmF"></a>
<a name="//apple_ref/swift/Element/data" class="dashAnchor"></a>
<a class="token" href="#/s:13XestiMonitors19DeviceMotionMonitorC4InfoO4dataAESo08CMDeviceD0CcAEmF">data</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The device motion measurement at a moment of time.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">data</span><span class="p">(</span><span class="kt">CMDeviceMotion</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/eBardX/XestiMonitors/tree/f70b5c8992dc56f9e7848c97e875d3dfa5ae58c8/Sources/Core/CoreMotion/DeviceMotionMonitor.swift#L38">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:13XestiMonitors19DeviceMotionMonitorC4InfoO5errorAEs5Error_pcAEmF"></a>
<a name="//apple_ref/swift/Element/error" class="dashAnchor"></a>
<a class="token" href="#/s:13XestiMonitors19DeviceMotionMonitorC4InfoO5errorAEs5Error_pcAEmF">error</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The error encountered in attempting to obtain the device motion
measurement.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">error</span><span class="p">(</span><span class="kt">Error</span><span class="p">)</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/eBardX/XestiMonitors/tree/f70b5c8992dc56f9e7848c97e875d3dfa5ae58c8/Sources/Core/CoreMotion/DeviceMotionMonitor.swift#L44">Show on GitHub</a>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:13XestiMonitors19DeviceMotionMonitorC4InfoO7unknownA2EmF"></a>
<a name="//apple_ref/swift/Element/unknown" class="dashAnchor"></a>
<a class="token" href="#/s:13XestiMonitors19DeviceMotionMonitorC4InfoO7unknownA2EmF">unknown</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>No device motion measurement is available.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="n">unknown</span></code></pre>
</div>
</div>
<div class="slightly-smaller">
<a href="https://github.com/eBardX/XestiMonitors/tree/f70b5c8992dc56f9e7848c97e875d3dfa5ae58c8/Sources/Core/CoreMotion/DeviceMotionMonitor.swift#L49">Show on GitHub</a>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2016–2018 J. G. Pusey</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</body>
</div>
</html>
| {
"content_hash": "e335cfc5fab0cb90988a7fe3847d70dd",
"timestamp": "",
"source": "github",
"line_count": 766,
"max_line_length": 223,
"avg_line_length": 54.12532637075718,
"alnum_prop": 0.519922817173179,
"repo_name": "eBardX/XestiMonitors",
"id": "41c86703716e3d35e09eb2bf45c5a2f867b95571",
"size": "41677",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/Classes/DeviceMotionMonitor/Info.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "1741"
},
{
"name": "Ruby",
"bytes": "1301"
},
{
"name": "Shell",
"bytes": "1916"
},
{
"name": "Swift",
"bytes": "594714"
}
],
"symlink_target": ""
} |
require('coffee-script');
var roaster = require("roaster");
var taskLists = require("../src/index");
var fs = require("fs");
var options = {};
options.isFile = true;
roaster("./markdown.md", options, function(err, contents) {
contents = taskLists(contents);
fs.writeFileSync("./markdown.html", contents, "utf8");
}); | {
"content_hash": "0f89ac984541695b016cd29fe354f681",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 26.916666666666668,
"alnum_prop": 0.6749226006191951,
"repo_name": "atom/task-lists-js",
"id": "37190db3e40d5addc0b0c72cf92c9bb3dc09b74c",
"size": "323",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "794"
},
{
"name": "HTML",
"bytes": "1468"
},
{
"name": "JavaScript",
"bytes": "323"
},
{
"name": "Shell",
"bytes": "125"
}
],
"symlink_target": ""
} |
export BOOST_ROOT=/src/monero/boost_1_70_0
export OPENSSL_ROOT_DIR=/src/monero/openssl-1.1.1g
cd monero
git submodule init
git submodule update
mkdir -p build
cd build
cmake -D SANITIZE=ON -D OSSFUZZ=ON -D STATIC=ON -D BUILD_TESTS=ON -D USE_LTO=OFF -D ARCH="default" ..
make -C tests/fuzz \
base58_fuzz_tests \
block_fuzz_tests \
transaction_fuzz_tests \
load-from-binary_fuzz_tests \
load-from-json_fuzz_tests \
parse-url_fuzz_tests \
http-client_fuzz_tests \
levin_fuzz_tests \
bulletproof_fuzz_tests \
signature_fuzz_tests \
transaction_fuzz_tests \
cold-outputs_fuzz_tests \
cold-transaction_fuzz_tests
cd /src/monero/monero/build/tests/fuzz
for fuzzer in *_fuzz_tests
do
cp "$fuzzer" "$OUT"
base=$(echo $fuzzer | sed -e s/_fuzz_tests//)
cd "/src/monero/monero/tests/data/fuzz/$base"
rm -f "${OUT}/${base}_seed_corpus.zip"
for f in *
do
h=$(sha1sum "$f" | awk '{print $1}')
cp "$f" "$h"
zip "${OUT}/${fuzzer}_seed_corpus.zip" "$h"
rm -f "$h"
done
cd -
done
| {
"content_hash": "b9dfaba2b6847c0996314dac9dbf5f90",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 101,
"avg_line_length": 25.525,
"alnum_prop": 0.6669931439764937,
"repo_name": "FeliciaLim/oss-fuzz",
"id": "b2ba520b1735cd0d1ed7e938ea8ae1c0365af988",
"size": "1704",
"binary": false,
"copies": "1",
"ref": "refs/heads/opus",
"path": "projects/monero/build.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7113"
},
{
"name": "C++",
"bytes": "29021"
},
{
"name": "Groovy",
"bytes": "8689"
},
{
"name": "HTML",
"bytes": "603"
},
{
"name": "Python",
"bytes": "25585"
},
{
"name": "Shell",
"bytes": "70002"
}
],
"symlink_target": ""
} |
package uk.nhs.ciao.docs.transformer;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
/**
* Utility methods to clone / deep clone property object graphs
*/
public final class PropertyCloneUtils {
private PropertyCloneUtils() {
// Suppress default constructor
}
public static <K> Map<K, Object> deepClone(final Map<K, Object> map) {
if (map == null) {
return null;
}
final Map<K, Object> clone = Maps.newLinkedHashMap();
for (final Entry<K, Object> entry: map.entrySet()) {
Object value = entry.getValue();
value = deepCloneNestedProperties(value);
clone.put(entry.getKey(), value);
}
return clone;
}
public static List<Object> deepClone(final List<?> list) {
if (list == null) {
return null;
}
final List<Object> clone = Lists.newArrayList();
for (Object value: list) {
value = deepCloneNestedProperties(value);
clone.add(value);
}
return clone;
}
@SuppressWarnings("unchecked")
public static Object deepCloneNestedProperties(final Object value) {
final Object result;
if (value instanceof Map) {
result = deepClone((Map<Object, Object>)value);
} else if (value instanceof List) {
result = deepClone((List<?>)value);
} else {
result = value;
}
return result;
}
}
| {
"content_hash": "cd624d1e560c40eef331954a887075bb",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 71,
"avg_line_length": 22.92063492063492,
"alnum_prop": 0.6488919667590027,
"repo_name": "nhs-ciao/ciao-docs-transformer",
"id": "6e39a6fa6ca729e15551fa71dcd6036730a1cc40",
"size": "1444",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ciao-docs-transformer/src/main/java/uk/nhs/ciao/docs/transformer/PropertyCloneUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "59197"
}
],
"symlink_target": ""
} |
package org.sakaiproject.sitestats.tool.wicket.widget;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.wicket.Page;
import org.apache.wicket.PageParameters;
import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.ResourceModel;
import org.sakaiproject.sitestats.api.EventStat;
import org.sakaiproject.sitestats.api.PrefsData;
import org.sakaiproject.sitestats.api.Stat;
import org.sakaiproject.sitestats.api.StatsManager;
import org.sakaiproject.sitestats.api.Util;
import org.sakaiproject.sitestats.api.report.Report;
import org.sakaiproject.sitestats.api.report.ReportDef;
import org.sakaiproject.sitestats.api.report.ReportManager;
import org.sakaiproject.sitestats.api.report.ReportParams;
import org.sakaiproject.sitestats.tool.facade.Locator;
import org.sakaiproject.sitestats.tool.wicket.pages.PreferencesPage;
import org.sakaiproject.user.api.UserNotDefinedException;
public class ActivityWidget extends Panel {
private static final long serialVersionUID = 1L;
private static Log LOG = LogFactory.getLog(ActivityWidget.class);
/** The site id. */
private String siteId = null;
private PrefsData prefsdata = null;
/**
* Default constructor.
* @param id The wicket:id
* @param siteId The related site id
*/
public ActivityWidget(String id, final String siteId) {
super(id);
this.siteId = siteId;
setRenderBodyOnly(true);
setOutputMarkupId(true);
// Single values (MiniStat)
List<WidgetMiniStat> widgetMiniStats = new ArrayList<WidgetMiniStat>();
widgetMiniStats.add(getMiniStatActivityEvents());
widgetMiniStats.add(getMiniStatMostActiveTool());
widgetMiniStats.add(getMiniStatMostActiveUser());
//widgetMiniStats.add(getMiniStatConfigureLink());
// Tabs
List<AbstractTab> tabs = new ArrayList<AbstractTab>();
tabs.add(new AbstractTab(new ResourceModel("overview_tab_bydate")) {
private static final long serialVersionUID = 1L;
@Override
public Panel getPanel(String panelId) {
return getWidgetTabByDate(panelId);
}
});
tabs.add(new AbstractTab(new ResourceModel("overview_tab_byuser")) {
private static final long serialVersionUID = 1L;
@Override
public Panel getPanel(String panelId) {
return getWidgetTabByUser(panelId);
}
});
tabs.add(new AbstractTab(new ResourceModel("overview_tab_bytool")) {
private static final long serialVersionUID = 1L;
@Override
public Panel getPanel(String panelId) {
return getWidgetTabByTool(panelId);
}
});
// Final Widget object
String icon = StatsManager.SILK_ICONS_DIR + "chart_pie.png";
String title = (String) new ResourceModel("overview_title_activity").getObject();
Widget widget = new Widget("widget", icon, title, widgetMiniStats, tabs);
add(widget);
}
// -------------------------------------------------------------------------------
/** MiniStat:: Activity events */
private WidgetMiniStat getMiniStatActivityEvents() {
return new WidgetMiniStat() {
private static final long serialVersionUID = 1L;
@Override
public String getValue() {
long start = 0;
if(LOG.isDebugEnabled()) start = System.currentTimeMillis();
String val = Long.toString(Locator.getFacade().getStatsManager().getTotalSiteActivity(siteId, getPrefsdata().getToolEventsStringList()));
if(LOG.isDebugEnabled()) LOG.debug("getMiniStatActivityEvents() in " + (System.currentTimeMillis() - start) + " ms");
return val;
}
@Override
public String getSecondValue() {
return null;
}
@Override
public String getTooltip() {
return null;
}
@Override
public boolean isWiderText() {
return false;
}
@Override
public String getLabel() {
return (String) new ResourceModel("overview_title_events_sum").getObject();
}
@Override
public ReportDef getReportDefinition() {
ReportDef r = new ReportDef();
r.setId(0);
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getPrefsdata().getToolEventsStringList());
// when
rp.setWhen(ReportManager.WHEN_ALL);
// who
rp.setWho(ReportManager.WHO_ALL);
// grouping
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_EVENT);
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
rp.setHowSortBy(StatsManager.T_EVENT);
rp.setHowSortAscending(true);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_TABLE);
r.setReportParams(rp);
return r;
}
};
}
/** MiniStat:: Most active tool */
private WidgetMiniStat getMiniStatMostActiveTool() {
return new WidgetMiniStat() {
private static final long serialVersionUID = 1L;
private String mostActiveTool = null;
private long totalToolActivity = 0;
private long totalActivity = 0;
@Override
public String getValue() {
long start = 0;
if(LOG.isDebugEnabled()) start = System.currentTimeMillis();
processData();
String val = null;
if(mostActiveTool != null) {
val = Locator.getFacade().getEventRegistryService().getToolName(mostActiveTool);
}else{
val = "-";
}
if(LOG.isDebugEnabled()) LOG.debug("getMiniStatMostActiveTool() in " + (System.currentTimeMillis() - start) + " ms");
return val;
}
@Override
public String getSecondValue() {
double percentage = totalActivity==0 ? 0 : Util.round(100 * totalToolActivity / (double) totalActivity, 0);
return String.valueOf((int) percentage) + '%';
}
@Override
public String getTooltip() {
if(mostActiveTool != null) {
return Locator.getFacade().getEventRegistryService().getToolName(mostActiveTool);
}else{
return null;
}
}
@Override
public boolean isWiderText() {
return true;
}
@Override
public String getLabel() {
return (String) new ResourceModel("overview_title_mostactivetool_sum").getObject();
}
private ReportDef getCommonReportDefition() {
ReportDef r = new ReportDef();
r.setId(0);
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getPrefsdata().getToolEventsStringList());
// when
rp.setWhen(ReportManager.WHEN_ALL);
// who
rp.setWho(ReportManager.WHO_ALL);
// grouping
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_EVENT);
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
rp.setHowSortBy(StatsManager.T_EVENT);
rp.setHowSortAscending(true);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_TABLE);
r.setReportParams(rp);
return r;
}
private void processData() {
if(mostActiveTool == null) {
ReportDef rd = getCommonReportDefition();
ReportParams rp = rd.getReportParams();
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_TOOL);
rp.setHowTotalsBy(totalsBy);
rp.setHowSort(true);
rp.setHowSortBy(StatsManager.T_TOTAL);
rp.setHowSortAscending(false);
Report r = Locator.getFacade().getReportManager().getReport(rd, true, null, false);
try{
boolean first = true;
for(Stat s : r.getReportData()) {
EventStat es = (EventStat) s;
if(first) {
mostActiveTool = es.getToolId();
totalToolActivity = es.getCount();
first = false;
}
totalActivity += es.getCount();
}
}catch(Exception e) {
mostActiveTool = null;
}
}
}
@Override
public ReportDef getReportDefinition() {
ReportDef rd = getCommonReportDefition();
ReportParams rp = rd.getReportParams();
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_TOOL);
rp.setHowTotalsBy(totalsBy);
rp.setHowSortBy(StatsManager.T_TOOL);
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_BOTH);
rp.setHowChartType(StatsManager.CHARTTYPE_PIE);
rp.setHowChartSource(StatsManager.T_TOOL);
return rd;
}
};
}
/** MiniStat:: Most active user */
private WidgetMiniStat getMiniStatMostActiveUser() {
return new WidgetMiniStat() {
private static final long serialVersionUID = 1L;
private String mostActiveUser = null;
private long totalUserActivity = 0;
private long totalActivity = 0;
@Override
public String getValue() {
long start = 0;
if(LOG.isDebugEnabled()) start = System.currentTimeMillis();
processData();
String val = null;
if(mostActiveUser != null) {
String id = null;
if(("-").equals(mostActiveUser) || ("?").equals(mostActiveUser)){
id = "-";
}else{
try{
id = Locator.getFacade().getUserDirectoryService().getUser(mostActiveUser).getDisplayId();
}catch(UserNotDefinedException e1){
id = mostActiveUser;
}
}
val = id;
}else{
val = "-";
}
if(LOG.isDebugEnabled()) LOG.debug("getMiniStatMostActiveUser() in " + (System.currentTimeMillis() - start) + " ms");
return val;
}
@Override
public String getSecondValue() {
double percentage = totalActivity==0 ? 0 : Util.round(100 * totalUserActivity / (double) totalActivity, 0);
return String.valueOf((int) percentage) + '%';
}
@Override
public String getTooltip() {
if(mostActiveUser != null) {
String name = null;
if(("-").equals(mostActiveUser)) {
name = (String) new ResourceModel("user_anonymous").getObject();
}else if(("?").equals(mostActiveUser)) {
name = (String) new ResourceModel("user_anonymous_access").getObject();
}else{
name = Locator.getFacade().getStatsManager().getUserNameForDisplay(mostActiveUser);
}
return name;
}else{
return null;
}
}
@Override
public boolean isWiderText() {
return true;
}
@Override
public String getLabel() {
return (String) new ResourceModel("overview_title_mostactiveuser_sum").getObject();
}
private ReportDef getCommonReportDefition() {
ReportDef r = new ReportDef();
r.setId(0);
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getPrefsdata().getToolEventsStringList());
// when
rp.setWhen(ReportManager.WHEN_ALL);
// who
rp.setWho(ReportManager.WHO_ALL);
// grouping
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_USER);
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
rp.setHowSortBy(StatsManager.T_TOTAL);
rp.setHowSortAscending(false);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_TABLE);
r.setReportParams(rp);
return r;
}
private void processData() {
if(mostActiveUser == null) {
Report r = Locator.getFacade().getReportManager().getReport(getCommonReportDefition(), true, null, false);
try{
boolean first = true;
for(Stat s : r.getReportData()) {
EventStat es = (EventStat) s;
if(first) {
mostActiveUser = es.getUserId();
totalUserActivity = es.getCount();
first = false;
}
totalActivity += es.getCount();
}
}catch(Exception e) {
mostActiveUser = null;
}
}
}
@Override
public ReportDef getReportDefinition() {
return getCommonReportDefition();
}
};
}
/** MiniStat:: Link for Preferences */
private WidgetMiniStat getMiniStatConfigureLink() {
return new WidgetMiniStatLink() {
private static final long serialVersionUID = 1L;
@Override
public Page getPageLink() {
return new PreferencesPage(new PageParameters("siteId="+siteId));
}
@Override
public String getLabel() {
return (String) new ResourceModel("overview_title_configure_activity").getObject();
}
@Override
public String getPageLinkTooltip() {
return (String) new ResourceModel("overview_title_configure_activity_tip").getObject();
};
};
}
// -------------------------------------------------------------------------------
/** WidgetTab: By date */
protected WidgetTabTemplate getWidgetTabByDate(String panelId) {
WidgetTabTemplate wTab = new WidgetTabTemplate(panelId, ActivityWidget.this.siteId) {
private static final long serialVersionUID = 1L;
@Override
public List<Integer> getFilters() {
return Arrays.asList(FILTER_DATE, FILTER_ROLE, FILTER_TOOL);
}
@Override
public boolean useChartReportDefinitionForTable() {
return true;
}
@Override
public ReportDef getTableReportDefinition() {
return getChartReportDefinition();
}
@Override
public ReportDef getChartReportDefinition() {
String dateFilter = getDateFilter();
String roleFilter = getRoleFilter();
ReportDef r = new ReportDef();
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getToolEventsFilter());
// when
rp.setWhen(dateFilter);
// who
if(!ReportManager.WHO_ALL.equals(roleFilter)) {
rp.setWho(ReportManager.WHO_ROLE);
rp.setWhoRoleId(roleFilter);
}
// grouping
List<String> totalsBy = new ArrayList<String>();
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
totalsBy.add(StatsManager.T_DATEMONTH);
}else{
totalsBy.add(StatsManager.T_DATE);
}
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
rp.setHowSortBy(StatsManager.T_DATEMONTH);
}else{
rp.setHowSortBy(StatsManager.T_DATE);
}
rp.setHowSortAscending(false);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_BOTH);
rp.setHowChartType(StatsManager.CHARTTYPE_TIMESERIESBAR);
rp.setHowChartSource(StatsManager.T_DATE);
rp.setHowChartSeriesSource(StatsManager.T_NONE);
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_MONTH);
}else if(dateFilter.equals(ReportManager.WHEN_LAST30DAYS)) {
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_DAY);
}else{
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_WEEKDAY);
}
r.setReportParams(rp);
return r;
}
};
return wTab;
}
/** WidgetTab: By user */
protected WidgetTabTemplate getWidgetTabByUser(String panelId) {
WidgetTabTemplate wTab = new WidgetTabTemplate(panelId, ActivityWidget.this.siteId) {
private static final long serialVersionUID = 1L;
@Override
public List<Integer> getFilters() {
return Arrays.asList(FILTER_DATE, FILTER_ROLE, FILTER_TOOL);
}
@Override
public boolean useChartReportDefinitionForTable() {
return false;
}
@Override
public ReportDef getTableReportDefinition() {
ReportDef r = getChartReportDefinition();
ReportParams rp = r.getReportParams();
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_USER);
rp.setHowTotalsBy(totalsBy);
rp.setHowSortBy(StatsManager.T_TOTAL);
rp.setHowChartType(StatsManager.CHARTTYPE_PIE);
rp.setHowChartSource(StatsManager.T_USER);
r.setReportParams(rp);
return r;
}
@Override
public ReportDef getChartReportDefinition() {
String dateFilter = getDateFilter();
String roleFilter = getRoleFilter();
ReportDef r = new ReportDef();
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getToolEventsFilter());
// when
rp.setWhen(dateFilter);
// who
if(!ReportManager.WHO_ALL.equals(roleFilter)) {
rp.setWho(ReportManager.WHO_ROLE);
rp.setWhoRoleId(roleFilter);
}
// grouping
List<String> totalsBy = new ArrayList<String>();
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
totalsBy.add(StatsManager.T_DATEMONTH);
}else{
totalsBy.add(StatsManager.T_DATE);
}
totalsBy.add(StatsManager.T_USER);
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
rp.setHowSortBy(StatsManager.T_DATEMONTH);
}else{
rp.setHowSortBy(StatsManager.T_DATE);
}
rp.setHowSortAscending(false);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_BOTH);
/*rp.setHowChartType(StatsManager.CHARTTYPE_TIMESERIES);
rp.setHowChartSource(StatsManager.T_DATE);
rp.setHowChartSeriesSource(StatsManager.T_USER);
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_MONTH);
}else if(dateFilter.equals(ReportManager.WHEN_LAST30DAYS)) {
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_DAY);
}else{
rp.setHowChartSeriesPeriod(StatsManager.CHARTTIMESERIES_WEEKDAY);
}*/
rp.setHowChartType(StatsManager.CHARTTYPE_PIE);
rp.setHowChartSource(StatsManager.T_USER);
r.setReportParams(rp);
return r;
}
};
return wTab;
}
/** WidgetTab: By tool */
protected WidgetTabTemplate getWidgetTabByTool(String panelId) {
WidgetTabTemplate wTab = new WidgetTabTemplate(panelId, ActivityWidget.this.siteId) {
private static final long serialVersionUID = 1L;
@Override
public List<Integer> getFilters() {
return Arrays.asList(FILTER_DATE, FILTER_ROLE, FILTER_TOOL);
}
@Override
public boolean useChartReportDefinitionForTable() {
return false;
}
@Override
public ReportDef getTableReportDefinition() {
ReportDef r = getChartReportDefinition();
ReportParams rp = r.getReportParams();
List<String> totalsBy = new ArrayList<String>();
totalsBy.add(StatsManager.T_TOOL);
rp.setHowTotalsBy(totalsBy);
rp.setHowSortBy(StatsManager.T_TOTAL);
rp.setHowChartType(StatsManager.CHARTTYPE_PIE);
rp.setHowChartSource(StatsManager.T_TOOL);
r.setReportParams(rp);
return r;
}
@Override
public ReportDef getChartReportDefinition() {
String dateFilter = getDateFilter();
String roleFilter = getRoleFilter();
ReportDef r = new ReportDef();
r.setSiteId(siteId);
ReportParams rp = new ReportParams(siteId);
// what
rp.setWhat(ReportManager.WHAT_EVENTS);
rp.setWhatEventSelType(ReportManager.WHAT_EVENTS_BYEVENTS);
rp.setWhatEventIds(getToolEventsFilter());
// when
rp.setWhen(dateFilter);
// who
if(!ReportManager.WHO_ALL.equals(roleFilter)) {
rp.setWho(ReportManager.WHO_ROLE);
rp.setWhoRoleId(roleFilter);
}
// grouping
List<String> totalsBy = new ArrayList<String>();
/*if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
totalsBy.add(StatsManager.T_DATEMONTH);
}else{
totalsBy.add(StatsManager.T_DATE);
}*/
totalsBy.add(StatsManager.T_TOOL);
rp.setHowTotalsBy(totalsBy);
// sorting
rp.setHowSort(true);
if(dateFilter.equals(ReportManager.WHEN_LAST365DAYS) || dateFilter.equals(ReportManager.WHEN_ALL)) {
rp.setHowSortBy(StatsManager.T_DATEMONTH);
}else{
rp.setHowSortBy(StatsManager.T_DATE);
}
rp.setHowSortAscending(false);
// chart
rp.setHowPresentationMode(ReportManager.HOW_PRESENTATION_BOTH);
rp.setHowChartType(StatsManager.CHARTTYPE_PIE);
rp.setHowChartSource(StatsManager.T_TOOL);
r.setReportParams(rp);
return r;
}
};
return wTab;
}
// -------------------------------------------------------------------------------
// -------------------------------------------------------------------------------
private PrefsData getPrefsdata() {
if(prefsdata == null) {
prefsdata = Locator.getFacade().getStatsManager().getPreferences(siteId, true);
}
return prefsdata;
}
}
| {
"content_hash": "f9bfc99f18e39cb806903f13159e1ae1",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 141,
"avg_line_length": 31.731411229135052,
"alnum_prop": 0.6813638754722395,
"repo_name": "eemirtekin/Sakai-10.6-TR",
"id": "de059fcbc2aad8bdae05efb6b2d1cbfe795c073a",
"size": "21795",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sitestats/sitestats-tool/src/java/org/sakaiproject/sitestats/tool/wicket/widget/ActivityWidget.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "59098"
},
{
"name": "Batchfile",
"bytes": "6366"
},
{
"name": "C++",
"bytes": "6402"
},
{
"name": "CSS",
"bytes": "2616828"
},
{
"name": "ColdFusion",
"bytes": "146057"
},
{
"name": "HTML",
"bytes": "5982358"
},
{
"name": "Java",
"bytes": "49585098"
},
{
"name": "JavaScript",
"bytes": "6722774"
},
{
"name": "Lasso",
"bytes": "26436"
},
{
"name": "PHP",
"bytes": "223840"
},
{
"name": "PLSQL",
"bytes": "2163243"
},
{
"name": "Perl",
"bytes": "102776"
},
{
"name": "Python",
"bytes": "87575"
},
{
"name": "Ruby",
"bytes": "3606"
},
{
"name": "Shell",
"bytes": "33041"
},
{
"name": "SourcePawn",
"bytes": "2274"
},
{
"name": "XSLT",
"bytes": "607759"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="license">Licence</string>
<string name="import_wif">"Import z privátní klíč (WIF)"</string>
<string name="txt_wif_activity">Peněženka import Format - WIF</string>
<string name="txt_wif_paste">Soukromý klíč (WIF)</string>
<string name="please_enter_wif">Prosím, zadejte soukromý klíč (wif)</string>
<string name="invalid_wif">Neplatný WIF</string>
<string name="wif_error_invalid_account">Neplatný účet, zkontrolujte wif za překlepy</string>
<string name="unable_to_load_wif">Nelze načíst wif</string>
<string name="error_wif">Chyba při vytváření klíče wif</string>
<string name="error_brainkey_wif_export">WIF dováženy účet nepodporuje brainkey zálohu</string>
<string name="pin_number_warning">Číslo pin musí být alespoň 6 číslic</string>
<string name="old_pin_number_warning">Starý PIN musí být alespoň 6 číslic</string>
<string name="send_capital">Odeslat</string>
<string name="account_create_register_or_import">Vytvořit účet/Registrovat nebo importovat</string>
<string name="txt_account_name">Jméno účtu</string>
<string name="time_stamp">Časové razítko</string>
<string name="email_pdf">Email PDF</string>
<string name="account">Účet</string>
<string name="friendly_name">Jméno účtu</string>
<string name="notes">Poznámky</string>
<string name="bts_will_be_deducted">BTS budou odečteny z</string>
<string name="note">Poznámka</string>
<string name="payment_received">Platba přijata</string>
<string name="import_brainkey">Importujte z BrainKey</string>
<string name="import_backup_old">Importujte zálohu z .bin souboru</string>
<string name="choose_backup">Vyberte zálohu</string>
<string name="unable_to_import_account_from_bin_file">Nelze importovat účet z bin souboru</string>
<string name="importing_keys_from_bin_file">Importuji klíče ze souboru bin</string>
<string name="import_backup">Import zálohy z bin souboru</string>
<string name="is_already_added">je již přidáno</string>
<string name="in_valid_email">Neplatný email</string>
<string name="select">Vybrat</string>
<string name="are_you_sure">Opravdu?</string>
<string name="please_make_sure_your_pin">Prosím ujistěte se, že PIN je správný.</string>
<string name="please_make_sure_your_pin_file">Prosím ujistěte se, že PIN je správný nebo je vybrán správný soubor PIN.</string>
<string name="choose_file">Vyberte soubor</string>
<string name="no_file_chosen">Není zvolen žádný soubor</string>
<string name="account_label">Vyberte soubor</string>
<string name="loading_msg">Počkejte než se načte zůstatek.</string>
<string name="txt_6_digits_pin">PIN (6+ číslic)</string>
<string name="txt_6_digits_pin_confirm">PIN confirm</string>
<string name="create">VYTVOŘIT</string>
<string name="existing_account">Stávající účet</string>
<string name="agreement">Dohoda</string>
<string name="cancel_and_exit">Zrušit a zavřít</string>
<string name="i_agree">Souhlasím</string>
<string name="kindly_create_account">Vytvořte účet prosím</string>
<string name="please_enter_old_6_digit_pin">Prosím, zadejte starý PIN</string>
<string name="please_enter_6_digit_pin">Zadejte kód PIN</string>
<string name="please_enter_6_digit_pin_confirm">Prosím, zadejte potvrzení PIN</string>
<string name="mismatch_pin">Neshoda PINů</string>
<string name="txt_brain_key">Brainkey</string>
<string name="txt_brain_key_info">Vytiskněte si ho nebo si ho poznamenejte. Každý, kdo má přístup k vašemu klíči pro obnovení bude mít přístup k finančním prostředkům v této peněžence.</string>
<string name="create_wallet">VYTVOŘTE PENĚŽENKU</string><string name="cance">ZRUŠIT</string>
<string name="save">ULOŽIT</string>
<string name="next">DALŠÍ</string>
<string name="please_enter_brainkey">Prosím zadejte brainkey</string>
<string name="please_enter_correct_brainkey">Prosím zadejte správný brainkey</string>
<string name="balances">Zůstatky</string>
<string name="contacts">Kontakty</string>
<string name="receive_uppercase">VYŽÁDAT</string>
<string name="send_uppercase">POSLAT</string>
<string name="transactions">Transakce</string>
<string name="title_activity_setting">Nastavení</string>
<string name="backup_asset">Zálohování zůstatku</string>
<string name="taxable_country">Země zdanění</string>
<string name="date_time">Zobrazení data a času</string>
<string name="check_for_updates">Zkontrolovat aktualizace při startu</string>
<string name="automatically_install">Automatická instalace hlavní verze</string>
<string name="require_pin">Vyžadovat PIN / Šablona plateb & Zobrazení poznámky</string>
<string name="close_bitshare">Automaticky zavřít peněženku Bitshares po 3 minutách nečinnosti</string>
<string name="always_donate">Vždy darovat 2 BTS vývojáři BitShares Mnichov</string>
<string name="hide_donations">Skrýt dary v seznamu transakcí</string>
<string name="backup">ZÁLOHA BIN</string>
<string name="checkbox_donate_old">Darovat 2 BTS vývojáři Bitshares Mnichov</string>
<string name="backup_brainkey">ZÁLOHA BRAINKEY</string>
<string name="imported_created_accounts">Importované / vytvořené účty</string>
<string name="register_new_account">Registrovat nový účet</string>
<string name="secure_pin">ZMĚNIT PIN</string>
<string name="export">Export</string>
<string name="checkbox_donate">Darovat 2 BTS podpory vývojáři</string>
<string name="show_more">Zobrazit více</string>
<string name="share_text">Našel jsem tuto šikovnou kryptoměnovou peněženku, která umožňuje odesílat a přijímat "Chytré mince". Koukni na to! Zdraví</string>
<string name="share_info">Pozvěte jednoho nebo více z vašich přátel vyzkoušet kryptoměnovou peněženku! E-mailové adresy nejsou ukládány nebo shromáždovány a jejich soukromí je zajištěno.</string>
<string name="share_subject">Šikovná kryptoměnná peněženka</string>
<string name="share_heading">Sdílet s přáteli</string>
<string name="share_btn_text">OTEVŘI emailové aplikace</string>
<string name="action_settings">Nastavení</string>
<string name="txt_validating_account">Ověřování účtu ...</string>
<string name="validating_account">Ověřování účtu ...</string>
<string name="account_name_should_be_longer">Název účtu by měl být delší</string>
<string name="account_name_already_exist">Název účtu %s již existuje</string>
<string name="account_name_not_exist">Název účtu %s neexistuje</string>
<string name="add_contact">Přidat</string>
<string name="edit_contact">Změnit</string>
<string name="empty_list">Seznam kontaktů je prázdný</string>
<string name="account_name_validate">Název účtu je platný</string>
<string name="txt_no_internet_connection">Internet nedostupný</string>
<string name="unable_to_create_account_from_brainkey">Nelze vytvořit účet z brainkey</string>
<string name="importing_your_wallet">Importuji peněženku...</string>
<string name="str_trading_pair_not_exist">Obchodní pár neexistuje</string>
<string name="unable_to_create_qr_code">Nelze generovat QR kód</string>
<string name="price">Cena</string>
<string name="currency">Měna</string>
<string name="please_enter_amount">Prosím zadejte částku</string>
<string name="amount_should_be_greater_than_zero">Částka by měla být větší než nula</string>
<string name="no_amount_requested">Nepožadujete žádnou částku</string>
<string name="to_capital">Komu</string>
<string name="from_capital">Od</string>
<string name="memo_capital">Zpráva</string>
<string name="empty_file_created">Vytvořen prázdný soubor</string>
<string name="date">Datum</string>
<string name="all">Všechno</string>
<string name="to_from">Komu</string>
<string name="amount">Množství</string>
<string name="message">Zpráva</string>
<string name="pdf_generated_msg">PDF generován a uložen:</string>
<string name="pdf_generated_msg_error">Nelze vytvořit PDF. Prosím, zkuste to znovu. Chyba:</string>
<string name="raw_transactions">Raw Transaction:</string>
<string name="extensions">Extensions</string>
<string name="op_in_trx">op_in_trx</string>
<string name="virtual_op">virtual_op</string>
<string name="operation_results">operation_results</string>
<string name="sent_rcv">Odeslané / přijaté</string>
<string name="details">Podrobnosti</string>
<string name="share_qr_code">Sdílet QR kód</string>
<string name="done">Hotovo</string>
<string name="id_s">id</string>
<string name="time">čas</string>
<string name="operations">operace</string>
<string name="trx_in_block">trx_in_block</string>
<string name="symbol_capital">Symbol</string>
<string name="fee_capital">Poplatek</string>
<string name="ok">OK</string>
<string name="loading">Načítání ...</string>
<string name="pay_to">Zaplať</string>
<string name="requested"></string>
<string name="failed_transaction">Nepodařilo se provést transankci</string>
<string name="str_invalid_amount">Zadejte prosím platnou částku</string>
<string name="str_invalid_receiver">Zadejte prosím platný účet příjemce</string>
<string name="str_transaction_failed">Transakce se nezdařila</string>
<string name="please_enter_valid_amount">Zadejte prosím platnou částku</string>
<string name="select_timezone">Vybrat časové pásmo</string>
<string name="old_pin">starý PIN</string>
<string name="pin_created_successfully">PIN úspěšně vytvořen</string>
<string name="edit_pin">Edit PIN</string>
<string name="txt_edit">ULOŽIT</string>
<string name="create_pin">vytvoření kódu PIN</string>
<string name="pin_changed_successfully">PIN byl úspěšně změněn</string>
<string name="incorrect_old_pin">Nesprávný starý PIN</string>
<string name="copy">Kopírovat</string>
<string name="pin_verification">ODEMKNI</string>
<string name="send_screen_name">Poslat</string>
<string name="rcv_screen_name">Vyžádat</string>
<string name="request_amount_screen_name">Požadovaná suma</string>
<string name="payment_rcvd_screen_name">Děkuji</string>
<string name="e_receipt_activity_name">e-Stvrzenka</string>
<string name="settings_activity_name">Nastavení</string>
<string name="qr_code_activity_name">Skenování QR</string>
<string name="share_account_activity_name">Sdílet s přáteli</string>
<string name="add_contact_activity_name">Přidat kontakt</string>
<string name="str_trade_not_available">Obchod není k dispozici</string>
<string name="preferred_lang">Preferovaný jazyk</string>
<string name="got_it">Mám to</string>
<string name="upgrade_to_ltm">Přechod na doživotní členství</string>
<string name="txt_back">Zpět</string>
<string name="please_pay">Věnujte prosím</string>
<string name="transfer_funds">Přenos fondů</string>
<string name="unable_to_process">Nelze zpracovat</string>
<string name="cancel">ZRUŠIT</string>
<string formatted="false" name="help_message">Získejte 80% slevu na poplatcích! Doživotní členové získají 80% slevu na každém poplatku, který musí zaplatit za transakce a získají nárok na provizi za uživatele, které zaregistrují nebo na síti doporučí. Doživotní členství je nyní pod 20000 BTS!</string>
<string name="txt_yes">Ano</string> <string name="txt_no">Ne</string>
<string name="txt_confirmation">Potvrzení</string>
<string name="txt_confirmation_msg">Opravdu?</string>
<string name="txt_folder_name">Smartcoins</string>
<string name="txt_folder_created">Vytvořené složky</string>
<string name="upgrade_failed">Aktualizace selhala</string>
<string name="upgrading">Aktualizace ...</string>
<string name="import_new_account">IMPORT ÚČTU</string>
<string name="upgrade_account">PŘECHOD NA VYŠŠÍ VERZI ÚČTU</string>
<string name="remove_account">Odebrat účet</string>
<string name="txt_alertmsg">Opravdu chcete smazat tento účet?</string>
<string name="validation_in_progress">Ověření probíhá ...</string>
<string name="last_letter_cannot">Poslední písmeno nemůže být -</string>
<string name="account_name_shoud_have">Název účtu by měl mít aspoň jedno -</string>
<string name="default_currency">CZK</string>
<string name="account_already_exist">Účet již existuje</string>
<string name="donation">Dar</string>
<string name="insufficient_funds">Nedostatečné finanční prostředky</string>
<string name="txt_wallet_atleast_one_account">Omlouváme se, ale vaše peněženka musí obsahovat alespoň 1 účet</string>
<string name="updating_transaction_id">Aktualizace ID transakce. Prosím, vyčkejte</string>
<string name="email_name">Chcete-li zobrazit fotografii pro tento kontakt, zadejte zde jeho Gravatar email</string>
<string name="upgrade_success">Aktualizace byla úspěšná!</string>
<string name="copied_to_clipboard">Byl zkopírován do schránky</string>
<string name="unable_to_load_brainkey">Nelze načíst brainkey</string>
<string name="unable_to_generate_bin_format_for_key">Pro klíč nelze generovat bin formát</string>
<string name="creating_backup_file">Vytváření záložního souboru</string>
<string name="fetching_key">Načítám klíč</string>
<string name="generating_bin_format">Generování formátu bin</string>
<string name="invalid_pin">Neplatný PIN</string>
<string name="saving_bin_file_to">Ukládání bin souboru do</string>
<string name="bin_file_saved_successfully_to">Bin soubor byl úspěšně uložen do</string>
<string name="unable_to_save_bin_file">Nelze uložit soubor bin</string>
<string name="txt_alertmsg_fr">Opravdu chcete odstranit</string>
<string name="txt_alertmsg_la">účet z této peněženky?</string>
<string name="bugs_or_errors">Chyba nebo chyby?</string>
<string name="please_let_us_know">Prosím, dejte nám vědět:</string>
<string name="try_again">Zkuste to znovu po 5 minutách</string>
<string name="warning_msg_same_account">Nemůžete poslat částky na stejný účet</string>
<string name="please_backup_your_brainkey">Prosím zálohujte svůj brainkey</string>
<string name="backup_brainkey_msg">Zálohujte bin soubor někam do bezpečí, nebo vaše finanční prostředky mohou být ztraceny!</string>
<string name="unable_to_trade_bAssets">Nelze obchodovat záložní aktiva</string>
<string name="unable_to_send_amount">Nelze odeslat částku</string>
<string name="unable_to_decode_QR">Nelze dekódovat QR kód</string>
<string name="loyalty_points">Věrnostní body</string>
<string name="str_warning_only_available">Varování! Je k dispozici pouze %1$s %2$s</string>
<string name="str_balance_available">Dostupný zůstatek %1$s %2$s</string>
<string name="select_backup_asset">Vyberte záložní aktivum</string>
<string name="sender_account">Účet odesílatele</string>
<string name="receiver_account">Účet příjemce</string>
<string name="total">Celkem</string>
<string name="payment_method">Způsob platby</string>
<string name="thankyou_string">Děkujeme Vám za použití peněženky</string>
<string name="audio_folder_path">Cesta k audio složce</string>
<string name="please_make_sure_your_bin_file">Prosím ujistěte se, že zadáváte správný PIN a že je vybrán správný soubor</string>
<string name="change">Změnit...</string>
<string name="connected_to">Připojeno k</string>
<string name="account_create_msg">Registrovat lze pouze jeden účet každých 10 minut</string>
<string name="names_must_include_a_number">Názvy musí obsahovat číslo</string>
<string name="account_name_must_include_dash_and_a_number">Názvy musí obsahovat pomlčku (-) a číslo</string>
<string name="import_gravatar">Import Gravataru</string>
<string name="please_import_the_correct_file">Prosím importujte správný soubor</string>
<string name="merchant_email_has_been_imported_successfully">Obchodní email byl úspěšně importován</string>
</resources>
| {
"content_hash": "0949138fd5f8d84ba46b65bb08b3c1b4",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 306,
"avg_line_length": 33.31856540084388,
"alnum_prop": 0.7404546317988983,
"repo_name": "computationalcore/smartcoins-wallet",
"id": "db33ee8eb3fa0c60ab2d5c69be53f427b6f14cb3",
"size": "16388",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/src/main/res/values-cs/strings.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1172644"
}
],
"symlink_target": ""
} |
import logging
import sys
from twisted.internet import reactor, stdio
from twisted.protocols import basic
from twobitbot.utils import configure
from twobitbot.botresponder import BotResponder
from twobitbot.bitstampwatcher import BitstampWatcher
log = logging.getLogger("termbot")
# Terminal environment for testing
# Resources:
# https://twistedmatrix.com/documents/current/core/examples/stdiodemo.py
# https://twistedmatrix.com/documents/current/core/examples/stdin.py
###########################################
##### NEEDS PATCH TO WORK ON WINDOWS:
##### http://stackoverflow.com/a/14332475
###########################################
class TerminalBot(basic.LineReceiver):
delimiter = '\n'
def __init__(self, config):
self.config = config
self.watcher = BitstampWatcher()
self.watcher.add_alert_callback(self.out)
self.responder = BotResponder(self.config, self.watcher)
def connectionMade(self):
print("Welcome! This should work if you aren't using Windows.")
def lineReceived(self, line):
response = self.responder.dispatch(line)
if response:
self.out(response)
def out(self, line):
self.sendLine(line)
def main():
configure.setup_logs()
try:
config = configure.load_config()
except IOError as e:
log.critical("Aborting, problem loading config: {0}".format(e), exc_info=True)
sys.exit(1)
bot = TerminalBot(config)
stdio.StandardIO(bot)
reactor.run()
if __name__ == '__main__':
main()
| {
"content_hash": "94b7916d2f727421a6d1958d1f74f4b8",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 86,
"avg_line_length": 24.746031746031747,
"alnum_prop": 0.6465683130211675,
"repo_name": "socillion/twobitbot",
"id": "3e1a48b459eae0d084aa34aaa584ebc0631af763",
"size": "1582",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "termbot.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "59749"
},
{
"name": "Shell",
"bytes": "2208"
}
],
"symlink_target": ""
} |
struct SESound
{
playmu_sound* sound;
int pos;
float volume;
bool loop;
bool stop;
};
SESound playmu_sesounds[64];
float* playmu_soundbank[2048];
StereoBufferP playmu_soundbuffer;
void playmu_ZeroSoundBuffer()
{
if(playmu_soundbuffer.size==0)
return;
ZeroBuffer(playmu_soundbuffer.left, playmu_soundbuffer.size);
ZeroBuffer(playmu_soundbuffer.right, playmu_soundbuffer.size);
}
void playmu_RenderSoundBuffer(SESound& se, int size)
{
StereoBufferP& buffer=playmu_soundbuffer;
if(buffer.size!=size) // allocate new buffer if incorrect size
{
// LogPrint("allocating sound effect buffer (%i samples)", size);
free(buffer.left);
free(buffer.right);
buffer.size=size;
buffer.mono=false;
buffer.left=(float*)malloc(buffer.size*sizeof(float));
buffer.right=(float*)malloc(buffer.size*sizeof(float));
playmu_ZeroSoundBuffer();
}
for(int i=0;i<size;i++)
{
if(se.pos<se.sound->length)
{
buffer.left[i]+=se.sound->samples[se.pos]*se.volume;
buffer.right[i]+=se.sound->samples[se.pos]*se.volume;
}
se.pos++;
if(se.pos>=se.sound->length && se.loop) // restart if looping
se.pos=0;
}
if(se.pos>=se.sound->length) // finished playing
se.sound=NULL;
}
void playmu_freesound(playmu_sound& sound)
{
for(int i=0;i<2048;i++)
if(playmu_soundbank[i]==sound.samples) // only free if it has been loaded
{
free(sound.samples);
sound.samples=NULL;
sound.length=0;
playmu_soundbank[i]=NULL;
break;
}
}
bool playmu_loadsound(playmu_sound& sound, char* filename, int channels)
{
playmu_freesound(sound);
FILE *file=fopen(filename, "rb");
if(!file)
return false;
int wchannels=0;
int samplebits=0;
int samplerate=0;
char string[256];
int word=0;
int dword=0;
int chunksize=0;
fread(string, 4, 1, file); // "RIFF"
fread(&dword, 1, 4, file); // remaining file size
fread(string, 4, 1, file); // "WAVE"
fread(string, 4, 1, file); // "fmt "
fread(&chunksize, 1, 4, file); // chunk size
fread(&word, 1, 2, file); // compression code
if(word!=1)
{
// LogPrint("swave: Unsupported compression format (%i)", word);
return false; // not PCM
}
fread(&wchannels, 1, 2, file); // channels
fread(&samplerate, 1, 4, file); // sample rate
fread(&dword, 1, 4, file); // bytes/sec (ignore)
fread(&word, 1, 2, file); // block align (ignore)
fread(&samplebits, 1, 2, file); // bits per sample
for(int i=0;i<chunksize-16;i+=2) // extra format bytes
fread(&word, 1, 2, file);
fread(string, 4, 1, file); // "data"
// string[4]='\0';
// LogPrint("\"%s\"", string);
fread(&chunksize, 1, 4, file); // chunk size
// LogPrint("Chunksize=%i", chunksize);
// read sample data
// float peak=1.0f/65535; // not zero...
int samplesize=samplebits/8*wchannels;
int numsamples=chunksize/samplesize;
// LogPrint("Reading %i samples, bits=%i, channels=%i", numsamples, samplebits, channels);
float *data=(float*)malloc(numsamples*sizeof(float));
int audiostart=-1; // set to 0 to disable removal of silence at the start of the sample
int audioend=0;
for(int i=0;i<numsamples;i++)
{
float value=0.0f;
if(samplebits==8) // 8 bit unsigned
{
unsigned char byte=0;
fread(&byte, 1, 1, file);
if(wchannels==2)
{
int a=(int)byte;
fread(&byte, 1, 1, file);
byte=(unsigned char)((a+byte)/2);
}
value=(float)(byte-128)/0x80;
}
if(samplebits==16) // 16 bit signed
{
short word=0;
fread(&word, 1, 2, file);
if(wchannels==2)
{
int a=(int)word;
fread(&word, 1, 2, file);
word=(short)((a+word)/2);
}
value=(float)word/0x8000;
}
if(value!=0.0f)
{
audioend=i+1;
if(audiostart==-1)
audiostart=i;
}
if(audiostart!=-1)
data[i-audiostart]=value;
// if(fabs(value)>peak)
// peak=fabs(value);
}
// LogPrint("swave: audiostart=%i, audioend=%i", audiostart, audioend);
// LogPrint("swave: silence removal (%i -> %i)", numsamples, audioend-audiostart);
numsamples=audioend-audiostart;
float *finaldata;
int slength=0;
if(samplerate!=44100) // resampling needed
{
int length=numsamples*44100/samplerate;
// LogPrint("swave: Resampling from %i (%i -> %i)", samplerate, numsamples, length);
finaldata=(float*)malloc(length*sizeof(float));
slength=length;
for(int i=0;i<length;i++)
{
float fpos=(float)i/(length-1)*(numsamples-1);
int index=(int)(fpos-0.5f);
float f=fpos-(float)index;
if(index<0) index=0;
if(index>numsamples-2) index=numsamples-2;
float s1=data[index];
float s2=data[index+1];
float value=s1*(1.0f-f)+s2*f;
finaldata[i]=value;
}
free(data);
}
else // matching samplerate
{
finaldata=data;
slength=numsamples;
}
// scale
for(int i=0;i<slength;i++)
{
finaldata[i]*=0.5f; // default to half maximum volume, to alleviate clipping issues
// finaldata[i]*=0.99f/peak;
// finaldata[i]=(float)((char)(finaldata[i]*127))/127;
}
// for(int i=0;i<2000;i+=100)
// LogPrint("%.2f", samples[id].data[i]);
// LogPrint("swave: Loaded wave \"%s\": length=%i, %i bit, %i Hz, %i channels", filename, slength, samplebits, samplerate, channels);
fclose(file);
// return finaldata;
sound.samples=finaldata;
sound.channels=channels;
sound.length=slength;
for(int i=0;i<2048;i++)
if(playmu_soundbank[i]==NULL)
{
// playmu_soundbank[i]=&sound;
playmu_soundbank[i]=sound.samples;
break;
}
return true;
}
void playmu_stopsound(playmu_sound& sound)
{
for(int i=0;i<64;i++)
if(playmu_sesounds[i].sound!=NULL && playmu_sesounds[i].sound->samples==sound.samples)
playmu_sesounds[i].stop=true;
}
void playmu_soundvolume(playmu_sound& sound, int volume) // set volume of playing sound
{
for(int i=0;i<64;i++)
if(playmu_sesounds[i].sound!=NULL && playmu_sesounds[i].sound->samples==sound.samples)
playmu_sesounds[i].volume=(float)volume/100;
}
void playmu_playsound(playmu_sound& sound, int volume)
{
playmu_playsound(sound, volume, false);
}
void playmu_playsound(playmu_sound& sound, int volume, bool loop)
{
// LogPrintf("playsound (%.8X)", sound.samples);
if(sound.samples==NULL || sound.length==0)
{
// LogPrintf(" - empty sample\n");
return;
}
int oldest=0;
int channels=0;
int i=0;
// see if we need to override an old instance of the same sound
for(i=0;i<64;i++)
if(playmu_sesounds[i].sound!=NULL && playmu_sesounds[i].sound->samples==sound.samples)
{
channels++;
oldest=i;
}
if(channels>=sound.channels)
{
i=oldest;
// LogPrintf(" - override old channel");
}
else // ok to add new channel, search for spot (or override oldest playing)
{
int oldest_pos=0;
for(i=0;i<64;i++)
{
if(playmu_sesounds[i].sound==NULL)
break;
else if(playmu_sesounds[i].pos>=oldest_pos)
{
oldest=i;
oldest_pos=playmu_sesounds[i].pos;
}
}
if(i==64)
{
i=oldest;
// LogPrintf(" - channel overflow");
}
}
playmu_sesounds[i].sound=&sound;
playmu_sesounds[i].pos=0;
playmu_sesounds[i].volume=(float)volume/100;
playmu_sesounds[i].loop=loop;
playmu_sesounds[i].stop=false;
// LogPrintf(" @ channel=%i, volume=%.2f\n", i, playmu_sesounds[i].volume);
// LogPrint("---channels:");
channels=0;
for(int ci=0;ci<64;ci++)
if(playmu_sesounds[ci].sound!=NULL)
{
channels++;
// LogPrint("ch%.2i: (%.8X) - v=%.2f pos=%.2i%%", ci, playmu_sesounds[ci].sound->samples, playmu_sesounds[ci].volume, playmu_sesounds[ci].pos*100/playmu_sesounds[ci].sound->length);
}
// LogPrint("---");
}
| {
"content_hash": "8529990ad1813783aaf9a0f65dc4892b",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 183,
"avg_line_length": 25.84175084175084,
"alnum_prop": 0.6300977198697069,
"repo_name": "Huntasubs/musagi-hunta",
"id": "85e08834fe2ff58aa4b25bd7ca1801a890f78c2a",
"size": "7675",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "playmu/playmu_sound.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "424"
},
{
"name": "C",
"bytes": "70321"
},
{
"name": "C++",
"bytes": "800025"
},
{
"name": "Makefile",
"bytes": "410"
},
{
"name": "Shell",
"bytes": "983"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project name="zstack all in one package builder" basedir="../">
<property name="target.license.file" location="${allinone.dir}/zstack-license" />
<property name="zstack.repo.version" location="${zstack.distro.source}/mkiso/.repo_version" />
<condition property="check.repo.version" value="True" else="False">
<and>
<isset property="build_war_flag"/>
</and>
</condition>
<target name="all-in-one-package" >
<copy file="${zstack.install}" todir="${build.dir}" />
<copy file="${war.file}" todir="${allinone.dir}" />
<copy file="${apachetomcat.pkg}" todir="${allinone.dir}" />
<tar destfile="${allinone.file}" basedir="${allinone.dir}" compression="gzip" />
<echo message="successfully build zstack all in one package at ${allinone.file}" />
</target>
<target name="copy-license-file" if="license.file">
<echo message="copy license file to ${allinone.dir}" />
<copy file="${license.file}" tofile="${target.license.file}" />
</target>
<target name="copy-trial-license">
<echo message="copy zstack_trial_license to ${allinone.bin.dir}" />
<copy file="${zstack.trial.license}" todir="${allinone.bin.dir}" />
</target>
<target name="check-repo-version-exists">
<available file="${zstack.repo.version}" property="repo.version.exists"/>
</target>
<target name="copy-repo-version" depends="check-repo-version-exists" if="repo.version.exists">
<echo message="copy .repo_version to ${allinone.bin.dir}" />
<copy file="${zstack.repo.version}" todir="${allinone.bin.dir}" />
</target>
<target name="build-centos-offline" depends="copy-license-file, check-repo-version-exists">
<copy file="${war.file}" todir="${allinone.dir}" />
<echo message="copy apache-tomcat to ${allinone.file}" />
<copy file="${apachetomcat.pkg}" todir="${allinone.dir}" />
<tar destfile="${allinone.file}" basedir="${allinone.dir}" compression="gzip" />
<makeDir dir="${allinone.bin.dir}" />
<move file="${allinone.file}" todir="${allinone.bin.dir}" />
<copy file="${zstack.install}" todir="${allinone.bin.dir}" />
<exec executable="bash" dir="${allinone.bin.dir}" failonerror="true">
<arg value="${offline.bin.gen.setup.script}" />
<arg value="${product.name}" />
<arg value="${product.version}" />
<arg value="${check.repo.version}" />
<arg value="${offline.bin.setup.script}" />
</exec>
<exec executable="bash" dir="${allinone.bin.dir}" failonerror="true">
<arg value="${gen.product.title.script}" />
<arg value="${product.name}" />
<arg value="${product.version}" />
<arg value="${allinone.bin.product.title}" />
</exec>
<antcall target="copy-trial-license" />
<fail message=".repo_version file does not exists.">
<condition>
<and>
<isset property="build_war_flag" />
<not>
<isset property="repo.version.exists" />
</not>
</and>
</condition>
</fail>
<antcall target="copy-repo-version" />
<tar destfile="${allinone.offline.file}" basedir="${allinone.bin.dir}" />
<exec executable="bash" dir="${build.dir}" failonerror="true">
<arg value="${build.installation.bin.script}" />
<arg value="${offline.bin.setup.script}" />
<arg value="${allinone.offline.file}" />
<arg value="${allinone.bin.file}" />
</exec>
<echo message="successfully build zstack all in one package at ${allinone.file}" />
</target>
</project>
| {
"content_hash": "b98f583601cdbfdca70925412d1850b3",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 98,
"avg_line_length": 43.90909090909091,
"alnum_prop": 0.5709109730848861,
"repo_name": "zstackio/zstack-utility",
"id": "d3d929bf06f92a47d00fc3f6f0c207e9b4e3d2bd",
"size": "3864",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "zstackbuild/projects/zstack-buildallinone.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "6782"
},
{
"name": "Jinja",
"bytes": "26501"
},
{
"name": "Puppet",
"bytes": "10604"
},
{
"name": "Python",
"bytes": "3712203"
},
{
"name": "Shell",
"bytes": "334521"
}
],
"symlink_target": ""
} |
#ifndef __XLBINTREE_H_6C3F6F71_DCAC_4B1D_9BAC_1333FB803DEE_INCLUDED__
#define __XLBINTREE_H_6C3F6F71_DCAC_4B1D_9BAC_1333FB803DEE_INCLUDED__
#include "../Memory/xlMemory.h"
namespace xl
{
template <typename T>
struct BinTreeNode
{
typedef BinTreeNode *NodePtr;
T tValue;
NodePtr pParent;
NodePtr pLeft;
NodePtr pRight;
BinTreeNode() : pParent(nullptr), pLeft(nullptr), pRight(nullptr)
{
}
BinTreeNode(const T &tValue, NodePtr pParent = nullptr, NodePtr pLeft = nullptr, NodePtr pRight = nullptr) :
tValue(tValue), pParent(pParent), pLeft(pLeft), pRight(pRight)
{
}
};
template <typename T, typename NodeType = BinTreeNode<T>>
class BinTree
{
public:
typedef NodeType *NodePtr;
public:
BinTree() : m_pRoot(nullptr)
{
}
BinTree(const BinTree &that) : m_pRoot(nullptr)
{
*this = that;
}
~BinTree()
{
Clear();
}
protected:
NodePtr m_pRoot;
public:
BinTree &operator = (const BinTree &that)
{
if (this == &that)
{
return *this;
}
this->SetRoot(CopySubTree(that.m_pRoot));
return *this;
}
bool operator == (const BinTree &that) const
{
if (this == &that)
{
return true;
}
return IsSubTreeEqual(this->m_pRoot, that.m_pRoot);
}
bool operator != (const BinTree &that) const
{
if (this == &that)
{
return false;
}
return IsSubTreeUnequal(this->m_pRoot, that.m_pRoot);
}
public:
NodePtr Root() const
{
return m_pRoot;
}
bool Empty() const
{
return m_pRoot == nullptr;
}
public:
void Clear()
{
DeleteSubTree(m_pRoot);
}
NodePtr SetRoot(NodePtr pNode)
{
m_pRoot = pNode;
return m_pRoot;
}
public:
static bool IsSubTreeEqual(NodePtr pThisNode, NodePtr pThatNode)
{
if (pThisNode == pThatNode)
{
return true;
}
if (pThisNode == nullptr || pThatNode == nullptr)
{
return false;
}
if (pThisNode->tValue != pThatNode->tValue)
{
return false;
}
return (IsSubTreeEqual(pThisNode->pLeft, pThatNode->pLeft) &&
IsSubTreeEqual(pThisNode->pRight, pThatNode->pRight));
}
static bool IsSubTreeUnequal(NodePtr pThisNode, NodePtr pThatNode)
{
if (pThisNode == pThatNode)
{
return false;
}
if (pThisNode == nullptr || pThatNode == nullptr)
{
return true;
}
if (pThisNode->tValue != pThatNode->tValue)
{
return true;
}
return (IsSubTreeUnequal(pThisNode->pLeft, pThatNode->pLeft) ||
IsSubTreeUnequal(pThisNode->pRight, pThatNode->pRight));
}
static NodePtr RightmostOf(NodePtr pRoot)
{
if (pRoot == nullptr || pRoot->pRight == nullptr)
{
return pRoot;
}
return RightmostOf(pRoot->pRight);
}
static NodePtr LeftmostOf(NodePtr pRoot)
{
if (pRoot == nullptr || pRoot->pLeft == nullptr)
{
return pRoot;
}
return LeftmostOf(pRoot->pLeft);
}
static NodePtr PreviousOf(NodePtr pNode)
{
if (pNode == nullptr)
{
return nullptr;
}
if (pNode->pLeft != nullptr)
{
return RightmostOf(pNode->pLeft);
}
if (pNode->pParent == nullptr)
{
return nullptr;
}
while (pNode->pParent != nullptr && pNode == pNode->pParent->pLeft)
{
pNode = pNode->pParent;
}
return pNode->pParent;
}
static NodePtr NextOf(NodePtr pNode)
{
if (pNode == nullptr)
{
return nullptr;
}
if (pNode->pRight != nullptr)
{
return LeftmostOf(pNode->pRight);
}
if (pNode->pParent == nullptr)
{
return nullptr;
}
while (pNode->pParent != nullptr && pNode == pNode->pParent->pRight)
{
pNode = pNode->pParent;
}
return pNode->pParent;
}
public:
NodePtr CopySubTree(NodePtr pSubTreeRoot)
{
if (pSubTreeRoot == nullptr)
{
return nullptr;
}
NodePtr pNode = new NodeType(pSubTreeRoot->tValue);
if (pSubTreeRoot->pLeft != nullptr)
{
NodePtr pLeft = CopySubTree(pSubTreeRoot->pLeft);
pLeft->pParent = pNode;
pNode->pLeft = pLeft;
}
if (pSubTreeRoot->pRight != nullptr)
{
NodePtr pRight = CopySubTree(pSubTreeRoot->pRight);
pRight->pParent = pNode;
pNode->pRight = pRight;
}
return pNode;
}
NodePtr SetLeftSubTree(NodePtr pParent, NodePtr pSubTreeRoot)
{
if (pSubTreeRoot == nullptr)
{
return nullptr;
}
if (pParent == nullptr)
{
return nullptr;
}
pSubTreeRoot->pParent = pParent;
if (pParent->pLeft != nullptr)
{
DeleteSubTree(pParent->pLeft);
}
pParent->pLeft = pSubTreeRoot;
return pSubTreeRoot;
}
NodePtr SetRightSubTree(NodePtr pParent, NodePtr pSubTreeRoot)
{
if (pSubTreeRoot == nullptr)
{
return nullptr;
}
if (pParent == nullptr)
{
return nullptr;
}
pSubTreeRoot->pParent = pParent;
if (pParent->pRight != nullptr)
{
DeleteSubTree(pParent->pRight);
}
pParent->pRight = pSubTreeRoot;
return pSubTreeRoot;
}
NodePtr DeleteSubTree(NodePtr pSubTreeRoot)
{
if (pSubTreeRoot == nullptr)
{
return nullptr;
}
NodePtr pParent = pSubTreeRoot->pParent;
if (pParent == nullptr)
{
m_pRoot = nullptr;
}
else
{
if (pSubTreeRoot == pParent->pLeft)
{
pParent->pLeft = nullptr;
}
else
{
pParent->pRight = nullptr;
}
}
delete pSubTreeRoot;
return pParent;
}
public:
void SwapNode(NodePtr pNode1, NodePtr pNode2)
{
if (pNode1->pLeft == pNode2)
{
pNode1->pLeft = pNode1;
pNode2->pParent = pNode2;
}
if (pNode1->pRight == pNode2)
{
pNode1->pRight = pNode1;
pNode2->pParent = pNode2;
}
if (pNode2->pLeft == pNode1)
{
pNode2->pLeft = pNode2;
pNode1->pParent = pNode2;
}
if (pNode2->pRight == pNode1)
{
pNode2->pRight = pNode2;
pNode1->pParent = pNode1;
}
NodePtr pParent1 = pNode1->pParent, pLeft1 = pNode1->pLeft, pRight1 = pNode1->pRight;
NodePtr pParent2 = pNode2->pParent, pLeft2 = pNode2->pLeft, pRight2 = pNode2->pRight;
NodePtr *ppParent1ToNode1 = nullptr, *ppParent2ToNode2 = nullptr;
if (pParent1 == nullptr)
{
m_pRoot = pNode2;
}
else
{
if (pNode1 == pParent1->pLeft)
{
ppParent1ToNode1 = &pParent1->pLeft;
}
else
{
ppParent1ToNode1 = &pParent1->pRight;
}
}
if (pParent2 == nullptr)
{
m_pRoot = pNode1;
}
else
{
if (pNode2 == pParent2->pLeft)
{
ppParent2ToNode2 = &pParent2->pLeft;
}
else
{
ppParent2ToNode2 = &pParent2->pRight;
}
}
if (ppParent1ToNode1 != nullptr)
{
*ppParent1ToNode1 = pNode2;
}
if (ppParent2ToNode2 != nullptr)
{
*ppParent2ToNode2 = pNode1;
}
pNode1->pParent = pParent2;
pNode2->pParent = pParent1;
pNode1->pLeft = pLeft2;
pNode1->pRight = pRight2;
pNode2->pLeft = pLeft1;
pNode2->pRight = pRight1;
if (pLeft1 != nullptr)
{
pLeft1->pParent = pNode2;
}
if (pRight1 != nullptr)
{
pRight1->pParent = pNode2;
}
if (pLeft2 != nullptr)
{
pLeft2->pParent = pNode1;
}
if (pRight2 != nullptr)
{
pRight2->pParent = pNode1;
}
}
NodePtr RotateLeft(NodePtr pNode)
{
if (pNode == nullptr || pNode->pRight == nullptr)
{
return pNode;
}
NodePtr pNewNode = pNode->pRight;
if (pNode->pParent == nullptr)
{
m_pRoot = pNewNode;
}
else
{
if (pNode == pNode->pParent->pLeft)
{
pNode->pParent->pLeft = pNewNode;
}
else
{
pNode->pParent->pRight = pNewNode;
}
}
pNewNode->pParent = pNode->pParent;
pNode->pRight = pNewNode->pLeft;
if (pNewNode->pLeft != nullptr)
{
pNewNode->pLeft->pParent = pNode;
}
pNode->pParent = pNewNode;
pNewNode->pLeft = pNode;
return pNewNode;
}
NodePtr RotateRight(NodePtr pNode)
{
if (pNode == nullptr || pNode->pLeft == nullptr)
{
return pNode;
}
NodePtr pNewNode = pNode->pLeft;
if (pNode->pParent == nullptr)
{
m_pRoot = pNewNode;
}
else
{
if (pNode == pNode->pParent->pLeft)
{
pNode->pParent->pLeft = pNewNode;
}
else
{
pNode->pParent->pRight = pNewNode;
}
}
pNewNode->pParent = pNode->pParent;
pNode->pLeft = pNewNode->pRight;
if (pNewNode->pRight != nullptr)
{
pNewNode->pRight->pParent = pNode;
}
pNode->pParent = pNewNode;
pNewNode->pRight = pNode;
return pNewNode;
}
// Iterator
public:
class Iterator
{
public:
Iterator() : m_pCurrent(nullptr), m_pHead(nullptr)
{
}
Iterator(const Iterator &that) : m_pCurrent(nullptr), m_pHead(nullptr)
{
*this = that;
}
protected:
Iterator(NodePtr pCurrent) : m_pCurrent(pCurrent), m_pHead(nullptr)
{
}
Iterator(NodePtr pCurrent, NodePtr pHead) : m_pCurrent(pCurrent), m_pHead(pHead)
{
}
protected:
friend class BinTree;
protected:
NodePtr m_pCurrent;
NodePtr m_pHead;
public:
T &operator * ()
{
return m_pCurrent->tValue.tValue;
}
T *operator -> ()
{
return &m_pCurrent->tValue.tValue;
}
operator T * ()
{
return &m_pCurrent->tValue.tValue;
}
operator const T * () const
{
return &m_pCurrent->tValue.tValue;
}
public:
Iterator &operator = (const Iterator &that)
{
if (this == &that)
{
return *this;
}
this->m_pCurrent = that.m_pCurrent;
this->m_pHead = that.m_pHead;
return *this;
}
bool operator == (const Iterator &that) const
{
return (this->m_pCurrent == that.m_pCurrent);
}
bool operator != (const Iterator &that) const
{
return (this->m_pCurrent != that.m_pCurrent);
}
public:
Iterator &operator ++ ()
{
m_pCurrent = BinTree::NextOf(m_pCurrent);
return *this;
}
Iterator operator ++ (int)
{
typename RBTree<T>::Iterator itRet = *this;
++*this;
return itRet;
}
Iterator &operator -- ()
{
if (m_pCurrent == nullptr)
{
return BinTree::ReverseIterator(BinTree::RightmostOf(m_pRoot), m_pHead);
}
else
{
m_pCurrent = BinTree::NextOf(m_pCurrent);
}
}
Iterator operator -- (int)
{
typename RBTree<T>::Iterator itRet = *this;
--*this;
return itRet;
}
};
class ReverseIterator : public Iterator
{
public:
ReverseIterator() : Iterator()
{
}
ReverseIterator(const ReverseIterator &that) : Iterator()
{
*this = that;
}
protected:
ReverseIterator(NodePtr pCurrent) : Iterator(pCurrent)
{
}
ReverseIterator(NodePtr pCurrent, NodePtr pHead) : Iterator(pCurrent, pHead)
{
}
protected:
friend class BinTree;
public:
ReverseIterator &operator ++ ()
{
m_pCurrent = BinTree::PreviousOf(m_pCurrent);
return *this;
}
ReverseIterator operator ++ (int)
{
typename RBTree<T>::ReverseIterator itRet = *this;
++*this;
return itRet;
}
ReverseIterator &operator -- ()
{
if (m_pCurrent == nullptr)
{
return BinTree::ReverseIterator(BinTree::LeftmostOf(m_pRoot), m_pHead);
}
else
{
m_pCurrent = BinTree::NextOf(m_pCurrent);
}
return *this;
}
ReverseIterator operator -- (int)
{
typename RBTree<T>::ReverseIterator itRet = *this;
--*this;
return itRet;
}
};
public:
Iterator Begin() const
{
return BinTree::Iterator(LeftmostOf(m_pRoot), m_pRoot);
}
Iterator End() const
{
return BinTree::Iterator(nullptr, m_pRoot);
}
ReverseIterator ReverseBegin() const
{
return BinTree::ReverseIterator(RightmostOf(m_pRoot), m_pRoot);
}
ReverseIterator ReverseEnd() const
{
return BinTree::ReverseIterator(nullptr, m_pRoot);
}
public:
Iterator GetIterator(NodePtr pNode) const
{
return Iterator(pNode, m_pRoot);
}
ReverseIterator GetReverseIterator(NodePtr pNode) const
{
return ReverseIterator(pNode, m_pRoot);
}
};
} // namespace xl
//
// For convenience of debugging, put the following code to the [AutoExpand] section of
// X:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\Debugger\autoexp.dat
//
// ;------------------------------------------------------------------------------
// ; xl::BinTree
// ;------------------------------------------------------------------------------
// xl::BinTree<*>::Iterator|xl::BinTree<*>::ReverseIterator{
// preview (
// $e.m_pCurrent->tValue.tValue
// )
// children (
// #(
// [ptr] : &$e.m_pCurrent->tValue.tValue
// )
// )
// }
//
#endif // #ifndef __XLBINTREE_H_6C3F6F71_DCAC_4B1D_9BAC_1333FB803DEE_INCLUDED__
| {
"content_hash": "ca159a93f429a521c3431d4e2b4d1daa",
"timestamp": "",
"source": "github",
"line_count": 755,
"max_line_length": 116,
"avg_line_length": 24.566887417218542,
"alnum_prop": 0.4037632089713177,
"repo_name": "ywang2014/xlLib",
"id": "7726f1ae33dba0f86df6636b1e417bee72e43d0f",
"size": "18927",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "Include/xl/Common/Containers/xlBinTree.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1668"
},
{
"name": "C++",
"bytes": "1155906"
}
],
"symlink_target": ""
} |
. $PSScriptRoot\..\Dns\GcdCmdlets.ps1
Describe "Get-GcdResourceRecordSet" {
BeforeAll {
Remove-AllManagedZone($project)
}
AfterAll {
Remove-AllManagedZone($project)
}
It "should fail to return ResourceRecordSets of non-existent project" {
{ Get-GcdResourceRecordSet -Project $nonExistProject $testZone1 } | Should Throw "400"
}
It "should give access errors as appropriate" {
# Don't know who created the "asdf" project.
{ Get-GcdResourceRecordSet -Project $accessErrProject $testZone1 } | Should Throw "403"
}
It "should fail to return ResourceRecordSets of non-existent ManagedZone of existing project" {
{ Get-GcdResourceRecordSet -Project $project $nonExistManagedZone } | Should Throw "404"
}
# Create zone for testing
gcloud dns managed-zones create --dns-name=$dnsName1 --description=$testDescrip1 $testZone1 --project=$project
# Add a new A-type record and a new AAAA type record to the test zone
Add-GcdChange -Project $project -Zone $testZone1 -Add $testRrsetA,$testRrsetAAAA
It "should work and retrieve 4 ResourceRecordSets (2 from creation, 2 added)" {
$rrsets = Get-GcdResourceRecordSet -Project $project $testZone1
$rrsets.Count | Should Be 4
# The object type, Kind, and Name should be the same for all ResourceRecordSets
($rrsets | Get-Member).TypeName | Should Match $rrsetType
$rrsets.Kind | Should Match $rrsetKind
$rrsets.Name | Should Match $dnsName
$rrsets.Type -contains "SOA" | Should Match $true
$rrsets.Type -contains "NS" | Should Match $true
$rrsets.Type -contains "A" | Should Match $true
$rrsets.Type -contains "AAAA" | Should Match $true
(($rrsets.Rrdatas -contains $rrdataA1) -and ($rrsets.Rrdatas -contains $rrdataAAAA)) | Should Match $true
}
It "should work and retrieve only the NS and AAAA type records" {
$rrsets = Get-GcdResourceRecordSet -Project $project $testZone1 "NS","AAAA"
$rrsets.Count | Should Be 2
($rrsets | Get-Member).TypeName | Should Match $rrsetType
$rrsets.Kind | Should Match $rrsetKind
$rrsets.Name | Should Match $dnsName
$rrsets.Type -contains "NS" | Should Match $true
$rrsets.Type -contains "AAAA" | Should Match $true
$rrsets.Type -contains "SOA" | Should Match $false
$rrsets.Type -contains "A" | Should Match $false
}
}
Describe "New-GcdResourceRecordSet" {
It "should fail to create a new ResourceRecordSet with an invalid record type" {
{ New-GcdResourceRecordSet $dnsName1 $rrdataA1 "Invalid" } | Should Throw "ValidateSet"
}
It "should work and create a new ResourceRecordSet with the specified properties and default ttl (A type record)" {
$rrset = New-GcdResourceRecordSet $dnsName1 $rrdataA1,$rrdataA2 "A"
$rrset.Count | Should Be 1
$rrset.GetType().FullName | Should Match $rrsetType
$rrset.Kind | Should Match $rrsetKind
$rrset.Name | Should Match $dnsName1
$rrset.Rrdatas.Count | Should Be 2
$rrset.Rrdatas[0] | Should Match $rrdataA1
$rrset.Rrdatas[1] | Should Match $rrdataA2
$rrset.Ttl | Should Match $ttlDefault
$rrset.Type | Should Match "A"
}
It "should work and create a new ResourceRecordSet with the specified properties and custom ttl (AAAA type record)" {
$rrset = New-GcdResourceRecordSet $dnsName1_1 $rrdataAAAA "AAAA" $ttl1
$rrset.Count | Should Be 1
$rrset.GetType().FullName | Should Match $rrsetType
$rrset.Kind | Should Match $rrsetKind
$rrset.Name | Should Match $dnsName1_1
$rrset.Rrdatas | Should Match $rrdataAAAA
$rrset.Ttl | Should Match $ttl1
$rrset.Type | Should Match "AAAA"
}
It "should work and create ResourceRecordSets of other types (CNAME and TXT)" {
$rrsetCNAME = New-GcdResourceRecordSet $dnsName1_2 $rrdataCNAME1_2 "CNAME" $ttl1
$rrsetTXT = New-GcdResourceRecordSet $dnsName1 $rrdataTXT1 "TXT" $ttl1
$rrsetCNAME.Type | Should Match "CNAME"
$rrsetTXT.Type | Should Match "TXT"
}
}
| {
"content_hash": "d5c5aad05e5de08592bbf41ac2bb1430",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 121,
"avg_line_length": 41.73267326732673,
"alnum_prop": 0.6657176749703441,
"repo_name": "marceloyuela/google-cloud-powershell",
"id": "f7b12f67b9377e571a61d6b18752c1700385d86d",
"size": "4217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Google.PowerShell.IntegrationTests/Dns/Dns.GcdResourceRecordSet.Tests.ps1",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "608671"
},
{
"name": "HTML",
"bytes": "22550"
},
{
"name": "PowerShell",
"bytes": "238815"
},
{
"name": "Ruby",
"bytes": "4405"
}
],
"symlink_target": ""
} |
//---------------------------------------------------------------------------
// myobject.h - Implementation of the User Layer
//
// This file implements the 2 classes required by the SlimTree Library User
// Layer.
//
// TCity is the object which will be indexed by a metric tree. It abstracts a
// city. Each city has a name, a latitude and a longitude. TCity defines an
// interface to manipulate its information and also implements the stObject
// interface.
//
// TCityDistanceEvaluator implements the stMetricEvaluator interface. It will
// mesure the distance between 2 TCity instances.
//
// With these classes, it is possible to define and instantiate any metric tree
// defined by the SlimTree Library.
//
// Author: Fabio Jun Takada Chino (chino@icmc.sc.usp.br)
// Copyright (c) 2002 GBDI-ICMC-USP
//---------------------------------------------------------------------------
#ifndef myobjectH
#define myobjectH
#include <math.h>
#include <string>
#include <ostream>
using namespace std;
// Metric Tree includes
#include <arboretum/stTypes.h>
#include <arboretum/stUserLayerUtil.h>
//---------------------------------------------------------------------------
// Class TCity
//---------------------------------------------------------------------------
/**
* This class abstracts a city in a map. Each city has a name and a pair
* latitude/longitude.
*
* <P>In addition to data manipulation methods (such as GetLatitude(), GetName()
* and others), this class implements the stObject interface. This interface
* qualifies this object to be indexed by a metric tree implemented by GBDI
* SlimTree Library.
*
* <P>This interface requires no inheritance (because of the use of class
* templates in the Structure Layer) but requires the following methods:
* - TCity() - A default constructor.
* - Clone() - Creates a clone of this object.
* - IsEqual() - Checks if this instance is equal to another.
* - GetSerializedSize() - Gets the size of the serialized version of this object.
* - Serialize() - Gets the serialzied version of this object.
* - Unserialize() - Restores a serialzied object.
*
* <P>Since the array which contains the serialized version of the object must be
* created and destroyed by each object instance, this class will hold this array
* as a buffer of the serialized version of this instance. This buffer will be
* created only if required and will be invalidated every time the object changes
* its values.
*
* <P>The serialized version of the object will be created as follows:<BR>
* <CODE>
* +----------+-----------+--------+<BR>
* | Latitude | Longitude | Name[] |<BR>
* +----------+-----------+--------+<BR>
* </CODE>
*
* <P>Latitude and Logitude are stored as doubles (2 64-bit IEEE floating point
* value) and Name[] is an array of chars with no terminator. Since Name[] has
* a variable size (associated with the name of the city), the serialized form
* will also have a variable number of bytes.
*
* @version 1.0
* @author Fabio Jun Takada Chino
*/
class TCity{
public:
/**
* Default constructor. It creates a city with no name and longitude and
* latitude set to 0. This constructor is required by stObject interface.
*/
TCity(){
Name = "";
Latitude = 0;
Longitude = 0;
// Invalidate Serialized buffer.
Serialized = NULL;
}//end TCity
/**
* Creates a new city.
*
* @param name The name of the city.
* @param latitude Latitude.
* @param longitude Longitude.
*/
TCity(const string name, double latitude, double longitude){
Name = name;
Latitude = latitude;
Longitude = longitude;
// Invalidate Serialized buffer.
Serialized = NULL;
}//end TCity
/**
* Destroys this instance and releases all associated resources.
*/
~TCity(){
// Does Serialized exist ?
if (Serialized != NULL){
// Yes! Dispose it!
delete [] Serialized;
}//end if
}//end TCity
/**
* Gets the latitude of the city.
*/
double GetLatitude(){
return Latitude;
}//end GetLatitude
/**
* Gets the longitude of the city.
*/
double GetLongitude(){
return Longitude;
}//end GetLongitude
/**
* Gets the name of the city.
*/
const string & GetName(){
return Name;
}//end GetName
// The following methods are required by the stObject interface.
/**
* Creates a perfect clone of this object. This method is required by
* stObject interface.
*
* @return A new instance of TCity wich is a perfect clone of the original
* instance.
*/
TCity * Clone(){
return new TCity(Name, Latitude, Longitude);
}//end Clone
/**
* Checks to see if this object is equal to other. This method is required
* by stObject interface.
*
* @param obj Another instance of TCity.
* @return True if they are equal or false otherwise.
*/
bool IsEqual(TCity *obj){
return (Latitude == obj->GetLatitude()) &&
(Longitude == obj->GetLongitude()) &&
(Name == obj->GetName());
}//end IsEqual
/**
* Returns the size of the serialized version of this object in bytes.
* This method is required by stObject interface.
*/
stSize GetSerializedSize(){
return (sizeof(double) * 2) + Name.length();
}//end GetSerializedSize
/**
* Returns the serialized version of this object.
* This method is required by stObject interface.
*
* @warning If you don't know how to serialize an object, this methos may
* be a good example.
*/
const stByte * Serialize();
/**
* Rebuilds a serialized object.
* This method is required by stObject interface.
*
* @param data The serialized object.
* @param datasize The size of the serialized object in bytes.
* @warning If you don't know how to serialize an object, this methos may
* be a good example.
*/
void Unserialize (const stByte *data, stSize datasize);
private:
/**
* The name of the city.
*/
string Name;
/**
* City's longitude.
*/
double Longitude;
/**
* City's latitude.
*/
double Latitude;
/**
* Serialized version. If NULL, the serialized version is not created.
*/
stByte * Serialized;
};//end TMapPoint
//---------------------------------------------------------------------------
// Class TCityDistanceEvaluator
//---------------------------------------------------------------------------
/**
* This class implements a metric evaluator for TCity instances. It calculates
* the distance between cities by performing a euclidean distance between city
* coordinates (I know it is not accurate but is is only a sample!!!).
*
* <P>It implements the stMetricEvaluator interface. As stObject interface, the
* stMetricEvaluator interface requires no inheritance and defines 2 methods:
* - GetDistance() - Calculates the distance between 2 objects.
* - GetDistance2() - Calculates the distance between 2 objects raised by 2.
*
* <P>Both methods are defined due to optmization reasons. Since euclidean
* distance raised by 2 is easier to calculate, It will implement GetDistance2()
* and use it to calculate GetDistance() result.
*
* @version 1.0
* @author Fabio Jun Takada Chino
*/
class TCityDistanceEvaluator: public stMetricEvaluatorStatistics{
public:
/**
* Returns the distance between 2 cities. This method is required by
* stMetricEvaluator interface.
*
* @param obj1 Object 1.
* @param obj2 Object 2.
*/
stDistance GetDistance(TCity *obj1, TCity *obj2){
this->UpdateDistanceCount();
return sqrt(GetDistance2(obj1, obj2));
}//end GetDistance
/**
* Returns the distance between 2 cities raised by the power of 2.
* This method is required by stMetricEvaluator interface.
*
* @param obj1 Object 1.
* @param obj2 Object 2.
*/
stDistance GetDistance2(TCity *obj1, TCity *obj2){
double delta1;
double delta2;
this->UpdateDistanceCount();
delta1 = obj1->GetLatitude() - obj2->GetLatitude();
delta2 = obj1->GetLongitude() - obj2->GetLongitude();
return (delta1 * delta1) + (delta2 * delta2);
}//end GetDistance2
};//end TCityDistanceEvaluator
//---------------------------------------------------------------------------
// Output operator
//---------------------------------------------------------------------------
/**
* This operator will write a string representation of a city to an outputstream.
*/
ostream & operator << (ostream & out, TCity & city);
#endif //end myobjectH
| {
"content_hash": "64018ad231b09a235260c1cb9e8cbf6c",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 85,
"avg_line_length": 32.763636363636365,
"alnum_prop": 0.5942286348501665,
"repo_name": "pedro-stanaka/PgAR-tree",
"id": "384696789e38625ad093b21da4006a7aa60754d5",
"size": "9010",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sample/sample-01_MMtree/myobject.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "671043"
},
{
"name": "C++",
"bytes": "1865636"
},
{
"name": "CSS",
"bytes": "1801"
},
{
"name": "D",
"bytes": "8626"
},
{
"name": "Objective-C",
"bytes": "1898"
},
{
"name": "Pascal",
"bytes": "8287"
},
{
"name": "Perl",
"bytes": "2591"
},
{
"name": "Prolog",
"bytes": "2133"
},
{
"name": "Racket",
"bytes": "227395"
},
{
"name": "Shell",
"bytes": "5162"
}
],
"symlink_target": ""
} |
<?php
namespace tests\TransactPRO\Gate\Builders;
class ChargeRecurrentDataBuilderTest extends BuilderTestCase
{
protected function setUp()
{
$this->builderClass = 'TransactPRO\Gate\Builders\ChargeRecurrentDataBuilder';
$this->data = array(
'f_extended' => '5',
'init_transaction_id' => '13hpf5rp1e0ss72dypjnhalzn1wmrkfmsjtwzocg',
);
$this->buildData = $this->data;
}
public function getMandatoryFields()
{
return array(
array('init_transaction_id'),
);
}
public function getNonMandatoryFields()
{
return array(
array('f_extended', 5),
);
}
}
| {
"content_hash": "9bf66ede977323c3685e01e2ee256434",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 86,
"avg_line_length": 24.2,
"alnum_prop": 0.5661157024793388,
"repo_name": "TransactPRO/transactpro-integration-php",
"id": "26f20a4ac40e85445537d439370986647c7bc503",
"size": "726",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/TransactPRO/Gate/Builders/ChargeRecurrentDataBuilderTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "89186"
}
],
"symlink_target": ""
} |
/**
* Autogenerated by Thrift Compiler (0.16.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
package org.apache.hadoop.hive.metastore.api;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)")
@org.apache.hadoop.classification.InterfaceAudience.Public @org.apache.hadoop.classification.InterfaceStability.Stable public class AbortTxnRequest implements org.apache.thrift.TBase<AbortTxnRequest, AbortTxnRequest._Fields>, java.io.Serializable, Cloneable, Comparable<AbortTxnRequest> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AbortTxnRequest");
private static final org.apache.thrift.protocol.TField TXNID_FIELD_DESC = new org.apache.thrift.protocol.TField("txnid", org.apache.thrift.protocol.TType.I64, (short)1);
private static final org.apache.thrift.protocol.TField REPL_POLICY_FIELD_DESC = new org.apache.thrift.protocol.TField("replPolicy", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final org.apache.thrift.protocol.TField TXN_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("txn_type", org.apache.thrift.protocol.TType.I32, (short)3);
private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new AbortTxnRequestStandardSchemeFactory();
private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new AbortTxnRequestTupleSchemeFactory();
private long txnid; // required
private @org.apache.thrift.annotation.Nullable java.lang.String replPolicy; // optional
private @org.apache.thrift.annotation.Nullable TxnType txn_type; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
TXNID((short)1, "txnid"),
REPL_POLICY((short)2, "replPolicy"),
/**
*
* @see TxnType
*/
TXN_TYPE((short)3, "txn_type");
private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();
static {
for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // TXNID
return TXNID;
case 2: // REPL_POLICY
return REPL_POLICY;
case 3: // TXN_TYPE
return TXN_TYPE;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
@org.apache.thrift.annotation.Nullable
public static _Fields findByName(java.lang.String name) {
return byName.get(name);
}
private final short _thriftId;
private final java.lang.String _fieldName;
_Fields(short thriftId, java.lang.String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public java.lang.String getFieldName() {
return _fieldName;
}
}
// isset id assignments
private static final int __TXNID_ISSET_ID = 0;
private byte __isset_bitfield = 0;
private static final _Fields optionals[] = {_Fields.REPL_POLICY,_Fields.TXN_TYPE};
public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.TXNID, new org.apache.thrift.meta_data.FieldMetaData("txnid", org.apache.thrift.TFieldRequirementType.REQUIRED,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.REPL_POLICY, new org.apache.thrift.meta_data.FieldMetaData("replPolicy", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.TXN_TYPE, new org.apache.thrift.meta_data.FieldMetaData("txn_type", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TxnType.class)));
metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AbortTxnRequest.class, metaDataMap);
}
public AbortTxnRequest() {
}
public AbortTxnRequest(
long txnid)
{
this();
this.txnid = txnid;
setTxnidIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public AbortTxnRequest(AbortTxnRequest other) {
__isset_bitfield = other.__isset_bitfield;
this.txnid = other.txnid;
if (other.isSetReplPolicy()) {
this.replPolicy = other.replPolicy;
}
if (other.isSetTxn_type()) {
this.txn_type = other.txn_type;
}
}
public AbortTxnRequest deepCopy() {
return new AbortTxnRequest(this);
}
@Override
public void clear() {
setTxnidIsSet(false);
this.txnid = 0;
this.replPolicy = null;
this.txn_type = null;
}
public long getTxnid() {
return this.txnid;
}
public void setTxnid(long txnid) {
this.txnid = txnid;
setTxnidIsSet(true);
}
public void unsetTxnid() {
__isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __TXNID_ISSET_ID);
}
/** Returns true if field txnid is set (has been assigned a value) and false otherwise */
public boolean isSetTxnid() {
return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __TXNID_ISSET_ID);
}
public void setTxnidIsSet(boolean value) {
__isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __TXNID_ISSET_ID, value);
}
@org.apache.thrift.annotation.Nullable
public java.lang.String getReplPolicy() {
return this.replPolicy;
}
public void setReplPolicy(@org.apache.thrift.annotation.Nullable java.lang.String replPolicy) {
this.replPolicy = replPolicy;
}
public void unsetReplPolicy() {
this.replPolicy = null;
}
/** Returns true if field replPolicy is set (has been assigned a value) and false otherwise */
public boolean isSetReplPolicy() {
return this.replPolicy != null;
}
public void setReplPolicyIsSet(boolean value) {
if (!value) {
this.replPolicy = null;
}
}
/**
*
* @see TxnType
*/
@org.apache.thrift.annotation.Nullable
public TxnType getTxn_type() {
return this.txn_type;
}
/**
*
* @see TxnType
*/
public void setTxn_type(@org.apache.thrift.annotation.Nullable TxnType txn_type) {
this.txn_type = txn_type;
}
public void unsetTxn_type() {
this.txn_type = null;
}
/** Returns true if field txn_type is set (has been assigned a value) and false otherwise */
public boolean isSetTxn_type() {
return this.txn_type != null;
}
public void setTxn_typeIsSet(boolean value) {
if (!value) {
this.txn_type = null;
}
}
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
switch (field) {
case TXNID:
if (value == null) {
unsetTxnid();
} else {
setTxnid((java.lang.Long)value);
}
break;
case REPL_POLICY:
if (value == null) {
unsetReplPolicy();
} else {
setReplPolicy((java.lang.String)value);
}
break;
case TXN_TYPE:
if (value == null) {
unsetTxn_type();
} else {
setTxn_type((TxnType)value);
}
break;
}
}
@org.apache.thrift.annotation.Nullable
public java.lang.Object getFieldValue(_Fields field) {
switch (field) {
case TXNID:
return getTxnid();
case REPL_POLICY:
return getReplPolicy();
case TXN_TYPE:
return getTxn_type();
}
throw new java.lang.IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new java.lang.IllegalArgumentException();
}
switch (field) {
case TXNID:
return isSetTxnid();
case REPL_POLICY:
return isSetReplPolicy();
case TXN_TYPE:
return isSetTxn_type();
}
throw new java.lang.IllegalStateException();
}
@Override
public boolean equals(java.lang.Object that) {
if (that instanceof AbortTxnRequest)
return this.equals((AbortTxnRequest)that);
return false;
}
public boolean equals(AbortTxnRequest that) {
if (that == null)
return false;
if (this == that)
return true;
boolean this_present_txnid = true;
boolean that_present_txnid = true;
if (this_present_txnid || that_present_txnid) {
if (!(this_present_txnid && that_present_txnid))
return false;
if (this.txnid != that.txnid)
return false;
}
boolean this_present_replPolicy = true && this.isSetReplPolicy();
boolean that_present_replPolicy = true && that.isSetReplPolicy();
if (this_present_replPolicy || that_present_replPolicy) {
if (!(this_present_replPolicy && that_present_replPolicy))
return false;
if (!this.replPolicy.equals(that.replPolicy))
return false;
}
boolean this_present_txn_type = true && this.isSetTxn_type();
boolean that_present_txn_type = true && that.isSetTxn_type();
if (this_present_txn_type || that_present_txn_type) {
if (!(this_present_txn_type && that_present_txn_type))
return false;
if (!this.txn_type.equals(that.txn_type))
return false;
}
return true;
}
@Override
public int hashCode() {
int hashCode = 1;
hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(txnid);
hashCode = hashCode * 8191 + ((isSetReplPolicy()) ? 131071 : 524287);
if (isSetReplPolicy())
hashCode = hashCode * 8191 + replPolicy.hashCode();
hashCode = hashCode * 8191 + ((isSetTxn_type()) ? 131071 : 524287);
if (isSetTxn_type())
hashCode = hashCode * 8191 + txn_type.getValue();
return hashCode;
}
@Override
public int compareTo(AbortTxnRequest other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
lastComparison = java.lang.Boolean.compare(isSetTxnid(), other.isSetTxnid());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTxnid()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txnid, other.txnid);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetReplPolicy(), other.isSetReplPolicy());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetReplPolicy()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replPolicy, other.replPolicy);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = java.lang.Boolean.compare(isSetTxn_type(), other.isSetTxn_type());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetTxn_type()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txn_type, other.txn_type);
if (lastComparison != 0) {
return lastComparison;
}
}
return 0;
}
@org.apache.thrift.annotation.Nullable
public _Fields fieldForId(int fieldId) {
return _Fields.findByThriftId(fieldId);
}
public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
scheme(iprot).read(iprot, this);
}
public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
scheme(oprot).write(oprot, this);
}
@Override
public java.lang.String toString() {
java.lang.StringBuilder sb = new java.lang.StringBuilder("AbortTxnRequest(");
boolean first = true;
sb.append("txnid:");
sb.append(this.txnid);
first = false;
if (isSetReplPolicy()) {
if (!first) sb.append(", ");
sb.append("replPolicy:");
if (this.replPolicy == null) {
sb.append("null");
} else {
sb.append(this.replPolicy);
}
first = false;
}
if (isSetTxn_type()) {
if (!first) sb.append(", ");
sb.append("txn_type:");
if (this.txn_type == null) {
sb.append("null");
} else {
sb.append(this.txn_type);
}
first = false;
}
sb.append(")");
return sb.toString();
}
public void validate() throws org.apache.thrift.TException {
// check for required fields
if (!isSetTxnid()) {
throw new org.apache.thrift.protocol.TProtocolException("Required field 'txnid' is unset! Struct:" + toString());
}
// check for sub-struct validity
}
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
try {
write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
try {
// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
__isset_bitfield = 0;
read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
} catch (org.apache.thrift.TException te) {
throw new java.io.IOException(te);
}
}
private static class AbortTxnRequestStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public AbortTxnRequestStandardScheme getScheme() {
return new AbortTxnRequestStandardScheme();
}
}
private static class AbortTxnRequestStandardScheme extends org.apache.thrift.scheme.StandardScheme<AbortTxnRequest> {
public void read(org.apache.thrift.protocol.TProtocol iprot, AbortTxnRequest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TField schemeField;
iprot.readStructBegin();
while (true)
{
schemeField = iprot.readFieldBegin();
if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
break;
}
switch (schemeField.id) {
case 1: // TXNID
if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
struct.txnid = iprot.readI64();
struct.setTxnidIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // REPL_POLICY
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.replPolicy = iprot.readString();
struct.setReplPolicyIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 3: // TXN_TYPE
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
struct.txn_type = org.apache.hadoop.hive.metastore.api.TxnType.findByValue(iprot.readI32());
struct.setTxn_typeIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
iprot.readFieldEnd();
}
iprot.readStructEnd();
struct.validate();
}
public void write(org.apache.thrift.protocol.TProtocol oprot, AbortTxnRequest struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
oprot.writeFieldBegin(TXNID_FIELD_DESC);
oprot.writeI64(struct.txnid);
oprot.writeFieldEnd();
if (struct.replPolicy != null) {
if (struct.isSetReplPolicy()) {
oprot.writeFieldBegin(REPL_POLICY_FIELD_DESC);
oprot.writeString(struct.replPolicy);
oprot.writeFieldEnd();
}
}
if (struct.txn_type != null) {
if (struct.isSetTxn_type()) {
oprot.writeFieldBegin(TXN_TYPE_FIELD_DESC);
oprot.writeI32(struct.txn_type.getValue());
oprot.writeFieldEnd();
}
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class AbortTxnRequestTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
public AbortTxnRequestTupleScheme getScheme() {
return new AbortTxnRequestTupleScheme();
}
}
private static class AbortTxnRequestTupleScheme extends org.apache.thrift.scheme.TupleScheme<AbortTxnRequest> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, AbortTxnRequest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
oprot.writeI64(struct.txnid);
java.util.BitSet optionals = new java.util.BitSet();
if (struct.isSetReplPolicy()) {
optionals.set(0);
}
if (struct.isSetTxn_type()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetReplPolicy()) {
oprot.writeString(struct.replPolicy);
}
if (struct.isSetTxn_type()) {
oprot.writeI32(struct.txn_type.getValue());
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, AbortTxnRequest struct) throws org.apache.thrift.TException {
org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
struct.txnid = iprot.readI64();
struct.setTxnidIsSet(true);
java.util.BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.replPolicy = iprot.readString();
struct.setReplPolicyIsSet(true);
}
if (incoming.get(1)) {
struct.txn_type = org.apache.hadoop.hive.metastore.api.TxnType.findByValue(iprot.readI32());
struct.setTxn_typeIsSet(true);
}
}
}
private static <S extends org.apache.thrift.scheme.IScheme> S scheme(org.apache.thrift.protocol.TProtocol proto) {
return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
}
}
| {
"content_hash": "2bd00102f749ea7c16b68c110db29a94",
"timestamp": "",
"source": "github",
"line_count": 589,
"max_line_length": 288,
"avg_line_length": 33.0509337860781,
"alnum_prop": 0.6625057790106333,
"repo_name": "sankarh/hive",
"id": "37311fc02a628624b7fc4105f36c05b2a29fa3f7",
"size": "19467",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/AbortTxnRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "55440"
},
{
"name": "Batchfile",
"bytes": "845"
},
{
"name": "C",
"bytes": "28218"
},
{
"name": "C++",
"bytes": "96657"
},
{
"name": "CSS",
"bytes": "4742"
},
{
"name": "GAP",
"bytes": "204254"
},
{
"name": "HTML",
"bytes": "24102"
},
{
"name": "HiveQL",
"bytes": "8290287"
},
{
"name": "Java",
"bytes": "59285075"
},
{
"name": "JavaScript",
"bytes": "44139"
},
{
"name": "M4",
"bytes": "2276"
},
{
"name": "PHP",
"bytes": "148097"
},
{
"name": "PLSQL",
"bytes": "9105"
},
{
"name": "PLpgSQL",
"bytes": "294996"
},
{
"name": "Perl",
"bytes": "319742"
},
{
"name": "PigLatin",
"bytes": "12333"
},
{
"name": "Python",
"bytes": "383647"
},
{
"name": "ReScript",
"bytes": "3460"
},
{
"name": "Roff",
"bytes": "5379"
},
{
"name": "SQLPL",
"bytes": "1190"
},
{
"name": "Shell",
"bytes": "271549"
},
{
"name": "TSQL",
"bytes": "14126"
},
{
"name": "Thrift",
"bytes": "164235"
},
{
"name": "XSLT",
"bytes": "1329"
},
{
"name": "q",
"bytes": "289182"
}
],
"symlink_target": ""
} |
'use strict';
describe('diagrammatica.bar', function () {
var chart;
var dataset;
var fixture;
beforeEach(function () {
dataset = [
{name: 'A', data: [2, 1, 5]},
{name: 'B', data: [1, 4, 3]}
];
fixture = d3.select('body').append('div').classed('test-container', true);
chart = bar(fixture, dataset);
});
afterEach(function () {
fixture.remove();
});
it('should add bars to chart', function () {
var bars = chart.bars();
expect(bars[0].length).toBeGreaterThan(0);
expect(bars[0].length).toEqual(dataset.length);
});
it('should set y axis label text', function () {
var chartBase = chart.chartBase();
spyOn(chartBase, 'yAxisLabelText');
var expected = 'foo';
chart.yAxisLabelText(expected);
expect(chartBase.yAxisLabelText).toHaveBeenCalledWith(expected);
});
it('should set x axis label text', function () {
var chartBase = chart.chartBase();
spyOn(chartBase, 'xAxisLabelText');
var expected = 'foo';
chart.xAxisLabelText(expected);
expect(chartBase.xAxisLabelText).toHaveBeenCalledWith(expected);
});
it('should set width', function () {
var chartBase = chart.chartBase();
spyOn(chartBase, 'width');
var expected = 200;
chart.width(expected);
expect(chartBase.width).toHaveBeenCalledWith(expected, jasmine.any(Function));
});
});
| {
"content_hash": "f7c60165260ef1b83d6607abca902762",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 86,
"avg_line_length": 26.526315789473685,
"alnum_prop": 0.5787037037037037,
"repo_name": "ethanhann/Diagrammatica",
"id": "eb80e23d0f29e966c15fc342bbefd373074f32c2",
"size": "1512",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unit/bar-spec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4021"
},
{
"name": "HTML",
"bytes": "7955"
},
{
"name": "JavaScript",
"bytes": "133315"
}
],
"symlink_target": ""
} |
package com.landawn.abacus.util.function;
import com.landawn.abacus.util.N;
import com.landawn.abacus.util.Try;
/**
*
* @since 0.8
*
* @author Haiyang Li
*/
public interface ByteFunction<R> extends Try.ByteFunction<R, RuntimeException> {
static final ByteFunction<Byte> BOX = new ByteFunction<Byte>() {
@Override
public Byte apply(byte value) {
return value;
}
};
@Override
R apply(byte value);
default <V> ByteFunction<V> andThen(Function<? super R, ? extends V> after) {
N.checkArgNotNull(after);
return t -> after.apply(apply(t));
}
static ByteFunction<Byte> identity() {
return t -> t;
}
}
| {
"content_hash": "ea1f1676aa918fe77609c437ee7c192a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 81,
"avg_line_length": 21.61764705882353,
"alnum_prop": 0.5877551020408164,
"repo_name": "landawn/AbacusUtil",
"id": "cdbd0b8b035d7fcb1871321e9306abe053ba0b1d",
"size": "1334",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/landawn/abacus/util/function/ByteFunction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "266"
},
{
"name": "Java",
"bytes": "11893417"
}
],
"symlink_target": ""
} |
package com.company;
public interface ITelphone {
void powerOn();
void dial(int phoneNumber);
void answer();
boolean callPhone(int phoneNumber);
boolean isRinging();
}
| {
"content_hash": "0f2fcec4eaeadff9aabc113220b13141",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 39,
"avg_line_length": 22,
"alnum_prop": 0.6565656565656566,
"repo_name": "DorkinsTheOwl/owl-learning-java",
"id": "db3a6133305c5992af120e58d43bd2de430223f0",
"size": "198",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Interfaces/src/com/company/ITelphone.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "201"
},
{
"name": "Java",
"bytes": "429147"
}
],
"symlink_target": ""
} |
import sendgrid
import os
sg = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
##################################################
# Retrieve all blocks #
# GET /suppression/blocks #
params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1}
response = sg.client.suppression.blocks.get(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete blocks #
# DELETE /suppression/blocks #
data = {
"delete_all": False,
"emails": [
"example1@example.com",
"example2@example.com"
]
}
response = sg.client.suppression.blocks.delete(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve a specific block #
# GET /suppression/blocks/{email} #
email = "test_url_param"
response = sg.client.suppression.blocks._(email).get()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete a specific block #
# DELETE /suppression/blocks/{email} #
email = "test_url_param"
response = sg.client.suppression.blocks._(email).delete()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve all bounces #
# GET /suppression/bounces #
params = {'start_time': 1, 'end_time': 1}
response = sg.client.suppression.bounces.get(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete bounces #
# DELETE /suppression/bounces #
data = {
"delete_all": True,
"emails": [
"example@example.com",
"example2@example.com"
]
}
response = sg.client.suppression.bounces.delete(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve a Bounce #
# GET /suppression/bounces/{email} #
email = "test_url_param"
response = sg.client.suppression.bounces._(email).get()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete a bounce #
# DELETE /suppression/bounces/{email} #
params = {'email_address': 'example@example.com'}
email = "test_url_param"
response = sg.client.suppression.bounces._(email).delete(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve all invalid emails #
# GET /suppression/invalid_emails #
params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1}
response = sg.client.suppression.invalid_emails.get(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete invalid emails #
# DELETE /suppression/invalid_emails #
data = {
"delete_all": False,
"emails": [
"example1@example.com",
"example2@example.com"
]
}
response = sg.client.suppression.invalid_emails.delete(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve a specific invalid email #
# GET /suppression/invalid_emails/{email} #
email = "test_url_param"
response = sg.client.suppression.invalid_emails._(email).get()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete a specific invalid email #
# DELETE /suppression/invalid_emails/{email} #
email = "test_url_param"
response = sg.client.suppression.invalid_emails._(email).delete()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve a specific spam report #
# GET /suppression/spam_report/{email} #
email = "test_url_param"
response = sg.client.suppression.spam_report._(email).get()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete a specific spam report #
# DELETE /suppression/spam_report/{email} #
email = "test_url_param"
response = sg.client.suppression.spam_report._(email).delete()
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve all spam reports #
# GET /suppression/spam_reports #
params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1}
response = sg.client.suppression.spam_reports.get(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Delete spam reports #
# DELETE /suppression/spam_reports #
data = {
"delete_all": False,
"emails": [
"example1@example.com",
"example2@example.com"
]
}
response = sg.client.suppression.spam_reports.delete(request_body=data)
print(response.status_code)
print(response.body)
print(response.headers)
##################################################
# Retrieve all global suppressions #
# GET /suppression/unsubscribes #
params = {'start_time': 1, 'limit': 1, 'end_time': 1, 'offset': 1}
response = sg.client.suppression.unsubscribes.get(query_params=params)
print(response.status_code)
print(response.body)
print(response.headers)
| {
"content_hash": "bdb1c579461905a90511eae27b786418",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 77,
"avg_line_length": 27.555,
"alnum_prop": 0.6131373616403557,
"repo_name": "sendgrid/sendgrid-python",
"id": "430f76f352a31a0b5436fa9350601d4b1ded67dd",
"size": "5511",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "examples/suppression/suppression.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "211"
},
{
"name": "HTML",
"bytes": "356"
},
{
"name": "Makefile",
"bytes": "848"
},
{
"name": "Procfile",
"bytes": "43"
},
{
"name": "Python",
"bytes": "388101"
},
{
"name": "Shell",
"bytes": "59"
}
],
"symlink_target": ""
} |
<?php
namespace App\Container\Helpers;
class Request {
private $vars = [];
public $post = [];
public $get = [];
public function __construct($vars){
$this->vars = $vars;
if(isset($vars['post']['_token'])) unset($vars['post']['_token']);
$this->post = (object) $vars['post'];
$this->get = (object) $vars['get'];
}
public function url(){
return $this->vars['without_vars'];
}
public function get_url(){
return '/'.$this->vars['url'];
}
public function get_beardcrubs(){
return explode('/', $this->url());
}
public function method(){
return isset($this->vars['post']['_method']) ? strtolower($this->vars['post']['_method']) : 'get';
}
} | {
"content_hash": "9bff33f0a0aa99ba8852054f8f45187d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 106,
"avg_line_length": 22.685714285714287,
"alnum_prop": 0.5012594458438288,
"repo_name": "OrangeeWeb/IMT-3851-Assignment-3",
"id": "54e5f5869caa143ae0cabe595ee60d7d536bcdfe",
"size": "794",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "App/Container/Helpers/Request.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "466"
},
{
"name": "CSS",
"bytes": "74763"
},
{
"name": "HTML",
"bytes": "13349"
},
{
"name": "JavaScript",
"bytes": "7929"
},
{
"name": "PHP",
"bytes": "90290"
}
],
"symlink_target": ""
} |
class DeviceActions : public ash::AndroidIntentHelper,
public ash::assistant::DeviceActions,
public ArcAppListPrefs::Observer {
public:
explicit DeviceActions(std::unique_ptr<DeviceActionsDelegate> delegate);
DeviceActions(const DeviceActions&) = delete;
DeviceActions& operator=(const DeviceActions&) = delete;
~DeviceActions() override;
// ash::assistant::DeviceActions overrides:
void SetWifiEnabled(bool enabled) override;
void SetBluetoothEnabled(bool enabled) override;
void GetScreenBrightnessLevel(
GetScreenBrightnessLevelCallback callback) override;
void SetScreenBrightnessLevel(double level, bool gradual) override;
void SetNightLightEnabled(bool enabled) override;
void SetSwitchAccessEnabled(bool enabled) override;
bool OpenAndroidApp(const ash::assistant::AndroidAppInfo& app_info) override;
ash::assistant::AppStatus GetAndroidAppStatus(
const ash::assistant::AndroidAppInfo& app_info) override;
void LaunchAndroidIntent(const std::string& intent) override;
void AddAndFireAppListEventSubscriber(
ash::assistant::AppListEventSubscriber* subscriber) override;
void RemoveAppListEventSubscriber(
ash::assistant::AppListEventSubscriber* subscriber) override;
// ash::AndroidIntentHelper overrides:
absl::optional<std::string> GetAndroidAppLaunchIntent(
const ash::assistant::AndroidAppInfo& app_info) override;
private:
// ArcAppListPrefs::Observer overrides.
void OnPackageListInitialRefreshed() override;
void OnAppRegistered(const std::string& app_id,
const ArcAppListPrefs::AppInfo& app_info) override;
void OnAppRemoved(const std::string& id) override;
std::unique_ptr<DeviceActionsDelegate> delegate_;
base::ScopedMultiSourceObservation<ArcAppListPrefs, ArcAppListPrefs::Observer>
scoped_prefs_observations_{this};
base::ObserverList<ash::assistant::AppListEventSubscriber>
app_list_subscribers_;
mojo::Remote<ash::bluetooth_config::mojom::CrosBluetoothConfig>
remote_cros_bluetooth_config_;
};
#endif // CHROME_BROWSER_UI_ASH_ASSISTANT_DEVICE_ACTIONS_H_
| {
"content_hash": "57167b42b265e875d5d587372f82f9e5",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 80,
"avg_line_length": 42.23529411764706,
"alnum_prop": 0.7599814298978644,
"repo_name": "chromium/chromium",
"id": "43df537a5471df8e869705f13ca6ada71986642d",
"size": "3094",
"binary": false,
"copies": "5",
"ref": "refs/heads/main",
"path": "chrome/browser/ui/ash/assistant/device_actions.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package stocklist_demo.adapters;
import java.io.File;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.log4j.Logger;
import org.apache.log4j.xml.DOMConfigurator;
import com.lightstreamer.adapters.metadata.LiteralBasedProvider;
import com.lightstreamer.interfaces.metadata.CreditsException;
import com.lightstreamer.interfaces.metadata.ItemsException;
import com.lightstreamer.interfaces.metadata.MetadataProviderException;
import com.lightstreamer.interfaces.metadata.MpnDeviceInfo;
import com.lightstreamer.interfaces.metadata.MpnPlatformType;
import com.lightstreamer.interfaces.metadata.MpnSubscriptionInfo;
import com.lightstreamer.interfaces.metadata.NotificationException;
import com.lightstreamer.interfaces.metadata.TableInfo;
public class MPNStockQuotesMetadataAdapter extends LiteralBasedProvider {
/**
* Keeps the client context informations supplied by Lightstreamer
* on the new session notifications.
* Session information is used when logging MPN subscription activations.
*/
private ConcurrentHashMap<String,Map<String,String>> sessions = new ConcurrentHashMap<String,Map<String,String>>();
/**
* Used as a Set, to keep unique identifiers for the currently connected
* clients.
* This information is used when logging MPN subscription activations to
* uniquely identify by the client IP address and the HTTP user agent;
* in case of conflicts, a custom progressive is appended to
* the user agent. This set lists the concatenations of the current
* IP and user agent pairs, to help determining uniqueness.
*/
private ConcurrentHashMap<String,Object> uaIpPairs = new ConcurrentHashMap<String,Object>();
/**
* Private logger; a specific "LS_demos_Logger.StockQuotesMetadata" category
* should be supplied by log4j configuration.
*/
private Logger logger;
/////////////////////////////////////////////////////////////////////////
// Initialization
public MPNStockQuotesMetadataAdapter() {}
@Override
@SuppressWarnings("rawtypes")
public void init(Map params, File configDir)
throws MetadataProviderException {
// Call super's init method to handle basic Metadata Adapter features
super.init(params, configDir);
String logConfig = (String) params.get("log_config");
if (logConfig != null) {
File logConfigFile = new File(configDir, logConfig);
String logRefresh = (String) params.get("log_config_refresh_seconds");
if (logRefresh != null) {
DOMConfigurator.configureAndWatch(logConfigFile.getAbsolutePath(), Integer.parseInt(logRefresh) * 1000);
} else {
DOMConfigurator.configure(logConfigFile.getAbsolutePath());
}
}
logger = Logger.getLogger("LS_demos_Logger.StockQuotesMetadata");
logger.info("StockQuotesMetadataAdapter ready");
}
/////////////////////////////////////////////////////////////////////////
// Session management
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void notifyNewSession(String user, String session, Map clientContext)
throws CreditsException, NotificationException {
// We can't have duplicate sessions
assert(!sessions.containsKey(session));
/* If needed, modify the user agent and store it directly
* in the session infos object, for logging support.
* Note: we are free to change and store the received object.
*/
uniquelyIdentifyClient(clientContext);
// Register the session details on the sessions HashMap,
// for Chat and Monitor support.
sessions.put(session, clientContext);
}
@Override
public void notifySessionClose(String session) throws NotificationException {
// The session must exist to be closed
assert(sessions.containsKey(session));
// We have to remove session informations from the session HashMap
// and from the pairs "Set"
Map<String,String> sessionInfo = sessions.get(session);
String ua = sessionInfo.get("USER_AGENT");
String IP = sessionInfo.get("REMOTE_IP");
uaIpPairs.remove(IP+" "+ua);
sessions.remove(session);
}
/////////////////////////////////////////////////////////////////////////
// Mobile push notifications management
@Override
public void notifyMpnDeviceAccess(String user, String sessionID, MpnDeviceInfo device)
throws CreditsException, NotificationException {
// Authorize all devices
}
@Override
public void notifyMpnSubscriptionActivation(String user, String sessionID, TableInfo table, MpnSubscriptionInfo mpnSubscription)
throws CreditsException, NotificationException {
// We suppose someone may try to communicate with the Server directly, through
// the TLCP protocol, and force it to send unexpected or unwanted push notifications.
// They could try to change both the items and the format of legit push notifications,
// but could not change the app name, as it is checked by the Server during subscription.
// Hence notifications may only be delivered to the legit app. They could not even change
// the trigger expression, as it is filtered by the Server using the regular expression
// list specified in configuration files.
// Check the item name, should be one of those supported by the StockList Data Adapter
if (table.getId() == null) {
throw new NotificationException("Unexpected error on item names");
}
String[] itemNames;
try {
itemNames= getItems(user, sessionID, table.getId());
} catch (ItemsException e) {
throw new NotificationException("Unexpected error on item names");
}
for (String itemName : itemNames) {
if (!itemName.startsWith("item")) {
throw new CreditsException(-102, "Invalid item argument for push notifications");
}
}
// Check the platform type
if (mpnSubscription.getDevice().getType().getName().equals(MpnPlatformType.Apple.getName())) {
// Here, we can add APNS-related checks, by inspecting the JSON string returned by:
// mpnSubscription.getNotificationFormat()
// Authorized, log it
doLog(logger, sessionID, "Authorized APNS subscription with parameters:\n" +
((table.getId() != null) ? "\tgroup: " + table.getId() + "\n" : "") +
((itemNames != null) && (itemNames.length > 0) ? "\titems: " + itemNames + "\n" : "") +
((table.getSchema() != null) ? "\tschema: " + table.getSchema() + "\n" : "") +
((mpnSubscription.getTrigger() != null) ? "\ttrigger expression: " + mpnSubscription.getTrigger() + "\n" : "") +
((mpnSubscription.getNotificationFormat() != null) ? "\tformat: " + mpnSubscription.getNotificationFormat() + "\n" : ""));
// Here, we can add custom APNS log, by inspecting the JSON string returned by:
// mpnSubscription.getNotificationFormat()
} else if (mpnSubscription.getDevice().getType().getName().equals(MpnPlatformType.Google.getName())) {
// Here, we can add FCM-related checks, by inspecting the JSON string returned by:
// mpnSubscription.getNotificationFormat()
// Authorized, log it
doLog(logger, sessionID, "Authorized FCM subscription with parameters:\n" +
((table.getId() != null) ? "\tgroup: " + table.getId() + "\n" : "") +
((itemNames != null) && (itemNames.length > 0) ? "\titems: " + itemNames + "\n" : "") +
((table.getSchema() != null) ? "\tschema: " + table.getSchema() + "\n" : "") +
((mpnSubscription.getTrigger() != null) ? "\ttrigger expression: " + mpnSubscription.getTrigger() + "\n" : "") +
((mpnSubscription.getNotificationFormat() != null) ? "\tformat: " + mpnSubscription.getNotificationFormat() + "\n" : ""));
// Here, we can add custom FCM log, by inspecting the JSON string returned by:
// mpnSubscription.getNotificationFormat()
} else {
throw new CreditsException(-103, "Invalid platform argument for push notifications");
}
}
@Override
public void notifyMpnDeviceTokenChange(String user, String sessionID, MpnDeviceInfo device, String newDeviceToken)
throws CreditsException, NotificationException {
// Authorize all token changes
}
/////////////////////////////////////////////////////////////////////////
// Internals
/**
* Modifies the clientContext to provide a unique identification
* for the client session, for Chat support.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private void uniquelyIdentifyClient(Map clientContext) {
// Extract user agent and ip from session infos
String ua = (String) clientContext.get("USER_AGENT");
String ip = (String) clientContext.get("REMOTE_IP");
/*
* we need to ensure that each pair IP-User Agent is unique so that
* the sender can be identified on the client, if such pair is not
* unique we add a counter on the user agent string
*/
String count = "";
int c = 0;
// Synchronize to ensure that we do not generate two identical pairs
synchronized(uaIpPairs) {
while (uaIpPairs.containsKey(ip+" "+ua+" "+count)) {
c++;
count = "["+c+"]";
}
ua = ua+" "+count;
uaIpPairs.put(ip+" "+ua,new Object());
}
clientContext.put("USER_AGENT", ua);
}
private void doLog(Logger logger, String session, String msg) {
if (logger != null) {
Map<String,String> sessionInfo = sessions.get(session);
String IP = sessionInfo.get("REMOTE_IP");
logger.info(msg + "\tfrom " + IP);
}
}
}
| {
"content_hash": "657417356d847efabfaf39f95165108e",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 142,
"avg_line_length": 42.69387755102041,
"alnum_prop": 0.615678776290631,
"repo_name": "Weswit/Lightstreamer-example-MPNStockListMetadata-adapter-java",
"id": "e0fe5339233c91671bd4248bdbca15a83baa339f",
"size": "11042",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/stocklist_demo/adapters/MPNStockQuotesMetadataAdapter.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "14659"
}
],
"symlink_target": ""
} |
function [Fx,Fy,Fz]=backwards2forwards(Bx,By,Bz)
% This function will turn a backward transformation field in to a
% forward transformation field, using gaussian kernel splatting.
%
% Thus when you have transformed image1 into image2 with the Rueckert
% Registration, this function can reverse the vectorField allowing the
% transformation of image2 into image 1.
%
% Note: Some small interpolation artifacts will be present, thus derivatives
% of the transformation field used for strain measurements are less reliable.
%
%
% [Fx,Fy]=backwards2forwards(Bx,By);
% or (3D) [Fx,Fy,Fz]=backwards2forwards(Bx,By,Bz);
%
% inputs,
% Bx,By,Bz : The backward transformation fields
%
% outputs,
% Fx,Fy,Fz : The forward transformation fields
%
% Function is written by D.Kroon University of Twente (November 2008)
if(~exist('Bz','var')) % Detect if 2D or 3D
% Gaussian kernel (Must be symetric and odd in size)
H=fspecial('gaussian',[7 7],5/6);
Bx=2*imresize(Bx,2,'bilinear'); By=2*imresize(By,2,'bilinear');
[Fx,Fy]=backwards2forwards_2d_double(double(Bx),double(By),double(H));
Fx=(1/2)*imresize(Fx,1/2,'bilinear'); Fy=(1/2)*imresize(Fy,1/2,'bilinear');
else
sigma=9/6;
[x,y,z] = ndgrid(-3:3,-3:3,-3:3);
H = exp(-(x.*x/2/sigma^2 + y.*y/2/sigma^2 + z.*z/2/sigma^2)); H = H/sum(H(:));
if(isa(Bx,'double'))
[Fx,Fy,Fz]=backwards2forwards_3d_double(double(Bx),double(By),double(Bz),double(H));
else
[Fx,Fy,Fz]=backwards2forwards_3d_single(single(Bx),single(By),single(Bz),single(H));
end
end
| {
"content_hash": "9415148f935a7b9afa17f3eb81b11fd9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 92,
"avg_line_length": 39.02439024390244,
"alnum_prop": 0.665625,
"repo_name": "bugra/Similarity-Transform",
"id": "79d2b4d2c42f79e48b291d1cdda69fcab98985c0",
"size": "1600",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "functions/backwards2forwards.m",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "268463"
},
{
"name": "C++",
"bytes": "5036"
},
{
"name": "Matlab",
"bytes": "82753"
},
{
"name": "Objective-C",
"bytes": "50154"
}
],
"symlink_target": ""
} |
package dk.brics.tajs.util;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Map;
import java.util.Map.Entry;
/**
* Comparator for map entries using the natural order of the entry keys.
*/
public class MapEntryComparator<K extends Comparable<K>,V> implements Comparator<Map.Entry<K,V>>, Serializable {
private static final long serialVersionUID = 1L;
@Override
public int compare(Entry<K, V> e1, Entry<K, V> e2) {
return e1.getKey().compareTo(e2.getKey());
}
}
| {
"content_hash": "f8af3ad7becbe48aea0115a4078ab229",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 112,
"avg_line_length": 22.818181818181817,
"alnum_prop": 0.7370517928286853,
"repo_name": "cursem/ScriptCompressor",
"id": "32ca5de23655107d3a93549052d26a6114e9b84c",
"size": "1107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ScriptCompressor1.0/src/dk/brics/tajs/util/MapEntryComparator.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "112227"
},
{
"name": "C++",
"bytes": "2452"
},
{
"name": "Java",
"bytes": "3198021"
},
{
"name": "XSLT",
"bytes": "13228"
}
],
"symlink_target": ""
} |
extern NxActor* gSelectedActor;
// Draw 3ds mesh
void Draw3DSMesh(NxShape* shape, Model_3DS* model)
{
NxMat34 pose;
pose = shape->getGlobalPose();
// Get saved-away wheel shape pose to draw wheel shape at proper position
if (shape->getType() == NX_SHAPE_WHEEL)
{
NxWheelShape* ws = (NxWheelShape *)shape;
pose = ((ShapeUserData*)(ws->userData))->wheelShapePose;
}
glPushMatrix();
float glmat[16]; //4x4 column major matrix for OpenGL.
pose.M.getColumnMajorStride4(&(glmat[0]));
pose.t.get(&(glmat[12]));
//clear the elements we don't need:
glmat[3] = glmat[7] = glmat[11] = 0.0f;
glmat[15] = 1.0f;
glMultMatrixf(&(glmat[0]));
model->Draw();
glPopMatrix();
glDisable( GL_TEXTURE_2D );
}
void Draw3DSMeshActor(NxActor *actor)
{
NxShape*const* shapes = actor->getShapes();
NxU32 nShapes = actor->getNbShapes();
while (nShapes--)
{
ShapeUserData* sud = (ShapeUserData*)(shapes[nShapes]->userData);
if (sud && sud->model)
Draw3DSMesh(shapes[nShapes], ((Model_3DS*)(sud->model))); //only set one shape in 3ds model.
else
DrawShape(shapes[nShapes], true);
}
nShapes = actor->getNbShapes();
if (gSelectedActor && actor == gSelectedActor)
{
while (nShapes--)
{
if (shapes[nShapes]->getFlag(NX_TRIGGER_ENABLE))
DrawWireShape(shapes[nShapes], NxVec3(0,0,1), true);
else
DrawWireShape(shapes[nShapes], NxVec3(1,1,1), true);
}
}
}
| {
"content_hash": "92344fb69f020e6234c225e8932f10f1",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 96,
"avg_line_length": 24.103448275862068,
"alnum_prop": 0.6688125894134478,
"repo_name": "daher-alfawares/xr.desktop",
"id": "e9881da4d2a05d3aae0100606c8955b6695ff360",
"size": "1831",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sdk/physx/2.8.3/TrainingPrograms/Programs/Shared_Source/Draw3DSShapes.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7637032"
},
{
"name": "C++",
"bytes": "10341154"
},
{
"name": "CSS",
"bytes": "13999"
},
{
"name": "FLUX",
"bytes": "8962"
},
{
"name": "Lua",
"bytes": "41544"
},
{
"name": "Makefile",
"bytes": "153491"
},
{
"name": "Objective-C",
"bytes": "26770"
},
{
"name": "Papyrus",
"bytes": "8538"
},
{
"name": "Python",
"bytes": "166588"
},
{
"name": "Shell",
"bytes": "264166"
},
{
"name": "XSLT",
"bytes": "12347"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_45) on Tue Dec 02 21:24:55 EST 2014 -->
<title>Uses of Interface org.maltparser.core.syntaxgraph.node.Node (MaltParser 1.8.1)</title>
<meta name="date" content="2014-12-02">
<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 Interface org.maltparser.core.syntaxgraph.node.Node (MaltParser 1.8.1)";
}
//-->
</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/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><b>MaltParser 1.8.1</b></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/maltparser/core/syntaxgraph/node/class-use/Node.html" target="_top">Frames</a></li>
<li><a href="Node.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface org.maltparser.core.syntaxgraph.node.Node" class="title">Uses of Interface<br>org.maltparser.core.syntaxgraph.node.Node</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.maltparser.core.lw.graph">org.maltparser.core.lw.graph</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.maltparser.core.syntaxgraph">org.maltparser.core.syntaxgraph</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="#org.maltparser.core.syntaxgraph.edge">org.maltparser.core.syntaxgraph.edge</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.maltparser.core.syntaxgraph.node">org.maltparser.core.syntaxgraph.node</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.maltparser.core.lw.graph">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> in <a href="../../../../../../org/maltparser/core/lw/graph/package-summary.html">org.maltparser.core.lw.graph</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../org/maltparser/core/lw/graph/package-summary.html">org.maltparser.core.lw.graph</a> that implement <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWNode.html" title="class in org.maltparser.core.lw.graph">LWNode</a></strong></code>
<div class="block">A lightweight version of org.maltparser.core.syntaxgraph.node.{Token,Root}</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/maltparser/core/lw/graph/package-summary.html">org.maltparser.core.lw.graph</a> that return <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">LWEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWEdge.html#getSource()">getSource</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">LWEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWEdge.html#getTarget()">getTarget</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/maltparser/core/lw/graph/package-summary.html">org.maltparser.core.lw.graph</a> with parameters of type <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">LWEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWEdge.html#setEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int)">setEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../../org/maltparser/core/lw/graph/package-summary.html">org.maltparser.core.lw.graph</a> with parameters of type <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWEdge.html#LWEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node)">LWEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> _source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> _target)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/lw/graph/LWEdge.html#LWEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, java.util.SortedMap)">LWEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> _source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> _target,
<a href="http://java.sun.com/javase/6/docs/api/java/util/SortedMap.html?is-external=true" title="class or interface in java.util">SortedMap</a><org.maltparser.concurrent.graph.dataformat.ColumnDescription,<a href="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> _labels)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.maltparser.core.syntaxgraph">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> in <a href="../../../../../../org/maltparser/core/syntaxgraph/package-summary.html">org.maltparser.core.syntaxgraph</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/maltparser/core/syntaxgraph/package-summary.html">org.maltparser.core.syntaxgraph</a> with parameters of type <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><span class="strong">DependencyGraph.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/DependencyGraph.html#removeDependencyEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node)">removeDependencyEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> head,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> dependent)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><span class="strong">MappablePhraseStructureGraph.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/MappablePhraseStructureGraph.html#removeDependencyEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node)">removeDependencyEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> head,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> dependent)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.maltparser.core.syntaxgraph.edge">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> in <a href="../../../../../../org/maltparser/core/syntaxgraph/edge/package-summary.html">org.maltparser.core.syntaxgraph.edge</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/maltparser/core/syntaxgraph/edge/package-summary.html">org.maltparser.core.syntaxgraph.edge</a> that return <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">GraphEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/GraphEdge.html#getSource()">getSource</a></strong>()</code>
<div class="block">Returns the source node of the edge.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">Edge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/Edge.html#getSource()">getSource</a></strong>()</code>
<div class="block">Returns the source node of the edge.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">GraphEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/GraphEdge.html#getTarget()">getTarget</a></strong>()</code>
<div class="block">Returns the target node of the edge.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></code></td>
<td class="colLast"><span class="strong">Edge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/Edge.html#getTarget()">getTarget</a></strong>()</code>
<div class="block">Returns the target node of the edge.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/maltparser/core/syntaxgraph/edge/package-summary.html">org.maltparser.core.syntaxgraph.edge</a> with parameters of type <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">GraphEdge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/GraphEdge.html#setEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int)">setEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type)</code>
<div class="block">Sets the edge with a source node, a target node and a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE
or SECONDARY_EDGE).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">Edge.</span><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/Edge.html#setEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int)">setEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type)</code>
<div class="block">Sets the edge with a source node, a target node and a type (DEPENDENCY_EDGE, PHRASE_STRUCTURE_EDGE
or SECONDARY_EDGE).</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../../org/maltparser/core/syntaxgraph/edge/package-summary.html">org.maltparser.core.syntaxgraph.edge</a> with parameters of type <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/GraphEdge.html#GraphEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int)">GraphEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/WeightedEdge.html#WeightedEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int)">WeightedEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type)</code> </td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/edge/WeightedEdge.html#WeightedEdge(org.maltparser.core.syntaxgraph.node.Node, org.maltparser.core.syntaxgraph.node.Node, int, java.lang.Double)">WeightedEdge</a></strong>(<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> source,
<a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> target,
int type,
<a href="http://java.sun.com/javase/6/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a> weight)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.maltparser.core.syntaxgraph.node">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a> in <a href="../../../../../../org/maltparser/core/syntaxgraph/node/package-summary.html">org.maltparser.core.syntaxgraph.node</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../org/maltparser/core/syntaxgraph/node/package-summary.html">org.maltparser.core.syntaxgraph.node</a> that implement <a href="../../../../../../org/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Node</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/node/GraphNode.html" title="class in org.maltparser.core.syntaxgraph.node">GraphNode</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/node/NonTerminal.html" title="class in org.maltparser.core.syntaxgraph.node">NonTerminal</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Root.html" title="class in org.maltparser.core.syntaxgraph.node">Root</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/maltparser/core/syntaxgraph/node/Token.html" title="class in org.maltparser.core.syntaxgraph.node">Token</a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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/maltparser/core/syntaxgraph/node/Node.html" title="interface in org.maltparser.core.syntaxgraph.node">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em><b>MaltParser 1.8.1</b></em></div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/maltparser/core/syntaxgraph/node/class-use/Node.html" target="_top">Frames</a></li>
<li><a href="Node.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright 2007-2014 Johan Hall, Jens Nilsson and Joakim Nivre.</small></p>
</body>
</html>
| {
"content_hash": "c2fd4aea1494468430474ac04e17d227",
"timestamp": "",
"source": "github",
"line_count": 364,
"max_line_length": 478,
"avg_line_length": 67.38461538461539,
"alnum_prop": 0.6687866927592955,
"repo_name": "jerryyeezus/nlp-summarization",
"id": "07f854c45bad9f02e9bd52ff5e803523e06ffad8",
"size": "24528",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "maltparser/dist/maltparser-1.8.1/docs/api/org/maltparser/core/syntaxgraph/node/class-use/Node.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "10226"
},
{
"name": "CSS",
"bytes": "30720"
},
{
"name": "E",
"bytes": "2831"
},
{
"name": "Forth",
"bytes": "2657"
},
{
"name": "Java",
"bytes": "1774038"
},
{
"name": "Perl",
"bytes": "108222"
},
{
"name": "Python",
"bytes": "98753"
},
{
"name": "Shell",
"bytes": "924"
},
{
"name": "TeX",
"bytes": "7823"
},
{
"name": "XSLT",
"bytes": "11436"
}
],
"symlink_target": ""
} |
// Data Access is a Java library to store data
// Copyright (C) 2016-2019 Adrián Romero Corchado.
//
// This file is part of Data Access
//
// 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.adr.data.sql;
import com.adr.data.DataException;
import com.adr.data.record.Header;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import com.adr.data.record.Record;
import com.adr.data.record.Records;
import com.google.common.collect.ImmutableList;
import com.adr.data.Link;
/**
*
* @author adrian
*/
public class SQLCommandLink implements Link {
private final DataSource ds;
private final SQLEngine engine;
private final Map<String, Sentence> sentences = new HashMap<>();
public SQLCommandLink(DataSource ds, SQLEngine engine, Sentence... sentences) {
this.ds = ds;
this.engine = engine;
for (Sentence s : sentences) {
this.sentences.put(s.getName(), s);
}
}
public SQLCommandLink(DataSource ds, Sentence... sentences) {
this(ds, SQLEngine.GENERIC, sentences);
}
@Override
public List<Record> process(Header headers, List<Record> l) throws DataException {
try (Connection c = ds.getConnection()) {
c.setAutoCommit(false);
for (Record r : l) {
Sentence s = sentences.get(Records.getCollection(r));
if (s == null) {
s = engine.getPutSentence();
}
s.execute(c, engine, r);
}
c.commit();
return ImmutableList.of(new Record("PROCESSED", l.size()));
} catch (SQLException ex) {
throw new DataException(ex);
}
}
}
| {
"content_hash": "dcd5daa3311d212243f888b9a8c30e21",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 86,
"avg_line_length": 33.32394366197183,
"alnum_prop": 0.6398985629754861,
"repo_name": "adrianromero/data",
"id": "ec242c514bb81dcc4d214728ae848dad04e91a78",
"size": "2367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/adr/data/sql/SQLCommandLink.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "337031"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>quickchick: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / quickchick - 1.6.3</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
quickchick
<small>
1.6.3
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-17 05:01:29 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-17 05:01:29 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.10.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "llamp@seas.upenn.edu"
synopsis: "Randomized Property-Based Testing Plugin for Coq"
homepage: "https://github.com/QuickChick/QuickChick"
dev-repo: "git+https://github.com/QuickChick/QuickChick.git"
bug-reports: "https://github.com/QuickChick/QuickChick/issues"
license: "MIT"
build: [ make "-j" jobs ]
install: [
[make "-j" jobs "install" ]
]
depends: [
"ocaml" {>= "4.07"}
"coq" {>= "8.11" < "8.16~"}
"coq-ext-lib"
"coq-mathcomp-ssreflect"
"ocamlbuild"
"ocamlfind"
"menhir" {build}
"cppo" {build & >= "1.6.8"}
"coq-simple-io"
]
authors: [
"Leonidas Lampropoulos <>"
"Zoe Paraskevopoulou <>"
"Maxime Denes <>"
"Catalin Hritcu <>"
"Benjamin Pierce <>"
"Li-yao Xia <>"
"Arthur Azevedo de Amorim <>"
"Yishuai Li <>"
"Antal Spector-Zabusky <>"
]
tags: [
"keyword:extraction"
"category:Miscellaneous/Coq Extensions"
"logpath:QuickChick"
]
url {
src: "https://github.com/QuickChick/QuickChick/archive/v1.6.3.tar.gz"
checksum: [
"sha512=995ee69b09583329e39137b641ab8c286d58fe13457fc9c7d32f7ffeea5d5dd8a354e76b81b583986dc730ffe7c6597f2d16c9cc39adfd983dc6869eb49d5d50"
]
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-quickchick.1.6.3 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-quickchick -> ocaml >= 4.07
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-quickchick.1.6.3</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "5a18ce9ee736712a403fba92c11cb412",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 159,
"avg_line_length": 39.26775956284153,
"alnum_prop": 0.5464792652379628,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "19b81c12a2c196f3dfd57877adfcd6cc650fbf9b",
"size": "7211",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.10.0/quickchick/1.6.3.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers
{
internal static class AllocationRules
{
public const string PerformanceSensitiveAttributeName = "Roslyn.Utilities.PerformanceSensitiveAttribute";
}
}
| {
"content_hash": "72ce26c8435bd6fd3c33dbbdfc0bdcd0",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 161,
"avg_line_length": 44.22222222222222,
"alnum_prop": 0.7814070351758794,
"repo_name": "pakdev/roslyn-analyzers",
"id": "ee97c5ddaf667eba2b9e5dc3e04e444171c7cf1e",
"size": "400",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/PerformanceSensitiveAnalyzers/Core/AllocationRules.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5165"
},
{
"name": "C#",
"bytes": "10824190"
},
{
"name": "PowerShell",
"bytes": "19192"
},
{
"name": "Rich Text Format",
"bytes": "246282"
},
{
"name": "Shell",
"bytes": "9077"
},
{
"name": "Visual Basic",
"bytes": "161767"
}
],
"symlink_target": ""
} |
FROM balenalib/odroid-u3+-ubuntu:cosmic-build
ENV NODE_VERSION 15.10.0
ENV YARN_VERSION 1.22.4
RUN for key in \
6A010C5166006599AA17F08146C2130DFD2497F5 \
; do \
gpg --keyserver pgp.mit.edu --recv-keys "$key" || \
gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \
done \
&& curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-armv7l.tar.gz" \
&& echo "ca27a48dd9233b00c49b37a07751395657d4e454ebfa5066a6371e5f6c9969cf node-v$NODE_VERSION-linux-armv7l.tar.gz" | sha256sum -c - \
&& tar -xzf "node-v$NODE_VERSION-linux-armv7l.tar.gz" -C /usr/local --strip-components=1 \
&& rm "node-v$NODE_VERSION-linux-armv7l.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
&& curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
&& gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& mkdir -p /opt/yarn \
&& tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \
&& ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
&& npm config set unsafe-perm true -g --unsafe-perm \
&& rm -rf /tmp/*
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \
&& echo "Running test-stack@node" \
&& chmod +x test-stack@node.sh \
&& bash test-stack@node.sh \
&& rm -rf test-stack@node.sh
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu cosmic \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v15.10.0, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "795b785881add6de97ec3062d4672ccb",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 694,
"avg_line_length": 66.8780487804878,
"alnum_prop": 0.7097009482129832,
"repo_name": "nghiant2710/base-images",
"id": "a28b09235879c1312e77c3104b6d53311f33ca36",
"size": "2763",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/node/odroid-u3+/ubuntu/cosmic/15.10.0/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace DSerfozo.LibclangSharp.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DSerfozo.LibclangSharp.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Q4Qhznj4NvZBVhbuiDN1JA==.
/// </summary>
internal static string libclang_x64_checksum {
get {
return ResourceManager.GetString("libclang_x64_checksum", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to TUXhTuHHV7g/z3QB/8mLgQ==.
/// </summary>
internal static string libclang_x86_checksum {
get {
return ResourceManager.GetString("libclang_x86_checksum", resourceCulture);
}
}
}
}
| {
"content_hash": "f4b7f8afbdb99f24be53fe0edbeb5955",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 188,
"avg_line_length": 42.60493827160494,
"alnum_prop": 0.6009852216748769,
"repo_name": "arsher/libclangsharp",
"id": "2f40a73848e98e305abc127bc336b183bc9cd67d",
"size": "3453",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DSerfozo.LibclangSharp/Properties/Resources.Designer.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "32143"
},
{
"name": "C++",
"bytes": "142"
}
],
"symlink_target": ""
} |
package omtteam.omlib.network.messages.render;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import omtteam.omlib.proxy.ClientProxy;
import omtteam.omlib.util.RandomUtil;
import java.util.Objects;
/**
* Created by nico on 23/05/17.
* This gives the client a Ray object to be rendered in the next RenderWorldLastEvent.
*/
public class MessageSpawnParticleQuad implements IMessage {
private double x, y, z, xRange, yRange, zRange, speedFactor;
private int amount, id, dimensionId;
public MessageSpawnParticleQuad() {
}
public MessageSpawnParticleQuad(int id, int dimensionId, double x, double y, double z, double xRange, double yRange, double zRange, double speedFactor, int amount) {
this.id = id;
this.dimensionId = dimensionId;
this.x = x;
this.y = y;
this.z = z;
this.xRange = xRange;
this.yRange = yRange;
this.zRange = zRange;
this.speedFactor = speedFactor;
this.amount = amount;
}
@Override
public void fromBytes(ByteBuf buf) {
this.id = buf.readInt();
this.dimensionId = buf.readInt();
this.x = buf.readDouble();
this.y = buf.readDouble();
this.z = buf.readDouble();
this.xRange = buf.readDouble();
this.yRange = buf.readDouble();
this.zRange = buf.readDouble();
this.speedFactor = buf.readDouble();
this.amount = buf.readInt();
}
@Override
public void toBytes(ByteBuf buf) {
buf.writeInt(id);
buf.writeInt(dimensionId);
buf.writeDouble(x);
buf.writeDouble(y);
buf.writeDouble(z);
buf.writeDouble(xRange);
buf.writeDouble(yRange);
buf.writeDouble(zRange);
buf.writeDouble(speedFactor);
buf.writeInt(amount);
}
public static class MessageHandlerSpawnParticleQuad implements IMessageHandler<MessageSpawnParticleQuad, IMessage> {
@Override
@SideOnly(Side.CLIENT)
public IMessage onMessage(MessageSpawnParticleQuad messageIn, MessageContext ctx) {
final MessageSpawnParticleQuad message = messageIn;
Minecraft.getMinecraft().addScheduledTask(() -> {
World world = ClientProxy.getWorld(FMLClientHandler.instance().getClient());
if (world.provider.getDimension() != message.dimensionId) {
return;
}
for (int i = 0; i <= message.amount; i++) {
try {
world.spawnParticle(Objects.requireNonNull(EnumParticleTypes.getParticleFromId(message.id)),
message.x + (RandomUtil.random.nextDouble() - 0.5) * message.xRange,
message.y + (RandomUtil.random.nextDouble() - 0.5) * message.yRange,
message.z + (RandomUtil.random.nextDouble() - 0.5) * message.zRange,
(RandomUtil.random.nextDouble() - 0.5) * message.speedFactor,
(RandomUtil.random.nextDouble() - 0.5) * message.speedFactor,
(RandomUtil.random.nextDouble() - 0.5) * message.speedFactor);
} catch (Exception e) {
return;
}
}
});
return null;
}
}
}
| {
"content_hash": "676d89072e00431d7d73b3a236078f3d",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 169,
"avg_line_length": 40.44329896907217,
"alnum_prop": 0.6064236553657915,
"repo_name": "OpenModularTurretsTeam/OMLib",
"id": "55bc82278dde5d7d4f0776e80af64c0ce51f5b60",
"size": "3923",
"binary": false,
"copies": "1",
"ref": "refs/heads/1.12",
"path": "src/main/java/omtteam/omlib/network/messages/render/MessageSpawnParticleQuad.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "317"
},
{
"name": "Java",
"bytes": "408357"
}
],
"symlink_target": ""
} |
var Action = require('../action');
var Register = Action.extend({
data: function() {
return {
title: 'MomConnect: Register the user',
fields: [{
key: 'msisdn',
name: 'msisdn',
userFieldId: 'msisdn'
}, {
key: 'clinic-code',
name: 'Clinic Code',
userFieldId: null
}, {
key: 'edd',
name: 'Expected Due Date',
userFieldId: null
}]
};
}
});
Register.Edit = Action.Edit.extend();
module.exports = Register;
| {
"content_hash": "1645623d200200093d654a05fecc137b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 45,
"avg_line_length": 17.96551724137931,
"alnum_prop": 0.510556621880998,
"repo_name": "praekelt/numi-prototypes",
"id": "48a9c26461d2194193d00e87136d0614dea10161",
"size": "521",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "src/views/blocks/register/index.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "20172"
},
{
"name": "HTML",
"bytes": "79804"
},
{
"name": "JavaScript",
"bytes": "3284863"
}
],
"symlink_target": ""
} |
export interface IPushNotificationSub {
version: string;
createdOn: number;
copayerId: string;
token: string;
externalUserId: string;
packageName: string;
platform: string;
walletId: string;
}
export class PushNotificationSub {
version: string;
createdOn: number;
copayerId: string;
token: string;
externalUserId: string;
packageName: string;
platform: string;
walletId: string;
static create(opts) {
opts = opts || {};
const x = new PushNotificationSub();
x.version = '1.0.0';
x.createdOn = Math.floor(Date.now() / 1000);
x.copayerId = opts.copayerId;
x.token = opts.token;
x.externalUserId = opts.externalUserId;
x.packageName = opts.packageName;
x.platform = opts.platform;
x.walletId = opts.walletId;
return x;
}
static fromObj(obj) {
const x = new PushNotificationSub();
x.version = obj.version;
x.createdOn = obj.createdOn;
x.copayerId = obj.copayerId;
x.token = obj.token;
x.externalUserId = obj.externalUserId;
x.packageName = obj.packageName;
x.platform = obj.platform;
x.walletId = obj.walletId;
return x;
}
}
| {
"content_hash": "fae33300a916dcb51ea602c69c12aee8",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 48,
"avg_line_length": 22.98,
"alnum_prop": 0.6684073107049608,
"repo_name": "bitpay/bitcore",
"id": "5880fa9e6557572c16ca49cf9879913d393c7baa",
"size": "1149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/bitcore-wallet-service/src/lib/model/pushnotificationsub.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "4247"
},
{
"name": "HTML",
"bytes": "3596"
},
{
"name": "JavaScript",
"bytes": "6426173"
},
{
"name": "Makefile",
"bytes": "430"
},
{
"name": "Shell",
"bytes": "3357"
},
{
"name": "TypeScript",
"bytes": "2995740"
}
],
"symlink_target": ""
} |
<?php
/**
* @namespace
*/
namespace Zend\Crypt\Rsa\Key;
/**
* @see Zend_Crypt_Rsa_Key
*/
require_once 'Zend/Crypt/Rsa/Key.php';
/**
* @category Zend
* @package Zend_Crypt
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Private extends Key
{
protected $_publicKey = null;
public function __construct($pemString, $passPhrase = null)
{
$this->_pemString = $pemString;
$this->_parse($passPhrase);
}
/**
* @param string $passPhrase
* @throws Zend_Crypt_Exception
*/
protected function _parse($passPhrase)
{
$result = openssl_get_privatekey($this->_pemString, $passPhrase);
if (!$result) {
/**
* @see Zend_Crypt_Exception
*/
require_once 'Zend/Crypt/Exception.php';
throw new \Zend\Crypt\Exception('Unable to load private key');
}
$this->_opensslKeyResource = $result;
$this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
}
public function getPublicKey()
{
if ($this->_publicKey === null) {
/**
* @see Zend_Crypt_Rsa_Key_Public
*/
require_once 'Zend/Crypt/Rsa/Key/Public.php';
$this->_publicKey = new Public($this->_details['key']);
}
return $this->_publicKey;
}
} | {
"content_hash": "4a9df54508de0e1ce29cd5f3e2816d77",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 87,
"avg_line_length": 24.37704918032787,
"alnum_prop": 0.5608607935440484,
"repo_name": "FbN/Zend-Framework-Namespaced-",
"id": "b9eae8d6b83ab8bb4dd9b4a5657624b7f8f7dd56",
"size": "2243",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Zend/Crypt/Rsa/Key/Private.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "14877183"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_77) on Sun Feb 12 12:26:27 EST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.buffalokiwi.aerodrome.jet.products.IJetAPIBulkProductUpload (Aerodrome 1.0-SNAPSHOT API)</title>
<meta name="date" content="2017-02-12">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.buffalokiwi.aerodrome.jet.products.IJetAPIBulkProductUpload (Aerodrome 1.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/IJetAPIBulkProductUpload.html" title="interface in com.buffalokiwi.aerodrome.jet.products">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/buffalokiwi/aerodrome/jet/products/class-use/IJetAPIBulkProductUpload.html" target="_top">Frames</a></li>
<li><a href="IJetAPIBulkProductUpload.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface com.buffalokiwi.aerodrome.jet.products.IJetAPIBulkProductUpload" class="title">Uses of Interface<br>com.buffalokiwi.aerodrome.jet.products.IJetAPIBulkProductUpload</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/IJetAPIBulkProductUpload.html" title="interface in com.buffalokiwi.aerodrome.jet.products">IJetAPIBulkProductUpload</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.buffalokiwi.aerodrome.jet.products">com.buffalokiwi.aerodrome.jet.products</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.buffalokiwi.aerodrome.jet.products">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/IJetAPIBulkProductUpload.html" title="interface in com.buffalokiwi.aerodrome.jet.products">IJetAPIBulkProductUpload</a> in <a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/package-summary.html">com.buffalokiwi.aerodrome.jet.products</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/package-summary.html">com.buffalokiwi.aerodrome.jet.products</a> that implement <a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/IJetAPIBulkProductUpload.html" title="interface in com.buffalokiwi.aerodrome.jet.products">IJetAPIBulkProductUpload</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/JetAPIBulkProductUpload.html" title="class in com.buffalokiwi.aerodrome.jet.products">JetAPIBulkProductUpload</a></span></code>
<div class="block">This should handle bulk product uploads and stuff.....</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../com/buffalokiwi/aerodrome/jet/products/IJetAPIBulkProductUpload.html" title="interface in com.buffalokiwi.aerodrome.jet.products">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?com/buffalokiwi/aerodrome/jet/products/class-use/IJetAPIBulkProductUpload.html" target="_top">Frames</a></li>
<li><a href="IJetAPIBulkProductUpload.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2017. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "03e473a0ffcdc7f31dff612a5fef7c1c",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 408,
"avg_line_length": 42.970238095238095,
"alnum_prop": 0.6554924504779055,
"repo_name": "SheepGuru/aerodrome-for-jet",
"id": "5fa88c675bc7a7ebf834350c39d356e5dfdf7856",
"size": "7219",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "docs/com/buffalokiwi/aerodrome/jet/products/class-use/IJetAPIBulkProductUpload.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "874322"
}
],
"symlink_target": ""
} |
{% extends "base.html" %}
{% load email_protection %}
{% block content %}
<div id="LR_Provision" class="anchor"></div>
<h2>Provision of LRs in the ELRC-SHARE repository</h2>
<div class="content_box">
<p>The ELRC-SHARE repository is intended for documenting, storing, browsing and accessing LRs that are considered useful for feeding the CEF.AT platform.</p>
<p>You are welcome to document and upload any LRs that you have identified as useful for this purpose. The <a href="http://www.lr-coordination.eu" target="_blank">ELRC action</a> is looking for open data that can be made available for re-use through open data initiatives, but also for commercially available datasets.</p>
<p>The LR descriptions (metadata) are licensed under the Creative Commons Attribution (CC-BY) version 4.0 or higher. All LR providers are obliged to allow the harvesting of their metadata.</p>
<p>Anyone can browse the inventory and view the resource descriptions; in addition, they may download resources only in accordance to the licensing terms under which they are provided.</p>
<div id="Procedure_for_LR_provision" class="anchor"></div>
<h2>Steps to follow for providing LRs</h2>
<div class="content_box">
<p>All registered users can contribute LRs via the ELRC-SHARE repository according to the following procedure:</p>
<ul>
<li>First register <a href="../accounts/create/">here</a>; a valid email address is required for this process. Once you obtain the account credentials, you can log in and use a simple form (cf. menu item: "Contribute resources") to describe and upload LRs.</li>
<li>For each LR, you must provide at least a short description and a title in English and upload it in zipped format.</li>
<li>Following this submission, you will soon be contacted by an ELRC responsible who may ask for further information about the resource and its licensing conditions. During the documentation process, the resource descriptions are considered "internal" and cannot be viewed by anyone else besides authorised editors of the ELRC consortium. When the documentation and the licensing conditions under which the resource is provided are finalised, the resource description (metadata record) will be made public through the inventory and the resource itself will be downloadable by users, in accordance to its licensing conditions.</li>
<li>Authorised users from the ELRC consortium ("editors") are assigned the task of enriching the descriptions of the resources provided by contributors according to the ELRC-SHARE metadata schema (adapted from the META-SHARE schema) and publishing them at the ELRC-SHARE inventory (cf. menu item:"Manage resources"). Each LR description must include the licensing terms under which the LR is provided - cf. <a href="#Licensing_LRs">below</a>.</li>
</ul>
</div>
<div id="Licensing_LRs" class="anchor"></div>
<h2>Licensing LRs for the ELRC action</h2>
<div class="content_box">
<p>Any grant of access to LRs through the ELRC-SHARE repository should include not only the right to read the relevant content but also to allow transformative uses, dissemination and distribution of such resources
and their derivatives, according to the needs and policies of LR owners and users.</p>
<p>To limit the complexity of licensing, we strongly advise LR providers to use one of the standard open licences, i.e. <b>Creative Commons</b> and open national licences (- cf. <a href="#Licences">table</a> below). If, however, the LR comes with another licence, the licensing terms and conditions must be documented in the metadata so that they are clearly available to all repository users.</p>
<p>
A <a href="http://www.lr-coordination.eu/helpdesk" target="_blank">helpdesk facility</a> has been set up for assistance in understanding, choosing and using any of these licence and other legal tools, as well as the metadata required for the documentation of the licence.</p>
<p>The rights of use of the resource, any possible restrictions, as well as rights and restrictions on the original raw data are under the control and responsibility of the resource owners. The repository in which the resource resides acts mainly as a facilitator for the search-and-get procedure while providing guidelines and metadata curation activities.</p>
<p>Metadata elements regarding rights of use, availability and distribution are among the mandatory elements of the minimal metadata schema and are shown to users (essentially language resource consumers) so that they can promptly understand what they are allowed to do with a specific resource. Users are asked to always refer to these metadata before using any of the resources on this repository.</p>
<div id="Standard_and_National_Open_Licences" class="anchor"></div>
<h3>Standard and National Open Licences</h3>
<table id="Licences">
<thead>
<tr>
<th>Value</th>
<th>Full name with link to licence text or Definition</th>
</tr>
</thead>
<tbody>
<tr>
<td>CC-BY</td>
<td><a href="https://creativecommons.org/licenses/by/4.0/" target="_blank">Creative Commons Attribution</a></td>
</td>
</tr>
<tr>
<td>CC-BY-NC</td>
<td><a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">Creative Commons Attribution-NonCommercial</a></td>
</td>
</tr>
<tr>
<td>CC-BY-NC-ND</td>
<td><a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">Creative Commons Attribution- NonCommercial-NoDerivatives</a></td>
</td>
</tr>
<tr>
<td>CC-BY-NC-SA</td>
<td><a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">Creative Commons Attribution-NonCommercial-ShareAlike</a></td>
</td>
</tr>
<tr>
<td>CC-BY-ND</td>
<td><a href="https://creativecommons.org/licenses/by-nd/4.0/" target="_blank">Creative Commons Attribution-NoDerivatives</a></td>
</td>
</tr>
<tr>
<td>CC-BY-SA</td>
<td><a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Creative Commons Attribution-ShareAlike</a></td>
</td>
</tr>
<tr>
<td>CC-ZERO</td>
<td><a href="https://creativecommons.org/publicdomain/zero/1.0/" target="_blank">Creative Commons Zero</a></td>
</td>
</tr>
<tr>
<td>DL-DE-BY_Germany</td>
<td><a href="https://www.govdata.de/dl-de/by-2-0" target="_blank">Datenlizenz Deutschland – Namensnennung</a></td>
</td>
</tr>
<tr>
<td>DL-DE-ZERO_Germany</td>
<td><a href="https://www.govdata.de/dl-de/zero-2-0" target="_blank">Datenlizenz Deutschland – Zero</a></td>
</td>
</tr>
<tr>
<td>FreeOpenDataLicence_Belgium</td>
<td><a href="http://www.opendataforum.info/files/Modellicenties_ENG.pdf" target="_blank">Free Open Data Licence (Flanders)</a></td>
</td>
</tr>
<tr>
<td>FreeOpenDataLicenceForNon-CommercialRe-use_Belgium</td>
<td><a href="http://www.opendataforum.info/files/Modellicenties_ENG.pdf" target="_blank">Free Open Data Licence For Non-Commercial Re-use (Flanders)</a></td>
</td>
</tr>
<tr>
<td>IODL_Italy</td>
<td><a href="http://www.formez.it/iodl/" target="_blank">Italian Open Data License</a></td>
</td>
</tr>
<tr>
<td>LicenceOuverte-OpenLicence_France</td>
<td><a href="https://wiki.data.gouv.fr/images/9/9d/Licence_Ouverte.pdf" target="_blank">Licence Ouverte / Open Licence</a></td>
</td>
</tr>
<tr>
<td>NCGL_UK</td>
<td><a href="http://www.nationalarchives.gov.uk/doc/non-commercial-government-licence/non-commercial-government-licence.htm" target="_blank">Non-Commercial Government Licence (UK)</a></td>
</td>
</tr>
<tr>
<td>NLOD_Norway</td>
<td><a href="http://data.norge.no/nlod/en/1.0" target="_blank">Norwegian Licence for Open Government Data</a></td>
</td>
</tr>
<tr>
<td>NLSOpenDataLicence_Finland</td>
<td><a href="http://www.maanmittauslaitos.fi/en/NLS_open_data_licence_version1_20120501" target="_blank">National Land Survey Open Data Licence</a></td>
</td>
</tr>
<tr>
<td>ODbL</td>
<td><a href="http://opendatacommons.org/licenses/odbl/" target="_blank">Open Data Commons Open Database License</a></td>
</td>
</tr>
<tr>
<td>ODC-BY</td>
<td><a href="http://opendatacommons.org/licenses/by/" target="_blank">Open Data Commons Attribution License</a></td>
</td>
</tr>
<tr>
<td>OGL_UK</td>
<td><a href="http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/" target="_blank">Open Government Licence (UK)</a></td>
</td>
</tr>
<tr>
<td>OpenDataLicenceAtAFairCost_Belgium</td>
<td><a href="http://www.opendataforum.info/files/Modellicenties_ENG.pdf" target="_blank">Open Data Licence At A Fair Cost (Flanders)</a></td>
</td>
</tr>
<tr>
<td>OpenDataLicenceAtAFairCostForCommercialRe-use_Belgium</td>
<td><a href="http://www.opendataforum.info/files/Modellicenties_ENG.pdf" target="_blank">Open Data Licence at a Fair Cost For Commercial Re-use (Flanders)</a></td>
</td>
</tr>
<tr>
<td>PDDL</td>
<td><a href="http://opendatacommons.org/licenses/pddl/" target="_blank">Open Data Commons Public Domain Dedication and License</a></td>
</td>
</tr>
<tr>
<td>PSI-licence (Ireland)</td>
<td><a href="http://psi.gov.ie/files/2010/03/PSI-Licence.pdf" target="_blank">Public Sector Information licence (Ireland)</a></td>
</td>
</tr>
<tr>
<td>openForReuseWithRestrictions</td>
<td>Resources under this licence are considered to be open for reuse with some restrictions. Specific conditions may apply. Resource providers are prompted to provide the licence text or url of the resource for further details about the restrictions and/or conditions of use and other obligations.</td>
</td>
</tr>
<tr>
<td>non-standard/Other_licence/Terms</td>
<td>Resources with this value are distributed with a non-standard or proprietary licence. Resource providers are prompted to provide the licence text or url of the resource for further details about the restrictions and/or conditions of use and other obligations.</td>
</td>
</tr>
<tr>
<td>underReview</td>
<td>Used for resources whose licence value is pending</td>
</td>
</tr>
<tbody>
</table>
</div>
<div id="Notice_and_Take_Down_Policy" class="anchor"></div>
<h2>Notice and Take Down Policy</h2>
<div class="content_box">
<p>If a rights holder is concerned that s/he has found Language Resources (LRs) on the ELRC-SHARE repository, for which s/he has not given permission, granted a licence or is not covered by a limitation or
exception in national law, such rights holder is asked to contact ELRC-SHARE ({% encrypt_email 'elrc-share@ilsp.gr' %}) in writing, stating the following:</p>
<ol>
<li>His/Her contact details;</li>
<li>The full bibliographic details of the LR;</li>
<li>The exact and full URL where s/he found the LR;</li>
<li>Proof that s/he is the rights holder and a statement that, under penalty of perjury, s/he is the rights holder or an authorised representative.</li>
</ol>
<p>Upon receipt of notification the <b>Notice and Takedown</b> procedure is then invoked as follows:</p>
<ol>
<li>ELRC-SHARE will acknowledge receipt of the complaint by email or letter and will make an initial assessment of its validity and plausibility.</li>
<li>Upon receipt of a valid complaint, the LR will be temporarily removed from the ELRC-SHARE inventory pending an agreed solution.</li>
<li>ELRC-SHARE will contact the individual or organisation who deposited the material within ten working days from the reception of a valid complaint. The ELRC-SHARE depositor will be notified that the material is subject to a complaint, under what allegations, and will be encouraged to assuage the complaints concerned.</li>
<li>The complainant and the ELRC-SHARE depositor will be encouraged to resolve the issue swiftly and amicably and to the satisfaction of both parties, with the following possible outcomes:
<ul>
<li>The LR is replaced on the ELRC-SHARE inventory unchanged.</li>
<li>The LR is replaced on the ELRC-SHARE inventory with changes.</li>
<li>The LR is permanently removed from the ELRC-SHARE inventory.</li>
</ul>
</li>
<li>If the ELRC-SHARE depositor and the complainant are unable to agree on a solution, the LR will remain unavailable through the ELRC-SHARE inventory until a time when a resolution has been reached.</li>
</ol>
</div>
<div id="Privacy" class="anchor"></div>
<h2>Privacy</h2>
<div class="content_box">
<p>The ELRC-SHARE website and services log certain information about every request sent to them. This information is used for system administration and for producing usage statistics. Summary statistics are extracted from this data and some of these may be made publicly available, but these do not include information from which individuals could be identified. Relevant subsets of this data may be used as part of investigations of computer misuse involving this site. Data may also on occasion be used to enable investigation of technical problems on the website. Otherwise logged information is not passed to any third party except if required by law.</p>
</div>
<div id="Data_Protection" class="anchor"></div>
<h2>Data Protection</h2>
<div class="content_box">
<p>From time to time the ELRC-SHARE Service Providers may use electronic forms on this site to gather personal information for purposes directly related to a service, function or activity of the ELRC services. When the Service Provider will do so it will let users know the purpose for which the information is being collected (including if the information is to be published). Completion of and submission of any form on this website is entirely at the discretion of the user.</p>
</div>
<div id="Data_Protection_Statement" class="anchor"></div>
<h2>Data Protection Statement</h2>
<div class="content_box">
<p>In using and submitting content on the ELRC-SHARE services, users agree that the Service Provider may use any personal data that users supply through contributing content or by filling in electronic forms. The Service Providers respect users' privacy and seek to protect their personal data.</p>
</div>
</div>
{% endblock %} | {
"content_hash": "3708afadd8a801f5286a39b2f0966574",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 660,
"avg_line_length": 63.51111111111111,
"alnum_prop": 0.7237228831350595,
"repo_name": "MiltosD/CEF-ELRC",
"id": "c6455e874ed2b6b7aef301ddfa263a1c85ea2f05",
"size": "14294",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "metashare/templates/elrc-info.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "7362"
},
{
"name": "C",
"bytes": "321"
},
{
"name": "C++",
"bytes": "112277"
},
{
"name": "CSS",
"bytes": "220423"
},
{
"name": "HTML",
"bytes": "2722281"
},
{
"name": "Java",
"bytes": "12780"
},
{
"name": "JavaScript",
"bytes": "362648"
},
{
"name": "Makefile",
"bytes": "26172"
},
{
"name": "Python",
"bytes": "10258932"
},
{
"name": "Shell",
"bytes": "111376"
},
{
"name": "XSLT",
"bytes": "473763"
}
],
"symlink_target": ""
} |
package org.fishwife.jrugged.examples;
import java.util.Random;
import org.fishwife.jrugged.aspects.PerformanceMonitor;
public class AspectResponseTweaker {
@PerformanceMonitor("AspectResponseTweaker")
public int delay() throws Exception {
Random r = new Random();
int count = r.nextInt(2001);
if (count > 1650) {
throw new Exception("Count was over the limit.");
}
try {
Thread.sleep(count);
} catch (InterruptedException e) { }
return count;
}
}
| {
"content_hash": "a862e0676fab1bb1f0700c0675c43083",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 61,
"avg_line_length": 21.115384615384617,
"alnum_prop": 0.6229508196721312,
"repo_name": "bvand/jrugged",
"id": "b07075ee089cd7cf1c187dc00f37ba62e738d6fb",
"size": "1165",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "jrugged-examples/src/main/java/org/fishwife/jrugged/examples/AspectResponseTweaker.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "7206"
},
{
"name": "Java",
"bytes": "596949"
}
],
"symlink_target": ""
} |
from model.group import Group
import random
import string
import jsonpickle
import os.path
import getopt
import sys
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"])
except getopt.GetoptError as err:
getopt.usage()
sys.exit(2)
n = 1
f = "data/groups_editor.json"
for o, a in opts:
if o == "-n":
n = int(a)
elif o == "-f":
f = a
def random_string(prefix, maxlen):
symbols = string.ascii_letters + string.digits + " "*10
return prefix + "".join([random.choice(symbols) for i in range(random.randrange(maxlen))])
testdata = [
Group(name = random_string("name", 10), header = random_string("header", 20), footer = random_string("footer",20))
for i in range(n)
]
file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", f)
with open(file, "w") as out:
jsonpickle.set_encoder_options("json", indent=2)
out.write(jsonpickle.encode(testdata))
| {
"content_hash": "8b755633ef8006fa0bc48b75711f65f0",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 114,
"avg_line_length": 22.523809523809526,
"alnum_prop": 0.6469344608879493,
"repo_name": "IgorGolubenkov/python_training",
"id": "81392b2ad422a03948df0328ba3c4a5004c25307",
"size": "947",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generator/group_editor.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "43976"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<configuration>
<property>
<name>fuzzyjoin.data.dir</name>
<value>/data/enron</value>
</property>
<property>
<name>fuzzyjoin.data.record.data</name>
<value>8</value>
</property>
<property>
<name>fuzzyjoin.data.raw</name>
<value>enron.txt</value>
<description>Only used for RecordBuild. Not needed if there is
only one file in the "raw" directory.</description>
</property>
<property>
<name>fuzzyjoin.data.norecords</name>
<value>500000</value>
<description>Only used for RecordBuild and RecordGenerate.
</description>
</property>
<property>
<name>fuzzyjoin.data.copy</name>
<value>1</value>
</property>
<property>
<name>fuzzyjoin.similarity.threshold</name>
<value>.95</value>
</property>
<property>
<name>fuzzyjoin.tokens.package</name>
<value>array</value>
</property>
<property>
<name>fuzzyjoin.tokens.lengthstats</name>
<value>true</value>
</property>
<property>
<name>fuzzyjoin.data.dir.output.suffix</name>
<value></value>
</property>
<!--
================================================================
Hadoop
================================================================
-->
<!--
<property>
<name>mapred.min.split.size</name>
<value>9223372036854775807</value>
<description>Set to Long.MAX_VALUE to have only one map.
</description>
</property>
-->
<property>
<name>mapred.child.java.opts</name>
<value>-Xmx2g</value>
</property>
<property>
<name>mapred.map.tasks</name>
<value>100</value>
</property>
<property>
<name>mapred.reduce.tasks</name>
<value>100</value>
</property>
<property>
<name>mapred.task.timeout</name>
<value>6000000</value>
</property>
</configuration>
| {
"content_hash": "b17770488ce03520727fd95e6483a836",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 66,
"avg_line_length": 23.819444444444443,
"alnum_prop": 0.6309037900874636,
"repo_name": "TonyApuzzo/fuzzyjoin",
"id": "616a6384bd2a70ea950a5cc412613cf57ad8e179",
"size": "1715",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "fuzzyjoin-hadoop/src/main/resources/fuzzyjoin/enron.batch.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "6230"
},
{
"name": "Java",
"bytes": "462352"
},
{
"name": "Python",
"bytes": "55247"
},
{
"name": "Shell",
"bytes": "65771"
},
{
"name": "XSLT",
"bytes": "1070"
}
],
"symlink_target": ""
} |
/* */
"format cjs";
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.0-master-0d7fbad
*/
goog.provide('ngmaterial.components.autocomplete');
goog.require('ngmaterial.components.icon');
goog.require('ngmaterial.components.virtualRepeat');
goog.require('ngmaterial.core');
/**
* @ngdoc module
* @name material.components.autocomplete
*/
/*
* @see js folder for autocomplete implementation
*/
angular.module('material.components.autocomplete', [
'material.core',
'material.components.icon',
'material.components.virtualRepeat'
]);
angular
.module('material.components.autocomplete')
.controller('MdAutocompleteCtrl', MdAutocompleteCtrl);
var ITEM_HEIGHT = 41,
MAX_HEIGHT = 5.5 * ITEM_HEIGHT,
MENU_PADDING = 8,
INPUT_PADDING = 2; // Padding provided by `md-input-container`
function MdAutocompleteCtrl ($scope, $element, $mdUtil, $mdConstant, $mdTheming, $window,
$animate, $rootElement, $attrs, $q, $log) {
// Internal Variables.
var ctrl = this,
itemParts = $scope.itemsExpr.split(/ in /i),
itemExpr = itemParts[ 1 ],
elements = null,
cache = {},
noBlur = false,
selectedItemWatchers = [],
hasFocus = false,
lastCount = 0,
fetchesInProgress = 0,
enableWrapScroll = null,
inputModelCtrl = null;
// Public Exported Variables with handlers
defineProperty('hidden', handleHiddenChange, true);
// Public Exported Variables
ctrl.scope = $scope;
ctrl.parent = $scope.$parent;
ctrl.itemName = itemParts[ 0 ];
ctrl.matches = [];
ctrl.loading = false;
ctrl.hidden = true;
ctrl.index = null;
ctrl.messages = [];
ctrl.id = $mdUtil.nextUid();
ctrl.isDisabled = null;
ctrl.isRequired = null;
ctrl.isReadonly = null;
ctrl.hasNotFound = false;
// Public Exported Methods
ctrl.keydown = keydown;
ctrl.blur = blur;
ctrl.focus = focus;
ctrl.clear = clearValue;
ctrl.select = select;
ctrl.listEnter = onListEnter;
ctrl.listLeave = onListLeave;
ctrl.mouseUp = onMouseup;
ctrl.getCurrentDisplayValue = getCurrentDisplayValue;
ctrl.registerSelectedItemWatcher = registerSelectedItemWatcher;
ctrl.unregisterSelectedItemWatcher = unregisterSelectedItemWatcher;
ctrl.notFoundVisible = notFoundVisible;
ctrl.loadingIsVisible = loadingIsVisible;
ctrl.positionDropdown = positionDropdown;
return init();
//-- initialization methods
/**
* Initialize the controller, setup watchers, gather elements
*/
function init () {
$mdUtil.initOptionalProperties($scope, $attrs, { searchText: '', selectedItem: null });
$mdTheming($element);
configureWatchers();
$mdUtil.nextTick(function () {
gatherElements();
moveDropdown();
focusElement();
$element.on('focus', focusElement);
});
}
function updateModelValidators() {
if (!$scope.requireMatch || !inputModelCtrl) return;
inputModelCtrl.$setValidity('md-require-match', !!$scope.selectedItem);
}
/**
* Calculates the dropdown's position and applies the new styles to the menu element
* @returns {*}
*/
function positionDropdown () {
if (!elements) return $mdUtil.nextTick(positionDropdown, false, $scope);
var hrect = elements.wrap.getBoundingClientRect(),
vrect = elements.snap.getBoundingClientRect(),
root = elements.root.getBoundingClientRect(),
top = vrect.bottom - root.top,
bot = root.bottom - vrect.top,
left = hrect.left - root.left,
width = hrect.width,
offset = getVerticalOffset(),
styles;
// Adjust the width to account for the padding provided by `md-input-container`
if ($attrs.mdFloatingLabel) {
left += INPUT_PADDING;
width -= INPUT_PADDING * 2;
}
styles = {
left: left + 'px',
minWidth: width + 'px',
maxWidth: Math.max(hrect.right - root.left, root.right - hrect.left) - MENU_PADDING + 'px'
};
if (top > bot && root.height - hrect.bottom - MENU_PADDING < MAX_HEIGHT) {
styles.top = 'auto';
styles.bottom = bot + 'px';
styles.maxHeight = Math.min(MAX_HEIGHT, hrect.top - root.top - MENU_PADDING) + 'px';
} else {
styles.top = (top - offset) + 'px';
styles.bottom = 'auto';
styles.maxHeight = Math.min(MAX_HEIGHT, root.bottom + $mdUtil.scrollTop() - hrect.bottom - MENU_PADDING) + 'px';
}
elements.$.scrollContainer.css(styles);
$mdUtil.nextTick(correctHorizontalAlignment, false);
/**
* Calculates the vertical offset for floating label examples to account for ngMessages
* @returns {number}
*/
function getVerticalOffset () {
var offset = 0;
var inputContainer = $element.find('md-input-container');
if (inputContainer.length) {
var input = inputContainer.find('input');
offset = inputContainer.prop('offsetHeight');
offset -= input.prop('offsetTop');
offset -= input.prop('offsetHeight');
// add in the height left up top for the floating label text
offset += inputContainer.prop('offsetTop');
}
return offset;
}
/**
* Makes sure that the menu doesn't go off of the screen on either side.
*/
function correctHorizontalAlignment () {
var dropdown = elements.scrollContainer.getBoundingClientRect(),
styles = {};
if (dropdown.right > root.right - MENU_PADDING) {
styles.left = (hrect.right - dropdown.width) + 'px';
}
elements.$.scrollContainer.css(styles);
}
}
/**
* Moves the dropdown menu to the body tag in order to avoid z-index and overflow issues.
*/
function moveDropdown () {
if (!elements.$.root.length) return;
$mdTheming(elements.$.scrollContainer);
elements.$.scrollContainer.detach();
elements.$.root.append(elements.$.scrollContainer);
if ($animate.pin) $animate.pin(elements.$.scrollContainer, $rootElement);
}
/**
* Sends focus to the input element.
*/
function focusElement () {
if ($scope.autofocus) elements.input.focus();
}
/**
* Sets up any watchers used by autocomplete
*/
function configureWatchers () {
var wait = parseInt($scope.delay, 10) || 0;
$attrs.$observe('disabled', function (value) { ctrl.isDisabled = $mdUtil.parseAttributeBoolean(value, false); });
$attrs.$observe('required', function (value) { ctrl.isRequired = $mdUtil.parseAttributeBoolean(value, false); });
$attrs.$observe('readonly', function (value) { ctrl.isReadonly = $mdUtil.parseAttributeBoolean(value, false); });
$scope.$watch('searchText', wait ? $mdUtil.debounce(handleSearchText, wait) : handleSearchText);
$scope.$watch('selectedItem', selectedItemChange);
angular.element($window).on('resize', positionDropdown);
$scope.$on('$destroy', cleanup);
}
/**
* Removes any events or leftover elements created by this controller
*/
function cleanup () {
if (!ctrl.hidden) {
$mdUtil.enableScrolling();
}
angular.element($window).off('resize', positionDropdown);
if ( elements ){
var items = ['ul', 'scroller', 'scrollContainer', 'input'];
angular.forEach(items, function(key){
elements.$[key].remove();
});
}
}
/**
* Gathers all of the elements needed for this controller
*/
function gatherElements () {
elements = {
main: $element[0],
scrollContainer: $element[0].querySelector('.md-virtual-repeat-container'),
scroller: $element[0].querySelector('.md-virtual-repeat-scroller'),
ul: $element.find('ul')[0],
input: $element.find('input')[0],
wrap: $element.find('md-autocomplete-wrap')[0],
root: document.body
};
elements.li = elements.ul.getElementsByTagName('li');
elements.snap = getSnapTarget();
elements.$ = getAngularElements(elements);
inputModelCtrl = elements.$.input.controller('ngModel');
}
/**
* Finds the element that the menu will base its position on
* @returns {*}
*/
function getSnapTarget () {
for (var element = $element; element.length; element = element.parent()) {
if (angular.isDefined(element.attr('md-autocomplete-snap'))) return element[ 0 ];
}
return elements.wrap;
}
/**
* Gathers angular-wrapped versions of each element
* @param elements
* @returns {{}}
*/
function getAngularElements (elements) {
var obj = {};
for (var key in elements) {
if (elements.hasOwnProperty(key)) obj[ key ] = angular.element(elements[ key ]);
}
return obj;
}
//-- event/change handlers
/**
* Handles changes to the `hidden` property.
* @param hidden
* @param oldHidden
*/
function handleHiddenChange (hidden, oldHidden) {
if (!hidden && oldHidden) {
positionDropdown();
if (elements) {
$mdUtil.nextTick(function () {
$mdUtil.disableScrollAround(elements.ul);
enableWrapScroll = disableElementScrollEvents(angular.element(elements.wrap));
}, false, $scope);
}
} else if (hidden && !oldHidden) {
$mdUtil.nextTick(function () {
$mdUtil.enableScrolling();
if (enableWrapScroll) {
enableWrapScroll();
enableWrapScroll = null;
}
}, false, $scope);
}
}
/**
* Disables scrolling for a specific element
*/
function disableElementScrollEvents(element) {
function preventDefault(e) {
e.preventDefault();
}
element.on('wheel', preventDefault);
element.on('touchmove', preventDefault);
return function() {
element.off('wheel', preventDefault);
element.off('touchmove', preventDefault);
};
}
/**
* When the user mouses over the dropdown menu, ignore blur events.
*/
function onListEnter () {
noBlur = true;
}
/**
* When the user's mouse leaves the menu, blur events may hide the menu again.
*/
function onListLeave () {
if (!hasFocus && !ctrl.hidden) elements.input.focus();
noBlur = false;
ctrl.hidden = shouldHide();
}
/**
* When the mouse button is released, send focus back to the input field.
*/
function onMouseup () {
elements.input.focus();
}
/**
* Handles changes to the selected item.
* @param selectedItem
* @param previousSelectedItem
*/
function selectedItemChange (selectedItem, previousSelectedItem) {
updateModelValidators();
if (selectedItem) {
getDisplayValue(selectedItem).then(function (val) {
$scope.searchText = val;
handleSelectedItemChange(selectedItem, previousSelectedItem);
});
} else if (previousSelectedItem && $scope.searchText) {
getDisplayValue(previousSelectedItem).then(function(displayValue) {
// Clear the searchText, when the selectedItem is set to null.
// Do not clear the searchText, when the searchText isn't matching with the previous
// selected item.
if (displayValue.toString().toLowerCase() === $scope.searchText.toLowerCase()) {
$scope.searchText = '';
}
});
}
if (selectedItem !== previousSelectedItem) announceItemChange();
}
/**
* Use the user-defined expression to announce changes each time a new item is selected
*/
function announceItemChange () {
angular.isFunction($scope.itemChange) && $scope.itemChange(getItemAsNameVal($scope.selectedItem));
}
/**
* Use the user-defined expression to announce changes each time the search text is changed
*/
function announceTextChange () {
angular.isFunction($scope.textChange) && $scope.textChange();
}
/**
* Calls any external watchers listening for the selected item. Used in conjunction with
* `registerSelectedItemWatcher`.
* @param selectedItem
* @param previousSelectedItem
*/
function handleSelectedItemChange (selectedItem, previousSelectedItem) {
selectedItemWatchers.forEach(function (watcher) { watcher(selectedItem, previousSelectedItem); });
}
/**
* Register a function to be called when the selected item changes.
* @param cb
*/
function registerSelectedItemWatcher (cb) {
if (selectedItemWatchers.indexOf(cb) == -1) {
selectedItemWatchers.push(cb);
}
}
/**
* Unregister a function previously registered for selected item changes.
* @param cb
*/
function unregisterSelectedItemWatcher (cb) {
var i = selectedItemWatchers.indexOf(cb);
if (i != -1) {
selectedItemWatchers.splice(i, 1);
}
}
/**
* Handles changes to the searchText property.
* @param searchText
* @param previousSearchText
*/
function handleSearchText (searchText, previousSearchText) {
ctrl.index = getDefaultIndex();
// do nothing on init
if (searchText === previousSearchText) return;
updateModelValidators();
getDisplayValue($scope.selectedItem).then(function (val) {
// clear selected item if search text no longer matches it
if (searchText !== val) {
$scope.selectedItem = null;
// trigger change event if available
if (searchText !== previousSearchText) announceTextChange();
// cancel results if search text is not long enough
if (!isMinLengthMet()) {
ctrl.matches = [];
setLoading(false);
updateMessages();
} else {
handleQuery();
}
}
});
}
/**
* Handles input blur event, determines if the dropdown should hide.
*/
function blur($event) {
hasFocus = false;
if (!noBlur) {
ctrl.hidden = shouldHide();
evalAttr('ngBlur', { $event: $event });
}
}
/**
* Force blur on input element
* @param forceBlur
*/
function doBlur(forceBlur) {
if (forceBlur) {
noBlur = false;
hasFocus = false;
}
elements.input.blur();
}
/**
* Handles input focus event, determines if the dropdown should show.
*/
function focus($event) {
hasFocus = true;
// When the searchText is not a string, force it to be an empty string.
if (!angular.isString($scope.searchText)) {
$scope.searchText = '';
}
ctrl.hidden = shouldHide();
if (!ctrl.hidden) {
handleQuery();
}
evalAttr('ngFocus', { $event: $event });
}
/**
* Handles keyboard input.
* @param event
*/
function keydown (event) {
switch (event.keyCode) {
case $mdConstant.KEY_CODE.DOWN_ARROW:
if (ctrl.loading) return;
event.stopPropagation();
event.preventDefault();
ctrl.index = Math.min(ctrl.index + 1, ctrl.matches.length - 1);
updateScroll();
updateMessages();
break;
case $mdConstant.KEY_CODE.UP_ARROW:
if (ctrl.loading) return;
event.stopPropagation();
event.preventDefault();
ctrl.index = ctrl.index < 0 ? ctrl.matches.length - 1 : Math.max(0, ctrl.index - 1);
updateScroll();
updateMessages();
break;
case $mdConstant.KEY_CODE.TAB:
// If we hit tab, assume that we've left the list so it will close
onListLeave();
if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;
select(ctrl.index);
break;
case $mdConstant.KEY_CODE.ENTER:
if (ctrl.hidden || ctrl.loading || ctrl.index < 0 || ctrl.matches.length < 1) return;
if (hasSelection()) return;
event.stopPropagation();
event.preventDefault();
select(ctrl.index);
break;
case $mdConstant.KEY_CODE.ESCAPE:
event.preventDefault(); // Prevent browser from always clearing input
if (!shouldProcessEscape()) return;
event.stopPropagation();
clearSelectedItem();
if ($scope.searchText && hasEscapeOption('clear')) {
clearSearchText();
}
// Manually hide (needed for mdNotFound support)
ctrl.hidden = true;
if (hasEscapeOption('blur')) {
// Force the component to blur if they hit escape
doBlur(true);
}
break;
default:
}
}
//-- getters
/**
* Returns the minimum length needed to display the dropdown.
* @returns {*}
*/
function getMinLength () {
return angular.isNumber($scope.minLength) ? $scope.minLength : 1;
}
/**
* Returns the display value for an item.
* @param item
* @returns {*}
*/
function getDisplayValue (item) {
return $q.when(getItemText(item) || item).then(function(itemText) {
if (itemText && !angular.isString(itemText)) {
$log.warn('md-autocomplete: Could not resolve display value to a string. ' +
'Please check the `md-item-text` attribute.');
}
return itemText;
});
/**
* Getter function to invoke user-defined expression (in the directive)
* to convert your object to a single string.
*/
function getItemText (item) {
return (item && $scope.itemText) ? $scope.itemText(getItemAsNameVal(item)) : null;
}
}
/**
* Returns the locals object for compiling item templates.
* @param item
* @returns {{}}
*/
function getItemAsNameVal (item) {
if (!item) return undefined;
var locals = {};
if (ctrl.itemName) locals[ ctrl.itemName ] = item;
return locals;
}
/**
* Returns the default index based on whether or not autoselect is enabled.
* @returns {number}
*/
function getDefaultIndex () {
return $scope.autoselect ? 0 : -1;
}
/**
* Sets the loading parameter and updates the hidden state.
* @param value {boolean} Whether or not the component is currently loading.
*/
function setLoading(value) {
if (ctrl.loading != value) {
ctrl.loading = value;
}
// Always refresh the hidden variable as something else might have changed
ctrl.hidden = shouldHide();
}
/**
* Determines if the menu should be hidden.
* @returns {boolean}
*/
function shouldHide () {
if (ctrl.loading && !hasMatches()) return true; // Hide while loading initial matches
else if (hasSelection()) return true; // Hide if there is already a selection
else if (!hasFocus) return true; // Hide if the input does not have focus
else return !shouldShow(); // Defer to standard show logic
}
/**
* Determines if the escape keydown should be processed
* @returns {boolean}
*/
function shouldProcessEscape() {
return hasEscapeOption('blur') || !ctrl.hidden || ctrl.loading || hasEscapeOption('clear') && $scope.searchText;
}
/**
* Determines if an escape option is set
* @returns {boolean}
*/
function hasEscapeOption(option) {
return !$scope.escapeOptions || $scope.escapeOptions.toLowerCase().indexOf(option) !== -1;
}
/**
* Determines if the menu should be shown.
* @returns {boolean}
*/
function shouldShow() {
return (isMinLengthMet() && hasMatches()) || notFoundVisible();
}
/**
* Returns true if the search text has matches.
* @returns {boolean}
*/
function hasMatches() {
return ctrl.matches.length ? true : false;
}
/**
* Returns true if the autocomplete has a valid selection.
* @returns {boolean}
*/
function hasSelection() {
return ctrl.scope.selectedItem ? true : false;
}
/**
* Returns true if the loading indicator is, or should be, visible.
* @returns {boolean}
*/
function loadingIsVisible() {
return ctrl.loading && !hasSelection();
}
/**
* Returns the display value of the current item.
* @returns {*}
*/
function getCurrentDisplayValue () {
return getDisplayValue(ctrl.matches[ ctrl.index ]);
}
/**
* Determines if the minimum length is met by the search text.
* @returns {*}
*/
function isMinLengthMet () {
return ($scope.searchText || '').length >= getMinLength();
}
//-- actions
/**
* Defines a public property with a handler and a default value.
* @param key
* @param handler
* @param value
*/
function defineProperty (key, handler, value) {
Object.defineProperty(ctrl, key, {
get: function () { return value; },
set: function (newValue) {
var oldValue = value;
value = newValue;
handler(newValue, oldValue);
}
});
}
/**
* Selects the item at the given index.
* @param index
*/
function select (index) {
//-- force form to update state for validation
$mdUtil.nextTick(function () {
getDisplayValue(ctrl.matches[ index ]).then(function (val) {
var ngModel = elements.$.input.controller('ngModel');
ngModel.$setViewValue(val);
ngModel.$render();
}).finally(function () {
$scope.selectedItem = ctrl.matches[ index ];
setLoading(false);
});
}, false);
}
/**
* Clears the searchText value and selected item.
*/
function clearValue () {
clearSelectedItem();
clearSearchText();
}
/**
* Clears the selected item
*/
function clearSelectedItem () {
// Reset our variables
ctrl.index = 0;
ctrl.matches = [];
}
/**
* Clears the searchText value
*/
function clearSearchText () {
// Set the loading to true so we don't see flashes of content.
// The flashing will only occur when an async request is running.
// So the loading process will stop when the results had been retrieved.
setLoading(true);
$scope.searchText = '';
// Normally, triggering the change / input event is unnecessary, because the browser detects it properly.
// But some browsers are not detecting it properly, which means that we have to trigger the event.
// Using the `input` is not working properly, because for example IE11 is not supporting the `input` event.
// The `change` event is a good alternative and is supported by all supported browsers.
var eventObj = document.createEvent('CustomEvent');
eventObj.initCustomEvent('change', true, true, { value: '' });
elements.input.dispatchEvent(eventObj);
// For some reason, firing the above event resets the value of $scope.searchText if
// $scope.searchText has a space character at the end, so we blank it one more time and then
// focus.
elements.input.blur();
$scope.searchText = '';
elements.input.focus();
}
/**
* Fetches the results for the provided search text.
* @param searchText
*/
function fetchResults (searchText) {
var items = $scope.$parent.$eval(itemExpr),
term = searchText.toLowerCase(),
isList = angular.isArray(items),
isPromise = !!items.then; // Every promise should contain a `then` property
if (isList) onResultsRetrieved(items);
else if (isPromise) handleAsyncResults(items);
function handleAsyncResults(items) {
if ( !items ) return;
items = $q.when(items);
fetchesInProgress++;
setLoading(true);
$mdUtil.nextTick(function () {
items
.then(onResultsRetrieved)
.finally(function(){
if (--fetchesInProgress === 0) {
setLoading(false);
}
});
},true, $scope);
}
function onResultsRetrieved(matches) {
cache[term] = matches;
// Just cache the results if the request is now outdated.
// The request becomes outdated, when the new searchText has changed during the result fetching.
if ((searchText || '') !== ($scope.searchText || '')) {
return;
}
handleResults(matches);
}
}
/**
* Updates the ARIA messages
*/
function updateMessages () {
getCurrentDisplayValue().then(function (msg) {
ctrl.messages = [ getCountMessage(), msg ];
});
}
/**
* Returns the ARIA message for how many results match the current query.
* @returns {*}
*/
function getCountMessage () {
if (lastCount === ctrl.matches.length) return '';
lastCount = ctrl.matches.length;
switch (ctrl.matches.length) {
case 0:
return 'There are no matches available.';
case 1:
return 'There is 1 match available.';
default:
return 'There are ' + ctrl.matches.length + ' matches available.';
}
}
/**
* Makes sure that the focused element is within view.
*/
function updateScroll () {
if (!elements.li[0]) return;
var height = elements.li[0].offsetHeight,
top = height * ctrl.index,
bot = top + height,
hgt = elements.scroller.clientHeight,
scrollTop = elements.scroller.scrollTop;
if (top < scrollTop) {
scrollTo(top);
} else if (bot > scrollTop + hgt) {
scrollTo(bot - hgt);
}
}
function isPromiseFetching() {
return fetchesInProgress !== 0;
}
function scrollTo (offset) {
elements.$.scrollContainer.controller('mdVirtualRepeatContainer').scrollTo(offset);
}
function notFoundVisible () {
var textLength = (ctrl.scope.searchText || '').length;
return ctrl.hasNotFound && !hasMatches() && (!ctrl.loading || isPromiseFetching()) && textLength >= getMinLength() && (hasFocus || noBlur) && !hasSelection();
}
/**
* Starts the query to gather the results for the current searchText. Attempts to return cached
* results first, then forwards the process to `fetchResults` if necessary.
*/
function handleQuery () {
var searchText = $scope.searchText || '';
var term = searchText.toLowerCase();
// If caching is enabled and the current searchText is stored in the cache
if (!$scope.noCache && cache[term]) {
// The results should be handled as same as a normal un-cached request does.
handleResults(cache[term]);
} else {
fetchResults(searchText);
}
ctrl.hidden = shouldHide();
}
/**
* Handles the retrieved results by showing them in the autocompletes dropdown.
* @param results Retrieved results
*/
function handleResults(results) {
ctrl.matches = results;
ctrl.hidden = shouldHide();
// If loading is in progress, then we'll end the progress. This is needed for example,
// when the `clear` button was clicked, because there we always show the loading process, to prevent flashing.
if (ctrl.loading) setLoading(false);
if ($scope.selectOnMatch) selectItemOnMatch();
updateMessages();
positionDropdown();
}
/**
* If there is only one matching item and the search text matches its display value exactly,
* automatically select that item. Note: This function is only called if the user uses the
* `md-select-on-match` flag.
*/
function selectItemOnMatch () {
var searchText = $scope.searchText,
matches = ctrl.matches,
item = matches[ 0 ];
if (matches.length === 1) getDisplayValue(item).then(function (displayValue) {
var isMatching = searchText == displayValue;
if ($scope.matchInsensitive && !isMatching) {
isMatching = searchText.toLowerCase() == displayValue.toLowerCase();
}
if (isMatching) select(0);
});
}
/**
* Evaluates an attribute expression against the parent scope.
* @param {String} attr Name of the attribute to be evaluated.
* @param {Object?} locals Properties to be injected into the evaluation context.
*/
function evalAttr(attr, locals) {
if ($attrs[attr]) {
$scope.$parent.$eval($attrs[attr], locals || {});
}
}
}
MdAutocompleteCtrl.$inject = ["$scope", "$element", "$mdUtil", "$mdConstant", "$mdTheming", "$window", "$animate", "$rootElement", "$attrs", "$q", "$log"];
angular
.module('material.components.autocomplete')
.directive('mdAutocomplete', MdAutocomplete);
/**
* @ngdoc directive
* @name mdAutocomplete
* @module material.components.autocomplete
*
* @description
* `<md-autocomplete>` is a special input component with a drop-down of all possible matches to a
* custom query. This component allows you to provide real-time suggestions as the user types
* in the input area.
*
* To start, you will need to specify the required parameters and provide a template for your
* results. The content inside `md-autocomplete` will be treated as a template.
*
* In more complex cases, you may want to include other content such as a message to display when
* no matches were found. You can do this by wrapping your template in `md-item-template` and
* adding a tag for `md-not-found`. An example of this is shown below.
*
* To reset the displayed value you must clear both values for `md-search-text` and `md-selected-item`.
*
* ### Validation
*
* You can use `ng-messages` to include validation the same way that you would normally validate;
* however, if you want to replicate a standard input with a floating label, you will have to
* do the following:
*
* - Make sure that your template is wrapped in `md-item-template`
* - Add your `ng-messages` code inside of `md-autocomplete`
* - Add your validation properties to `md-autocomplete` (ie. `required`)
* - Add a `name` to `md-autocomplete` (to be used on the generated `input`)
*
* There is an example below of how this should look.
*
* ### Notes
* The `md-autocomplete` uses the the <a ng-href="api/directive/mdVirtualRepeatContainer">VirtualRepeat</a>
* directive for displaying the results inside of the dropdown.<br/>
* > When encountering issues regarding the item template please take a look at the
* <a ng-href="api/directive/mdVirtualRepeatContainer">VirtualRepeatContainer</a> documentation.
*
*
* @param {expression} md-items An expression in the format of `item in items` to iterate over
* matches for your search.
* @param {expression=} md-selected-item-change An expression to be run each time a new item is
* selected
* @param {expression=} md-search-text-change An expression to be run each time the search text
* updates
* @param {expression=} md-search-text A model to bind the search query text to
* @param {object=} md-selected-item A model to bind the selected item to
* @param {expression=} md-item-text An expression that will convert your object to a single string.
* @param {string=} placeholder Placeholder text that will be forwarded to the input.
* @param {boolean=} md-no-cache Disables the internal caching that happens in autocomplete
* @param {boolean=} ng-disabled Determines whether or not to disable the input field
* @param {boolean=} md-require-match When set to true, the autocomplete will add a validator,
* which will evaluate to false, when no item is currently selected.
* @param {number=} md-min-length Specifies the minimum length of text before autocomplete will
* make suggestions
* @param {number=} md-delay Specifies the amount of time (in milliseconds) to wait before looking
* for results
* @param {boolean=} md-autofocus If true, the autocomplete will be automatically focused when a `$mdDialog`,
* `$mdBottomsheet` or `$mdSidenav`, which contains the autocomplete, is opening. <br/><br/>
* Also the autocomplete will immediately focus the input element.
* @param {boolean=} md-no-asterisk When present, asterisk will not be appended to the floating label
* @param {boolean=} md-autoselect If set to true, the first item will be automatically selected
* in the dropdown upon open.
* @param {string=} md-menu-class This will be applied to the dropdown menu for styling
* @param {string=} md-floating-label This will add a floating label to autocomplete and wrap it in
* `md-input-container`
* @param {string=} md-input-name The name attribute given to the input element to be used with
* FormController
* @param {string=} md-select-on-focus When present the inputs text will be automatically selected
* on focus.
* @param {string=} md-input-id An ID to be added to the input element
* @param {number=} md-input-minlength The minimum length for the input's value for validation
* @param {number=} md-input-maxlength The maximum length for the input's value for validation
* @param {boolean=} md-select-on-match When set, autocomplete will automatically select exact
* the item if the search text is an exact match. <br/><br/>
* Exact match means that there is only one match showing up.
* @param {boolean=} md-match-case-insensitive When set and using `md-select-on-match`, autocomplete
* will select on case-insensitive match
* @param {string=} md-escape-options Override escape key logic. Default is `blur clear`.<br/>
* Options: `blur | clear`, `none`
*
* @usage
* ### Basic Example
* <hljs lang="html">
* <md-autocomplete
* md-selected-item="selectedItem"
* md-search-text="searchText"
* md-items="item in getMatches(searchText)"
* md-item-text="item.display">
* <span md-highlight-text="searchText">{{item.display}}</span>
* </md-autocomplete>
* </hljs>
*
* ### Example with "not found" message
* <hljs lang="html">
* <md-autocomplete
* md-selected-item="selectedItem"
* md-search-text="searchText"
* md-items="item in getMatches(searchText)"
* md-item-text="item.display">
* <md-item-template>
* <span md-highlight-text="searchText">{{item.display}}</span>
* </md-item-template>
* <md-not-found>
* No matches found.
* </md-not-found>
* </md-autocomplete>
* </hljs>
*
* In this example, our code utilizes `md-item-template` and `md-not-found` to specify the
* different parts that make up our component.
*
* ### Example with validation
* <hljs lang="html">
* <form name="autocompleteForm">
* <md-autocomplete
* required
* md-input-name="autocomplete"
* md-selected-item="selectedItem"
* md-search-text="searchText"
* md-items="item in getMatches(searchText)"
* md-item-text="item.display">
* <md-item-template>
* <span md-highlight-text="searchText">{{item.display}}</span>
* </md-item-template>
* <div ng-messages="autocompleteForm.autocomplete.$error">
* <div ng-message="required">This field is required</div>
* </div>
* </md-autocomplete>
* </form>
* </hljs>
*
* In this example, our code utilizes `md-item-template` and `ng-messages` to specify
* input validation for the field.
*/
function MdAutocomplete ($$mdSvgRegistry) {
return {
controller: 'MdAutocompleteCtrl',
controllerAs: '$mdAutocompleteCtrl',
scope: {
inputName: '@mdInputName',
inputMinlength: '@mdInputMinlength',
inputMaxlength: '@mdInputMaxlength',
searchText: '=?mdSearchText',
selectedItem: '=?mdSelectedItem',
itemsExpr: '@mdItems',
itemText: '&mdItemText',
placeholder: '@placeholder',
noCache: '=?mdNoCache',
requireMatch: '=?mdRequireMatch',
selectOnMatch: '=?mdSelectOnMatch',
matchInsensitive: '=?mdMatchCaseInsensitive',
itemChange: '&?mdSelectedItemChange',
textChange: '&?mdSearchTextChange',
minLength: '=?mdMinLength',
delay: '=?mdDelay',
autofocus: '=?mdAutofocus',
floatingLabel: '@?mdFloatingLabel',
autoselect: '=?mdAutoselect',
menuClass: '@?mdMenuClass',
inputId: '@?mdInputId',
escapeOptions: '@?mdEscapeOptions'
},
link: function(scope, element, attrs, controller) {
// Retrieve the state of using a md-not-found template by using our attribute, which will
// be added to the element in the template function.
controller.hasNotFound = !!element.attr('md-has-not-found');
},
template: function (element, attr) {
var noItemsTemplate = getNoItemsTemplate(),
itemTemplate = getItemTemplate(),
leftover = element.html(),
tabindex = attr.tabindex;
// Set our attribute for the link function above which runs later.
// We will set an attribute, because otherwise the stored variables will be trashed when
// removing the element is hidden while retrieving the template. For example when using ngIf.
if (noItemsTemplate) element.attr('md-has-not-found', true);
// Always set our tabindex of the autocomplete directive to -1, because our input
// will hold the actual tabindex.
element.attr('tabindex', '-1');
return '\
<md-autocomplete-wrap\
ng-class="{ \'md-whiteframe-z1\': !floatingLabel, \'md-menu-showing\': !$mdAutocompleteCtrl.hidden }">\
' + getInputElement() + '\
<md-progress-linear\
class="' + (attr.mdFloatingLabel ? 'md-inline' : '') + '"\
ng-if="$mdAutocompleteCtrl.loadingIsVisible()"\
md-mode="indeterminate"></md-progress-linear>\
<md-virtual-repeat-container\
md-auto-shrink\
md-auto-shrink-min="1"\
ng-mouseenter="$mdAutocompleteCtrl.listEnter()"\
ng-mouseleave="$mdAutocompleteCtrl.listLeave()"\
ng-mouseup="$mdAutocompleteCtrl.mouseUp()"\
ng-hide="$mdAutocompleteCtrl.hidden"\
class="md-autocomplete-suggestions-container md-whiteframe-z1"\
ng-class="{ \'md-not-found\': $mdAutocompleteCtrl.notFoundVisible() }"\
role="presentation">\
<ul class="md-autocomplete-suggestions"\
ng-class="::menuClass"\
id="ul-{{$mdAutocompleteCtrl.id}}">\
<li md-virtual-repeat="item in $mdAutocompleteCtrl.matches"\
ng-class="{ selected: $index === $mdAutocompleteCtrl.index }"\
ng-click="$mdAutocompleteCtrl.select($index)"\
md-extra-name="$mdAutocompleteCtrl.itemName">\
' + itemTemplate + '\
</li>' + noItemsTemplate + '\
</ul>\
</md-virtual-repeat-container>\
</md-autocomplete-wrap>\
<aria-status\
class="md-visually-hidden"\
role="status"\
aria-live="assertive">\
<p ng-repeat="message in $mdAutocompleteCtrl.messages track by $index" ng-if="message">{{message}}</p>\
</aria-status>';
function getItemTemplate() {
var templateTag = element.find('md-item-template').detach(),
html = templateTag.length ? templateTag.html() : element.html();
if (!templateTag.length) element.empty();
return '<md-autocomplete-parent-scope md-autocomplete-replace>' + html + '</md-autocomplete-parent-scope>';
}
function getNoItemsTemplate() {
var templateTag = element.find('md-not-found').detach(),
template = templateTag.length ? templateTag.html() : '';
return template
? '<li ng-if="$mdAutocompleteCtrl.notFoundVisible()"\
md-autocomplete-parent-scope>' + template + '</li>'
: '';
}
function getInputElement () {
if (attr.mdFloatingLabel) {
return '\
<md-input-container ng-if="floatingLabel">\
<label>{{floatingLabel}}</label>\
<input type="search"\
' + (tabindex != null ? 'tabindex="' + tabindex + '"' : '') + '\
id="{{ inputId || \'fl-input-\' + $mdAutocompleteCtrl.id }}"\
name="{{inputName}}"\
autocomplete="off"\
ng-required="$mdAutocompleteCtrl.isRequired"\
ng-readonly="$mdAutocompleteCtrl.isReadonly"\
ng-minlength="inputMinlength"\
ng-maxlength="inputMaxlength"\
ng-disabled="$mdAutocompleteCtrl.isDisabled"\
ng-model="$mdAutocompleteCtrl.scope.searchText"\
ng-model-options="{ allowInvalid: true }"\
ng-keydown="$mdAutocompleteCtrl.keydown($event)"\
ng-blur="$mdAutocompleteCtrl.blur($event)"\
ng-focus="$mdAutocompleteCtrl.focus($event)"\
aria-owns="ul-{{$mdAutocompleteCtrl.id}}"\
' + (attr.mdNoAsterisk != null ? 'md-no-asterisk="' + attr.mdNoAsterisk + '"' : '') + '\
' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=""' : '') + '\
aria-label="{{floatingLabel}}"\
aria-autocomplete="list"\
role="combobox"\
aria-haspopup="true"\
aria-activedescendant=""\
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>\
<div md-autocomplete-parent-scope md-autocomplete-replace>' + leftover + '</div>\
</md-input-container>';
} else {
return '\
<input type="search"\
' + (tabindex != null ? 'tabindex="' + tabindex + '"' : '') + '\
id="{{ inputId || \'input-\' + $mdAutocompleteCtrl.id }}"\
name="{{inputName}}"\
ng-if="!floatingLabel"\
autocomplete="off"\
ng-required="$mdAutocompleteCtrl.isRequired"\
ng-disabled="$mdAutocompleteCtrl.isDisabled"\
ng-readonly="$mdAutocompleteCtrl.isReadonly"\
ng-model="$mdAutocompleteCtrl.scope.searchText"\
ng-keydown="$mdAutocompleteCtrl.keydown($event)"\
ng-blur="$mdAutocompleteCtrl.blur($event)"\
ng-focus="$mdAutocompleteCtrl.focus($event)"\
placeholder="{{placeholder}}"\
aria-owns="ul-{{$mdAutocompleteCtrl.id}}"\
' + (attr.mdSelectOnFocus != null ? 'md-select-on-focus=""' : '') + '\
aria-label="{{placeholder}}"\
aria-autocomplete="list"\
role="combobox"\
aria-haspopup="true"\
aria-activedescendant=""\
aria-expanded="{{!$mdAutocompleteCtrl.hidden}}"/>\
<button\
type="button"\
tabindex="-1"\
ng-if="$mdAutocompleteCtrl.scope.searchText && !$mdAutocompleteCtrl.isDisabled"\
ng-click="$mdAutocompleteCtrl.clear($event)">\
<md-icon md-svg-src="' + $$mdSvgRegistry.mdClose + '"></md-icon>\
<span class="md-visually-hidden">Clear</span>\
</button>\
';
}
}
}
};
}
MdAutocomplete.$inject = ["$$mdSvgRegistry"];
angular
.module('material.components.autocomplete')
.directive('mdAutocompleteParentScope', MdAutocompleteItemScopeDirective);
function MdAutocompleteItemScopeDirective($compile, $mdUtil) {
return {
restrict: 'AE',
compile: compile,
terminal: true,
transclude: 'element'
};
function compile(tElement, tAttr, transclude) {
return function postLink(scope, element, attr) {
var ctrl = scope.$mdAutocompleteCtrl;
var newScope = ctrl.parent.$new();
var itemName = ctrl.itemName;
// Watch for changes to our scope's variables and copy them to the new scope
watchVariable('$index', '$index');
watchVariable('item', itemName);
// Ensure that $digest calls on our scope trigger $digest on newScope.
connectScopes();
// Link the element against newScope.
transclude(newScope, function(clone) {
element.after(clone);
});
/**
* Creates a watcher for variables that are copied from the parent scope
* @param variable
* @param alias
*/
function watchVariable(variable, alias) {
newScope[alias] = scope[variable];
scope.$watch(variable, function(value) {
$mdUtil.nextTick(function() {
newScope[alias] = value;
});
});
}
/**
* Creates watchers on scope and newScope that ensure that for any
* $digest of scope, newScope is also $digested.
*/
function connectScopes() {
var scopeDigesting = false;
var newScopeDigesting = false;
scope.$watch(function() {
if (newScopeDigesting || scopeDigesting) {
return;
}
scopeDigesting = true;
scope.$$postDigest(function() {
if (!newScopeDigesting) {
newScope.$digest();
}
scopeDigesting = newScopeDigesting = false;
});
});
newScope.$watch(function() {
newScopeDigesting = true;
});
}
};
}
}
MdAutocompleteItemScopeDirective.$inject = ["$compile", "$mdUtil"];
angular
.module('material.components.autocomplete')
.controller('MdHighlightCtrl', MdHighlightCtrl);
function MdHighlightCtrl ($scope, $element, $attrs) {
this.init = init;
function init (termExpr, unsafeTextExpr) {
var text = null,
regex = null,
flags = $attrs.mdHighlightFlags || '',
watcher = $scope.$watch(function($scope) {
return {
term: termExpr($scope),
unsafeText: unsafeTextExpr($scope)
};
}, function (state, prevState) {
if (text === null || state.unsafeText !== prevState.unsafeText) {
text = angular.element('<div>').text(state.unsafeText).html();
}
if (regex === null || state.term !== prevState.term) {
regex = getRegExp(state.term, flags);
}
$element.html(text.replace(regex, '<span class="highlight">$&</span>'));
}, true);
$element.on('$destroy', watcher);
}
function sanitize (term) {
return term && term.toString().replace(/[\\\^\$\*\+\?\.\(\)\|\{}\[\]]/g, '\\$&');
}
function getRegExp (text, flags) {
var startFlag = '', endFlag = '';
if (flags.indexOf('^') >= 0) startFlag = '^';
if (flags.indexOf('$') >= 0) endFlag = '$';
return new RegExp(startFlag + sanitize(text) + endFlag, flags.replace(/[\$\^]/g, ''));
}
}
MdHighlightCtrl.$inject = ["$scope", "$element", "$attrs"];
angular
.module('material.components.autocomplete')
.directive('mdHighlightText', MdHighlight);
/**
* @ngdoc directive
* @name mdHighlightText
* @module material.components.autocomplete
*
* @description
* The `md-highlight-text` directive allows you to specify text that should be highlighted within
* an element. Highlighted text will be wrapped in `<span class="highlight"></span>` which can
* be styled through CSS. Please note that child elements may not be used with this directive.
*
* @param {string} md-highlight-text A model to be searched for
* @param {string=} md-highlight-flags A list of flags (loosely based on JavaScript RexExp flags).
* #### **Supported flags**:
* - `g`: Find all matches within the provided text
* - `i`: Ignore case when searching for matches
* - `$`: Only match if the text ends with the search term
* - `^`: Only match if the text begins with the search term
*
* @usage
* <hljs lang="html">
* <input placeholder="Enter a search term..." ng-model="searchTerm" type="text" />
* <ul>
* <li ng-repeat="result in results" md-highlight-text="searchTerm">
* {{result.text}}
* </li>
* </ul>
* </hljs>
*/
function MdHighlight ($interpolate, $parse) {
return {
terminal: true,
controller: 'MdHighlightCtrl',
compile: function mdHighlightCompile(tElement, tAttr) {
var termExpr = $parse(tAttr.mdHighlightText);
var unsafeTextExpr = $interpolate(tElement.html());
return function mdHighlightLink(scope, element, attr, ctrl) {
ctrl.init(termExpr, unsafeTextExpr);
};
}
};
}
MdHighlight.$inject = ["$interpolate", "$parse"];
ngmaterial.components.autocomplete = angular.module("material.components.autocomplete"); | {
"content_hash": "4ae114db8606d9f5184b6b8e7b885001",
"timestamp": "",
"source": "github",
"line_count": 1431,
"max_line_length": 162,
"avg_line_length": 33.714884696016775,
"alnum_prop": 0.6182066907101107,
"repo_name": "israel-11/solid-fiesta",
"id": "b8c4fb798d7be127a5eed34f4878182e5c19c261",
"size": "48246",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/jspm_packages/github/angular/bower-material@master/modules/closure/autocomplete/autocomplete.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "3627812"
},
{
"name": "HTML",
"bytes": "9866"
},
{
"name": "JavaScript",
"bytes": "2104810"
}
],
"symlink_target": ""
} |
require "HDRHistogram/version"
require "ruby_hdr_histogram"
class HDRHistogram
def initialize(lowest, highest, sig, opt={})
@multiplier = opt[:multiplier] || 1
@unit = opt[:unit] || opt[:units]
if opt[:unserialized]
m=opt[:unserialized]
self.unit_magnitude= m[:unit_magnitude].to_i
self.sub_bucket_half_count_magnitude= m[:sub_bucket_half_count_magnitude].to_i
self.sub_bucket_half_count= m[:sub_bucket_half_count].to_i
self.sub_bucket_mask= m[:sub_bucket_mask].to_i
self.sub_bucket_count= m[:sub_bucket_count].to_i
self.bucket_count= m[:bucket_count].to_i
self.min_value= m[:min_value].to_i
self.max_value= m[:max_value].to_i
self.normalizing_index_offset= m[:normalizing_index_offset].to_i
self.conversion_ratio= m[:conversion_ratio].to_f
counts_len = m[:counts_len].to_i
self.counts_len= counts_len
self.total_count= m[:total_count].to_i
if !opt[:multiplier] && m[:multiplier]
@multiplier = m[:multiplier].to_f
end
if !@unit && m[:unit]
@unit = m[:unit]
end
counts = m[:counts].split " "
i=0
shorted = 0
counts.each do |count|
nf="~!@#$%^&*"
m = count.match /^([#{nf}])(\d+)$/
if m && nf.index(m[1])
shorted += 1
m[2].to_i.times do
set_raw_count(i, nf.index(m[1]))
i+=1
end
else
set_raw_count(i, count.to_i)
i+=1
end
end
if counts_len != i
raise HDRHistogramError, "invalid serialization pattern: total count doesn't match, expected: #{counts_len}, found #{i} (diff: #{counts_len - i}), counts.count: #{counts.count}, shorted: #{shorted}"
end
end
end
def record(val)
raw_record(val * 1/@multiplier)
end
def record_corrected(val, expected_interval)
raw_record_corrected(val * 1/@multiplier, expected_interval * 1/@multiplier)
end
def min
raw_min * @multiplier
end
def max
raw_max * @multiplier
end
def mean
raw_mean * @multiplier
end
def stddev
raw_stddev * @multiplier
end
def percentile(pct)
raw_percentile(pct) * @multiplier
end
def merge!(other)
if self == other
raise HDRHistogramError, "can't merge histogram with itself"
end
if other.multiplier != multiplier
raise HDRHistogramError, "can't merge histograms with different multipliers"
end
if other.unit != unit
raise HDRHistogramError, "can't merge histograms with different units"
end
raw_merge other
self
end
def to_s
stats
end
def latency_stats
str = "Latency Stats\n"
str << stats([ 50.0, 75.0, 90.0, 99.0, 99.9, 99.99, 99.999, 100.0 ])
end
def stats(percentiles = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
str = ""
pctf = @multiplier < 1 ? "%12.#{Math.log(0.001, 10).abs.ceil}f" : "%12u"
percentiles.each do |pct|
str << sprintf("%7.3f%% #{pctf}%s\n", pct, percentile(pct), unit)
end
str
end
def serialize
attrs = [lowest_trackable_value, highest_trackable_value, unit_magnitude, significant_figures, sub_bucket_half_count_magnitude, sub_bucket_half_count, sub_bucket_mask, sub_bucket_count, bucket_count, min_value, max_value, normalizing_index_offset, ("%f" % conversion_ratio), counts_len, total_count]
raw_counts = []
numrun="~!@#$%^&*"
for i in 0...counts_len do
raw_counts << get_raw_count(i)
end
counts = []
while raw_counts.length > 0 do
num = raw_counts.shift
n = 1
if num < numrun.length
while raw_counts[0] == num
raw_counts.shift
n+=1
end
if n > 1
counts << "#{numrun[num]}#{n}"
else
counts << num
end
else
counts << num
end
end
out = "#{attrs.join " "} [#{counts.join " "} ]"
if @unit || @multiplier != 1
out << " (#{unit} #{multiplier})"
end
out
end
def self.adjusted_boundary_val(val, opt={})
return opt ? val * 1/(opt[:multiplier] || 1) : val
end
private_class_method :adjusted_boundary_val
def self.unserialize(str, opt={})
regex = /^(?<lowest_trackable_value>\d+) (?<highest_trackable_value>\d+) (?<unit_magnitude>\d+) (?<significant_figures>\d+) (?<sub_bucket_half_count_magnitude>\d+) (?<sub_bucket_half_count>\d+) (?<sub_bucket_mask>\d+) (?<sub_bucket_count>\d+) (?<bucket_count>\d+) (?<min_value>-?\d+) (?<max_value>\d+) (?<normalizing_index_offset>\d+) (?<conversion_ratio>\S+) (?<counts_len>\d+) (?<total_count>\d+) \[(?<counts>([~!@#$%^&*]?\d+ )+)\]( \((?<unit>.*) (?<multiplier>\S+)\))?/
m = str.match regex
raise HDRHistogramError, "invalid serialization pattern" if m.nil?
opt[:unserialized]=m
multiplier = opt[:multiplier] || 1
low = m[:lowest_trackable_value].to_i * multiplier
high = m[:highest_trackable_value].to_i * multiplier
hdrh = self.new(low, high, m[:significant_figures].to_i, opt)
return hdrh
end
end
| {
"content_hash": "68775c7e6feb5a8ad24978419d7161c3",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 476,
"avg_line_length": 30.704819277108435,
"alnum_prop": 0.583284284873455,
"repo_name": "slact/hdr_histogram_ruby",
"id": "2a60bf2e07e04dc571ee9cfae687f77670c04cbc",
"size": "5097",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/HDRHistogram.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "54321"
},
{
"name": "Ruby",
"bytes": "23529"
},
{
"name": "Shell",
"bytes": "131"
}
],
"symlink_target": ""
} |
/*global QUnit:true, module:true, test:true, asyncTest:true, expect:true*/
/*global start:true, stop:true ok:true, equal:true, notEqual:true, deepEqual:true*/
/*global notDeepEqual:true, strictEqual:true, notStrictEqual:true, raises:true*/
(function( window ) {
// window.unprefixed = window.unprefix();
module("Unprefix", {
setup: function() {
window.unprefixed = window.unprefix();
}
});
test("is initialized", 1, function() {
var unprefixed = window.unprefix();
ok( unprefixed, "unprefix instance" );
});
test("expected properties", 1, function() {
var unprefixed = window.unprefix();
ok(
!!~unprefixed.join("").indexOf("-moz--ms--o--webkit-MSMozOWebKitWebkitmozmsowebkit"),
"Is a list of prefixes"
);
});
module("API", {
setup: function() {
window.MozFoo = {};
window.mozBar = {};
window.MSFoo = {};
window.msBar = {};
window.OFoo = {};
window.oBar = {};
window.WebKitFoo = {};
window.WebkitBar = {};
window.webkitBaz = {};
}
});
test("expand()", 1, function() {
var unprefixed = window.unprefix();
ok(
!!~unprefixed.expand("foo").indexOf("foo -moz-foo -ms-foo -o-foo -webkit-foo MSfoo Mozfoo Ofoo WebKitfoo Webkitfoo mozfoo msfoo ofoo webkitfoo"),
"string of expanded prefixes"
);
});
test("translate()", 1, function() {
var unprefixed = window.unprefix();
deepEqual(
unprefixed.translate( window, "foo" ),
{},
"Translated"
);
});
test("supported()", 1, function() {
var unprefixed = window.unprefix(),
api = unprefixed.translate( window, "notGonnaFindIt" );
equal(
window.unprefix.supported.notGonnaFindIt,
false,
"notGonnaFindIt is not supported"
);
});
module("Array methods", {
setup: function() {
window.MozFoo = {};
window.mozBar = {};
window.MSFoo = {};
window.msBar = {};
window.OFoo = {};
window.oBar = {};
window.WebKitFoo = {};
window.WebkitBar = {};
window.webkitBaz = {};
}
});
test("push()", 1, function() {
var unprefixed = window.unprefix(),
length = unprefixed.length;
unprefixed.push("khtml");
ok( unprefixed.length === (length + 1), "push() results in new length" );
unprefixed.pop();
});
}( this ));
| {
"content_hash": "3902f3888261c5b04b384d674cc42d8c",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 151,
"avg_line_length": 23.92929292929293,
"alnum_prop": 0.5799915576192486,
"repo_name": "rwaldron/unprefix.js",
"id": "b2687de96ffb339561c2ec391a2e893b4e4b646e",
"size": "2369",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/unprefix.js_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "54804"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<REUTERS TOPICS="YES" LEWISSPLIT="TRAIN" CGISPLIT="TRAINING-SET" OLDID="12561" NEWID="379">
<DATE>2-MAR-1987 08:43:25.91</DATE>
<TOPICS>
<D>acq</D>
</TOPICS>
<PLACES>
<D>usa</D>
</PLACES>
<PEOPLE/>
<ORGS/>
<EXCHANGES/>
<COMPANIES/>
<UNKNOWN>F
f0362 reute
d f BC-MARRIOTT-<MHS>-TO-SEL 03-02 0063</UNKNOWN>
<TEXT>
<TITLE>MARRIOTT <MHS> TO SELL HOTEL</TITLE>
<DATELINE>TORONTO, March 2 -</DATELINE>
<BODY><Four Seasons Hotels> said it and <VMS
Realty Partners> of Chicago have agreed to purchase the Santa
Barbara Biltmore Hotel from Marriott Corp for an undisclosed
amount.
It said the venture will rename the hotel the Four Seasons
Biltmore at Santa Barbara and invest over 13 mln dlrs in
improvements on the 228-room property.
Reuter</BODY>
</TEXT>
</REUTERS>
| {
"content_hash": "7e342636219116a2d428e2188b1dcb0b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 91,
"avg_line_length": 28.896551724137932,
"alnum_prop": 0.7028639618138425,
"repo_name": "fyears/tmpy",
"id": "33a58db6033ad4217a0c2d087a3e253a223dc090",
"size": "838",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tmpy/misc/texts/acq/reut-00032.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Python",
"bytes": "39158"
}
],
"symlink_target": ""
} |
package com.wayneleo.quickstart.sample.security;
import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
@Entity( name = "sample_security_permission" )
@SuppressWarnings( "serial" )
public class Permission implements Serializable {
private String id;
private String name;
private List<Role> roles;
@Id
@Column( name = "id", length = 32 )
public String getId() {
return id;
}
public void setId( String id ) {
this.id = id;
}
@Column( name = "name", length = 20 )
public String getName() {
return name;
}
public void setName( String name ) {
this.name = name;
}
@ManyToMany( cascade = CascadeType.REFRESH, targetEntity = Role.class, mappedBy = "permissions", fetch = FetchType.LAZY )
public List<Role> getRoles() {
return roles;
}
public void setRoles( List<Role> roles ) {
this.roles = roles;
}
}
| {
"content_hash": "64f806813cd38e2ddf18a05863ba8b4c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 125,
"avg_line_length": 24.73913043478261,
"alnum_prop": 0.6590509666080844,
"repo_name": "cnwayne/QuickStartForJava",
"id": "31ba112e379b21920b8d31972fa91e1a7c027ed8",
"size": "1138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "transactional-sample/sample-security/src/main/java/com/wayneleo/quickstart/sample/security/Permission.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "88"
},
{
"name": "Java",
"bytes": "182143"
},
{
"name": "Shell",
"bytes": "1272"
}
],
"symlink_target": ""
} |
<?php
/**
* $LICENSE$
*
* @category Light
* @package Light_Test
* @subpackage Library
* @license New BSD License
* @version $Id:$
* @author erenon
*/
require_once 'Light/Service/Abstract.php';
/**
* Library Service Abstract test suite
*
* @category Light
* @package Light_Test
* @subpackage Library
* @license New BSD License
* @author erenon
*
* @group Light_Library
*
* @todo add test for class not found
*
*/
class Library_Light_Service_AbstractTest
extends PHPUnit_Framework_TestCase
{
public function testSetGetService()
{
$mock = $this->getMock('ServiceFoo');
$serviceName = 'Foo';
$module = 'Bar';
Light_Service_Abstract::setService($mock, $serviceName, $module);
$this->assertEquals(
$mock,
Light_Service_Abstract::getService($serviceName, $module)
);
}
} | {
"content_hash": "bb3a58b024bc0b7828ccb9cdba038ac2",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 73,
"avg_line_length": 19.77777777777778,
"alnum_prop": 0.6157303370786517,
"repo_name": "erenon/Light",
"id": "f4ccedf54115983e016c05c9175dfb31bd9bac03",
"size": "890",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/library/Light/Service/AbstractTest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "53881"
}
],
"symlink_target": ""
} |
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["mode", "children", "className"];
import * as React from "react";
import { classNamesString } from "../../lib/classNames";
/**
* @see https://vkcom.github.io/VKUI/#/RadioGroup
*/
export var RadioGroup = function RadioGroup(_ref) {
var _ref$mode = _ref.mode,
mode = _ref$mode === void 0 ? "vertical" : _ref$mode,
children = _ref.children,
className = _ref.className,
restProps = _objectWithoutProperties(_ref, _excluded);
return /*#__PURE__*/React.createElement("div", _extends({
className: classNamesString("vkuiRadioGroup", styles["RadioGroup--mode-".concat(mode)], className)
}, restProps), children);
};
var styles = {
"RadioGroup--mode-horizontal": "vkuiRadioGroup--mode-horizontal",
"RadioGroup--mode-vertical": "vkuiRadioGroup--mode-vertical"
};
//# sourceMappingURL=RadioGroup.js.map | {
"content_hash": "cbacac0a0fbd75f3ab7727ba02d18045",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 102,
"avg_line_length": 39.64,
"alnum_prop": 0.6962663975782039,
"repo_name": "cdnjs/cdnjs",
"id": "a29b5ac4a7655cc04d68d01bd7f75fc7fa6f6e52",
"size": "991",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/vkui/5.0.0-beta.2/components/RadioGroup/RadioGroup.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
'-------------------------------------------------------------------------------------------'
' Inicio del codigo
'-------------------------------------------------------------------------------------------'
' Importando librerias
'-------------------------------------------------------------------------------------------'
Imports System.Data
'-------------------------------------------------------------------------------------------'
' Inicio de clase "fCDiario_Regla_CuentaContable"
'-------------------------------------------------------------------------------------------'
Partial Class fCDiario_Regla_CuentaContable
Inherits vis2formularios.frmReporte
Dim loObjetoReporte As CrystalDecisions.CrystalReports.Engine.ReportDocument
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Try
Dim loComandoSeleccionar As New StringBuilder()
loComandoSeleccionar.AppendLine("SELECT Comprobantes.Documento AS Documento, ")
loComandoSeleccionar.AppendLine(" YEAR(Comprobantes.Fec_Ini) AS Anno, ")
loComandoSeleccionar.AppendLine(" MONTH(Comprobantes.Fec_Ini) AS Mes, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Fec_Ini AS Fec_Ini, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Fec_Fin AS Fec_Fin, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Resumen AS Resumen, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Tipo As Tipo, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Origen AS Origen, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Integracion AS Integracion, ")
loComandoSeleccionar.AppendLine(" Comprobantes.Status As Status")
loComandoSeleccionar.AppendLine("INTO #tmpTemporal1 ")
loComandoSeleccionar.AppendLine("FROM Comprobantes ")
loComandoSeleccionar.AppendLine("WHERE " & cusAplicacion.goFormatos.pcCondicionPrincipal)
loComandoSeleccionar.AppendLine("")
loComandoSeleccionar.AppendLine("")
loComandoSeleccionar.AppendLine("SELECT Renglones_Comprobantes.Documento AS Documento,")
loComandoSeleccionar.AppendLine(" SUM(Renglones_Comprobantes.Mon_Deb) AS Mon_Deb,")
loComandoSeleccionar.AppendLine(" SUM(Renglones_Comprobantes.Mon_Hab) AS Mon_Hab,")
loComandoSeleccionar.AppendLine(" ISNULL(Reglas_Integracion.Nom_Reg, '(Sin Regla)') AS Cod_Reg, ")
loComandoSeleccionar.AppendLine(" ISNULL(Reglas_Integracion.Nom_Reg, '(Sin Regla)') AS Nom_Reg, ")
loComandoSeleccionar.AppendLine(" Cuentas_Contables.Nom_Cue AS Nom_Cue,")
loComandoSeleccionar.AppendLine(" Cuentas_Contables.Cod_Cue As Cod_Cue ")
loComandoSeleccionar.AppendLine("INTO #tmpTemporal2 ")
loComandoSeleccionar.AppendLine("FROM Comprobantes")
loComandoSeleccionar.AppendLine(" JOIN Renglones_Comprobantes ON Renglones_Comprobantes.Documento = Comprobantes.Documento")
loComandoSeleccionar.AppendLine(" AND Renglones_Comprobantes.Adicional = Comprobantes.Adicional")
loComandoSeleccionar.AppendLine(" LEFT JOIN Reglas_Integracion ON (Reglas_Integracion.Cod_Reg = Renglones_Comprobantes.Cod_Reg)")
loComandoSeleccionar.AppendLine(" JOIN Cuentas_Contables ON Cuentas_Contables.Cod_Cue = Renglones_Comprobantes.Cod_Cue ")
loComandoSeleccionar.AppendLine("WHERE " & cusAplicacion.goFormatos.pcCondicionPrincipal)
loComandoSeleccionar.AppendLine("GROUP BY Renglones_Comprobantes.Documento,Renglones_Comprobantes.Cod_Reg,Reglas_Integracion.Nom_Reg,Cuentas_Contables.Cod_Cue, Cuentas_Contables.Nom_Cue")
loComandoSeleccionar.AppendLine("ORDER BY Renglones_Comprobantes.Cod_Reg ASC,Cuentas_Contables.Cod_Cue ASC ")
loComandoSeleccionar.AppendLine("SELECT #tmpTemporal1.*, ")
loComandoSeleccionar.AppendLine(" #tmpTemporal2.*")
loComandoSeleccionar.AppendLine("FROM #tmpTemporal1 ")
loComandoSeleccionar.AppendLine(" JOIN #tmpTemporal2 ON (#tmpTemporal2.Documento = #tmpTemporal1.Documento)")
Dim loServicios As New cusDatos.goDatos
Dim laDatosReporte As DataSet = loServicios.mObtenerTodosSinEsquema(loComandoSeleccionar.ToString, "curReportes")
'Me.mEscribirConsulta(loComandoSeleccionar.ToString)
'--------------------------------------------------'
' Carga la imagen del logo en cusReportes '
'--------------------------------------------------'
Me.mCargarLogoEmpresa(laDatosReporte.Tables(0), "LogoEmpresa")
'-------------------------------------------------------------------------------------------------------
' Verificando si el select (tabla nº0) trae registros
'-------------------------------------------------------------------------------------------------------
If (laDatosReporte.Tables(0).Rows.Count <= 0) Then
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Información", _
"No se Encontraron Registros para los Parámetros Especificados. ", _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Informacion, _
"350px", _
"200px")
End If
loObjetoReporte = cusAplicacion.goFormatos.mCargarInforme("fCDiario_Regla_CuentaContable", laDatosReporte)
Me.mTraducirReporte(loObjetoReporte)
Me.mFormatearCamposReporte(loObjetoReporte)
Me.crvfCDiario_Regla_CuentaContable.ReportSource = loObjetoReporte
Catch loExcepcion As Exception
Me.WbcAdministradorMensajeModal.mMostrarMensajeModal("Error", _
"No se pudo Completar el Proceso: " & loExcepcion.Message, _
vis3Controles.wbcAdministradorMensajeModal.enumTipoMensaje.KN_Error, _
"auto", _
"auto")
End Try
End Sub
Protected Sub Page_Unload(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Unload
Try
loObjetoReporte.Close()
Catch loExcepcion As Exception
End Try
End Sub
End Class
'-------------------------------------------------------------------------------------------'
' Fin del codigo '
'-------------------------------------------------------------------------------------------'
' MAT: 09/08/11: Codigo inicial '
'-------------------------------------------------------------------------------------------'
' RJG: 09/11/11: Ajuste para que aparezcan los renglones que no tienen una regla de '
' integración asociada. '
'-------------------------------------------------------------------------------------------'
' RJG: 20/01/12: Se agregó el campo Adicional a la unión entre el encabezado y los renglones'
'-------------------------------------------------------------------------------------------'
| {
"content_hash": "a3847bff0bc6a51b72fdf8b0ad0d1985",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 191,
"avg_line_length": 55.53846153846154,
"alnum_prop": 0.5556786703601108,
"repo_name": "kodeitsolutions/ef-reports",
"id": "90382fefe993f2111728d87ca7db9b10e0e6a3d0",
"size": "7228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Reportes - Contabilidad/fCDiario_Regla_CuentaContable.aspx.vb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "6246816"
},
{
"name": "Visual Basic",
"bytes": "25803337"
}
],
"symlink_target": ""
} |
/**
* Node Module that exports a housing ubpdate function that takes the url and data to be updated.
* Returns success or failure. Primarily used by the scraper script.
*
* Housing Schema: {
* city: 'string', # Name of the city (ie, 'Seattle WA')
* rent: { # rental object containing a single number for each datapoint
* low: int
* high: int
* average: int
* },
* own: { # owning object containing a single number for each datapoint
* low: int # the current lowest scraped real estate value
* high: int # the current highest scraped real estate value
* average: int # the current average of high/low real estate values
* }
* }
*/
'use strict';
const MongoClient = require('mongodb').MongoClient;
/**
* Export database function that updates the housing data collection
* @param {string} url - MongoDB connection URL
* @param {object} data - housing data object
* @return {string} 'Success' or 'Failure' result response
*/
module.exports.update = function update(url, data) {
const citySelector = data.city;
const rentData = data.rent;
const ownData = data.own;
return new Promise((resolve, reject) => {
MongoClient.connect(url, (clientError, db) => {
if (clientError) reject(clientError);
db.collection('housing_by_city', (dbError, collection) => {
if (dbError) reject(dbError);
collection.update({ city: citySelector }, {
$set: {
'rent.low': rentData.low, 'rent.high': rentData.high, 'rent.average': rentData.average,
'own.low': ownData.low, 'own.high': ownData.high, 'own.average': ownData.average,
},
},
{
upsert: true,
}, (collectionError) => {
if (collectionError) reject(collectionError);
db.close();
resolve('Success');
});
});
});
});
};
| {
"content_hash": "13ccb2e4fa98adabf6565435d03ebc1c",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 99,
"avg_line_length": 34.1551724137931,
"alnum_prop": 0.5906108026249369,
"repo_name": "masharp/maker-towns",
"id": "13fd505cc380132a038bc4f652b7883863858974",
"size": "1981",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "scripts/unused/db/update/housing.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "26403"
},
{
"name": "HTML",
"bytes": "5116"
},
{
"name": "JavaScript",
"bytes": "150206"
},
{
"name": "Python",
"bytes": "3011"
}
],
"symlink_target": ""
} |
echo Getting latest bits...
git pull
echo "Copying login.sh file to root..."
cp login.sh ~/
echo Starting Mini Mobile Device Lab Client
cd PiLab
echo ""
echo Starting Monitor...
forever start monitor.js
echo ""
echo Starting ADB Server with sudo
sudo adb start-server
# echo ""
# echo Installing and updating node modules
# npm install
echo ""
echo Starting MMDL Client
node simple.js
echo ""
echo Rebooting simple in 5 seconds
sleep 5
sudo reboot
| {
"content_hash": "5abaab4832710a510f005a62197f7f50",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 43,
"avg_line_length": 15.2,
"alnum_prop": 0.7478070175438597,
"repo_name": "GoogleChromeLabs/MiniMobileDeviceLab",
"id": "21a144b3600e34a42f22dd4dd7bbb2a2080115f8",
"size": "506",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "13903"
},
{
"name": "C++",
"bytes": "2031"
},
{
"name": "CSS",
"bytes": "5699"
},
{
"name": "HTML",
"bytes": "38565"
},
{
"name": "JavaScript",
"bytes": "80843"
},
{
"name": "Objective-C",
"bytes": "106712"
},
{
"name": "Shell",
"bytes": "3032"
}
],
"symlink_target": ""
} |
package org.ddogleg.clustering;
/**
* List of different initialization techniques for k-means
*
* @author Peter Abeles
*/
public enum KMeansInitializers {
/**
* Randomly select seeds from the set of available points
*/
STANDARD,
/**
* See {@link org.ddogleg.clustering.kmeans.InitializePlusPlus}. Selects points randomly based on
* distance from previously selected clusters.
*/
PLUS_PLUS
}
| {
"content_hash": "2508143192218d1791bc833b10365ca4",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 99,
"avg_line_length": 20.65,
"alnum_prop": 0.7239709443099274,
"repo_name": "bladestery/Sapphire",
"id": "f74f60410cd7a0d8190d9f591012f92bbb3c9fb1",
"size": "1095",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "example_apps/AndroidStudioMinnie/sapphire/src/main/java/org/ddogleg/clustering/KMeansInitializers.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "139298"
},
{
"name": "C++",
"bytes": "1444206"
},
{
"name": "CMake",
"bytes": "3964660"
},
{
"name": "Java",
"bytes": "14581743"
},
{
"name": "Makefile",
"bytes": "107081"
},
{
"name": "Python",
"bytes": "11485"
},
{
"name": "Shell",
"bytes": "495"
}
],
"symlink_target": ""
} |
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/*============================================================
**
**
**
** Purpose: This class will encapsulate a byte and provide an
** Object representation of it.
**
**
===========================================================*/
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
namespace System
{
[Serializable]
[StructLayout(LayoutKind.Sequential)]
[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
public struct Byte : IComparable, IConvertible, IFormattable, IComparable<Byte>, IEquatable<Byte>
{
private byte m_value; // Do not rename (binary serialization)
// The maximum value that a Byte may represent: 255.
public const byte MaxValue = (byte)0xFF;
// The minimum value that a Byte may represent: 0.
public const byte MinValue = 0;
// Compares this object to another object, returning an integer that
// indicates the relationship.
// Returns a value less than zero if this object
// null is considered to be less than any instance.
// If object is not of type byte, this method throws an ArgumentException.
//
public int CompareTo(Object value)
{
if (value == null)
{
return 1;
}
if (!(value is Byte))
{
throw new ArgumentException(SR.Arg_MustBeByte);
}
return m_value - (((Byte)value).m_value);
}
public int CompareTo(Byte value)
{
return m_value - value;
}
// Determines whether two Byte objects are equal.
public override bool Equals(Object obj)
{
if (!(obj is Byte))
{
return false;
}
return m_value == ((Byte)obj).m_value;
}
[NonVersionable]
public bool Equals(Byte obj)
{
return m_value == obj;
}
// Gets a hash code for this instance.
public override int GetHashCode()
{
return m_value;
}
public static byte Parse(String s)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo);
}
public static byte Parse(String s, NumberStyles style)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), style, NumberFormatInfo.CurrentInfo);
}
public static byte Parse(String s, IFormatProvider provider)
{
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.GetInstance(provider));
}
// Parses an unsigned byte from a String in the given style. If
// a NumberFormatInfo isn't specified, the current culture's
// NumberFormatInfo is assumed.
public static byte Parse(String s, NumberStyles style, IFormatProvider provider)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s);
return Parse(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider));
}
public static byte Parse(ReadOnlySpan<char> s, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return Parse(s, style, NumberFormatInfo.GetInstance(provider));
}
private static byte Parse(ReadOnlySpan<char> s, NumberStyles style, NumberFormatInfo info)
{
int i = 0;
try
{
i = Number.ParseInt32(s, style, info);
}
catch (OverflowException e)
{
throw new OverflowException(SR.Overflow_Byte, e);
}
if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_Byte);
return (byte)i;
}
public static bool TryParse(String s, out Byte result)
{
if (s == null)
{
result = 0;
return false;
}
return TryParse(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result);
}
public static bool TryParse(String s, NumberStyles style, IFormatProvider provider, out Byte result)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
if (s == null)
{
result = 0;
return false;
}
return TryParse(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider), out result);
}
public static bool TryParse(ReadOnlySpan<char> s, out byte result, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
{
NumberFormatInfo.ValidateParseStyleInteger(style);
return TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result);
}
private static bool TryParse(ReadOnlySpan<char> s, NumberStyles style, NumberFormatInfo info, out Byte result)
{
result = 0;
int i;
if (!Number.TryParseInt32(s, style, info, out i))
{
return false;
}
if (i < MinValue || i > MaxValue)
{
return false;
}
result = (byte)i;
return true;
}
public override String ToString()
{
return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo);
}
public String ToString(String format)
{
return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo);
}
public String ToString(IFormatProvider provider)
{
return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format, IFormatProvider provider)
{
return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
}
//
// IConvertible implementation
//
public TypeCode GetTypeCode()
{
return TypeCode.Byte;
}
bool IConvertible.ToBoolean(IFormatProvider provider)
{
return Convert.ToBoolean(m_value);
}
char IConvertible.ToChar(IFormatProvider provider)
{
return Convert.ToChar(m_value);
}
sbyte IConvertible.ToSByte(IFormatProvider provider)
{
return Convert.ToSByte(m_value);
}
byte IConvertible.ToByte(IFormatProvider provider)
{
return m_value;
}
short IConvertible.ToInt16(IFormatProvider provider)
{
return Convert.ToInt16(m_value);
}
ushort IConvertible.ToUInt16(IFormatProvider provider)
{
return Convert.ToUInt16(m_value);
}
int IConvertible.ToInt32(IFormatProvider provider)
{
return Convert.ToInt32(m_value);
}
uint IConvertible.ToUInt32(IFormatProvider provider)
{
return Convert.ToUInt32(m_value);
}
long IConvertible.ToInt64(IFormatProvider provider)
{
return Convert.ToInt64(m_value);
}
ulong IConvertible.ToUInt64(IFormatProvider provider)
{
return Convert.ToUInt64(m_value);
}
float IConvertible.ToSingle(IFormatProvider provider)
{
return Convert.ToSingle(m_value);
}
double IConvertible.ToDouble(IFormatProvider provider)
{
return Convert.ToDouble(m_value);
}
Decimal IConvertible.ToDecimal(IFormatProvider provider)
{
return Convert.ToDecimal(m_value);
}
DateTime IConvertible.ToDateTime(IFormatProvider provider)
{
throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Byte", "DateTime"));
}
Object IConvertible.ToType(Type type, IFormatProvider provider)
{
return Convert.DefaultToType((IConvertible)this, type, provider);
}
}
}
| {
"content_hash": "e57590dd61f395bd67cc6e659cd82f11",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 150,
"avg_line_length": 31.570422535211268,
"alnum_prop": 0.5817532902074504,
"repo_name": "rartemev/coreclr",
"id": "d9beb397b7802a0f9aace9b6fb77afa09dcf604c",
"size": "8966",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/mscorlib/shared/System/Byte.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "894703"
},
{
"name": "Awk",
"bytes": "5861"
},
{
"name": "Batchfile",
"bytes": "151143"
},
{
"name": "C",
"bytes": "3028711"
},
{
"name": "C#",
"bytes": "134219763"
},
{
"name": "C++",
"bytes": "68824892"
},
{
"name": "CMake",
"bytes": "640840"
},
{
"name": "Groovy",
"bytes": "206550"
},
{
"name": "Makefile",
"bytes": "2736"
},
{
"name": "Objective-C",
"bytes": "471844"
},
{
"name": "PAWN",
"bytes": "903"
},
{
"name": "Perl",
"bytes": "23640"
},
{
"name": "PowerShell",
"bytes": "9319"
},
{
"name": "Python",
"bytes": "242730"
},
{
"name": "Roff",
"bytes": "529523"
},
{
"name": "Shell",
"bytes": "223880"
},
{
"name": "Smalltalk",
"bytes": "1162648"
},
{
"name": "SuperCollider",
"bytes": "4752"
},
{
"name": "XSLT",
"bytes": "1016"
},
{
"name": "Yacc",
"bytes": "157348"
}
],
"symlink_target": ""
} |
[summary]: #summary
This RFC summarizes a few observed problems _of_ and suggestions for improvement _for_ the `/start_trajectory` service of Cartographer ROS.
## Motivation
[motivation]: #motivation
Starting a trajectory on demand, optionally with a start pose, is a very common task in robot localization.
However, the [`/start_trajectory`](https://github.com/googlecartographer/cartographer_ros/blob/3ca30fc90458152cc9a2c52aaa556e0ab09d0871/cartographer_ros_msgs/srv/StartTrajectory.srv) service is very hard to use for service clients.
Recent discussions related to this:
* https://github.com/googlecartographer/cartographer_ros/issues/1193
* https://github.com/googlecartographer/cartographer_ros/issues/1212
* https://github.com/googlecartographer/rfcs/pull/17#issuecomment-468639993
It requires a binary string of the trajectory options proto (see [here](https://github.com/googlecartographer/cartographer_ros/blob/61dd57bd94/cartographer_ros_msgs/msg/TrajectoryOptions.msg)), which is impossible to build by client code that should only know the message contract from `cartographer_ros_msgs`.
The `start_trajectory_main.cc` executable exists only to make this service usable.
It hides the implementation details away from the user/client with a proper interface that has only 3 simple options.
## Approach
[approach]: #approach
Change the service definition so that clients only need to depend on message packages (`cartographer_ros_msgs`, `geometry_msgs`, `std_msgs`), e.g.:
```
string configuration_directory
string configuration_basename
bool use_initial_pose
geometry_msgs/Pose initial_pose
int32 to_trajectory_id
---
cartographer_ros_msgs/StatusResponse status
int32 trajectory_id
```
Then, change the service handler in `node.cc` to do what `start_trajectory_main.cc` has been doing so far (essentially: loading the configuration).
As a nice side effect we can get rid of the following:
* `start_trajectory_main.cc`
* `TrajectoryOptions.msg`
* ROS message conversions in `trajectory_options.h`
* `SensorTopics.msg`
## Discussion Points
[discussion]: #discussion
### Optional initial pose
It should be possible to start a trajectory without initial pose, just as now when the initial pose argument isn't given to the start_trajectory executable.
Unlike e.g. protobuf, there's no way to define a part of a message definition as optional in ROS.
`to_trajectory_id` would be zero initialized if unspecified, which is a valid trajectory ID.
Maybe it's possible to find a workaround:
* hide the pose in an array that can have zero elements (ugly)
* two services: `/start_trajectory_with_initial_pose`, `start_trajectory`
* ...?
**Decision**:
Add boolean message field `use_initial_pose` - easy to understand and easy to use.
### Keep time parameter?
The time parameter of the initial pose is a bit of an obscure feature that might confuse people - should we keep it in the ROS service? See [cartographer/pose_graph.h](https://github.com/googlecartographer/cartographer/blob/bdb6f2db4a1f98484b222d61abceab8adb74dfd1/cartographer/mapping/pose_graph.h#L138)
**Decision**:
Don't expose in ROS service.
### Advantages of passing options in the message?
As mentioned by @ojura in the open house meeting, the proposed approach requires that the configuration lies on the host filesystem of the Cartographer node.
Binary proto allowed to transfer options from a client in the network.
**Decision**:
We agreed that we will drop this possibility for the sake of simplicity, which will benefit more users.
Also, client/server scenarios are better covered by Cartographer gRPC anyway.
| {
"content_hash": "c10b044e9892cb4ee115e051040de502",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 310,
"avg_line_length": 45.1,
"alnum_prop": 0.7904656319290465,
"repo_name": "googlecartographer/rfcs",
"id": "0b4ac90bbe6fbb6519b7e5abfe4023c35ca29b87",
"size": "3652",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "text/0028-simplify-ros-start-trajectory.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import scala.util.Try
import org.slf4j.LoggerFactory
import gitbucket.core.plugin.PluginRegistry
import gitbucket.core.service.SystemSettingsService.SystemSettings
import io.github.gitbucket.solidbase.model.Version
import javax.servlet.ServletContext
import tobiasroeser.gitbucket.asciidoctor.AsciidoctorRenderer
class Plugin extends gitbucket.core.plugin.Plugin {
private[this] val log = LoggerFactory.getLogger(classOf[Plugin])
override val pluginId: String = "asciidoctor"
override val pluginName: String = "AsciiDoctor Plugin"
override val description: String = "Provides AsciiDoc rendering for GitBucket."
override val versions: List[Version] = List(
new Version("1.0.1"),
new Version("1.0.2"),
new Version("1.1.0")
)
private[this] var renderer: Option[AsciidoctorRenderer] = None
override def initialize(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {
log.info("About to initialize Asciidoctor")
val test = Try { new AsciidoctorRenderer() }
log.info("Result: " + test)
val asciidoc = test.get
log.info("Registering AsciidoctorRenderer for various extensions")
registry.addRenderer("adoc", asciidoc)
registry.addRenderer("asciidoc", asciidoc)
registry.addRenderer("ad", asciidoc)
renderer = Option(asciidoc)
}
override def shutdown(registry: PluginRegistry, context: ServletContext, settings: SystemSettings): Unit = {
renderer.map(r => r.shutdown())
}
}
| {
"content_hash": "82a1372e65cee0fb179f4fb299323d80",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 112,
"avg_line_length": 31.638297872340427,
"alnum_prop": 0.7511768661735037,
"repo_name": "asciidoctor/gitbucket-asciidoctor-plugin",
"id": "2eb2ff8f5fd70232087599f69b2b6eb698d8f24f",
"size": "1487",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "src/main/scala/Plugin.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "1336"
},
{
"name": "Scala",
"bytes": "8331"
}
],
"symlink_target": ""
} |
<?php
namespace common\modules\user\models\forms;
use Yii;
use yii\base\Model;
/**
* LoginForm is the model behind the login form.
*/
class LoginForm extends Model
{
/**
* @var string Username and/or email
*/
public $username;
/**
* @var string Password
*/
public $password;
/**
* @var bool If true, users will be logged in for $loginDuration
*/
public $rememberMe = true;
/**
* @var \common\modules\user\models\User
*/
protected $_user = false;
/**
* @return array the validation rules.
*/
public function rules()
{
return [
[["username", "password"], "required"],
["username", "validateUser"],
["username", "validateUserStatus"],
["password", "validatePassword"],
["rememberMe", "boolean"],
];
}
/**
* Validate user
*/
public function validateUser()
{
// check for valid user
$user = $this->getUser();
if (!$user) {
// calculate error message
if (Yii::$app->getModule("user")->loginEmail && Yii::$app->getModule("user")->loginUsername) {
$errorAttribute = "Email/username";
} elseif (Yii::$app->getModule("user")->loginEmail) {
$errorAttribute = "Email";
} else {
$errorAttribute = "Username";
}
$this->addError("username", Yii::t("user", "$errorAttribute not found"));
}
}
/**
* Validate user status
*/
public function validateUserStatus()
{
// check for ban status
$user = $this->getUser();
if ($user->ban_time) {
$this->addError("username", Yii::t("user", "User is banned - {banReason}", [
"banReason" => $user->ban_reason,
]));
}
// check status and resend email if inactive
if ($user->status == $user::STATUS_INACTIVE) {
/** @var \common\modules\user\models\UserKey $userKey */
$userKey = Yii::$app->getModule("user")->model("UserKey");
$userKey = $userKey::generate($user->id, $userKey::TYPE_EMAIL_ACTIVATE);
$user->sendEmailConfirmation($userKey);
$this->addError("username", Yii::t("user", "Confirmation email resent"));
}
}
/**
* Validate password
*/
public function validatePassword()
{
// skip if there are already errors
if ($this->hasErrors()) {
return;
}
// check password
/** @var \common\modules\user\models\User $user */
$user = $this->getUser();
if (!$user->verifyPassword($this->password)) {
$this->addError("password", Yii::t("user", "Incorrect password"));
}
}
/**
* Get user based on email and/or username
*
* @return \common\modules\user\models\User|null
*/
public function getUser()
{
// check if we need to get user
if ($this->_user === false) {
// build query based on email and/or username login properties
$user = Yii::$app->getModule("user")->model("User");
$user = $user::find();
if (Yii::$app->getModule("user")->loginEmail) {
$user->orWhere(["email" => $this->username]);
}
if (Yii::$app->getModule("user")->loginUsername) {
$user->orWhere(["username" => $this->username]);
}
// get and store user
$this->_user = $user->one();
}
// return stored user
return $this->_user;
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
// calculate attribute label for "username"
$attribute = Yii::$app->getModule("user")->requireEmail ? Yii::t("user", "Email") : Yii::t("user", "Username");
return [
"username" => $attribute,
"password" => Yii::t("user", "Password"),
"rememberMe" => Yii::t("user", "Remember Me"),
];
}
/**
* Validate and log user in
*
* @param int $loginDuration
* @return bool
*/
public function login($loginDuration)
{
if ($this->validate()) {
return Yii::$app->user->login($this->getUser(), $this->rememberMe ? $loginDuration : 0);
}
return false;
}
} | {
"content_hash": "1d9e744b524781e40eb596471e1f97c6",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 119,
"avg_line_length": 26.867469879518072,
"alnum_prop": 0.5069506726457399,
"repo_name": "ramshresh/dmis",
"id": "707c3fc3a345baf69cf6fb4bb0f474f7846a3306",
"size": "4460",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "common/modules/user/models/forms/LoginForm.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "1813"
},
{
"name": "Batchfile",
"bytes": "1541"
},
{
"name": "CSS",
"bytes": "659347"
},
{
"name": "Emacs Lisp",
"bytes": "4820"
},
{
"name": "HTML",
"bytes": "4287597"
},
{
"name": "JavaScript",
"bytes": "63141275"
},
{
"name": "PHP",
"bytes": "2195503"
},
{
"name": "Python",
"bytes": "206600"
},
{
"name": "SQLPL",
"bytes": "6818"
},
{
"name": "Shell",
"bytes": "3806"
}
],
"symlink_target": ""
} |
package h;
import java.util.Arrays;
import java.util.List;
//2 at817e3s1icc92sqipan1gjl9
public interface Agedge_t extends Agedge_s {
public static List<String> DEFINITION = Arrays.asList(
"typedef struct Agedge_s Agedge_t");
}
// typedef struct Agedge_s Agedge_t; | {
"content_hash": "e9c4f75cc1a6f740c149b8ab96331923",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 55,
"avg_line_length": 20.692307692307693,
"alnum_prop": 0.7657992565055762,
"repo_name": "Banno/sbt-plantuml-plugin",
"id": "d918afe66f920c96532d04b804b3219a352e9a65",
"size": "1956",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/h/Agedge_t.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "12451864"
},
{
"name": "Scala",
"bytes": "7987"
},
{
"name": "Shell",
"bytes": "1069"
}
],
"symlink_target": ""
} |
package org.springframework.boot.autoconfigure.mongo;
import java.net.UnknownHostException;
import java.util.List;
import com.mongodb.MongoClient;
import com.mongodb.MongoCredential;
import com.mongodb.ServerAddress;
import org.junit.Test;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.test.EnvironmentTestUtils;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Configuration;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link MongoProperties}.
*
* @author Phillip Webb
* @author Andy Wilkinson
*/
public class MongoPropertiesTests {
@Test
public void canBindCharArrayPassword() {
// gh-1572
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(context, "spring.data.mongodb.password:word");
context.register(Conf.class);
context.refresh();
MongoProperties properties = context.getBean(MongoProperties.class);
assertThat(properties.getPassword()).isEqualTo("word".toCharArray());
}
@Test
public void portCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setPort(12345);
MongoClient client = properties.createMongoClient(null, null);
List<ServerAddress> allAddresses = client.getAllAddress();
assertThat(allAddresses).hasSize(1);
assertServerAddress(allAddresses.get(0), "localhost", 12345);
}
@Test
public void hostCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setHost("mongo.example.com");
MongoClient client = properties.createMongoClient(null, null);
List<ServerAddress> allAddresses = client.getAllAddress();
assertThat(allAddresses).hasSize(1);
assertServerAddress(allAddresses.get(0), "mongo.example.com", 27017);
}
@Test
public void credentialsCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setUsername("user");
properties.setPassword("secret".toCharArray());
MongoClient client = properties.createMongoClient(null, null);
assertMongoCredential(client.getCredentialsList().get(0), "user", "secret",
"test");
}
@Test
public void databaseCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setDatabase("foo");
properties.setUsername("user");
properties.setPassword("secret".toCharArray());
MongoClient client = properties.createMongoClient(null, null);
assertMongoCredential(client.getCredentialsList().get(0), "user", "secret",
"foo");
}
@Test
public void authenticationDatabaseCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setAuthenticationDatabase("foo");
properties.setUsername("user");
properties.setPassword("secret".toCharArray());
MongoClient client = properties.createMongoClient(null, null);
assertMongoCredential(client.getCredentialsList().get(0), "user", "secret",
"foo");
}
@Test
public void uriCanBeCustomized() throws UnknownHostException {
MongoProperties properties = new MongoProperties();
properties.setUri("mongodb://user:secret@mongo1.example.com:12345,"
+ "mongo2.example.com:23456/test");
MongoClient client = properties.createMongoClient(null, null);
List<ServerAddress> allAddresses = client.getAllAddress();
assertThat(allAddresses).hasSize(2);
assertServerAddress(allAddresses.get(0), "mongo1.example.com", 12345);
assertServerAddress(allAddresses.get(1), "mongo2.example.com", 23456);
List<MongoCredential> credentialsList = client.getCredentialsList();
assertThat(credentialsList).hasSize(1);
assertMongoCredential(credentialsList.get(0), "user", "secret", "test");
}
private void assertServerAddress(ServerAddress serverAddress, String expectedHost,
int expectedPort) {
assertThat(serverAddress.getHost()).isEqualTo(expectedHost);
assertThat(serverAddress.getPort()).isEqualTo(expectedPort);
}
private void assertMongoCredential(MongoCredential credentials,
String expectedUsername, String expectedPassword, String expectedSource) {
assertThat(credentials.getUserName()).isEqualTo(expectedUsername);
assertThat(credentials.getPassword()).isEqualTo(expectedPassword.toCharArray());
assertThat(credentials.getSource()).isEqualTo(expectedSource);
}
@Configuration
@EnableConfigurationProperties(MongoProperties.class)
static class Conf {
}
}
| {
"content_hash": "0403bf31923f438d07c457dff2445b32",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 88,
"avg_line_length": 36.912,
"alnum_prop": 0.7869527524924144,
"repo_name": "neo4j-contrib/spring-boot",
"id": "96a051a28ba8f4607af3ec28f51107de903df1a0",
"size": "5234",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/mongo/MongoPropertiesTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "6954"
},
{
"name": "CSS",
"bytes": "5769"
},
{
"name": "FreeMarker",
"bytes": "2116"
},
{
"name": "Groovy",
"bytes": "41115"
},
{
"name": "HTML",
"bytes": "69819"
},
{
"name": "Java",
"bytes": "7992035"
},
{
"name": "JavaScript",
"bytes": "37789"
},
{
"name": "Ruby",
"bytes": "1305"
},
{
"name": "SQLPL",
"bytes": "20085"
},
{
"name": "Shell",
"bytes": "20373"
},
{
"name": "Smarty",
"bytes": "3276"
},
{
"name": "XSLT",
"bytes": "33894"
}
],
"symlink_target": ""
} |
import React, { Component, PropTypes } from 'react';
import DailyPricesTable from './DailyPricesTable';
export default class DailyPricesCard extends Component {
static propTypes = {
dailyPrices: PropTypes.array.isRequired,
};
render() {
const { dailyPrices } = this.props;
return (
<DailyPricesTable dailyPrices={dailyPrices} />
);
}
}
| {
"content_hash": "b1f1e1992afb5c0df17798c0b0c675ba",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 58,
"avg_line_length": 23.529411764705884,
"alnum_prop": 0.635,
"repo_name": "qingweibinary/binary-next-gen",
"id": "1b4e18edb3932a1f4ee945429dd38d87852d1d51",
"size": "400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/daily-prices/DailyPricesCard.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15094"
},
{
"name": "HTML",
"bytes": "1823"
},
{
"name": "JavaScript",
"bytes": "625934"
},
{
"name": "Shell",
"bytes": "270"
}
],
"symlink_target": ""
} |
using Wangkanai.Detection.Models;
namespace Wangkanai.Detection.Services;
/// <summary>
/// Provides the APIs for query client platform.
/// </summary>
public interface IPlatformService
{
/// <summary>
/// Gets the <see cref="Processor"/> of the request client.
/// </summary>
public Processor Processor { get; }
/// <summary>
/// Gets the <see cref="Platform"/> of the request client.
/// </summary>
public Platform Name { get; }
/// <summary>
/// Gets the <see cref="Version"/> of the request client.
/// </summary>
public Version Version { get; }
} | {
"content_hash": "0f23546026f2caa74a432db77b3f35c0",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 63,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.6274834437086093,
"repo_name": "wangkanai/Detection",
"id": "784b41b6e47027763f354f7a73033c32f13e53a3",
"size": "701",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/Services/Interfaces/IPlatformService.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "166873"
},
{
"name": "CSS",
"bytes": "19759"
},
{
"name": "PowerShell",
"bytes": "145"
}
],
"symlink_target": ""
} |
package com.google.common.graph;
import static com.google.common.graph.GraphConstants.ENDPOINTS_MISMATCH;
import static com.google.common.graph.TestUtil.assertEdgeNotInGraphErrorMessage;
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import com.google.common.collect.ImmutableSet;
import java.util.Collections;
import java.util.Set;
import org.junit.After;
import org.junit.Test;
/**
* Abstract base class for testing implementations of {@link Network} interface.
*
* <p>This class is responsible for testing that a directed implementation of {@link Network} is
* correctly handling directed edges. Implementation-dependent test cases are left to subclasses.
* Test cases that do not require the graph to be directed are found in superclasses.
*/
public abstract class AbstractDirectedNetworkTest extends AbstractNetworkTest {
@After
public void validateSourceAndTarget() {
for (Integer node : network.nodes()) {
for (String inEdge : network.inEdges(node)) {
EndpointPair<Integer> endpointPair = network.incidentNodes(inEdge);
assertThat(endpointPair.source()).isEqualTo(endpointPair.adjacentNode(node));
assertThat(endpointPair.target()).isEqualTo(node);
}
for (String outEdge : network.outEdges(node)) {
EndpointPair<Integer> endpointPair = network.incidentNodes(outEdge);
assertThat(endpointPair.source()).isEqualTo(node);
assertThat(endpointPair.target()).isEqualTo(endpointPair.adjacentNode(node));
}
for (Integer adjacentNode : network.adjacentNodes(node)) {
Set<String> edges = network.edgesConnecting(node, adjacentNode);
Set<String> antiParallelEdges = network.edgesConnecting(adjacentNode, node);
assertThat(node.equals(adjacentNode) || Collections.disjoint(edges, antiParallelEdges))
.isTrue();
}
}
}
@Test
public void edges_containsOrderMismatch() {
addEdge(N1, N2, E12);
EndpointPair<Integer> endpointsN1N2 = EndpointPair.unordered(N1, N2);
EndpointPair<Integer> endpointsN2N1 = EndpointPair.unordered(N2, N1);
assertThat(network.asGraph().edges()).doesNotContain(endpointsN1N2);
assertThat(network.asGraph().edges()).doesNotContain(endpointsN2N1);
}
@Test
public void edgesConnecting_orderMismatch() {
addEdge(N1, N2, E12);
try {
Set<String> unused = network.edgesConnecting(EndpointPair.unordered(N1, N2));
fail("Expected IllegalArgumentException: " + ENDPOINTS_MISMATCH);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ENDPOINTS_MISMATCH);
}
}
@Test
public void edgeConnectingOrNull_orderMismatch() {
addEdge(N1, N2, E12);
try {
String unused = network.edgeConnectingOrNull(EndpointPair.unordered(N1, N2));
fail("Expected IllegalArgumentException: " + ENDPOINTS_MISMATCH);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ENDPOINTS_MISMATCH);
}
}
@Override
@Test
public void incidentNodes_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.incidentNodes(E12).source()).isEqualTo(N1);
assertThat(network.incidentNodes(E12).target()).isEqualTo(N2);
}
@Test
public void edgesConnecting_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.edgesConnecting(N1, N2)).containsExactly(E12);
// Passed nodes should be in the correct edge direction, first is the
// source node and the second is the target node
assertThat(network.edgesConnecting(N2, N1)).isEmpty();
}
@Test
public void inEdges_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.inEdges(N2)).containsExactly(E12);
// Edge direction handled correctly
assertThat(network.inEdges(N1)).isEmpty();
}
@Test
public void outEdges_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.outEdges(N1)).containsExactly(E12);
// Edge direction handled correctly
assertThat(network.outEdges(N2)).isEmpty();
}
@Test
public void predecessors_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.predecessors(N2)).containsExactly(N1);
// Edge direction handled correctly
assertThat(network.predecessors(N1)).isEmpty();
}
@Test
public void successors_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.successors(N1)).containsExactly(N2);
// Edge direction handled correctly
assertThat(network.successors(N2)).isEmpty();
}
@Test
public void source_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.incidentNodes(E12).source()).isEqualTo(N1);
}
@Test
public void source_edgeNotInGraph() {
try {
network.incidentNodes(EDGE_NOT_IN_GRAPH).source();
fail(ERROR_EDGE_NOT_IN_GRAPH);
} catch (IllegalArgumentException e) {
assertEdgeNotInGraphErrorMessage(e);
}
}
@Test
public void target_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.incidentNodes(E12).target()).isEqualTo(N2);
}
@Test
public void target_edgeNotInGraph() {
try {
network.incidentNodes(EDGE_NOT_IN_GRAPH).target();
fail(ERROR_EDGE_NOT_IN_GRAPH);
} catch (IllegalArgumentException e) {
assertEdgeNotInGraphErrorMessage(e);
}
}
@Test
public void inDegree_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.inDegree(N2)).isEqualTo(1);
// Edge direction handled correctly
assertThat(network.inDegree(N1)).isEqualTo(0);
}
@Test
public void outDegree_oneEdge() {
addEdge(N1, N2, E12);
assertThat(network.outDegree(N1)).isEqualTo(1);
// Edge direction handled correctly
assertThat(network.outDegree(N2)).isEqualTo(0);
}
// Element Mutation
@Test
public void addEdge_existingNodes() {
// Adding nodes initially for safety (insulating from possible future
// modifications to proxy methods)
addNode(N1);
addNode(N2);
assertThat(addEdge(N1, N2, E12)).isTrue();
assertThat(network.edges()).contains(E12);
assertThat(network.edgesConnecting(N1, N2)).containsExactly(E12);
// Direction of the added edge is correctly handled
assertThat(network.edgesConnecting(N2, N1)).isEmpty();
}
@Test
public void addEdge_existingEdgeBetweenSameNodes() {
addEdge(N1, N2, E12);
ImmutableSet<String> edges = ImmutableSet.copyOf(network.edges());
assertThat(addEdge(N1, N2, E12)).isFalse();
assertThat(network.edges()).containsExactlyElementsIn(edges);
}
@Test
public void addEdge_existingEdgeBetweenDifferentNodes() {
addEdge(N1, N2, E12);
try {
// Edge between totally different nodes
addEdge(N4, N5, E12);
fail(ERROR_ADDED_EXISTING_EDGE);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ERROR_REUSE_EDGE);
}
try {
// Edge between same nodes but in reverse direction
addEdge(N2, N1, E12);
fail(ERROR_ADDED_EXISTING_EDGE);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ERROR_REUSE_EDGE);
}
}
@Test
public void addEdge_parallelEdge() {
addEdge(N1, N2, E12);
try {
addEdge(N1, N2, EDGE_NOT_IN_GRAPH);
fail(ERROR_ADDED_PARALLEL_EDGE);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ERROR_PARALLEL_EDGE);
}
}
@Test
public void addEdge_orderMismatch() {
EndpointPair<Integer> endpoints = EndpointPair.unordered(N1, N2);
try {
addEdge(endpoints, E12);
fail("Expected IllegalArgumentException: " + ENDPOINTS_MISMATCH);
} catch (IllegalArgumentException e) {
assertThat(e).hasMessageThat().contains(ENDPOINTS_MISMATCH);
}
}
}
| {
"content_hash": "ab215fe5f4b352cf6eaab26bf6916da4",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 97,
"avg_line_length": 32.1,
"alnum_prop": 0.6984683281412254,
"repo_name": "EdwardLee03/guava",
"id": "6111f82367565110cd0613acc4b883d432a91285",
"size": "8304",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "android/guava-tests/test/com/google/common/graph/AbstractDirectedNetworkTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11478"
},
{
"name": "Java",
"bytes": "13083336"
},
{
"name": "Shell",
"bytes": "1128"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.dahanne.android.google.client" >
<uses-sdk android:minSdkVersion="11" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MainApplication"
android:icon="@drawable/app_notes"
android:label="@string/app_name" >
<activity
android:name=".GoogleActivity"
android:label="@string/title_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".GoogleWebOAuthActivity"
android:excludeFromRecents="true"
android:noHistory="true" />
<activity android:name=".GoogleProfileActivity" />
</application>
</manifest> | {
"content_hash": "fe3f921b674f8f6adc093a4e4db87758",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 34.275862068965516,
"alnum_prop": 0.6146881287726358,
"repo_name": "anthonydahanne/spring-for-android-starter-book",
"id": "80061d8e96bca0f587c1566f33fd0415fa042f5e",
"size": "994",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spring-for-android-ch4-oauth-google/AndroidManifest.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "87219"
}
],
"symlink_target": ""
} |
<ion-view>
<ion-content>
<ion-list>
<ion-item class="item-avatar"
ng-repeat="model in collection.models | groupFilter:searchText | orderBy:'+name'"
ng-controller="GroupCtrl"
ng-class="model.selected ? 'selected' : ''"
href="#/chat/groupchat/{{model.id}}"
on-hold="select()">
<ng-include src="'templates/group/item.html'"></ng-include>
</ion-item>
</ion-list>
<ion-infinite-scroll ng-if="collection.state.skip < collection.state.count" on-infinite="controller.loadMore()">
</ion-infinite-scroll>
</ion-content>
</ion-view> | {
"content_hash": "5ab370b35fb1672a3f37caaf8984d123",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 114,
"avg_line_length": 35.125,
"alnum_prop": 0.6637010676156584,
"repo_name": "jokyip/imsails",
"id": "db4af80e0a8cf69e91a5e6d5ac1252793252c88b",
"size": "562",
"binary": false,
"copies": "2",
"ref": "refs/heads/chatDefault",
"path": "www/templates/group/tab.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12901"
},
{
"name": "CoffeeScript",
"bytes": "107822"
},
{
"name": "HTML",
"bytes": "102734"
},
{
"name": "JavaScript",
"bytes": "1866"
},
{
"name": "Shell",
"bytes": "245"
}
],
"symlink_target": ""
} |
package com.orientechnologies.orient.core.db;
import com.orientechnologies.orient.core.db.ODatabase.ATTRIBUTES;
public interface ODatabaseComplexInternal<T> extends ODatabaseComplex<T>, ODatabaseInternal {
/**
* Returns the database owner. Used in wrapped instances to know the up level ODatabase instance.
*
* @return Returns the database owner.
*/
public ODatabaseComplexInternal<?> getDatabaseOwner();
/**
* Internal. Sets the database owner.
*/
public ODatabaseComplexInternal<?> setDatabaseOwner(ODatabaseComplexInternal<?> iOwner);
/**
* Return the underlying database. Used in wrapper instances to know the down level ODatabase instance.
*
* @return The underlying ODatabase implementation.
*/
public <DB extends ODatabase> DB getUnderlying();
/**
* Internal method. Don't call it directly unless you're building an internal component.
*/
public void setInternal(ATTRIBUTES attribute, Object iValue);
}
| {
"content_hash": "5008babef8861256633fc69e4911a23f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 105,
"avg_line_length": 29.484848484848484,
"alnum_prop": 0.7410071942446043,
"repo_name": "DiceHoldingsInc/orientdb",
"id": "19da34c00f990f2686d6e539e501513bc664f7ed",
"size": "1752",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/com/orientechnologies/orient/core/db/ODatabaseComplexInternal.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Original work: Copyright 2009 Google Inc. All Rights Reserved.
//
// Modified work: The original source code (AndroidNdt.java) comes from the NDT Android app
// that is available from http://code.google.com/p/ndt/.
// It's modified for the CalSPEED Android app by California
// State University Monterey Bay (CSUMB) on April 29, 2013.
//
package gov.va.cgit.vaspeed.android;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Color;
import android.location.LocationManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.text.method.ScrollingMovementMethod;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ToggleButton;
import android.telephony.TelephonyManager;
import android.net.wifi.*;
import android.content.SharedPreferences;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;
import java.io.EOFException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.File;
import com.google.analytics.tracking.android.EasyTracker;
import gov.va.cgit.vaspeed.android.R;
import gov.va.cgit.vaspeed.android.UiServices;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
/**
* UI Thread and Entry Point of mobile client.
*/
public class Calspeed extends Activity {
private int serverNumber;
private int progress;
private String operatorName;
private String providerName;
private String serverName;
private String serverHost;
private String mobileInfo;
private String statistics;
private Button buttonStandardTest;
private ProgressBar progressBar;
private TextView topText;
private TextView textViewMain;
private UiHandler uiHandler;
private PowerManager powerManager;
private PowerManager.WakeLock wakeLock;
private NetworkInfo networkInfo;
private AndroidUiServices uiServices;
private static NdtLocation ndtLocation;
private AssetManager assetManager;
private String applicationFilesDir;
private TelephonyManager telephonyManager;
private String telephoneInfo;
private String bssid, ssid;
private Date date;
private Double startLatitude;
private Double startLongitude;
private Context context;
private String DeviceId;
Boolean usingUploadButton = false;
Boolean validLocation = false;
private LatLong myLatLong;
private ProgressDialog GPSdialog, Mobiledialog;
private String Provider;
private String TCPPort;
private String UDPPort;
private String location = null;
private TextView uploadText;
private TextView uploadNum;
private TextView uploadUnits;
private TextView downloadText;
private TextView downloadNum;
private TextView downloadUnits;
private TextView latencyText;
private TextView latencyNum;
private TextView latencyUnits;
private TextView jitterText;
private TextView jitterNum;
private TextView jitterUnits;
private TextView networkView;
private View resultsView;
private Animation slideOut;
private Animation slideIn;
private Float smoothUpload;
private Float smoothDownload;
private String finalDownload;
private String finalUpload;
private Timer UploadTimer;
private Timer DownloadTimer;
private TimerTask uploadTask;
private TimerTask downloadTask;
private static Context mContext;
private TextView locationView;
private Button buttonMap;
private String newLat;
private String newLong;
/**
* Initializes the activity.
*/
public static Context getContext(){
return mContext;
}
public static void promptNetworkGeolocation(final Context activity)
{
LocationManager locManager = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
Log.d("locationbl", "aaaxz");
if(!(locManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER))) {
Log.d("noten", "network not enabled");
final AlertDialog.Builder builder =
new AlertDialog.Builder(activity);
final String action = android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS;
final String message = "Network-based geolocaiton is disabled."
+ " It is necessary when GPS is not available (indoors). Click OK to go to"
+ " location services settings enable it.";
builder.setMessage(message)
.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int id) {
activity.startActivity(new Intent(action));
d.dismiss();
}
})
.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface d, int id) {
d.cancel();
}
});
builder.create().show();
}
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
SharedPreferences legal = getSharedPreferences("Legal", MODE_PRIVATE);
if (!(legal.getBoolean("privacyPolicyAccepted", false))) {
createPrivacyPolicyAlert();
}
setContentView(R.layout.main);
try {
context = createPackageContext("gov.va.cgit.vaspeed.android", 0);
Prefs.resetGPSoverride(context);
} catch (Exception e) {
if (Constants.DEBUG)
Log.v("debug", "unable to set context OnCreate");
}
// Set the default server
serverNumber = Constants.DEFAULT_SERVER;
serverName = Constants.SERVER_NAME[serverNumber];
serverHost = Constants.SERVER_HOST[serverNumber];
powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
networkInfo = connectivityManager.getActiveNetworkInfo();
wakeLock = powerManager.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK,
"Network Testing");
uiHandler = new UiHandler(Looper.myLooper());
uiServices = new AndroidUiServices(this, uiHandler);
assetManager = getAssets();
ndtLocation = new NdtLocation(this, uiServices);
myLatLong = new LatLong();
applicationFilesDir = GetApplicationFilesDir();
SetupIperf();
textViewMain = (TextView) findViewById(R.id.TextViewMain);
textViewMain.setMovementMethod(ScrollingMovementMethod.getInstance());
textViewMain.setClickable(false);
textViewMain.setLongClickable(false);
topText = (TextView) findViewById(R.id.topText);
textViewMain.append(getString(R.string.nonofficial) + "\n");
uiServices.appendString(getString(R.string.nonofficial) + "\n",
uiServices.STAT_VIEW);
date = new Date();
textViewMain.append(date.toString() + "\n");
statistics = "";
initComponents();
ndtLocation.addGPSStatusListener();
if (!ndtLocation.gpsEnabled) {
createGpsDisabledAlert();
}
startGPS();
setupUploadTimer();
setupDownloadTimer();
}
/**
* {@inheritDoc}
*/
@Override
protected void onDestroy() {
ndtLocation.stopListen();
ndtLocation.removeGPSStatusListener();
if (Constants.DEBUG)
Log.v("debug", "onDestory");
if (wakeLock != null && wakeLock.isHeld()) {
wakeLock.release();
if (Constants.DEBUG)
Log.v("debug", "Release Wake Lock onDestroy");
}
super.onDestroy();
}
/**
* {@inheritDoc}
*/
@Override
protected void onStart() {
if (Constants.DEBUG)
Log.v("debug", "onStart");
super.onStart();
EasyTracker.getInstance(this).activityStart(this);
}
/**
* {@inheritDoc}
*/
@Override
protected void onResume() {
if (Constants.DEBUG)
Log.v("debug", "onResume");
super.onResume();
promptNetworkGeolocation(mContext);
}
/**
* {@inheritDoc}
*/
@Override
protected void onStop() {
if (Constants.DEBUG)
Log.v("debug", "onStop");
super.onStop();
EasyTracker.getInstance(this).activityStop(this);
}
/**
* Initializes the components on main view.
*/
private void initComponents() {
buttonStandardTest = (Button) findViewById(R.id.ButtonStandardTest);
buttonStandardTest.setOnClickListener(new StandardTestButtonListener());
final Activity oldthis=this;
progressBar = (ProgressBar) findViewById(R.id.ProgressBar);
progressBar.setIndeterminate(false);
uploadText = (TextView) findViewById(R.id.uploadLabel);
uploadNum = (TextView) findViewById(R.id.uploadSpeed);
uploadUnits = (TextView) findViewById(R.id.uploadUnits);
downloadText = (TextView) findViewById(R.id.downloadLabel);
downloadNum = (TextView) findViewById(R.id.downloadSpeed);
downloadUnits = (TextView) findViewById(R.id.downloadUnits);
latencyText = (TextView) findViewById(R.id.latencyLabel);
latencyNum = (TextView) findViewById(R.id.latencySpeed);
latencyUnits = (TextView) findViewById(R.id.latencyUnits);
jitterText = (TextView) findViewById(R.id.jitterLabel);
jitterNum = (TextView) findViewById(R.id.jitterSpeed);
jitterUnits = (TextView) findViewById(R.id.jitterUnits);
networkView = (TextView) findViewById(R.id.networkValue);
resultsView = findViewById(R.id.testResults);
slideOut = AnimationUtils.loadAnimation(this, R.anim.slideout);
slideOut.setAnimationListener(new SlideOutAnimationListener());
slideIn = AnimationUtils.loadAnimation(this, R.anim.slidein);
buttonMap = (Button) findViewById(R.id.mapButton);
buttonMap.setEnabled(false);
TelephonyManager manager = (TelephonyManager)mContext.getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();
/*
Toast.makeText(getApplicationContext(), "Network: " + carrierName,
Toast.LENGTH_LONG).show();*/
if (carrierName.equals("")){
carrierName="None";
}
networkView.setText(carrierName);
}
/**
* Check to see if a resource/asset file exists in
* /data/data/<package>/files directory
*/
private boolean FileExistsInActivity(String filename) {
FileInputStream fileinput = null;
try {
fileinput = openFileInput(filename);
fileinput.close();
return true;
} catch (IOException e) {
return false;
}
}
private void SetupIperf() {
CopyBinaryFile("android_iperf_2_0_2_3", "iperfT");
ExecCommandLine command = new ExecCommandLine("chmod 755 "
+ this.applicationFilesDir + "/iperfT", 60000, null, null,
null, uiServices);
try {
command.runCommand();
} catch (InterruptedException e) {
// do nothing
}
PrintAppDirectoryInfo();
}
private String GetApplicationFilesDir() {
File pathForAppFiles = getFilesDir();
String path = pathForAppFiles.getAbsolutePath();
return (path);
}
private void PrintAppDirectoryInfo() {
File pathForAppFiles = getFilesDir();
if (Constants.DEBUG)
Log.i("debug",
"Listing Files in " + pathForAppFiles.getAbsolutePath());
String[] fileList = pathForAppFiles.list();
File[] fileptrs = pathForAppFiles.listFiles();
for (int i = 0; i < fileList.length; i++) {
if (Constants.DEBUG)
Log.i("debug", "Filename " + i + ": " + fileList[i] + " size: "
+ fileptrs[i].length());
}
}
public void CopyBinaryFileIfNotExists(String inputFilename,
String outputFilename) {
try {
InputStream inputFile = this.assetManager.open(inputFilename);
try {
FileInputStream inputFileTest = openFileInput(outputFilename);
} catch (Exception e) { // file not found, so copy it to files
// directory
FileOutputStream outputFile = openFileOutput(outputFilename,
MODE_PRIVATE);
copy(inputFile, outputFile);
inputFile.close();
outputFile.flush();
outputFile.close();
}
} catch (IOException e) {
if (Constants.DEBUG)
Log.e("Asset File Error", e.getMessage());
}
}
public void CopyBinaryFile(String inputFilename, String outputFilename) {
try {
InputStream inputFile = this.assetManager.open(inputFilename);
FileOutputStream outputFile = openFileOutput(outputFilename,
MODE_PRIVATE);
copy(inputFile, outputFile);
inputFile.close();
outputFile.flush();
outputFile.close();
} catch (IOException e) {
if (Constants.DEBUG)
Log.e("Asset File Error", e.getMessage());
}
}
private static void copy(InputStream in, FileOutputStream out)
throws IOException {
byte[] b = new byte[4096];
int read;
try {
while ((read = in.read(b)) != -1) {
out.write(b, 0, read);
}
} catch (EOFException e) {
// just exit at end of file
}
}
private class StandardTestButtonListener implements OnClickListener {
public void onClick(View view) {
statistics = "";
ndtLocation.addGPSStatusListener();
if (!ndtLocation.gpsEnabled) {
createGpsDisabledAlert();
} else {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = connectivityManager
.getActiveNetworkInfo();
usingUploadButton = false;
context = view.getContext();
if (isNetworkActive()) {
WifiManager wifiManager = (WifiManager) getBaseContext()
.getSystemService(Context.WIFI_SERVICE);
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
WifiInfo winfo = wifiManager.getConnectionInfo();
bssid = winfo.getBSSID();
ssid = winfo.getSSID();
createWifiAlert();
} else {
if (wifiManager.isWifiEnabled()) {
createDisableWifiAlert();
} else {
finishStartButton();
}
}
} else {
finishStartButton();
}
}
}
}
public void finishApp() {
ndtLocation.stopListen();
ndtLocation.removeGPSStatusListener();
System.exit(0);
}
public void finishStartButton() {
//resultsView.setBackgroundColor(Color.WHITE);
resultsView.setBackgroundResource(R.drawable.datahawk1a);
ProgressBar loadingIcon = (ProgressBar) findViewById(R.id.loadingIcon);
loadingIcon.setVisibility(View.VISIBLE);
buttonStandardTest.setVisibility(View.INVISIBLE);
ToggleButton indoorOutdoor = (ToggleButton) findViewById(R.id.indoorOutdoorToggle);
indoorOutdoor.setEnabled(false);
topText.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.VISIBLE);
resetResults();
progressBar.setProgress(0);
textViewMain.setText("");
date = new Date();
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
networkInfo = null; // reset
networkInfo = connectivityManager.getActiveNetworkInfo();
mobileInfo = getMobileProperty();
telephoneInfo = getTelephoneProperty();
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(getString(R.string.nonofficial) + "\n");
stringBuilder.append(
getString(R.string.test_begins_at, date.toString() + "\n"))
.append("\n");
if (Prefs.getGPSoverride(context)) {
stringBuilder.append("GPS override set by Tester.\n");
}
ndtLocation.startListen();
uiServices.appendString(stringBuilder.toString(), UiServices.MAIN_VIEW);
uiServices.appendString(stringBuilder.toString(),
UiServices.SUMMARY_VIEW);
if (isNetworkActive()) {
stringBuilder.append("\nThe network is active\n");
} else {
stringBuilder.append("\nThe network is not active\n");
}
statistics += stringBuilder.toString();
stringBuilder = new StringBuilder().append("\n")
.append(getSystemProperty()).append("\n").append(mobileInfo)
.append("\n\n")
.append("\n").append(telephoneInfo).append("\n");
if (isNetworkActive()
&& networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
stringBuilder.append("\nWifi BSSID: " + bssid + "\nWifi SSID: "
+ ssid + "\n");
}
uiServices.appendString(stringBuilder.toString(), UiServices.MAIN_VIEW);
statistics += stringBuilder.toString();
CheckGpsOverride();
}
// Menu routines
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.about:
startActivity(new Intent(this, About.class));
return true;
}
return false;
}
private void startGPS() {
if (ndtLocation.bestProvider != null) {
ndtLocation.startListen();
}
}
public class AcquireGPS extends Thread {
private AndroidUiServices uiServices;
private LatLong gpsLatLong;
public AcquireGPS(AndroidUiServices uiServices) {
this.uiServices = uiServices;
this.gpsLatLong = new LatLong();
}
@Override
public void run() {
for (int i = 0; i < 3; i++) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
gpsLatLong.getLatitudeLongitude(gpsLatLong);
if (gpsLatLong.valid) {
uiServices.goodGpsSignal();
break;
}
}
if (!gpsLatLong.valid) {
ndtLocation.stopListen();
uiServices.noGpsSignal();
}
}
}
private void CheckGpsOverride() {
if (Prefs.getGPSoverride(context) == true) {
startTest(location);
} else {
AcquiringGPS();
}
}
private void AcquiringGPS() {
GPSdialog = ProgressDialog.show(context, "",
"Acquiring GPS information...", true);
Thread checkGPS = new Thread(new AcquireGPS(uiServices));
checkGPS.start();
}
public Boolean isNetworkMobile() {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
networkInfo = null; // reset
networkInfo = connectivityManager.getActiveNetworkInfo();
if ((networkInfo == null)
|| (networkInfo.getType() != ConnectivityManager.TYPE_MOBILE)) {
return (false);
} else {
return (true);
}
}
public Boolean isNetworkActive() {
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
networkInfo = null; // reset
networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo == null) {
return (false);
} else {
return (true);
}
}
public class WaitForMobileConnection extends Thread {
private AndroidUiServices uiServices;
public WaitForMobileConnection(AndroidUiServices uiServices) {
this.uiServices = uiServices;
}
@Override
public void run() {
for (int i = 0; i < 3; i++) {
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
}
if (isNetworkMobile()) {
break;
}
}
if (!isNetworkMobile()) {
uiServices.noMobileConnection();
} else {
uiServices.gotMobileConnection();
}
}
}
private void resultsNotSaved() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(
"Unable to save results to SD card. Please check your settings.")
.setCancelable(false)
.setPositiveButton("Okay",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void createGpsDisabledAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Your GPS is disabled! Would you like to enable it?")
.setCancelable(false)
.setPositiveButton("Enable GPS",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
showGpsOptions();
}
});
builder.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
finishApp();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void showGpsOptions() {
Intent gpsOptionsIntent = new Intent(
android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS);
startActivity(gpsOptionsIntent);
}
public void openWebURL(String inURL) {
Intent browse = new Intent(Intent.ACTION_VIEW, Uri.parse(inURL));
startActivity(browse);
}
private void createPrivacyPolicyAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(
"Have you read and agree to our terms and conditions?")
.setCancelable(false)
.setPositiveButton("Read",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
// Overwritten by privacyPolicyReadListener to
// prevent dialog closing
}
});
builder.setNegativeButton("Yes, I agree.",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
SharedPreferences legal = getSharedPreferences("Legal",
MODE_PRIVATE);
SharedPreferences.Editor legalEditor = legal.edit();
legalEditor.putBoolean("privacyPolicyAccepted", true);
legalEditor.commit();
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
Button readButton = alert.getButton(DialogInterface.BUTTON_POSITIVE);
readButton.setOnClickListener(new privacyPolicyReadListener(alert));
}
class privacyPolicyReadListener implements OnClickListener {
private final AlertDialog dialog;
public privacyPolicyReadListener(AlertDialog dialog) {
this.dialog = dialog;
}
@Override
public void onClick(View v) {
openWebURL(Constants.privacyPolicyURL);
}
}
private void createWifiAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(
"You're connected to Wifi!\n Would you like to use Wifi?")
.setCancelable(false)
.setPositiveButton("Wifi",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
uiServices.printWifiID();
finishStartButton();
}
});
builder.setNegativeButton("Cancel",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
private void createDisableWifiAlert() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(
"Wifi is turned on, but you may not be logged in. Please log into your Wifi network or turn it off before running CalSPEED.")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
AlertDialog alert = builder.create();
alert.show();
}
public void disableWifi() {
WifiManager wifiManager = (WifiManager) getBaseContext()
.getSystemService(Context.WIFI_SERVICE);
if (Constants.CHECK_FOR_WIFI) {
if (wifiManager.isWifiEnabled()) {
textViewMain.append("\nDisabling Wifi...\n");
wifiManager.setWifiEnabled(false);
}
if (!wifiManager.isWifiEnabled()) {
textViewMain.append("\nWifi is disabled.\n");
}
}
}
/**
* Gets the system related properties.
*
* @return a string describing the OS and Java environment
*/
private String getSystemProperty() {
String osName, osArch, osVer, javaVer, javaVendor;
osName = System.getProperty("os.name");
osArch = System.getProperty("os.arch");
osVer = System.getProperty("os.version");
javaVer = System.getProperty("java.version");
javaVendor = System.getProperty("java.vendor");
StringBuilder sb = new StringBuilder().append("\n")
.append(getString(R.string.os_line, osName, osArch, osVer))
.append("\n")
.append(getString(R.string.java_line, javaVer, javaVendor));
return sb.toString();
}
public void updateLatitudeLongitude() {
if (ndtLocation.location != null) {
myLatLong.setLatitudeLongitude(
(Double) ndtLocation.location.getLatitude(),
(Double) ndtLocation.location.getLongitude(), true);
} else {
myLatLong.setLatitudeLongitude(0.0, 0.0, false);
}
}
/**
* Gets the mobile device related properties.
*
* @return a string about location, network type (MOBILE or WIFI)
*/
private String getMobileProperty() {
StringBuilder sb = new StringBuilder();
if (ndtLocation.gpsEnabled && ndtLocation.location != null) {
LatLong newLatLong = new LatLong();
newLatLong.getLatitudeLongitude(newLatLong);
if (newLatLong.valid) {
if (Constants.DEBUG)
Log.v("debug", ndtLocation.location.toString());
sb.append(
getString(R.string.latitude_result, newLatLong.Latitude))
.append("\n")
.append(getString(R.string.longitude_result,
newLatLong.Longitude));
}
} else {
sb.append("").append(getString(R.string.no_GPS_info, ""));
}
ConnectivityManager connectivityManager = (ConnectivityManager) context
.getSystemService(Context.CONNECTIVITY_SERVICE);
networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo != null) {
if (Constants.DEBUG)
Log.v("debug", networkInfo.toString());
sb.append("\n")
.append(getString(R.string.network_type_indicator,
networkInfo.getTypeName())).append("\n");
}
return sb.toString();
}
/**
* Gets the mobile provider related properties.
*
* @return a string about network providers and network type
*/
@SuppressLint("NewApi")
private String getTelephoneProperty() {
StringBuilder sb = new StringBuilder();
this.telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
providerName = telephonyManager.getSimOperatorName();
String deviceModel = Build.MODEL;
String manufacturer = Build.MANUFACTURER;
String APIVersion = Build.VERSION.RELEASE;
int SDKVersion = Build.VERSION.SDK_INT;
if (providerName == null) {
providerName = "Unknown";
}
if (Constants.DEBUG)
Log.v("debug", providerName);
sb.append("\n").append(
getString(R.string.network_provider, providerName));
Provider = sb.substring(18, sb.length());
operatorName = telephonyManager.getNetworkOperatorName();
if (Provider.equalsIgnoreCase("")) {
Provider = operatorName;
}
getPorts();
if (operatorName == null) {
operatorName = "Unknown";
}
if (Constants.DEBUG)
Log.v("debug", operatorName);
sb.append("\n").append(
getString(R.string.network_operator, operatorName));
if (telephonyManager.isNetworkRoaming()) {
sb.append("\n").append("Network is Roaming.");
} else {
sb.append("\n").append("Network is Not Roaming.");
}
ToggleButton indoorOutdoor = (ToggleButton) findViewById(R.id.indoorOutdoorToggle);
if (indoorOutdoor.isChecked()) {
sb.append("\nThis device was: " + indoorOutdoor.getTextOn());
} else {
sb.append("\nThis device was " + indoorOutdoor.getTextOff());
}
String connectionType = getConnectionType();
if (Constants.DEBUG)
Log.v("debug", connectionType);
sb = printInfoLine(R.string.connection_type, connectionType, sb);
sb.append("\n").append("Phone Model: " + deviceModel);
sb.append("\n").append("Phone Manufacturer: " + manufacturer);
sb.append("\n").append("API Version: " + APIVersion);
sb.append("\n").append("SDK Version: " + SDKVersion);
return sb.toString();
}
private void getPorts() {
if (Provider.equalsIgnoreCase("at&t")) {
TCPPort = Constants.ports[0];
UDPPort = Constants.ports[1];
} else if (Provider.equalsIgnoreCase("sprint")) {
TCPPort = Constants.ports[2];
UDPPort = Constants.ports[3];
} else if (Provider.equalsIgnoreCase("t-mobile")) {
TCPPort = Constants.ports[4];
UDPPort = Constants.ports[5];
} else if (Provider.equalsIgnoreCase("verizon")) {
TCPPort = Constants.ports[6];
UDPPort = Constants.ports[7];
} else {
TCPPort = Constants.ports[8];
UDPPort = Constants.ports[9];
}
}
private StringBuilder printInfoLine(int label, String variable,
StringBuilder buffer) {
if (Constants.DEBUG)
Log.v("debug", variable);
buffer.append("\n").append(getString(label, variable));
return buffer;
}
private String getConnectionType() {
Integer intcon = 0;
String type = "UNKNOWN";
final int connection = this.telephonyManager.getNetworkType();
for (int i = 0; i < Constants.NETWORK_TYPE.length; i++) {
intcon = Integer.valueOf(Constants.NETWORK_TYPE[i][0]);
if (intcon == connection) {
type = Constants.NETWORK_TYPE[i][1];
break;
}
}
return type;
}
/**
* Gets the type of the active network, networkInfo should be initialized
* before called this function.
*
*/
private String getNetworkType() {
if (networkInfo != null) {
int networkType = networkInfo.getType();
switch (networkType) {
case ConnectivityManager.TYPE_MOBILE:
return Constants.NETWORK_MOBILE;
case ConnectivityManager.TYPE_WIFI:
return Constants.NETWORK_WIFI;
default:
return Constants.NETWORK_UNKNOWN;
}
} else {
return Constants.NETWORK_UNKNOWN;
}
}
public class LatLong {
public Double Latitude;
public Double Longitude;
public Boolean valid;
public LatLong() {
this.Latitude = 0.0;
this.Longitude = 0.0;
this.valid = false;
}
public synchronized void setLatitudeLongitude(Double latitude,
Double longitude, Boolean valid) {
myLatLong.Latitude = latitude;
myLatLong.Longitude = longitude;
myLatLong.valid = valid;
}
public synchronized Boolean getLatitudeLongitude(LatLong structLatLong) {
structLatLong.Latitude = myLatLong.Latitude;
structLatLong.Longitude = myLatLong.Longitude;
structLatLong.valid = myLatLong.valid;
return (structLatLong.valid);
}
}
public void updateLatLongDisplay() {
LatLong newLatLong = new LatLong();
newLatLong.getLatitudeLongitude(newLatLong);
if (newLatLong.valid) {
newLat = newLatLong.Latitude.toString();
newLong = newLatLong.Longitude.toString();
//Show lat/lon
if (newLat.length() > 11)
newLat = newLat.substring(0, 10);
if (newLong.length() > 11)
newLong = newLong.substring(0, 10);
DecimalFormat df = new DecimalFormat("0.00000");
buttonMap.setText("("+df.format(Double.parseDouble(newLat))+", "+df.format(Double.parseDouble(newLong))+")");
//buttonMap.setText("("+newLat+", "+newLong+")");
buttonMap.setEnabled(true);
buttonMap.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Uri uri = Uri.parse("http://filebox.vt.edu/users/sharni/DataHawkMap/MapWithAWS.html?"+newLat+"&"+newLong);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
}
}
private void setupUploadTimer() {
smoothUpload = 0.0f;
UploadTimer = new Timer();
uploadTask = new TimerTask() {
@Override
public void run() {
if (smoothUpload != 0.0f) {
uiServices.updateUploadNumber();
}
return;
}
};
}
private void setupDownloadTimer() {
smoothDownload = 0.0f;
DownloadTimer = new Timer();
downloadTask = new TimerTask() {
@Override
public void run() {
if (smoothDownload != 0.0f) {
uiServices.updateDownloadNumber();
}
return;
}
};
}
private Float LowPassFilter(Float newValue, Float smoothValue) {
Float newSmooth;
newSmooth = smoothValue + Constants.SMOOTH * (newValue - smoothValue);
return (newSmooth);
}
public class UiHandler extends Handler {
public UiHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
String results;
switch (message.what) {
case Constants.THREAD_MAIN_APPEND:
textViewMain.append(message.obj.toString());
break;
case Constants.THREAD_STAT_APPEND:
statistics += message.obj.toString();
break;
case Constants.THREAD_LAT_LONG_APPEND:
textViewMain.append("\nLatitude: " + startLatitude);
textViewMain.append("\nLongitude: " + startLongitude + "\n");
break;
case Constants.THREAD_BEGIN_TEST:
if (Constants.DEBUG)
Log.v("debug", "Begin the test");
progress = 0;
buttonStandardTest.setEnabled(false);
progressBar.setProgress(progress);
progressBar.setMax(Constants.TEST_STEPS);
if (wakeLock.isHeld() == false) {
wakeLock.acquire();
if (Constants.DEBUG)
Log.v("debug", "wakeLock acquired");
}
break;
case Constants.THREAD_END_TEST:
if (Constants.DEBUG)
Log.v("debug", "End the test");
textViewMain.append("\n-----End of Test------\n");
statistics += "\n";
buttonStandardTest.setEnabled(true);
if (wakeLock.isHeld()) {
wakeLock.release();
if (Constants.DEBUG)
Log.v("debug", "wakeLock released");
}
Button toggleButton = (ToggleButton) findViewById(R.id.indoorOutdoorToggle);
toggleButton.setEnabled(true);
ProgressBar loadingIcon = (ProgressBar) findViewById(R.id.loadingIcon);
loadingIcon.setVisibility(ProgressBar.INVISIBLE);
buttonStandardTest.setText("Test Again");
buttonStandardTest.setVisibility(Button.VISIBLE);
TextView upV = ((TextView) ((Activity) Calspeed.getContext()).findViewById(R.id.uploadSpeed));
TextView downV = ((TextView) ((Activity) Calspeed.getContext()).findViewById(R.id.downloadSpeed));
TextView delayV = ((TextView) ((Activity) Calspeed.getContext()).findViewById(R.id.latencySpeed));
TextView jitterV = ((TextView) ((Activity) Calspeed.getContext()).findViewById(R.id.jitterSpeed));
String up = upV.getText().toString();
String down = downV.getText().toString();
String delay = delayV.getText().toString();
String jitter = jitterV.getText().toString();
float upColor=(float) Math.pow(967.98*(Float.parseFloat(up)),-0.417);
upColor=checkColor(upColor);
float downColor=(float) Math.pow(967.98*(Float.parseFloat(down)),-0.417);
downColor=checkColor(downColor);
float delayColor=(float)(0.3857*(Float.parseFloat(delay))-5.8571);
delayColor=checkColor(delayColor);
float jitterColor=(float)(2.25*(Float.parseFloat(jitter))-15.5);
delayColor=checkColor(delayColor);
upV.setTextColor(Color.HSVToColor(new float[]{ upColor, 100, 100 }));
downV.setTextColor(Color.HSVToColor(new float[]{ downColor, 100, 100 }));
delayV.setTextColor(Color.HSVToColor(new float[]{ delayColor, 100, 100 }));
jitterV.setTextColor(Color.HSVToColor(new float[]{ jitterColor, 100, 100 }));
break;
case Constants.THREAD_TEST_INTERRUPTED:
if (Constants.DEBUG)
Log.v("debug", "End the test");
textViewMain.append("\n-----End of Test------\n");
statistics += "\n";
buttonStandardTest.setEnabled(true);
if (wakeLock.isHeld()) {
wakeLock.release();
if (Constants.DEBUG)
Log.v("debug", "wakeLock released");
}
break;
case Constants.THREAD_ADD_PROGRESS:
Integer increment = message.getData().getInt("increment");
progressBar.setProgress(progressBar.getProgress() + increment);
break;
case Constants.THREAD_SET_PROCESS_HANDLE:
break;
case Constants.THREAD_CLEAR_PROCESS_HANDLE:
break;
case Constants.THREAD_GOOD_GPS_SIGNAL:
GPSdialog.dismiss();
startTest(location);
break;
case Constants.THREAD_NO_GPS_SIGNAL:
GPSdialog.dismiss();
break;
case Constants.THREAD_NO_MOBILE_CONNECTION:
Mobiledialog.dismiss();
break;
case Constants.THREAD_GOT_MOBILE_CONNECTION:
Mobiledialog.dismiss();
finishStartButton();
break;
case Constants.THREAD_UPDATE_LATLONG:
LatLong newLatLong = new LatLong();
newLatLong.getLatitudeLongitude(newLatLong);
if (newLatLong.valid) {
String newLat = newLatLong.Latitude.toString();
String newLong = newLatLong.Longitude.toString();
if (newLat.length() > 11)
newLat = newLat.substring(0, 10);
if (newLong.length() > 11)
newLong = newLong.substring(0, 10);
}
break;
case Constants.THREAD_RESULTS_SAVED:
break;
case Constants.THREAD_RESULTS_NOT_SAVED:
resultsNotSaved();
break;
case Constants.THREAD_RESULTS_UPLOADED:
break;
case Constants.THREAD_RESULTS_NOT_UPLOADED:
break;
case Constants.THREAD_RESULTS_ATTEMP_UPLOAD:
break;
case Constants.THREAD_SET_STATUS_TEXT:
results = message.getData().getString("text");
topText.setText(results);
break;
case Constants.THREAD_PRINT_BSSID_SSID:
textViewMain.append("Wifi BSSID: " + bssid + "\nWifi SSID: "
+ ssid + "\n");
statistics += "Wifi BSSID: " + bssid + "\nWifi SSID: " + ssid
+ "\n";
break;
case Constants.THREAD_WRITE_UPLOAD_DATA:
if (message.getData().getBoolean("redText")) {
uploadText.setTextColor(Color.RED);
} else {
uploadText.setTextColor(Color.BLACK);
}
if (message.getData().getBoolean("numbersHidden")) {
uploadNum.setVisibility(View.GONE);
uploadUnits.setVisibility(View.GONE);
} else {
uploadNum.setVisibility(View.VISIBLE);
uploadUnits.setVisibility(View.VISIBLE);
finalUpload = removeDecimalPlaces(message.getData()
.getString("number"));
smoothUpload = LowPassFilter(Float.valueOf(finalUpload),
smoothUpload);
}
uploadText.setText(message.getData().getString("text"));
break;
case Constants.THREAD_WRITE_DOWNLOAD_DATA:
if (message.getData().getBoolean("redText")) {
downloadText.setTextColor(Color.RED);
} else {
downloadText.setTextColor(Color.BLACK);
}
if (message.getData().getBoolean("numbersHidden")) {
downloadNum.setVisibility(View.GONE);
downloadUnits.setVisibility(View.GONE);
} else {
downloadNum.setVisibility(View.VISIBLE);
downloadUnits.setVisibility(View.VISIBLE);
finalDownload = removeDecimalPlaces(message.getData()
.getString("number"));
smoothDownload = LowPassFilter(
Float.valueOf(finalDownload), smoothDownload);
}
downloadText.setText(message.getData().getString("text"));
break;
case Constants.THREAD_WRITE_LATENCY_DATA:
if (message.getData().getBoolean("redText")) {
latencyText.setTextColor(Color.RED);
} else {
latencyText.setTextColor(Color.BLACK);
}
if (message.getData().getBoolean("numbersHidden")) {
latencyNum.setVisibility(View.GONE);
latencyUnits.setVisibility(View.GONE);
} else {
latencyNum.setVisibility(View.VISIBLE);
latencyUnits.setVisibility(View.VISIBLE);
}
latencyText.setText(message.getData().getString("text"));
latencyNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
break;
case Constants.THREAD_WRITE_JITTER_DATA:
if (message.getData().getBoolean("redText")) {
jitterText.setTextColor(Color.RED);
} else {
jitterText.setTextColor(Color.BLACK);
}
if (message.getData().getBoolean("numbersHidden")) {
jitterNum.setVisibility(View.GONE);
jitterUnits.setVisibility(View.GONE);
} else {
jitterNum.setVisibility(View.VISIBLE);
jitterUnits.setVisibility(View.VISIBLE);
}
jitterText.setText(message.getData().getString("text"));
jitterNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
break;
case Constants.FINISH_PHASE_1:
resultsView.startAnimation(slideOut);
resultsView.setVisibility(View.INVISIBLE);
break;
case Constants.THREAD_START_UPLOAD_TIMER:
smoothUpload = 0.0f;
UploadTimer.scheduleAtFixedRate(uploadTask, 0, 500);
break;
case Constants.THREAD_STOP_UPLOAD_TIMER:
UploadTimer.cancel();
UploadTimer.purge();
UploadTimer = null;
setupUploadTimer();
break;
case Constants.THREAD_UPDATE_UPLOAD_NUMBER:
if (Constants.UploadDebug)
Log.v("debug", "in handler update Upload Timer number="
+ smoothUpload.toString());
if (smoothUpload != 0.0f) {
uploadNum.setText(removeDecimalPlaces(smoothUpload
.toString()));
}
break;
case Constants.THREAD_SET_UPLOAD_NUMBER:
String num2 = message.getData().getString("number");
if (Constants.UploadDebug)
Log.v("debug", "in handler set upload number number="
+ num2);
uploadNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
break;
case Constants.THREAD_SET_UPLOAD_NUMBER_STOP_TIMER:
UploadTimer.cancel();
UploadTimer.purge();
UploadTimer = null;
String num1 = message.getData().getString("number");
if (Constants.UploadDebug)
Log.v("debug", "in handler stop Upload Timer number="
+ num1);
uploadNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
setupUploadTimer();
break;
case Constants.THREAD_START_DOWNLOAD_TIMER:
smoothDownload = 0.0f;
DownloadTimer.scheduleAtFixedRate(downloadTask, 0, 500);
break;
case Constants.THREAD_STOP_DOWNLOAD_TIMER:
DownloadTimer.cancel();
DownloadTimer.purge();
setupDownloadTimer();
break;
case Constants.THREAD_UPDATE_DOWNLOAD_NUMBER:
if (smoothDownload != 0.0f) {
downloadNum.setText(removeDecimalPlaces(smoothDownload
.toString()));
}
break;
case Constants.THREAD_SET_DOWNLOAD_NUMBER:
downloadNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
break;
case Constants.THREAD_SET_DOWNLOAD_NUMBER_STOP_TIMER:
DownloadTimer.cancel();
DownloadTimer.purge();
DownloadTimer = null;
downloadNum.setText(removeDecimalPlaces(message.getData()
.getString("number")));
setupDownloadTimer();
break;
default:
break;
}
}
}
private float checkColor(float col){
if (col>240) col=240;
if (col<0) col=0;
return col;
}
private void startTest(String location) {
String s1 = Constants.SERVER_HOST[0];
String s2 = Constants.SERVER_HOST[1];
Thread netWorker = new Thread(new StandardTest((Calspeed) context, s1,
s2, uiServices, getNetworkType(), assetManager, ndtLocation,
applicationFilesDir, DeviceId, date, startLongitude,
startLatitude, statistics, location, TCPPort, UDPPort));
netWorker.start();
}
private void resetResults() {
uiServices.setResults(Constants.THREAD_WRITE_UPLOAD_DATA,
getResources().getString(R.string.uploadLabel), "0", false, false);
uiServices.setUploadNumber("0");
uiServices.setResults(Constants.THREAD_WRITE_DOWNLOAD_DATA,
getResources().getString(R.string.downloadLabel), "0", false, false);
uiServices.setDownloadNumber("0");
uiServices.setResults(Constants.THREAD_WRITE_LATENCY_DATA, getResources().getString(R.string.latencyLabel),
"0", false, false);
uiServices.setResults(Constants.THREAD_WRITE_JITTER_DATA,
getResources().getString(R.string.jitterLabel), "0", false, false);
}
private String removeDecimalPlaces(String value) {
try {
if (Constants.DEBUG)
Log.v("Debug", "In removeDecimalPlaces value=" + value);
Long numInt = Math.round(Double.parseDouble(value));
if (Constants.DEBUG)
Log.v("Debug", numInt.toString() + "");
return numInt.toString() + "";
} catch (Exception e) {
if (Constants.DEBUG)
Log.v("Debug", "removeDecimalPlaces Exception");
return ("0");
}
}
private class SlideOutAnimationListener implements AnimationListener {
@Override
public void onAnimationEnd(Animation arg0) {
resetResults();
resultsView.setVisibility(View.VISIBLE);
resultsView.startAnimation(slideIn);
}
@Override
public void onAnimationRepeat(Animation arg0) {
// Nothing
}
@Override
public void onAnimationStart(Animation arg0) {
// Nothing
}
}
}
| {
"content_hash": "71bcb17d848916542e2edc98bb1cd921",
"timestamp": "",
"source": "github",
"line_count": 1533,
"max_line_length": 129,
"avg_line_length": 28.596868884540118,
"alnum_prop": 0.7046693583339037,
"repo_name": "nikakhov/DataHawk",
"id": "78cd08255fe931850150adad555fe2b7a559cdef",
"size": "43839",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/gov/va/cgit/vaspeed/android/Calspeed.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "166606"
}
],
"symlink_target": ""
} |
package com.artech.prototype2.saver.dao.impl;
import com.artech.prototype2.saver.dao.AbstractDao;
import com.artech.prototype2.saver.entity.FourgramRuVarOne;
/**
* Created by User on 14.12.2014.
*/
public class FourgramRuVarOneDaoImpl extends AbstractDao<Integer, FourgramRuVarOne> {
}
| {
"content_hash": "cee1f625edff85adbb137afcaccadde4",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 85,
"avg_line_length": 29,
"alnum_prop": 0.8,
"repo_name": "mirabon/PrototypeV2",
"id": "21a19555b38714a26ef54b5b4ebe74dc5a762e2f",
"size": "290",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Saver/src/main/java/com/artech/prototype2/saver/dao/impl/FourgramRuVarOneDaoImpl.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "29"
},
{
"name": "Java",
"bytes": "226776"
}
],
"symlink_target": ""
} |
@interface RCDUpdateNameViewController()<UIViewControllerRestoration>
@end
@implementation RCDUpdateNameViewController
+ (UIViewController *)viewControllerWithRestorationIdentifierPath:(NSArray *)identifierComponents
coder:(NSCoder *)coder
{
UIViewController *vc = [self new];
return vc;
}
- (void)encodeRestorableStateWithCoder:(NSCoder *)coder
{
[super encodeRestorableStateWithCoder:coder];
}
- (void)decodeRestorableStateWithCoder:(NSCoder *)coder
{
[super decodeRestorableStateWithCoder:coder];
}
- (id)init
{
if ((self = [super init]))
{
// Custom initialization
self.restorationIdentifier = NSStringFromClass([self class]);
self.restorationClass = [self class];
}
return self;
}
-(void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithHexString:@"0195ff" alpha:1.0f]];
[self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(backBarButtonItemClicked:)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"保存" style:UIBarButtonItemStylePlain target:self action:@selector(rightBarButtonItemClicked:)];
self.tfName.text = self.displayText;
}
-(void) backBarButtonItemClicked:(id) sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
-(void) rightBarButtonItemClicked:(id) sender
{
//保存讨论组名称
if(self.tfName.text.length == 0){
NSString *title = @"提示";
NSString *message = @"请输入讨论组名称!";
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:title
message:message
preferredStyle:UIAlertControllerStyleActionSheet];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"知道了" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}];
[alertController addAction:cancelAction];
[self presentViewController:alertController animated:YES completion:^{
//
}];
return;
}
//回传值
if (self.setDisplayTextCompletion) {
self.setDisplayTextCompletion(self.tfName.text);
}
//保存设置
[[RCIMClient sharedRCIMClient] setDiscussionName:self.targetId name:self.tfName.text success:^{
} error:^(RCErrorCode status) {
}];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
//收起键盘
[self.tfName resignFirstResponder];
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 12.0f;
}
@end
| {
"content_hash": "b37066bcf9270e052238238dbc75d4db",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 180,
"avg_line_length": 29.761904761904763,
"alnum_prop": 0.66144,
"repo_name": "birdcopy/Birdcopy-IOS-APP",
"id": "3b97a38c4f5c5296e696d8e792510bea7eb059ed",
"size": "3448",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Class/IM/RCDUpdateNameViewController.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "513161"
},
{
"name": "C++",
"bytes": "476"
},
{
"name": "Objective-C",
"bytes": "2890543"
},
{
"name": "Ruby",
"bytes": "247"
}
],
"symlink_target": ""
} |
var chai = require('chai');
var should = chai.should();
var location = require('../../../../lib/model/response/vehicle/location');
describe('location model test', function () {
it('should create model', function (done) {
var locationModel = new location.Location('wielkopolskie', 'PL');
should.exist(locationModel);
locationModel.state.should.be.equal('wielkopolskie');
locationModel.country.should.be.equal('PL');
done();
});
it('should create model by builder', function (done) {
var locationModel = new location.LocationBuilder()
.withState('wielkopolskie')
.withCountry('PL')
.build();
should.exist(locationModel);
locationModel.state.should.be.equal('wielkopolskie');
locationModel.country.should.be.equal('PL');
done();
});
}); | {
"content_hash": "0e34b2c3fe1280cffcb72dedb4ae13fb",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 26.06451612903226,
"alnum_prop": 0.6633663366336634,
"repo_name": "togusafish/vehicle-history-_-npm-vehicle-history-model",
"id": "74a24eef83c1a3d58d9bc6734735a5eb6205e7d7",
"size": "808",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/model/response/vehicle/locationTest.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "170128"
},
{
"name": "Shell",
"bytes": "755"
}
],
"symlink_target": ""
} |
package org.apache.onami.persist;
import de.bechte.junit.runners.context.HierarchicalContextRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
/**
* Test for {@link ResourceLocalTransactionFacadeFactory}.
*/
@RunWith(HierarchicalContextRunner.class)
public class ResourceLocalTransactionFacadeProviderTest {
private ResourceLocalTransactionFacadeFactory sut;
private EntityManagerProvider emProvider;
private EntityManager em;
private EntityTransaction txn;
@Before
public void setUp() {
// input
emProvider = mock(EntityManagerProvider.class);
// subject under test
sut = new ResourceLocalTransactionFacadeFactory(emProvider);
// environment
em = mock(EntityManager.class);
doReturn(em).when(emProvider)
.get();
txn = mock(EntityTransaction.class);
doReturn(txn).when(em)
.getTransaction();
}
public class InnerTransactionTest {
private TransactionFacade sut;
@Before
public void setUp() {
doReturn(true).when(txn)
.isActive();
sut = ResourceLocalTransactionFacadeProviderTest.this.sut.createTransactionFacade();
}
@Test
public void beginShouldDoNothing() {
sut.begin();
verify(txn, never()).begin();
}
@Test
public void commitShouldDoNothing() {
sut.commit();
verify(txn, never()).commit();
}
@Test
public void rollbackShouldSetRollbackOnlyFlag() {
sut.rollback();
verify(txn).setRollbackOnly();
}
}
public class OuterTransactionTest {
private TransactionFacade sut;
@Before
public void setUp() {
doReturn(false).when(txn)
.isActive();
sut = ResourceLocalTransactionFacadeProviderTest.this.sut.createTransactionFacade();
}
@Test
public void beginShouldBeginTransaction() {
sut.begin();
verify(txn).begin();
}
@Test
public void commitShouldCommitTransaction() {
sut.commit();
verify(txn).commit();
}
@Test
public void commitShouldRollbackTransactionIfMarkedAsRollbackOnly() {
doReturn(true).when(txn)
.getRollbackOnly();
sut.commit();
verify(txn).rollback();
}
@Test
public void rollbackShouldRollbackTransaction() {
sut.rollback();
verify(txn).rollback();
}
}
}
| {
"content_hash": "afcb2bb0baaa61a79c63a1862ef0c9e9",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 90,
"avg_line_length": 20.677165354330707,
"alnum_prop": 0.6835491241431836,
"repo_name": "tocktix/onami-persist",
"id": "0d17f2b7b91e57ab1f8bbe2982a7f2db8c51ef45",
"size": "3433",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/org/apache/onami/persist/ResourceLocalTransactionFacadeProviderTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "307803"
}
],
"symlink_target": ""
} |
#import "GlobalNotificationSettingsViewController.h"
#import "RageShakeManager.h"
@implementation GlobalNotificationSettingsViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// Setup `MXKRoomMemberListViewController` properties
self.rageShakeManager = [RageShakeManager sharedManager];
}
@end
| {
"content_hash": "952634dde26e349c75537a4044b817fa",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 23.529411764705884,
"alnum_prop": 0.7725,
"repo_name": "matrix-org/matrix-ios-console",
"id": "e1b65b61077ea0ec2cfa6819715ad577459aba09",
"size": "970",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "matrixConsole/ViewController/GlobalNotificationSettingsViewController.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "208478"
},
{
"name": "Objective-C++",
"bytes": "946"
},
{
"name": "Ruby",
"bytes": "1004"
},
{
"name": "Shell",
"bytes": "3486"
}
],
"symlink_target": ""
} |
/**
* @file lv_mask.h
*
*/
#ifndef LV_MASK_H
#define LV_MASK_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include <stdbool.h>
#include "../lv_misc/lv_area.h"
#include "../lv_misc/lv_color.h"
/*********************
* DEFINES
*********************/
#define LV_MASK_ID_INV (-1)
#define _LV_MASK_MAX_NUM 16
/**********************
* TYPEDEFS
**********************/
enum {
LV_DRAW_MASK_RES_TRANSP,
LV_DRAW_MASK_RES_FULL_COVER,
LV_DRAW_MASK_RES_CHANGED,
LV_DRAW_MASK_RES_UNKNOWN
};
typedef uint8_t lv_draw_mask_res_t;
enum {
LV_DRAW_MASK_TYPE_LINE,
LV_DRAW_MASK_TYPE_ANGLE,
LV_DRAW_MASK_TYPE_RADIUS,
LV_DRAW_MASK_TYPE_FADE,
LV_DRAW_MASK_TYPE_MAP,
};
typedef uint8_t lv_draw_mask_type_t;
enum {
LV_DRAW_MASK_LINE_SIDE_LEFT = 0,
LV_DRAW_MASK_LINE_SIDE_RIGHT,
LV_DRAW_MASK_LINE_SIDE_TOP,
LV_DRAW_MASK_LINE_SIDE_BOTTOM,
};
/**
* A common callback type for every mask type.
* Used internally by the library.
*/
typedef lv_draw_mask_res_t (*lv_draw_mask_xcb_t)(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
lv_coord_t len,
void * p);
typedef uint8_t lv_draw_mask_line_side_t;
typedef struct {
lv_draw_mask_xcb_t cb;
lv_draw_mask_type_t type;
} lv_draw_mask_common_dsc_t;
typedef struct {
/*The first element must be the common descriptor*/
lv_draw_mask_common_dsc_t dsc;
struct {
/*First point */
lv_point_t p1;
/*Second point*/
lv_point_t p2;
/*Which side to keep?*/
lv_draw_mask_line_side_t side : 2;
} cfg;
/*A point of the line*/
lv_point_t origo;
/* X / (1024*Y) steepness (X is 0..1023 range). What is the change of X in 1024 Y?*/
int32_t xy_steep;
/* Y / (1024*X) steepness (Y is 0..1023 range). What is the change of Y in 1024 X?*/
int32_t yx_steep;
/*Helper which stores yx_steep for flat lines and xy_steep for steep (non flat) lines */
int32_t steep;
/*Steepness in 1 px in 0..255 range. Used only by flat lines. */
int32_t spx;
/*1: It's a flat line? (Near to horizontal)*/
uint8_t flat : 1;
/* Invert the mask. The default is: Keep the left part.
* It is used to select left/right/top/bottom*/
uint8_t inv: 1;
} lv_draw_mask_line_param_t;
typedef struct {
/*The first element must be the common descriptor*/
lv_draw_mask_common_dsc_t dsc;
struct {
lv_point_t vertex_p;
lv_coord_t start_angle;
lv_coord_t end_angle;
} cfg;
lv_draw_mask_line_param_t start_line;
lv_draw_mask_line_param_t end_line;
uint16_t delta_deg;
} lv_draw_mask_angle_param_t;
typedef struct {
/*The first element must be the common descriptor*/
lv_draw_mask_common_dsc_t dsc;
struct {
lv_area_t rect;
lv_coord_t radius;
/* Invert the mask. 0: Keep the pixels inside.*/
uint8_t outer: 1;
} cfg;
int32_t y_prev;
lv_sqrt_res_t y_prev_x;
} lv_draw_mask_radius_param_t;
typedef struct {
/*The first element must be the common descriptor*/
lv_draw_mask_common_dsc_t dsc;
struct {
lv_area_t coords;
lv_coord_t y_top;
lv_coord_t y_bottom;
lv_opa_t opa_top;
lv_opa_t opa_bottom;
} cfg;
} lv_draw_mask_fade_param_t;
typedef struct _lv_draw_mask_map_param_t {
/*The first element must be the common descriptor*/
lv_draw_mask_common_dsc_t dsc;
struct {
lv_area_t coords;
const lv_opa_t * map;
} cfg;
} lv_draw_mask_map_param_t;
typedef struct {
void * param;
void * custom_id;
} _lv_draw_mask_saved_t;
typedef _lv_draw_mask_saved_t _lv_draw_mask_saved_arr_t[_LV_MASK_MAX_NUM];
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Add a draw mask. Everything drawn after it (until removing the mask) will be affected by the mask.
* @param param an initialized mask parameter. Only the pointer is saved.
* @param custom_id a custom pointer to identify the mask. Used in `lv_draw_mask_remove_custom`.
* @return the an integer, the ID of the mask. Can be used in `lv_draw_mask_remove_id`.
*/
int16_t lv_draw_mask_add(void * param, void * custom_id);
//! @cond Doxygen_Suppress
/**
* Apply the added buffers on a line. Used internally by the library's drawing routines.
* @param mask_buf store the result mask here. Has to be `len` byte long. Should be initialized with `0xFF`.
* @param abs_x absolute X coordinate where the line to calculate start
* @param abs_y absolute Y coordinate where the line to calculate start
* @param len length of the line to calculate (in pixel count)
* @return One of these values:
* - `LV_DRAW_MASK_RES_FULL_TRANSP`: the whole line is transparent. `mask_buf` is not set to zero
* - `LV_DRAW_MASK_RES_FULL_COVER`: the whole line is fully visible. `mask_buf` is unchanged
* - `LV_DRAW_MASK_RES_CHANGED`: `mask_buf` has changed, it shows the desired opacity of each pixel in the given line
*/
LV_ATTRIBUTE_FAST_MEM lv_draw_mask_res_t lv_draw_mask_apply(lv_opa_t * mask_buf, lv_coord_t abs_x, lv_coord_t abs_y,
lv_coord_t len);
//! @endcond
/**
* Remove a mask with a given ID
* @param id the ID of the mask. Returned by `lv_draw_mask_add`
* @return the parameter of the removed mask.
* If more masks have `custom_id` ID then the last mask's parameter will be returned
*/
void * lv_draw_mask_remove_id(int16_t id);
/**
* Remove all mask with a given custom ID
* @param custom_id a pointer used in `lv_draw_mask_add`
* @return return the parameter of the removed mask.
* If more masks have `custom_id` ID then the last mask's parameter will be returned
*/
void * lv_draw_mask_remove_custom(void * custom_id);
//! @cond Doxygen_Suppress
/**
* Count the currently added masks
* @return number of active masks
*/
LV_ATTRIBUTE_FAST_MEM uint8_t lv_draw_mask_get_cnt(void);
//! @endcond
/**
*Initialize a line mask from two points.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
* @param p1x X coordinate of the first point of the line
* @param p1y Y coordinate of the first point of the line
* @param p2x X coordinate of the second point of the line
* @param p2y y coordinate of the second point of the line
* @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep.
* With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept
* With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept
*/
void lv_draw_mask_line_points_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t p1y, lv_coord_t p2x,
lv_coord_t p2y, lv_draw_mask_line_side_t side);
/**
*Initialize a line mask from a point and an angle.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
* @param px X coordinate of a point of the line
* @param py X coordinate of a point of the line
* @param angle right 0 deg, bottom: 90
* @param side and element of `lv_draw_mask_line_side_t` to describe which side to keep.
* With `LV_DRAW_MASK_LINE_SIDE_LEFT/RIGHT` and horizontal line all pixels are kept
* With `LV_DRAW_MASK_LINE_SIDE_TOP/BOTTOM` and vertical line all pixels are kept
*/
void lv_draw_mask_line_angle_init(lv_draw_mask_line_param_t * param, lv_coord_t p1x, lv_coord_t py, int16_t angle,
lv_draw_mask_line_side_t side);
/**
* Initialize an angle mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
* @param vertex_x X coordinate of the angle vertex (absolute coordinates)
* @param vertex_y Y coordinate of the angle vertex (absolute coordinates)
* @param start_angle start angle in degrees. 0 deg on the right, 90 deg, on the bottom
* @param end_angle end angle
*/
void lv_draw_mask_angle_init(lv_draw_mask_angle_param_t * param, lv_coord_t vertex_x, lv_coord_t vertex_y,
lv_coord_t start_angle, lv_coord_t end_angle);
/**
* Initialize a fade mask.
* @param param param pointer to a `lv_draw_mask_param_t` to initialize
* @param rect coordinates of the rectangle to affect (absolute coordinates)
* @param radius radius of the rectangle
* @param inv: true: keep the pixels inside the rectangle; keep the pixels outside of the rectangle
*/
void lv_draw_mask_radius_init(lv_draw_mask_radius_param_t * param, const lv_area_t * rect, lv_coord_t radius, bool inv);
/**
* Initialize a fade mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
* @param coords coordinates of the area to affect (absolute coordinates)
* @param opa_top opacity on the top
* @param y_top at which coordinate start to change to opacity to `opa_bottom`
* @param opa_bottom opacity at the bottom
* @param y_bottom at which coordinate reach `opa_bottom`.
*/
void lv_draw_mask_fade_init(lv_draw_mask_fade_param_t * param, const lv_area_t * coords, lv_opa_t opa_top,
lv_coord_t y_top,
lv_opa_t opa_bottom, lv_coord_t y_bottom);
/**
* Initialize a map mask.
* @param param pointer to a `lv_draw_mask_param_t` to initialize
* @param coords coordinates of the map (absolute coordinates)
* @param map array of bytes with the mask values
*/
void lv_draw_mask_map_init(lv_draw_mask_map_param_t * param, const lv_area_t * coords, const lv_opa_t * map);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /*LV_MASK_H*/
| {
"content_hash": "2dac15d4cd7160a9ac3a6380879c79e5",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 120,
"avg_line_length": 32.08940397350993,
"alnum_prop": 0.6370859560416882,
"repo_name": "littlevgl/lvgl",
"id": "adb9a050a8de7671116962bbcae7f0a1c9fef5cd",
"size": "9691",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/lv_draw/lv_draw_mask.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2897616"
},
{
"name": "C++",
"bytes": "17299"
},
{
"name": "Makefile",
"bytes": "3083"
},
{
"name": "Python",
"bytes": "6790"
},
{
"name": "Shell",
"bytes": "785"
}
],
"symlink_target": ""
} |
package fr.expdev.bench.bench.mysql.engine;
/**
* Table created with :
* <p>CREATE TABLE User_INNODB
* (
* id BIGINT PRIMARY KEY NOT NULL AUTO_INCREMENT,
* login VARCHAR(100) NOT NULL,
* firstName VARCHAR(255) NOT NULL,
* lastName VARCHAR(255) NOT NULL
* );
* CREATE UNIQUE INDEX UK_login ON User_INNODB ( login );
* </p>
* @author Olivier PEREZ
*/
public class InsertInnodb extends InsertAbstract {
@Override
protected String getTable() {
return "User_INNODB";
}
}
| {
"content_hash": "7cbadc5b29273b949697dbdd7e300321",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 57,
"avg_line_length": 23.761904761904763,
"alnum_prop": 0.6733466933867736,
"repo_name": "olivierperez/java-bench",
"id": "8c22d78338f34e39bc23a44db03a82846767d622",
"size": "499",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/fr/expdev/bench/bench/mysql/engine/InsertInnodb.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "12878"
}
],
"symlink_target": ""
} |
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/* Default homepage */
$app->get('/', function() {
return view('desktop.main');
});
/* GET API */
$app->get('/api/entries', 'App\Http\Controllers\Signups\ReadController@getAll');
$app->get('/api/entries/{id_game}', 'App\Http\Controllers\Signups\ReadController@getOne');
$app->get('/api/games', 'App\Http\Controllers\Signups\ReadController@getGames');
/* POST API */
$app->post('/api/entries/create/{id_game}', 'App\Http\Controllers\Signups\EntryAPIController@submit');
$app->post('/api/entries/approve/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@approvePass');
$app->post('/api/entries/edit/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@edit');
$app->post('/api/entries/delete/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@deletePass');
$app->post('/api/entries/forgot/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@forgot');
/* Admin API */
/* TO DO: Wrap with Middleware */
$app->post('/api/games/create', 'App\Http\Controllers\Signups\AdminController@createGame');
$app->post('/api/games/update', 'App\Http\Controllers\Signups\AdminController@updateGame');
$app->post('/api/games/delete', 'App\Http\Controllers\Signups\AdminController@deleteGame');
$app->post('/api/games/purge', 'App\Http\Controllers\Signups\AdminController@purgeGames');
/* Rendered views */
$app->get('/light', 'App\Http\Controllers\Signups\LightController@getGames');
$app->get('/light/{id_game}', 'App\Http\Controllers\Signups\LightController@getOne');
$app->get('/light/create/{id_game}', 'App\Http\Controllers\Signups\LightController@getCreateForm');
$app->get('/light/edit/{id_entry}', 'App\Http\Controllers\Signups\LightController@getEditForm');
$app->get('/light/delete/{id_entry}', 'App\Http\Controllers\Signups\LightController@getDeleteForm');
$app->get('/light/delete/{id_entry}/{crpt_pass}', 'App\Http\Controllers\Signups\EntryAPIController@delete');
$app->get('/light/verify/{id_entry}', 'App\Http\Controllers\Signups\LightController@getVerifyForm');
$app->get('/light/verify/{id_entry}/{crpt_pass}', 'App\Http\Controllers\Signups\EntryAPIController@verify');
$app->post('/light/forgot/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@forgot');
/* Validators */
$app->post('/light/create/{id_game}', 'App\Http\Controllers\Signups\EntryAPIController@submit');
$app->post('/light/edit/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@edit');
$app->post('/light/delete/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@deletePass');
$app->post('/light/verify/{id_entry}', 'App\Http\Controllers\Signups\EntryAPIController@verifyPass');
| {
"content_hash": "ceb6d6526e7d6544ecf22943e25115c9",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 109,
"avg_line_length": 51.33898305084746,
"alnum_prop": 0.70122152525586,
"repo_name": "Paturages/EEISTI-Tournaments",
"id": "43abad5f9f3111b79f17b7814dffc58cdf7c8f4f",
"size": "3029",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/Http/routes.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "430"
},
{
"name": "CSS",
"bytes": "14478"
},
{
"name": "JavaScript",
"bytes": "20556"
},
{
"name": "PHP",
"bytes": "291229"
}
],
"symlink_target": ""
} |
class Article < ActiveRecord::Base
has_many :comments
has_many :taggings
has_many :tags, through: :taggings
#has_attached_file :image # this method is part of the paperclip library.
# paperclip will understand that this model should accept a file attachment and that there are fields to store information about that file which start with image_ in this models database table
has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "/images/:style/missing.png"
#validates_attachment_content_type :image, :content_type => ["image/jpg", "image/jpeg", "image/png"] # Paperclip raises MissingRequiredValidatorError error if you do not do this
# As of version 4.0, for security reasons, all attachments are required to include a content_type validation, a file_name validation, or to explicitly state that theyre not going to have either.
validates_attachment_content_type :image, :content_type => /\Aimage\/.*\Z/
def tag_list
#tags.join(", ") # doesn't work 'cause the array of tags is an Array of tag instances. To make it work, either add a "def to_s; name; end" method to tag.rb or use the method below:
self.tags.collect do |tag|
tag.name
end.join(", ")
end
def tag_list=(tags_string)
tag_names = tags_string.split(",").collect{|s| s.strip.downcase}.uniq
new_or_found_tags = tag_names.collect { |name| Tag.find_or_create_by(name: name) }
self.tags = new_or_found_tags
end
end
| {
"content_hash": "e910260fe208ebe07d7e58dbde262d5f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 197,
"avg_line_length": 61.666666666666664,
"alnum_prop": 0.7128378378378378,
"repo_name": "arthur-vieira/rails-blogger",
"id": "08141bda8d325d54307eb23e683b7c0ff6a8ec61",
"size": "1480",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/article.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1877"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "HTML",
"bytes": "11709"
},
{
"name": "JavaScript",
"bytes": "661"
},
{
"name": "Ruby",
"bytes": "49889"
}
],
"symlink_target": ""
} |
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require 'spec_helper'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
# Requires supporting ruby files with custom matchers and macros, etc, in
# spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are
# run as spec files by default. This means that files in spec/support that end
# in _spec.rb will both be required and run as specs, causing the specs to be
# run twice. It is recommended that you do not name files matching this glob to
# end with _spec.rb. You can configure this pattern with the --pattern
# option on the command line or in ~/.rspec, .rspec or `.rspec-local`.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
#ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
# If you're not using ActiveRecord, or you'd prefer not to run each of your
# examples within a transaction, remove the following line or assign false
# instead of true.
config.use_transactional_fixtures = true
# RSpec Rails can automatically mix in different behaviours to your tests
# based on their file location, for example enabling you to call `get` and
# `post` in specs under `spec/controllers`.
#
# You can disable this behaviour by removing the line below, and instead
# explicitly tag your specs with their type, e.g.:
#
# RSpec.describe UsersController, :type => :controller do
# # ...
# end
#
# The different available types are documented in the features, such as in
# https://relishapp.com/rspec/rspec-rails/docs
config.infer_spec_type_from_file_location!
end
| {
"content_hash": "44a079272f46834341cc2ecdfa776fc3",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 45.74418604651163,
"alnum_prop": 0.7275038129130655,
"repo_name": "otsutomesan/mid",
"id": "f6e3494efccc139b7f90a4a479a45f1903312168",
"size": "1967",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/rails_helper.rb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2066"
},
{
"name": "CoffeeScript",
"bytes": "422"
},
{
"name": "JavaScript",
"bytes": "1458"
},
{
"name": "Ruby",
"bytes": "47563"
}
],
"symlink_target": ""
} |
<?php
use \Wa72\HtmlPageDom\HtmlPageCrawler;
class XmlParser {
private $task;
private $content;
private $page;
public function __construct($task, $content) {
$this->content = $content;
$this->task = $task;
$this->page = new HtmlPageCrawler($content);
}
public function getFixedContent() {
$urlParser = new UrlParser();
foreach ($this->page->filter('[href]') as $link) {
$url = $urlParser->compileRelativeUrl(
$this->task->website->rootUrl,
$this->task->document->url,
$link->getAttribute('href')
);
$link->setAttribute('href', $url);
}
foreach ($this->page->filter('[src]') as $link) {
$url = $urlParser->compileRelativeUrl(
$this->task->website->rootUrl,
$this->task->document->url,
$link->getAttribute('src')
);
$link->setAttribute('src', $url);
}
return $this->page->saveHTML();
}
public function createSubTasks() {
foreach ($this->page->filter('[href]') as $link) {
if (!$this->isLogoutLink($link)) {
$task = $this->createTask($link->getAttribute('href'));
}
}
foreach ($this->page->filter('[src]') as $link) {
if (!$this->isLogoutLink($link)) {
$task = $this->createTask($link->getAttribute('src'));
}
}
}
private function isLogoutLink($link) {
return in_array(
strtolower($link->nodeValue),
array(
'log out',
'logout',
'odhlasit',
'odhlasit sa',
'odhlásiť',
'odhlásiť sa'
)
);
}
private function createTask($url) {
// TODO: remove
if ($url == "http://spsz.6f.sk/home/logout") { llog("skipping logout"); return; }
$this->task->createSubTask($url);
}
}
| {
"content_hash": "79000a6e83e6a7926aea9f2274d98824",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 89,
"avg_line_length": 25.949367088607595,
"alnum_prop": 0.4795121951219512,
"repo_name": "Trungi/Webclone",
"id": "79fca4a9982d3f608b120d18dcba0de6d1e5677a",
"size": "2054",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "webclone/src/parser/xmlparser.php",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
layout: post
title: MP Vyapam Jail Department Jobs last date 19th Oct-2015
date: 2015-09-29 05:26
comments: true
tags: Instructor ITI-Apprentice Latest MP Online
archive: false
---
Examination-2015 for various job posts in MP Jail Department of Government of MP on Direct basis
An examination will be conducted on 22/11/2015 for the following posts :
- Physical Training Instructor : 04 posts
- Sewing Instructor : 03 posts
- Weaving Instructor : 01 post
- Male Nurse : 03 posts
- Carpentry Instructor : 03 posts
- Foreman Press : 01 post
- Assistant Teacher : 06 posts
- Watchman : 852 posts
Application Fee : Rs.500/- (Rs.250/- for OBC/SC/ST/PWD candidates)
**How to Apply** : Apply Online at websites <http://www.vyapam.nic.in> OR <http://www.mponline.gov.in> on or before 19/10/2015.
Please visit <http://mponline.gov.in/Portal/Examinations/vyapam/examslist.aspx> for details and link to apply online.Details is available at <http://mponline.gov.in/Quick%20Links/Vyapam/Notifications/JRT_2015_RULE_BOOK.pdf>
| {
"content_hash": "fa365e2f515674167ff4a33f62c59a50",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 224,
"avg_line_length": 34.63333333333333,
"alnum_prop": 0.7449470644850819,
"repo_name": "anchalrani/getopportunity",
"id": "12ee7961ddc671e89562bef30248c67214949e23",
"size": "1048",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-09-29-mp-vyapam-jail-department-jobs-last.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "132450"
},
{
"name": "HTML",
"bytes": "19402"
},
{
"name": "JavaScript",
"bytes": "10482"
},
{
"name": "Ruby",
"bytes": "6139"
}
],
"symlink_target": ""
} |
package org.jboss.resteasy.spring;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MediaTypeEditor;
import java.beans.PropertyEditor;
import static org.junit.Assert.assertEquals;
public class TestMediaTypePropertyEditor
{
private PropertyEditor propertyEditor;
@BeforeClass
public static void setup()
{
}
@Before
public void setupEditor()
{
propertyEditor = new MediaTypeEditor();
}
@Test
public void testSetAsText()
{
propertyEditor.setAsText("application/xml");
MediaType type = (MediaType) propertyEditor.getValue();
assertEquals("application", type.getType());
assertEquals("xml", type.getSubtype());
}
@Test
public void testSetAsTextWithCharset()
{
propertyEditor.setAsText("application/xml;charset=UTF-8");
MediaType type = (MediaType) propertyEditor.getValue();
assertEquals("application", type.getType());
assertEquals("xml", type.getSubtype());
assertEquals("UTF-8", type.getParameters().get("charset"));
}
@Test
public void testSetAsTextCustom()
{
propertyEditor.setAsText("application/custom");
MediaType type = (MediaType) propertyEditor.getValue();
assertEquals("application", type.getType());
assertEquals("custom", type.getSubtype());
}
@Test
public void testGetAsText()
{
MediaType type = MediaType.valueOf("application/xml");
propertyEditor.setValue(type);
String text = propertyEditor.getAsText();
assertEquals("application/xml", text);
}
@Test
public void testGetAsTextCustom()
{
MediaType type = MediaType.valueOf("application/custom");
propertyEditor.setValue(type);
String text = propertyEditor.getAsText();
assertEquals("application/custom", text);
}
}
| {
"content_hash": "8dea0142bfeb3e89980696db806a17f1",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 65,
"avg_line_length": 25.293333333333333,
"alnum_prop": 0.6879283078545071,
"repo_name": "raphaelning/resteasy-client-android",
"id": "7092b33dc391cd74474b9f4390ee2af7c04cc2df",
"size": "1897",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jaxrs/resteasy-spring/src/test/java/org/jboss/resteasy/spring/TestMediaTypePropertyEditor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "740"
},
{
"name": "Java",
"bytes": "8978090"
},
{
"name": "JavaScript",
"bytes": "22811"
},
{
"name": "Python",
"bytes": "10688"
},
{
"name": "Shell",
"bytes": "106"
},
{
"name": "TypeScript",
"bytes": "817"
}
],
"symlink_target": ""
} |
package com.bq.corbel.lib.queries.request;
import static org.fest.assertions.api.Assertions.assertThat;
import org.junit.Test;
import com.bq.corbel.lib.queries.BooleanQueryLiteral;
import com.bq.corbel.lib.queries.QueryNodeImpl;
import com.bq.corbel.lib.queries.StringQueryLiteral;
public class ResourceQueryTest {
private static final String FIELD1 = "field1";
private static final String FIELD2 = "field2";
private static final String VALUE1 = "value1";
private static final boolean VALUE2 = true;
@Test
public void toStringTest() {
ResourceQuery resourceQuery = new ResourceQuery();
StringQueryLiteral value1 = new StringQueryLiteral();
value1.setLiteral(VALUE1);
BooleanQueryLiteral value2 = new BooleanQueryLiteral();
value2.setLiteral(VALUE2);
resourceQuery.addQueryNode(new QueryNodeImpl(QueryOperator.$EQ, FIELD1, value1));
assertThat(resourceQuery.toString()).isEqualTo("[{\"$eq\":{\"" + FIELD1 + "\":\"" + VALUE1 + "\"}}]");
ResourceQuery resourceQuery2 = new ResourceQuery();
resourceQuery2.addQueryNode(new QueryNodeImpl(QueryOperator.$GT, FIELD2, value2));
resourceQuery2.addQueryNode(new QueryNodeImpl(QueryOperator.$EQ, FIELD1, value1));
assertThat(resourceQuery2.toString())
.isEqualTo("[{\"$gt\":{\"" + FIELD2 + "\":" + VALUE2 + "}},{\"$eq\":{\"" + FIELD1 + "\":\"" + VALUE1 + "\"}}]");
}
@Test
public void getFiltersTest() {
ResourceQuery resourceQuery = new ResourceQuery();
StringQueryLiteral value1 = new StringQueryLiteral();
value1.setLiteral(VALUE1);
BooleanQueryLiteral value2 = new BooleanQueryLiteral();
value2.setLiteral(VALUE2);
resourceQuery.addQueryNode(new QueryNodeImpl(QueryOperator.$EQ, FIELD1, value1));
resourceQuery.addQueryNode(new QueryNodeImpl(QueryOperator.$GT, FIELD2, value2));
assertThat(resourceQuery.getFilters()).containsExactly(FIELD1, FIELD2);
}
}
| {
"content_hash": "66548c58d657df5cbebdcc65aac2d174",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 128,
"avg_line_length": 41.16326530612245,
"alnum_prop": 0.6866633614278632,
"repo_name": "bq/lib-queries",
"id": "aa0eca8501f0e8e2c0acf6764738cd3d875088ae",
"size": "2017",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "queries-api/src/test/java/com/bq/corbel/lib/queries/request/ResourceQueryTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "166119"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MSBuild.Orchard.Tasks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("Orchard")]
[assembly: AssemblyCopyright("Copyright © .NET Foundation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("e0a78419-51a9-4612-932c-4b0143bfff5d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.9.0")]
[assembly: AssemblyFileVersion("1.9.0")]
| {
"content_hash": "3e3b738c4174993e6d1b8d744d676228",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 84,
"avg_line_length": 39.14705882352941,
"alnum_prop": 0.7272727272727273,
"repo_name": "bigfont/orchard-cms-modules-and-themes",
"id": "d80b3d68ce4da0fb20bcc3a99555c501d6e502ce",
"size": "1334",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/Tools/MSBuild.Orchard.Tasks/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "1442"
},
{
"name": "Batchfile",
"bytes": "4838"
},
{
"name": "C",
"bytes": "4964"
},
{
"name": "C#",
"bytes": "9186289"
},
{
"name": "CSS",
"bytes": "2248330"
},
{
"name": "Cucumber",
"bytes": "90619"
},
{
"name": "HTML",
"bytes": "38693"
},
{
"name": "JavaScript",
"bytes": "4614218"
},
{
"name": "TypeScript",
"bytes": "51192"
},
{
"name": "XSLT",
"bytes": "123490"
}
],
"symlink_target": ""
} |
package com.aspose.slides.examples.Shapes;
import com.aspose.slides.*;
import com.aspose.slides.examples.Utils;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public class FillShapesPicture
{
public static void main(String[] args) throws Exception
{
// The path to the documents directory.
String dataDir = Utils.getDataDir(FillShapesPicture.class);
//Instantiate PrseetationEx class that represents the PPTX
Presentation pres = new Presentation();
//Get the first slide
ISlide sld = pres.getSlides().get_Item(0);
//Add autoshape of rectangle type
IShape shp = sld.getShapes().addAutoShape(ShapeType.Rectangle, 50, 150, 75, 150);
//Set the fill type to Picture
shp.getFillFormat().setFillType (FillType.Picture);
//Set the picture fill mode
shp.getFillFormat().getPictureFillFormat().setPictureFillMode(PictureFillMode.Tile);
//Set the picture
IPPImage imgx=null;
try{
imgx = pres.getImages().addImage(new FileInputStream(new File( "aspose-logo.jpg")));
}
catch(IOException e){}
shp.getFillFormat().getPictureFillFormat().getPicture().setImage(imgx);
//Write the PPTX file to disk
pres.save(dataDir+ "RectShpPic.pptx", SaveFormat.Pptx);
System.out.println("Program executed successfully");
}
}
| {
"content_hash": "7fc8dcb5eff77d4db1a4529dc69599b8",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 96,
"avg_line_length": 27.51923076923077,
"alnum_prop": 0.6722571628232006,
"repo_name": "ali-salman/Aspose.Slides-for-Java",
"id": "389064bd3756f72925f54a712022cf5f4fc03bf7",
"size": "1714",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Examples/src/main/java/com/aspose/slides/examples/Shapes/FillShapesPicture.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "25219"
},
{
"name": "Java",
"bytes": "697904"
},
{
"name": "PHP",
"bytes": "146397"
},
{
"name": "Python",
"bytes": "132116"
},
{
"name": "Ruby",
"bytes": "166824"
}
],
"symlink_target": ""
} |
require 'rubygems'
require 'sinatra'
require 'sinatra/reloader'
require 'sqlite3'
def init_db
@db = SQLite3::Database.new 'leprosorium.db'
@db.results_as_hash = true
end
before do
init_db
end
configure do
init_db
#creates table Posts if it does not exist
@db.execute 'CREATE TABLE IF NOT EXISTS
"Posts"
(
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"created_date" DATE,
"content" TEXT,
"author" TEXT
)'
# создает таблицу если таблица не существует
@db.execute 'create table if not exists Comments
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
created_date DATE,
content TEXT,
post_id INTEGER,
author TEXT
)'
#used when page is refreshed and there are changes in file
end
get '/' do
#get all posts from db
@results = @db.execute 'select * from Posts order by id desc'
erb :index
end
get '/new' do
erb :new
end
post '/new' do
content = params[:content]
author = params[:author]
if content.length < 1
@error = 'Type new post text'
returm erb :new
end
# init_db
@db.execute 'insert into Posts (created_date, content, author) values (datetime(),?, ?)', [content, author]
#redirect to main page
redirect to "/"
end
#display post add information
get '/details/:post_id' do
def get_comments
# получаем переменную из url'a
post_id = params[:post_id]
# получаем список постов
# (у нас будет только один пост)
results = @db.execute 'select * from Posts where id = ?', [post_id]
# выбираем этот один пост в переменную @row
@row = results[0]
# выбираем комментарии для нашего поста
@comments = @db.execute 'select * from Comments where post_id = ? order by id', [post_id]
# возвращаем представление details.erb
end
get_comments
erb :details
end
#processing for post
post '/details/:post_id' do
post_id = params[:post_id]
content = params[:content]
author = params[:author]
if content.length < 1
@error = 'Type new comment'
get_comments
return erb :details
end
@db.execute 'insert into Comments
(
created_date,
content,
post_id,
author
)
values
(
datetime(),
?,
?,
?
)', [content, post_id, author]
erb "you typed comment #{content} for post #{post_id}"
redirect to ('/details/' + post_id)
end | {
"content_hash": "b60f7449de72809ea60d0cd5da33b850",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 109,
"avg_line_length": 19.36521739130435,
"alnum_prop": 0.6766951055231253,
"repo_name": "cheshi-mantu/smallLepra",
"id": "ba45c035e45c894a53d539b251f0f799e7b9b0c1",
"size": "2414",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "2500"
}
],
"symlink_target": ""
} |
<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
 <span id="projectnumber">9.4</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classoperations__research_1_1_running_average.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle"><div class="title">RunningAverage Member List</div></div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#a925b6233d6cc9970b8f5bba800e9a3eb">Add</a>(int value)</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#a8b0ef188b9f416aa368e07c94a9dd1af">ClearWindow</a>()</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#abe7238c645e1aeac09a33b1291357486">GlobalAverage</a>() const</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#a9cc27103c6a070bad6dcaea6df83e7ff">IsWindowFull</a>() const</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#a7adffacaf51777a81f9d3ff4e95cfd7b">Reset</a>(int window_size)</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="odd"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#afa981bdb0486c0373c864d3f5dbd2aff">RunningAverage</a>(int window_size=1)</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">explicit</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html#a240c66108d94a6cf475664188437b3b0">WindowAverage</a>() const</td><td class="entry"><a class="el" href="classoperations__research_1_1_running_average.html">RunningAverage</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
</table></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.4 </li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "2e5147dc7e275841eed53b02d144afb3",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 395,
"avg_line_length": 58.473684210526315,
"alnum_prop": 0.7002700270027002,
"repo_name": "or-tools/docs",
"id": "6e0c02d462f484bbfb571787ca3422bc70f41fdd",
"size": "6666",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "docs/cpp/classoperations__research_1_1_running_average-members.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
BlazePose topology contains 33 points extending 17 points by COCO with missing
points on palms and feet to provide lacking scale and orientation information
for limbs, which is vital for practical applications like fitness, yoga and
dance.
<!-- task: image-pose-detection -->
<!-- fine-tunable: false -->
| {
"content_hash": "f16d882ab74d667a54909a8595adcd40",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 78,
"avg_line_length": 43.714285714285715,
"alnum_prop": 0.7777777777777778,
"repo_name": "tensorflow/tfhub.dev",
"id": "2d91c35653e702d0324a943609dd005da8519f83",
"size": "356",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "assets/docs/mediapipe/models/blazeposelandmark_full/1.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "160084"
},
{
"name": "Starlark",
"bytes": "6838"
}
],
"symlink_target": ""
} |
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Duality;
using Duality.IO;
using Duality.Resources;
using NUnit.Framework;
namespace Duality.Tests.Resources
{
[TestFixture]
public class ContentProviderTest
{
[Test] public void AddRemoveContent()
{
Pixmap resource = new Pixmap();
string alias = "Foo";
// Register the new resource with the provider
ContentProvider.AddContent(alias, resource);
// Expect it to be registered and show up in all relevant API calls
Assert.IsTrue(ContentProvider.HasContent(alias));
Assert.AreSame(resource, ContentProvider.RequestContent<Pixmap>(alias).Res);
Assert.AreSame(resource, ContentProvider.RequestContent(alias).Res);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource);
// Expect it to not show up in specialized API calls that have nothing to do with the registered resource
CollectionAssert.DoesNotContain(ContentProvider.GetDefaultContent<Pixmap>(), (ContentRef<Pixmap>)resource);
CollectionAssert.DoesNotContain(ContentProvider.GetAvailableContent<Pixmap>(), (ContentRef<Pixmap>)resource);
// Expect the resource itself to reference back to its new primary path
Assert.AreEqual(alias, resource.Path);
Assert.IsFalse(resource.IsRuntimeResource);
// Un-register the new resource, but don't dispose it
ContentProvider.RemoveContent(alias, false);
// Expect the resource to still be valid
Assert.IsFalse(resource.Disposed);
// Expect it to no longer show up in any of the relevant API calls
Assert.IsFalse(ContentProvider.HasContent(alias));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias).Res);
Assert.IsNull(ContentProvider.RequestContent(alias).Res);
CollectionAssert.DoesNotContain(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource);
// Expect the resource itself to no longer back-reference to its former path
Assert.IsNull(resource.Path);
Assert.IsTrue(resource.IsRuntimeResource);
// Re-register the resource, and immediately unregister-dispose it afterwards
ContentProvider.AddContent(alias, resource);
ContentProvider.RemoveContent(alias, true);
// Expect the resource to be disposed and no longer show up in API calls
Assert.IsTrue(resource.Disposed);
Assert.IsFalse(ContentProvider.HasContent(alias));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias).Res);
Assert.IsNull(ContentProvider.RequestContent(alias).Res);
CollectionAssert.DoesNotContain(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource);
// Expect the resource path to remain unchanged, in order to allow reload-recovery
Assert.AreEqual(alias, resource.Path);
Assert.IsFalse(resource.IsRuntimeResource);
}
[Test] public void DisposeRemovesContent()
{
Pixmap resource = new Pixmap();
string alias = "Foo";
// Register the new resource with the provider
ContentProvider.AddContent(alias, resource);
// Dispose the resource
resource.Dispose();
// Expect the resource to be disposed and no longer show up in API calls
Assert.IsTrue(resource.Disposed);
Assert.IsFalse(ContentProvider.HasContent(alias));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias).Res);
Assert.IsNull(ContentProvider.RequestContent(alias).Res);
CollectionAssert.DoesNotContain(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource);
// Expect the resource path to remain unchanged, in order to allow reload-recovery
Assert.AreEqual(alias, resource.Path);
}
[Test] public void AddOverwritesContent()
{
Pixmap resourceA = new Pixmap();
Pixmap resourceB = new Pixmap();
string alias = "Foo";
// Register both first and second resource on the same alias
ContentProvider.AddContent(alias, resourceA);
ContentProvider.AddContent(alias, resourceB);
// Expect the first resource to be disposed, and the second to be properly registered
Assert.IsTrue(resourceA.Disposed);
Assert.AreEqual(alias, resourceA.Path);
Assert.IsTrue(ContentProvider.HasContent(alias));
Assert.AreSame(resourceB, ContentProvider.RequestContent<Pixmap>(alias).Res);
Assert.AreSame(resourceB, ContentProvider.RequestContent(alias).Res);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resourceB);
}
[Test] public void RenameContent()
{
Pixmap resource = new Pixmap();
string aliasA = "Foo";
string aliasB = "Bar";
// Register the resource with one alias, then rename it to use another
ContentProvider.AddContent(aliasA, resource);
ContentProvider.RenameContent(aliasA, aliasB);
// Expect the resource to use the second alias only, and the first to be unused
Assert.AreEqual(aliasB, resource.Path);
Assert.IsTrue(ContentProvider.HasContent(aliasB));
Assert.AreSame(resource, ContentProvider.RequestContent<Pixmap>(aliasB).Res);
Assert.AreSame(resource, ContentProvider.RequestContent(aliasB).Res);
Assert.IsFalse(ContentProvider.HasContent(aliasA));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(aliasA).Res);
Assert.IsNull(ContentProvider.RequestContent(aliasA).Res);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource);
}
[Test] public void RenameContentTree()
{
Pixmap resource1 = new Pixmap();
Pixmap resource2 = new Pixmap();
string dirA = "Foo";
string dirB = "Bar";
// Let's choose some tricky path names that would break when doing a path-unaware string replace
string alias1A = PathOp.Combine(dirA, "Foo", "Resource1");
string alias2A = PathOp.Combine(dirA, "Bar", "Resource2");
string alias1B = PathOp.Combine(dirB, "Foo", "Resource1");
string alias2B = PathOp.Combine(dirB, "Bar", "Resource2");
// Register the resources with their first alias, then rename their directory
ContentProvider.AddContent(alias1A, resource1);
ContentProvider.AddContent(alias2A, resource2);
ContentProvider.RenameContentTree(dirA, dirB);
// Expect the resources to use their second alias only, and the first to be unused
Assert.AreEqual(alias1B, resource1.Path);
Assert.AreEqual(alias2B, resource2.Path);
Assert.IsTrue(ContentProvider.HasContent(alias1B));
Assert.IsTrue(ContentProvider.HasContent(alias2B));
Assert.AreSame(resource1, ContentProvider.RequestContent<Pixmap>(alias1B).Res);
Assert.AreSame(resource2, ContentProvider.RequestContent<Pixmap>(alias2B).Res);
Assert.AreSame(resource1, ContentProvider.RequestContent(alias1B).Res);
Assert.AreSame(resource2, ContentProvider.RequestContent(alias2B).Res);
Assert.IsFalse(ContentProvider.HasContent(alias1A));
Assert.IsFalse(ContentProvider.HasContent(alias2A));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias1A).Res);
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias2A).Res);
Assert.IsNull(ContentProvider.RequestContent(alias1A).Res);
Assert.IsNull(ContentProvider.RequestContent(alias2A).Res);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource1);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource2);
}
[Test] public void RemoveContentTree()
{
Pixmap resource1 = new Pixmap();
Pixmap resource2 = new Pixmap();
Pixmap resource3 = new Pixmap();
string dirA = "Foo";
string dirB = "Bar";
string alias1 = dirA + "/" + "Resource1";
string alias2 = dirA + "/" + "Resource2";
string alias3 = dirB + "/" + "Resource3";
// Register all resources, then remove one of their directories
ContentProvider.AddContent(alias1, resource1);
ContentProvider.AddContent(alias2, resource2);
ContentProvider.AddContent(alias3, resource3);
ContentProvider.RemoveContentTree(dirA, true);
// Expect the resources from the removed directory to be disposed, but not any other resource
Assert.AreEqual(alias1, resource1.Path);
Assert.AreEqual(alias2, resource2.Path);
Assert.AreEqual(alias3, resource3.Path);
Assert.IsFalse(ContentProvider.HasContent(alias1));
Assert.IsFalse(ContentProvider.HasContent(alias2));
Assert.IsTrue(ContentProvider.HasContent(alias3));
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias1).Res);
Assert.IsNull(ContentProvider.RequestContent<Pixmap>(alias2).Res);
Assert.AreSame(resource3, ContentProvider.RequestContent<Pixmap>(alias3).Res);
Assert.IsNull(ContentProvider.RequestContent(alias1).Res);
Assert.IsNull(ContentProvider.RequestContent(alias2).Res);
Assert.AreSame(resource3, ContentProvider.RequestContent(alias3).Res);
Assert.IsFalse(ContentProvider.HasContent(alias1));
Assert.IsFalse(ContentProvider.HasContent(alias2));
Assert.IsTrue(ContentProvider.HasContent(alias3));
CollectionAssert.DoesNotContain(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource1);
CollectionAssert.DoesNotContain(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource2);
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), (ContentRef<Pixmap>)resource3);
}
[Test] public void RequestContent()
{
// Create a test resource and save it somewhere to be retrieved later
Pixmap resource = new Pixmap();
string path = PathOp.Combine(DualityApp.DataDirectory, "Test" + Resource.GetFileExtByType<Pixmap>());
resource.Save(path, false);
resource.Dispose();
resource = null;
// Request the resource from its path and expect it to be valid
Assert.IsNotNull(ContentProvider.RequestContent<Pixmap>(path).Res);
Assert.IsNotNull(ContentProvider.RequestContent(path).Res);
Assert.IsTrue(ContentProvider.HasContent(path));
CollectionAssert.Contains(ContentProvider.GetLoadedContent<Pixmap>(), new ContentRef<Pixmap>(null, path));
CollectionAssert.Contains(ContentProvider.GetAvailableContent<Pixmap>(), new ContentRef<Pixmap>(null, path));
// Request the resource multiple times and expect the same instance to be returned
ContentRef<Pixmap> requestA = ContentProvider.RequestContent<Pixmap>(path);
ContentRef<Pixmap> requestB = ContentProvider.RequestContent<Pixmap>(path);
Assert.AreEqual(requestA, requestB);
Assert.AreSame(requestA.Res, requestB.Res);
// Dispose the resource and expect an automatic reload on access
Pixmap oldResource = requestA.Res;
oldResource.Dispose();
Assert.IsNotNull(requestA.Res);
Assert.IsNotNull(requestB.Res);
Assert.AreEqual(requestA, requestB);
Assert.AreSame(requestA.Res, requestB.Res);
}
}
}
| {
"content_hash": "f306f38f0a8e815175d58e264dab71d2",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 112,
"avg_line_length": 44.924050632911396,
"alnum_prop": 0.7638771484925331,
"repo_name": "AdamsLair/duality",
"id": "7b6e11e2f489c177810b55bbc90ab03257ee4aaa",
"size": "10649",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "Test/Core/Resources/ContentProviderTest.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "767"
},
{
"name": "C#",
"bytes": "5977186"
},
{
"name": "GLSL",
"bytes": "3755"
}
],
"symlink_target": ""
} |
from os.path import expanduser, isfile
from typing import Dict, Iterator, Union
from yaml import safe_load_all, dump
class Configuration:
def __init__(self, path: str = ''):
self.settings: Dict[str, str] = {}
self.path = expanduser(path)
if self.exists():
input_file = open(self.path, 'r')
self.add_elements(safe_load_all(input_file))
input_file.close()
def add_elements(self, elements: Iterator) -> None:
for dictionary in elements:
for key, value in dictionary.items():
self.settings[key] = value
def exists(self) -> bool:
result = False
if isfile(self.path):
result = True
return result
def contains(self, key: str) -> bool:
result = False
if key in self.settings:
result = True
return result
def get(self, key: str) -> str:
return self.settings.get(key, '')
def get_nested(self, key: str) -> dict:
get_result: Union[str, Dict[str, str]] = self.settings.get(key, {})
result: Dict[str, str]
if isinstance(get_result, dict):
result = get_result
else:
result = {}
return result
def set(self, key: str, value: str) -> None:
self.settings[key] = value
def remove(self, key: str) -> str:
return self.settings.pop(key, '')
def save(self) -> None:
output_file = open(self.path, 'w')
output_file.write(dump(self.settings, default_flow_style=False))
output_file.close()
| {
"content_hash": "570359fda75b84c8a1f1e613303475cf",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 75,
"avg_line_length": 26.6,
"alnum_prop": 0.5639097744360902,
"repo_name": "FunTimeCoding/python-utility",
"id": "95b1ed01c9a336a614e1f96eeb9dc5b2fb149745",
"size": "1596",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "python_utility/configuration.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1004"
},
{
"name": "Dockerfile",
"bytes": "932"
},
{
"name": "Python",
"bytes": "34873"
},
{
"name": "SaltStack",
"bytes": "282"
},
{
"name": "Shell",
"bytes": "56817"
},
{
"name": "Smarty",
"bytes": "389"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.