text stringlengths 2 1.04M | meta dict |
|---|---|
using namespace DirectX::SimpleMath;
namespace onut
{
class Texture;
class SpriteBatch;
}
extern onut::SpriteBatch* OSpriteBatch;
namespace onut
{
class BMFont
{
public:
template<typename TcontentManagerType>
static BMFont* createFromFile(const std::string& filename, TcontentManagerType* pContentManager)
{
return BMFont::createFromFile(filename, [pContentManager](const char* pFilename)
{
return pContentManager->getResource<Texture>(pFilename);
});
}
static BMFont* createFromFile(const std::string& filename, std::function<Texture*(const char*)> loadTextureFn);
BMFont();
virtual ~BMFont();
Vector2 measure(const std::string& text);
decltype(std::string().size()) caretPos(const std::string& text, float at);
template<Align Talign = Align::TOP_LEFT>
Rect draw(const std::string& text,
const Vector2& pos,
const Color& color = Color::White,
onut::SpriteBatch* pSpriteBatch = OSpriteBatch,
Align align = Talign)
{
Vector2 alignf;
switch (align)
{
case Align::TOP_LEFT:
alignf = {0, 0};
break;
case Align::TOP:
alignf = {.5f, 0};
break;
case Align::TOP_RIGHT:
alignf = {1, 0};
break;
case Align::LEFT:
alignf = {0, .5f};
break;
case Align::CENTER:
alignf = {.5f, .5f};
break;
case Align::RIGHT:
alignf = {1, .5f};
break;
case Align::BOTTOM_LEFT:
alignf = {0, 1};
break;
case Align::BOTTOM:
alignf = {.5f, 1};
break;
case Align::BOTTOM_RIGHT:
alignf = {1, 1};
break;
}
return drawInternal(text, pos, color, pSpriteBatch, alignf);
}
Rect draw(const std::string& text,
const Vector2& pos,
const Color& color = Color::White,
onut::SpriteBatch* pSpriteBatch = OSpriteBatch,
const Vector2& align = Vector2::Zero)
{
return drawInternal(text, pos, color, pSpriteBatch, align);
}
template<Align Talign = Align::TOP_LEFT,
bool Tcheap = true>
Rect drawOutlined(const std::string& text,
Vector2 pos,
const Color& color = Color::White,
Color outlineColor = {0, 0, 0, .75f},
float outlineSize = 2.f,
onut::SpriteBatch* pSpriteBatch = OSpriteBatch,
Align align = Talign)
{
Vector2 alignf;
switch (align)
{
case Align::TOP_LEFT:
alignf = {0, 0};
break;
case Align::TOP:
alignf = {.5f, 0};
break;
case Align::TOP_RIGHT:
alignf = {1, 0};
break;
case Align::LEFT:
alignf = {0, .5f};
break;
case Align::CENTER:
alignf = {.5f, .5f};
break;
case Align::RIGHT:
alignf = {1, .5f};
break;
case Align::BOTTOM_LEFT:
alignf = {0, 1};
break;
case Align::BOTTOM:
alignf = {.5f, 1};
break;
case Align::BOTTOM_RIGHT:
alignf = {1, 1};
break;
}
outlineColor.w *= color.w;
pos = {std::round(pos.x), std::round(pos.y)};
if (Tcheap)
{
drawInternal(text, pos + Vector2{-outlineSize *0.86602540378443864676372317075294f, -outlineSize *0.5f}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{outlineSize * 0.86602540378443864676372317075294f, -outlineSize *0.5f}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{0, outlineSize}, outlineColor, pSpriteBatch, alignf, false);
}
else
{
drawInternal(text, pos + Vector2{-outlineSize *0.5f, -outlineSize *0.86602540378443864676372317075294f}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{outlineSize * 0.5f, -outlineSize *0.86602540378443864676372317075294f}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{-outlineSize, 0}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{outlineSize, 0}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{-outlineSize *0.5f, outlineSize *0.86602540378443864676372317075294f}, outlineColor, pSpriteBatch, alignf, false);
drawInternal(text, pos + Vector2{outlineSize * 0.5f, outlineSize *0.86602540378443864676372317075294f}, outlineColor, pSpriteBatch, alignf, false);
}
return drawInternal(text, pos, color, pSpriteBatch, alignf, false);
}
const std::string& getName() const { return m_name; }
private:
struct fntCommon
{
int lineHeight = 0;
int base = 0;
int scaleW = 0;
int scaleH = 0;
int pages = 0;
int packed = 0;
};
struct fntPage
{
int id = 0;
std::string file;
Texture* pTexture = nullptr;
};
struct fntChars
{
int count = 0;
};
struct fntChar
{
int id = 0;
int x = 0;
int y = 0;
int width = 0;
int height = 0;
int xoffset = 0;
int yoffset = 0;
int xadvance = 0;
int page = 0;
int chnl = 0;
int displayList = 0;
};
static int parseInt(const std::string& arg, const std::vector<std::string>& lineSplit);
static std::string parseString(const std::string& arg, const std::vector<std::string>& lineSplit);
Rect drawInternal(const std::string& text,
const Vector2& pos,
const Color& color,
onut::SpriteBatch* pSpriteBatch,
const Vector2& align,
bool snapPixels = true);
fntCommon m_common;
fntPage** m_pages = nullptr;
int m_charsCount = 0;
std::unordered_map<int, fntChar*> m_chars;
std::string m_name;
};
}
typedef onut::BMFont OFont;
| {
"content_hash": "f3ba8aa3e4cd3317784892e715561d2f",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 164,
"avg_line_length": 37.121827411167516,
"alnum_prop": 0.4746342130452619,
"repo_name": "Daivuk/ggj16",
"id": "286274075bd5aa9f90ba75dcca01a50e4136b5f5",
"size": "7474",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "onut/include/BMFont.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "801211"
},
{
"name": "C++",
"bytes": "2755266"
},
{
"name": "Objective-C",
"bytes": "30213"
}
],
"symlink_target": ""
} |
import argcomplete
import argparse
import importlib
import logging
import os
import pdb
import sys
import traceback
from datetime import datetime
from dateutil.parser import parse as date_parse
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(t):
return None
from c7n import deprecated
from c7n.config import Config
DEFAULT_REGION = 'us-east-1'
log = logging.getLogger('custodian.cli')
def _default_options(p, exclude=[]):
""" Add basic options ot the subparser.
`exclude` is a list of options to exclude from the default set.
e.g.: ['region', 'log-group']
"""
provider = p.add_argument_group(
"provider", "AWS account information, defaults per the aws cli")
if 'region' not in exclude:
provider.add_argument(
"-r", "--region", action='append', default=[],
dest='regions', metavar='REGION',
help="AWS Region to target. Can be used multiple times")
provider.add_argument(
"--profile",
help="AWS Account Config File Profile to utilize")
provider.add_argument("--assume", default=None, dest="assume_role",
help="Role to assume")
provider.add_argument("--external-id", default=None, dest="external_id",
help="External Id to provide when assuming a role")
config = p.add_argument_group(
"config", "Policy config file(s) and policy selectors")
# -c is deprecated. Supported for legacy reasons
config.add_argument("-c", "--config", help=argparse.SUPPRESS)
config.add_argument("configs", nargs='*',
help="Policy configuration file(s) or directory")
config.add_argument("-p", "--policies", default=[], dest='policy_filters',
action='append', help="Only use named/matched policies")
config.add_argument("-t", "--resource", default=[], dest='resource_types',
action='append',
help="Only use policies with the given resource type")
output = p.add_argument_group("output", "Output control")
output.add_argument("-v", "--verbose", action="count", help="Verbose logging")
if 'quiet' not in exclude:
output.add_argument("-q", "--quiet", action="count",
help="Less logging (repeatable, -qqq for no output)")
else:
output.add_argument("-q", "--quiet", action="count", help=argparse.SUPPRESS)
output.add_argument("--debug", default=False, help=argparse.SUPPRESS,
action="store_true")
if 'vars' not in exclude:
# p.add_argument('--vars', default=None,
# help='Vars file to substitute into policy')
p.set_defaults(vars=None)
if 'log-group' not in exclude:
p.add_argument(
"-l", "--log-group", default=None,
help="Location to send policy logs (Ex: AWS CloudWatch Log Group)")
else:
p.add_argument("--log-group", default=None, help=argparse.SUPPRESS)
if 'output-dir' not in exclude:
p.add_argument("-s", "--output-dir", required=True,
help="[REQUIRED] Directory or S3 URL For policy output")
if 'cache' not in exclude:
p.add_argument(
"-f", "--cache", default="~/.cache/cloud-custodian.cache",
help="Cache file (default %(default)s)")
p.add_argument(
"--cache-period", default=15, type=int,
help="Cache validity in minutes (default %(default)i)")
else:
p.add_argument("--cache", default=None, help=argparse.SUPPRESS)
def _report_options(p):
""" Add options specific to the report subcommand. """
_default_options(p, exclude=['cache', 'log-group', 'quiet'])
p.add_argument(
'--days', type=float, default=1,
help="Number of days of history to consider")
p.add_argument(
'--raw', type=argparse.FileType('w'),
help="Store raw json of collected records to given file path")
p.add_argument(
'--field', action='append', default=[], type=_key_val_pair,
metavar='HEADER=FIELD',
help='Repeatable. JMESPath of field to include in the output OR '
'for a tag use prefix `tag:`. Special case fields `region` and'
'`policy` are available')
p.add_argument(
'--no-default-fields', action="store_true",
help='Exclude default fields for report.')
p.add_argument(
'--format', default='csv', choices=['csv', 'grid', 'simple', 'json'],
help="Format to output data in (default: %(default)s). "
"Options include simple, grid, csv, json")
p.add_argument(
'--all-findings', default=False, action="store_true",
help="Outputs all findings per resource. Defaults to a single finding per resource. ")
def _metrics_options(p):
""" Add options specific to metrics subcommand. """
_default_options(p, exclude=['log-group', 'output-dir', 'cache', 'quiet'])
p.add_argument(
'--start', type=date_parse,
help='Start date (requires --end, overrides --days)')
p.add_argument(
'--end', type=date_parse, help='End date')
p.add_argument(
'--days', type=int, default=14,
help='Number of days of history to consider (default: %(default)i)')
p.add_argument('--period', type=int, default=60 * 24 * 24)
def _logs_options(p):
""" Add options specific to logs subcommand. """
_default_options(p, exclude=['cache', 'quiet'])
# default time range is 0 to "now" (to include all log entries)
p.add_argument(
'--start',
default='the beginning', # invalid, will result in 0
help='Start date and/or time',
)
p.add_argument(
'--end',
default=datetime.now().strftime('%c'),
help='End date and/or time',
)
def _schema_options(p):
""" Add options specific to schema subcommand. """
p.add_argument(
'resource', metavar='selector', nargs='?', default=None)
p.add_argument(
'--summary', action="store_true",
help="Summarize counts of available resources, actions and filters")
p.add_argument('--json', action="store_true",
help="Export custodian's jsonschema")
p.add_argument('--outline', action="store_true",
help="Print outline of all resources and their actions and filters")
p.add_argument("-v", "--verbose", action="count", help="Verbose logging")
p.add_argument("-q", "--quiet", action="count", help=argparse.SUPPRESS)
p.add_argument("--debug", default=False, help=argparse.SUPPRESS)
def _dryrun_option(p):
p.add_argument(
"-d", "--dryrun", "--dry-run", action="store_true",
help="Don't execute actions but filter resources")
def _key_val_pair(value):
"""
Type checker to ensure that --field values are of the format key=val
"""
if '=' not in value:
msg = 'values must be of the form `header=field`'
raise argparse.ArgumentTypeError(msg)
return value
def setup_parser():
c7n_desc = "Cloud Custodian - Cloud fleet management"
parser = argparse.ArgumentParser(description=c7n_desc)
# Setting `dest` means we capture which subparser was used.
subs = parser.add_subparsers(
title='commands',
dest='subparser')
run_desc = "\n".join((
"Execute the policies in a config file.",
"",
"Multiple regions can be passed in, as can the symbolic region 'all'. ",
"",
"When running across multiple regions, policies targeting resources in ",
"regions where they do not exist will not be run. The output directory ",
"when passing multiple regions is suffixed with the region. Resources ",
"with global endpoints are run just once and are suffixed with the first ",
"region passed in or us-east-1 if running against 'all' regions.",
""
))
run = subs.add_parser(
"run", description=run_desc,
help="Execute the policies in a config file",
formatter_class=argparse.RawDescriptionHelpFormatter)
run.set_defaults(command="c7n.commands.run")
_default_options(run)
_dryrun_option(run)
run.add_argument(
"--skip-validation",
action="store_true",
help="Skips validation of policies (assumes you've run the validate command seperately).")
metrics_help = ("Emit metrics to provider metrics. Specify 'aws', 'gcp', or 'azure'. "
"For more details on aws metrics options, see: "
"https://cloudcustodian.io/docs/aws/usage.html#metrics")
run.add_argument(
"-m", "--metrics-enabled", metavar="PROVIDER",
default=None, nargs="?", const="aws",
help=metrics_help)
run.add_argument(
"--trace",
dest="tracer",
help="Tracing integration",
default=None, nargs="?", const="default")
schema_desc = ("Browse the available vocabularies (resources, filters, modes, and "
"actions) for policy construction. The selector "
"is specified with RESOURCE[.CATEGORY[.ITEM]] "
"examples: s3, ebs.actions, or ec2.filters.instance-age")
schema = subs.add_parser(
'schema', description=schema_desc,
help="Interactive cli docs for policy authors")
schema.set_defaults(command="c7n.commands.schema_cmd")
_schema_options(schema)
report_desc = ("Report of resources that a policy matched/ran on. "
"The default output format is csv, but other formats "
"are available.")
report = subs.add_parser(
"report", description=report_desc,
help="Tabular report on policy matched resources")
report.set_defaults(command="c7n.commands.report")
_report_options(report)
logs = subs.add_parser(
'logs')
logs.set_defaults(command="c7n.commands.logs")
_logs_options(logs)
metrics = subs.add_parser('metrics')
metrics.set_defaults(command="c7n.commands.metrics_cmd")
_metrics_options(metrics)
version = subs.add_parser(
'version', help="Display installed version of custodian")
version.set_defaults(command='c7n.commands.version_cmd')
version.add_argument('-v', '--verbose', action="count", help="Verbose logging")
version.add_argument("-q", "--quiet", action="count", help=argparse.SUPPRESS)
version.add_argument(
"--debug", action="store_true",
help="Print info for bug reports")
validate_desc = (
"Validate config files against the json schema")
validate = subs.add_parser(
'validate', description=validate_desc, help=validate_desc)
validate.set_defaults(command="c7n.commands.validate", check_deprecations="yes")
validate.add_argument(
"-c", "--config", help=argparse.SUPPRESS)
validate.add_argument("configs", nargs='*',
help="Policy Configuration File(s)")
validate.add_argument("-v", "--verbose", action="count", help="Verbose Logging")
validate.add_argument("-q", "--quiet", action="count", help="Less logging (repeatable)")
validate.add_argument("--debug", default=False, help=argparse.SUPPRESS)
deprecations = validate.add_mutually_exclusive_group(required=False)
deprecations.add_argument("--no-deps", dest="check_deprecations",
action='store_const', const=deprecated.SKIP,
help="Do not check for deprecations")
deprecations.add_argument("--strict", dest="check_deprecations",
action='store_const', const=deprecated.STRICT,
help="Any deprecations will cause a non-zero exit code")
return parser
def _setup_logger(options):
level = 3 + (options.verbose or 0) - (options.quiet or 0)
if level <= 0:
# print nothing
log_level = logging.CRITICAL + 1
elif level == 1:
log_level = logging.ERROR
elif level == 2:
log_level = logging.WARNING
elif level == 3:
# default
log_level = logging.INFO
else:
log_level = logging.DEBUG
logging.basicConfig(
level=log_level,
format="%(asctime)s: %(name)s:%(levelname)s %(message)s")
external_log_level = logging.ERROR
if level <= 0:
external_log_level = logging.CRITICAL + 1
elif level >= 5:
external_log_level = logging.INFO
logging.getLogger('botocore').setLevel(external_log_level)
logging.getLogger('urllib3').setLevel(external_log_level)
logging.getLogger('s3transfer').setLevel(external_log_level)
logging.getLogger('urllib3').setLevel(logging.ERROR)
def main():
parser = setup_parser()
argcomplete.autocomplete(parser)
options = parser.parse_args()
if options.subparser is None:
parser.print_help(file=sys.stderr)
return sys.exit(2)
_setup_logger(options)
# Support the deprecated -c option
if getattr(options, 'config', None) is not None:
options.configs.append(options.config)
config = Config.empty(**vars(options))
try:
command = options.command
if not callable(command):
command = getattr(
importlib.import_module(command.rsplit('.', 1)[0]),
command.rsplit('.', 1)[-1])
# Set the process name to something cleaner
process_name = [os.path.basename(sys.argv[0])]
process_name.extend(sys.argv[1:])
setproctitle(' '.join(process_name))
command(config)
except Exception:
if not options.debug:
raise
traceback.print_exc()
pdb.post_mortem(sys.exc_info()[-1])
if __name__ == '__main__':
main()
| {
"content_hash": "28f46d78523f69d39bdb07222e08126d",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 98,
"avg_line_length": 37.63934426229508,
"alnum_prop": 0.6163617886178862,
"repo_name": "thisisshi/cloud-custodian",
"id": "eed92e6e54c02627362ebb175181be28722787a1",
"size": "13977",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "c7n/cli.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2126"
},
{
"name": "Go",
"bytes": "146637"
},
{
"name": "HCL",
"bytes": "62085"
},
{
"name": "Jinja",
"bytes": "19775"
},
{
"name": "Makefile",
"bytes": "14242"
},
{
"name": "PowerShell",
"bytes": "1804"
},
{
"name": "Python",
"bytes": "6684814"
},
{
"name": "Shell",
"bytes": "15323"
},
{
"name": "Smarty",
"bytes": "359"
}
],
"symlink_target": ""
} |
#ifndef PONG_SRC_APP_H_
#define PONG_SRC_APP_H_
#include <crossengine/i_main_game.h>
#include <memory>
#include "gameplay_screen.h"
/**
* @brief Our custom app that inherits from IMainGame.
*/
class App : public CrossEngine::IMainGame {
public:
/**
* @brief Construct a new App object.
*/
App();
/**
* @brief Destroy the App object.
*/
~App();
/**
* @brief Called on initialization.
*/
void OnInit() override;
/**
* @brief For adding all screens.
*/
void AddScreens() override;
/**
* @brief Called when exiting.
*/
void OnExit() override;
private:
std::unique_ptr<GameplayScreen> gameplay_screen_;
CrossEngine::Window window_;
};
#endif // PONG_SRC_APP_H_
| {
"content_hash": "d5d17b035eb357bbce1d0b2d071a34d5",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 54,
"avg_line_length": 15.166666666666666,
"alnum_prop": 0.6222527472527473,
"repo_name": "feserr/CrossEngine",
"id": "a8a3b6c1c69f88268616576a09a393071252a9b6",
"size": "847",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pong/src/app.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "228"
},
{
"name": "C",
"bytes": "1634836"
},
{
"name": "C++",
"bytes": "4489649"
},
{
"name": "CMake",
"bytes": "3870"
},
{
"name": "Lua",
"bytes": "19774"
},
{
"name": "Makefile",
"bytes": "11112"
},
{
"name": "Objective-C",
"bytes": "48246"
},
{
"name": "Objective-C++",
"bytes": "29423"
},
{
"name": "Python",
"bytes": "646"
},
{
"name": "Scala",
"bytes": "733"
},
{
"name": "Shell",
"bytes": "30689"
},
{
"name": "SuperCollider",
"bytes": "195"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jsmpp</groupId>
<artifactId>jsmpp-pom</artifactId>
<version>2.2.1</version>
<packaging>pom</packaging>
<name>jSMPP</name>
<description>SMPP library for Java</description>
<url>http://jsmpp.org</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>jsmpp</module>
<module>jsmpp-examples</module>
</modules>
<developers>
<developer>
<name>Denis Kostousov</name>
</developer>
<developer>
<name>Nuruddin Ashr</name>
</developer>
<developer>
<name>Daniel Pocock</name>
<email>daniel@pocock.pro</email>
<url>http://danielpocock.com</url>
</developer>
<developer>
<name>Pim Moerenhout</name>
<email>pim.moerenhout@gmail.com</email>
</developer>
</developers>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
<buildNumber>${maven.build.timestamp}</buildNumber>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.12</slf4j.version>
<log4j.version>1.2.17</log4j.version>
<junit.version>4.12</junit.version>
<testng.version>6.8.21</testng.version>
<commons-codec.version>1.10</commons-codec.version>
<git.properties>git.properties</git.properties>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>${testng.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>${commons-codec.version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.8</version>
</extension>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>2.8</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>utf-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- that's the default value, you don't have to set it -->
<prefix>git</prefix>
<!-- that's the default value -->
<dateFormat>dd.MM.yyyy '@' HH:mm:ss z</dateFormat>
<!-- false is default here, it prints some more information during the build -->
<verbose>true</verbose>
<!-- this is false by default, forces the plugin to generate the git.properties file -->
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<!-- The path for the to be generated properties file, it's relative to ${project.basedir} -->
<generateGitPropertiesFilename>${git.properties}</generateGitPropertiesFilename>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${git.properties}</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Implementation-Version>${project.version}-${git.branch}.${git.commit.id.abbrev}</Implementation-Version>
<Dependencies>org.apache.log4j</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<scm>
<url>https://github.com/opentelecoms-org/jsmpp</url>
<connection>scm:git:ssh://git@github.com:opentelecoms-org/jsmpp.git</connection>
<developerConnection>scm:git:ssh://git@github.com:opentelecoms-org/jsmpp.git</developerConnection>
</scm>
</project>
| {
"content_hash": "09a082fa9c7825afdac630ef953522e6",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 204,
"avg_line_length": 37.82222222222222,
"alnum_prop": 0.4691539365452409,
"repo_name": "kamslooce/jsmpp",
"id": "f16a710d55a76d9f8dc239f77cc04b7c25d904e0",
"size": "10212",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1813"
},
{
"name": "Java",
"bytes": "992207"
},
{
"name": "Shell",
"bytes": "2076"
}
],
"symlink_target": ""
} |
module Feature.ExtraSearchPathSpec where
import Network.HTTP.Types
import Network.Wai (Application)
import Test.Hspec
import Test.Hspec.Wai
import Test.Hspec.Wai.JSON
import Protolude
import SpecHelper
spec :: SpecWith Application
spec = describe "extra search path" $ do
it "finds the ltree <@ operator on the public schema" $
request methodGet "/ltree_sample?path=cd.Top.Science.Astronomy" [] ""
`shouldRespondWith` [json|[
{"path":"Top.Science.Astronomy"},
{"path":"Top.Science.Astronomy.Astrophysics"},
{"path":"Top.Science.Astronomy.Cosmology"}]|]
{ matchHeaders = [matchContentTypeJson] }
it "finds the ltree nlevel function on the public schema, used through a computed column" $
request methodGet "/ltree_sample?select=number_of_labels&path=eq.Top.Science" [] ""
`shouldRespondWith` [json|[{"number_of_labels":2}]|]
{ matchHeaders = [matchContentTypeJson] }
it "finds the isn = operator on the extensions schema" $
request methodGet "/isn_sample?id=eq.978-0-393-04002-9&select=name" [] ""
`shouldRespondWith` [json|[{"name":"Mathematics: From the Birth of Numbers"}]|]
{ matchHeaders = [matchContentTypeJson] }
it "finds the isn is_valid function on the extensions schema" $
request methodGet "/rpc/is_valid_isbn?input=978-0-393-04002-9" [] ""
`shouldRespondWith` [json|true|]
{ matchHeaders = [matchContentTypeJson] }
| {
"content_hash": "ded2bd8bc6a9f3198dbf670965a3d294",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 93,
"avg_line_length": 39.94444444444444,
"alnum_prop": 0.6947148817802503,
"repo_name": "diogob/postgrest",
"id": "c1c2e1126e9cf0910330197451c876a729b91f3c",
"size": "1438",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/Feature/ExtraSearchPathSpec.hs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1574"
},
{
"name": "Haskell",
"bytes": "432391"
},
{
"name": "Makefile",
"bytes": "1132"
},
{
"name": "Shell",
"bytes": "15948"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
Stud. Mycol. 31: 127 (1989)
#### Original name
Torrubiella formicarum Samson, Reenen & H.C. Evans, 1989
### Remarks
null | {
"content_hash": "65067c5ce100dcd3d1f82e732a17ac38",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 16.076923076923077,
"alnum_prop": 0.7033492822966507,
"repo_name": "mdoering/backbone",
"id": "e4cf7b7d7dd14df12b62e8aaa2452cad18353312",
"size": "289",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Sordariomycetes/Hypocreales/Cordycipitaceae/Torrubiella/Torrubiella formicarum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
/*************************************************************************/
/* os_haiku.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md) */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include <Screen.h>
#include "drivers/gles2/rasterizer_gles2.h"
#include "servers/physics/physics_server_sw.h"
#include "servers/visual/visual_server_raster.h"
#include "servers/visual/visual_server_wrap_mt.h"
//#include "servers/physics_2d/physics_2d_server_wrap_mt.h"
#include "main/main.h"
#include "os_haiku.h"
OS_Haiku::OS_Haiku() {
#ifdef MEDIA_KIT_ENABLED
AudioDriverManager::add_driver(&driver_media_kit);
#endif
};
void OS_Haiku::run() {
if (!main_loop) {
return;
}
main_loop->init();
context_gl->release_current();
// TODO: clean up
BMessenger *bms = new BMessenger(window);
BMessage *msg = new BMessage();
bms->SendMessage(LOCKGL_MSG, msg);
window->StartMessageRunner();
app->Run();
window->StopMessageRunner();
delete app;
delete bms;
delete msg;
main_loop->finish();
}
String OS_Haiku::get_name() {
return "Haiku";
}
int OS_Haiku::get_video_driver_count() const {
return 1;
}
const char *OS_Haiku::get_video_driver_name(int p_driver) const {
return "GLES2";
}
OS::VideoMode OS_Haiku::get_default_video_mode() const {
return OS::VideoMode(800, 600, false);
}
void OS_Haiku::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
main_loop = NULL;
current_video_mode = p_desired;
app = new HaikuApplication();
BRect frame;
frame.Set(50, 50, 50 + current_video_mode.width - 1, 50 + current_video_mode.height - 1);
window = new HaikuDirectWindow(frame);
window->SetVideoMode(¤t_video_mode);
if (current_video_mode.fullscreen) {
window->SetFullScreen(true);
}
if (!current_video_mode.resizable) {
uint32 flags = window->Flags();
flags |= B_NOT_RESIZABLE;
window->SetFlags(flags);
}
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
context_gl = memnew(ContextGL_Haiku(window));
context_gl->initialize();
context_gl->make_current();
rasterizer = memnew(RasterizerGLES2);
#endif
visual_server = memnew(VisualServerRaster(rasterizer));
ERR_FAIL_COND(!visual_server);
// TODO: enable multithreaded VS
/*
if (get_render_thread_mode() != RENDER_THREAD_UNSAFE) {
visual_server = memnew(VisualServerWrapMT(visual_server, get_render_thread_mode() == RENDER_SEPARATE_THREAD));
}
*/
input = memnew(InputDefault);
window->SetInput(input);
window->Show();
visual_server->init();
physics_server = memnew(PhysicsServerSW);
physics_server->init();
physics_2d_server = memnew(Physics2DServerSW);
// TODO: enable multithreaded PS
//physics_2d_server = Physics2DServerWrapMT::init_server<Physics2DServerSW>();
physics_2d_server->init();
AudioDriverManager::get_driver(p_audio_driver)->set_singleton();
if (AudioDriverManager::get_driver(p_audio_driver)->init() != OK) {
ERR_PRINT("Initializing audio failed.");
}
power_manager = memnew(PowerHaiku);
}
void OS_Haiku::finalize() {
if (main_loop) {
memdelete(main_loop);
}
main_loop = NULL;
visual_server->finish();
memdelete(visual_server);
memdelete(rasterizer);
physics_server->finish();
memdelete(physics_server);
physics_2d_server->finish();
memdelete(physics_2d_server);
memdelete(input);
#if defined(OPENGL_ENABLED) || defined(LEGACYGL_ENABLED)
memdelete(context_gl);
#endif
}
void OS_Haiku::set_main_loop(MainLoop *p_main_loop) {
main_loop = p_main_loop;
input->set_main_loop(p_main_loop);
window->SetMainLoop(p_main_loop);
}
MainLoop *OS_Haiku::get_main_loop() const {
return main_loop;
}
void OS_Haiku::delete_main_loop() {
if (main_loop) {
memdelete(main_loop);
}
main_loop = NULL;
window->SetMainLoop(NULL);
}
void OS_Haiku::release_rendering_thread() {
context_gl->release_current();
}
void OS_Haiku::make_rendering_thread() {
context_gl->make_current();
}
bool OS_Haiku::can_draw() const {
// TODO: implement
return true;
}
void OS_Haiku::swap_buffers() {
context_gl->swap_buffers();
}
Point2 OS_Haiku::get_mouse_position() const {
return window->GetLastMousePosition();
}
int OS_Haiku::get_mouse_button_state() const {
return window->GetLastButtonMask();
}
void OS_Haiku::set_cursor_shape(CursorShape p_shape) {
//ERR_PRINT("set_cursor_shape() NOT IMPLEMENTED");
}
int OS_Haiku::get_screen_count() const {
// TODO: implement get_screen_count()
return 1;
}
int OS_Haiku::get_current_screen() const {
// TODO: implement get_current_screen()
return 0;
}
void OS_Haiku::set_current_screen(int p_screen) {
// TODO: implement set_current_screen()
}
Point2 OS_Haiku::get_screen_position(int p_screen) const {
// TODO: make this work with the p_screen parameter
BScreen *screen = new BScreen(window);
BRect frame = screen->Frame();
delete screen;
return Point2i(frame.left, frame.top);
}
Size2 OS_Haiku::get_screen_size(int p_screen) const {
// TODO: make this work with the p_screen parameter
BScreen *screen = new BScreen(window);
BRect frame = screen->Frame();
delete screen;
return Size2i(frame.IntegerWidth() + 1, frame.IntegerHeight() + 1);
}
void OS_Haiku::set_window_title(const String &p_title) {
window->SetTitle(p_title.utf8().get_data());
}
Size2 OS_Haiku::get_window_size() const {
BSize size = window->Size();
return Size2i(size.IntegerWidth() + 1, size.IntegerHeight() + 1);
}
void OS_Haiku::set_window_size(const Size2 p_size) {
// TODO: why does it stop redrawing after this is called?
window->ResizeTo(p_size.x, p_size.y);
}
Point2 OS_Haiku::get_window_position() const {
BPoint point(0, 0);
window->ConvertToScreen(&point);
return Point2i(point.x, point.y);
}
void OS_Haiku::set_window_position(const Point2 &p_position) {
window->MoveTo(p_position.x, p_position.y);
}
void OS_Haiku::set_window_fullscreen(bool p_enabled) {
window->SetFullScreen(p_enabled);
current_video_mode.fullscreen = p_enabled;
visual_server->init();
}
bool OS_Haiku::is_window_fullscreen() const {
return current_video_mode.fullscreen;
}
void OS_Haiku::set_window_resizable(bool p_enabled) {
uint32 flags = window->Flags();
if (p_enabled) {
flags &= ~(B_NOT_RESIZABLE);
} else {
flags |= B_NOT_RESIZABLE;
}
window->SetFlags(flags);
current_video_mode.resizable = p_enabled;
}
bool OS_Haiku::is_window_resizable() const {
return current_video_mode.resizable;
}
void OS_Haiku::set_window_minimized(bool p_enabled) {
window->Minimize(p_enabled);
}
bool OS_Haiku::is_window_minimized() const {
return window->IsMinimized();
}
void OS_Haiku::set_window_maximized(bool p_enabled) {
window->Minimize(!p_enabled);
}
bool OS_Haiku::is_window_maximized() const {
return !window->IsMinimized();
}
void OS_Haiku::set_video_mode(const VideoMode &p_video_mode, int p_screen) {
ERR_PRINT("set_video_mode() NOT IMPLEMENTED");
}
OS::VideoMode OS_Haiku::get_video_mode(int p_screen) const {
return current_video_mode;
}
void OS_Haiku::get_fullscreen_mode_list(List<VideoMode> *p_list, int p_screen) const {
ERR_PRINT("get_fullscreen_mode_list() NOT IMPLEMENTED");
}
String OS_Haiku::get_executable_path() const {
return OS::get_executable_path();
}
bool OS_Haiku::_check_internal_feature_support(const String &p_feature) {
return p_feature == "pc" || p_feature == "s3tc";
}
| {
"content_hash": "3a70d73715b86afc7512058d4da6b66b",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 112,
"avg_line_length": 27.393491124260354,
"alnum_prop": 0.6427259963278972,
"repo_name": "RebelliousX/Go_Dot",
"id": "e897d4c385038defcb7ea636258a279583b96314",
"size": "9259",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "platform/haiku/os_haiku.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "50004"
},
{
"name": "C++",
"bytes": "17253448"
},
{
"name": "HTML",
"bytes": "10304"
},
{
"name": "Java",
"bytes": "497041"
},
{
"name": "Makefile",
"bytes": "451"
},
{
"name": "Objective-C",
"bytes": "2644"
},
{
"name": "Objective-C++",
"bytes": "147992"
},
{
"name": "Python",
"bytes": "268180"
},
{
"name": "Shell",
"bytes": "11105"
}
],
"symlink_target": ""
} |
namespace v8 {
namespace internal {
namespace compiler {
BasicBlock::BasicBlock(Zone* zone, Id id)
: loop_number_(-1),
rpo_number_(-1),
deferred_(false),
dominator_depth_(-1),
dominator_(nullptr),
rpo_next_(nullptr),
loop_header_(nullptr),
loop_end_(nullptr),
loop_depth_(0),
control_(kNone),
control_input_(nullptr),
nodes_(zone),
successors_(zone),
predecessors_(zone),
id_(id) {}
bool BasicBlock::LoopContains(BasicBlock* block) const {
// RPO numbers must be initialized.
DCHECK(rpo_number_ >= 0);
DCHECK(block->rpo_number_ >= 0);
if (loop_end_ == nullptr) return false; // This is not a loop.
return block->rpo_number_ >= rpo_number_ &&
block->rpo_number_ < loop_end_->rpo_number_;
}
void BasicBlock::AddSuccessor(BasicBlock* successor) {
successors_.push_back(successor);
}
void BasicBlock::AddPredecessor(BasicBlock* predecessor) {
predecessors_.push_back(predecessor);
}
void BasicBlock::AddNode(Node* node) { nodes_.push_back(node); }
void BasicBlock::set_control(Control control) {
control_ = control;
}
void BasicBlock::set_control_input(Node* control_input) {
control_input_ = control_input;
}
void BasicBlock::set_loop_depth(int32_t loop_depth) {
loop_depth_ = loop_depth;
}
void BasicBlock::set_rpo_number(int32_t rpo_number) {
rpo_number_ = rpo_number;
}
void BasicBlock::set_loop_end(BasicBlock* loop_end) { loop_end_ = loop_end; }
void BasicBlock::set_loop_header(BasicBlock* loop_header) {
loop_header_ = loop_header;
}
// static
BasicBlock* BasicBlock::GetCommonDominator(BasicBlock* b1, BasicBlock* b2) {
while (b1 != b2) {
if (b1->dominator_depth() < b2->dominator_depth()) {
b2 = b2->dominator();
} else {
b1 = b1->dominator();
}
}
return b1;
}
std::ostream& operator<<(std::ostream& os, const BasicBlock::Control& c) {
switch (c) {
case BasicBlock::kNone:
return os << "none";
case BasicBlock::kGoto:
return os << "goto";
case BasicBlock::kCall:
return os << "call";
case BasicBlock::kBranch:
return os << "branch";
case BasicBlock::kSwitch:
return os << "switch";
case BasicBlock::kDeoptimize:
return os << "deoptimize";
case BasicBlock::kTailCall:
return os << "tailcall";
case BasicBlock::kReturn:
return os << "return";
case BasicBlock::kThrow:
return os << "throw";
}
UNREACHABLE();
return os;
}
std::ostream& operator<<(std::ostream& os, const BasicBlock::Id& id) {
return os << id.ToSize();
}
Schedule::Schedule(Zone* zone, size_t node_count_hint)
: zone_(zone),
all_blocks_(zone),
nodeid_to_block_(zone),
rpo_order_(zone),
start_(NewBasicBlock()),
end_(NewBasicBlock()) {
nodeid_to_block_.reserve(node_count_hint);
}
BasicBlock* Schedule::block(Node* node) const {
if (node->id() < static_cast<NodeId>(nodeid_to_block_.size())) {
return nodeid_to_block_[node->id()];
}
return nullptr;
}
bool Schedule::IsScheduled(Node* node) {
if (node->id() >= nodeid_to_block_.size()) return false;
return nodeid_to_block_[node->id()] != nullptr;
}
BasicBlock* Schedule::GetBlockById(BasicBlock::Id block_id) {
DCHECK(block_id.ToSize() < all_blocks_.size());
return all_blocks_[block_id.ToSize()];
}
bool Schedule::SameBasicBlock(Node* a, Node* b) const {
BasicBlock* block = this->block(a);
return block != nullptr && block == this->block(b);
}
BasicBlock* Schedule::NewBasicBlock() {
BasicBlock* block = new (zone_)
BasicBlock(zone_, BasicBlock::Id::FromSize(all_blocks_.size()));
all_blocks_.push_back(block);
return block;
}
void Schedule::PlanNode(BasicBlock* block, Node* node) {
if (FLAG_trace_turbo_scheduler) {
OFStream os(stdout);
os << "Planning #" << node->id() << ":" << node->op()->mnemonic()
<< " for future add to B" << block->id() << "\n";
}
DCHECK(this->block(node) == nullptr);
SetBlockForNode(block, node);
}
void Schedule::AddNode(BasicBlock* block, Node* node) {
if (FLAG_trace_turbo_scheduler) {
OFStream os(stdout);
os << "Adding #" << node->id() << ":" << node->op()->mnemonic() << " to B"
<< block->id() << "\n";
}
DCHECK(this->block(node) == nullptr || this->block(node) == block);
block->AddNode(node);
SetBlockForNode(block, node);
}
void Schedule::AddGoto(BasicBlock* block, BasicBlock* succ) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kGoto);
AddSuccessor(block, succ);
}
void Schedule::AddCall(BasicBlock* block, Node* call, BasicBlock* success_block,
BasicBlock* exception_block) {
DCHECK_EQ(BasicBlock::kNone, block->control());
DCHECK_EQ(IrOpcode::kCall, call->opcode());
block->set_control(BasicBlock::kCall);
AddSuccessor(block, success_block);
AddSuccessor(block, exception_block);
SetControlInput(block, call);
}
void Schedule::AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock,
BasicBlock* fblock) {
DCHECK_EQ(BasicBlock::kNone, block->control());
DCHECK_EQ(IrOpcode::kBranch, branch->opcode());
block->set_control(BasicBlock::kBranch);
AddSuccessor(block, tblock);
AddSuccessor(block, fblock);
SetControlInput(block, branch);
}
void Schedule::AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks,
size_t succ_count) {
DCHECK_EQ(BasicBlock::kNone, block->control());
DCHECK_EQ(IrOpcode::kSwitch, sw->opcode());
block->set_control(BasicBlock::kSwitch);
for (size_t index = 0; index < succ_count; ++index) {
AddSuccessor(block, succ_blocks[index]);
}
SetControlInput(block, sw);
}
void Schedule::AddTailCall(BasicBlock* block, Node* input) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kTailCall);
SetControlInput(block, input);
if (block != end()) AddSuccessor(block, end());
}
void Schedule::AddReturn(BasicBlock* block, Node* input) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kReturn);
SetControlInput(block, input);
if (block != end()) AddSuccessor(block, end());
}
void Schedule::AddDeoptimize(BasicBlock* block, Node* input) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kDeoptimize);
SetControlInput(block, input);
if (block != end()) AddSuccessor(block, end());
}
void Schedule::AddThrow(BasicBlock* block, Node* input) {
DCHECK_EQ(BasicBlock::kNone, block->control());
block->set_control(BasicBlock::kThrow);
SetControlInput(block, input);
if (block != end()) AddSuccessor(block, end());
}
void Schedule::InsertBranch(BasicBlock* block, BasicBlock* end, Node* branch,
BasicBlock* tblock, BasicBlock* fblock) {
DCHECK_NE(BasicBlock::kNone, block->control());
DCHECK_EQ(BasicBlock::kNone, end->control());
end->set_control(block->control());
block->set_control(BasicBlock::kBranch);
MoveSuccessors(block, end);
AddSuccessor(block, tblock);
AddSuccessor(block, fblock);
if (block->control_input() != nullptr) {
SetControlInput(end, block->control_input());
}
SetControlInput(block, branch);
}
void Schedule::InsertSwitch(BasicBlock* block, BasicBlock* end, Node* sw,
BasicBlock** succ_blocks, size_t succ_count) {
DCHECK_NE(BasicBlock::kNone, block->control());
DCHECK_EQ(BasicBlock::kNone, end->control());
end->set_control(block->control());
block->set_control(BasicBlock::kSwitch);
MoveSuccessors(block, end);
for (size_t index = 0; index < succ_count; ++index) {
AddSuccessor(block, succ_blocks[index]);
}
if (block->control_input() != nullptr) {
SetControlInput(end, block->control_input());
}
SetControlInput(block, sw);
}
void Schedule::EnsureSplitEdgeForm() {
// Make a copy of all the blocks for the iteration, since adding the split
// edges will allocate new blocks.
BasicBlockVector all_blocks_copy(all_blocks_);
// Insert missing split edge blocks.
for (auto block : all_blocks_copy) {
if (block->PredecessorCount() > 1 && block != end_) {
for (auto current_pred = block->predecessors().begin();
current_pred != block->predecessors().end(); ++current_pred) {
BasicBlock* pred = *current_pred;
if (pred->SuccessorCount() > 1) {
// Found a predecessor block with multiple successors.
BasicBlock* split_edge_block = NewBasicBlock();
split_edge_block->set_control(BasicBlock::kGoto);
split_edge_block->successors().push_back(block);
split_edge_block->predecessors().push_back(pred);
split_edge_block->set_deferred(pred->deferred());
*current_pred = split_edge_block;
// Find a corresponding successor in the previous block, replace it
// with the split edge block... but only do it once, since we only
// replace the previous blocks in the current block one at a time.
for (auto successor = pred->successors().begin();
successor != pred->successors().end(); ++successor) {
if (*successor == block) {
*successor = split_edge_block;
break;
}
}
}
}
}
}
}
void Schedule::PropagateDeferredMark() {
// Push forward the deferred block marks through newly inserted blocks and
// other improperly marked blocks until a fixed point is reached.
// TODO(danno): optimize the propagation
bool done = false;
while (!done) {
done = true;
for (auto block : all_blocks_) {
if (!block->deferred()) {
bool deferred = block->PredecessorCount() > 0;
for (auto pred : block->predecessors()) {
if (!pred->deferred()) {
deferred = false;
}
}
if (deferred) {
block->set_deferred(true);
done = false;
}
}
}
}
}
void Schedule::AddSuccessor(BasicBlock* block, BasicBlock* succ) {
block->AddSuccessor(succ);
succ->AddPredecessor(block);
}
void Schedule::MoveSuccessors(BasicBlock* from, BasicBlock* to) {
for (BasicBlock* const successor : from->successors()) {
to->AddSuccessor(successor);
for (BasicBlock*& predecessor : successor->predecessors()) {
if (predecessor == from) predecessor = to;
}
}
from->ClearSuccessors();
}
void Schedule::SetControlInput(BasicBlock* block, Node* node) {
block->set_control_input(node);
SetBlockForNode(block, node);
}
void Schedule::SetBlockForNode(BasicBlock* block, Node* node) {
if (node->id() >= nodeid_to_block_.size()) {
nodeid_to_block_.resize(node->id() + 1);
}
nodeid_to_block_[node->id()] = block;
}
std::ostream& operator<<(std::ostream& os, const Schedule& s) {
for (BasicBlock* block :
((s.RpoBlockCount() == 0) ? *s.all_blocks() : *s.rpo_order())) {
if (block->rpo_number() == -1) {
os << "--- BLOCK id:" << block->id().ToInt();
} else {
os << "--- BLOCK B" << block->rpo_number();
}
if (block->deferred()) os << " (deferred)";
if (block->PredecessorCount() != 0) os << " <- ";
bool comma = false;
for (BasicBlock const* predecessor : block->predecessors()) {
if (comma) os << ", ";
comma = true;
if (predecessor->rpo_number() == -1) {
os << "id:" << predecessor->id().ToInt();
} else {
os << "B" << predecessor->rpo_number();
}
}
os << " ---\n";
for (Node* node : *block) {
os << " " << *node;
if (NodeProperties::IsTyped(node)) {
Type* type = NodeProperties::GetType(node);
os << " : ";
type->PrintTo(os);
}
os << "\n";
}
BasicBlock::Control control = block->control();
if (control != BasicBlock::kNone) {
os << " ";
if (block->control_input() != nullptr) {
os << *block->control_input();
} else {
os << "Goto";
}
os << " -> ";
comma = false;
for (BasicBlock const* successor : block->successors()) {
if (comma) os << ", ";
comma = true;
if (successor->rpo_number() == -1) {
os << "id:" << successor->id().ToInt();
} else {
os << "B" << successor->rpo_number();
}
}
os << "\n";
}
}
return os;
}
} // namespace compiler
} // namespace internal
} // namespace v8
| {
"content_hash": "03a2d8243a1102553380c398a731914b",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 80,
"avg_line_length": 28.45205479452055,
"alnum_prop": 0.6155512758786712,
"repo_name": "zero-rp/miniblink49",
"id": "4ac65e5ae4055b665c9409c878f0c0a18d9310c0",
"size": "12766",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "v8_5_1/src/compiler/schedule.cc",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "11324414"
},
{
"name": "Batchfile",
"bytes": "52488"
},
{
"name": "C",
"bytes": "31014938"
},
{
"name": "C++",
"bytes": "281193388"
},
{
"name": "CMake",
"bytes": "88548"
},
{
"name": "CSS",
"bytes": "20839"
},
{
"name": "DIGITAL Command Language",
"bytes": "226954"
},
{
"name": "HTML",
"bytes": "202637"
},
{
"name": "JavaScript",
"bytes": "32544926"
},
{
"name": "Lua",
"bytes": "32432"
},
{
"name": "M4",
"bytes": "125191"
},
{
"name": "Makefile",
"bytes": "1517330"
},
{
"name": "Objective-C",
"bytes": "87691"
},
{
"name": "Objective-C++",
"bytes": "35037"
},
{
"name": "PHP",
"bytes": "307541"
},
{
"name": "Perl",
"bytes": "3283676"
},
{
"name": "Prolog",
"bytes": "29177"
},
{
"name": "Python",
"bytes": "4308928"
},
{
"name": "R",
"bytes": "10248"
},
{
"name": "Scheme",
"bytes": "25457"
},
{
"name": "Shell",
"bytes": "264021"
},
{
"name": "TypeScript",
"bytes": "162421"
},
{
"name": "Vim script",
"bytes": "11362"
},
{
"name": "XS",
"bytes": "4319"
},
{
"name": "eC",
"bytes": "4383"
}
],
"symlink_target": ""
} |
.class public final enum Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.super Ljava/lang/Enum;
.source "Def.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/internal/policy/impl/sec/inkeffect/Def;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x4019
name = "ModeType"
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Enum",
"<",
"Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;",
">;"
}
.end annotation
# static fields
.field private static final synthetic $VALUES:[Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.field public static final enum RIPPLE_ONLY:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.field public static final enum RIPPLE_WITH_INK:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
# direct methods
.method static constructor <clinit>()V
.locals 4
.prologue
const/4 v3, 0x1
const/4 v2, 0x0
.line 6
new-instance v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
const-string v1, "RIPPLE_ONLY"
invoke-direct {v0, v1, v2}, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;-><init>(Ljava/lang/String;I)V
sput-object v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->RIPPLE_ONLY:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.line 7
new-instance v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
const-string v1, "RIPPLE_WITH_INK"
invoke-direct {v0, v1, v3}, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;-><init>(Ljava/lang/String;I)V
sput-object v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->RIPPLE_WITH_INK:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.line 5
const/4 v0, 0x2
new-array v0, v0, [Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
sget-object v1, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->RIPPLE_ONLY:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
aput-object v1, v0, v2
sget-object v1, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->RIPPLE_WITH_INK:Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
aput-object v1, v0, v3
sput-object v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->$VALUES:[Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
return-void
.end method
.method private constructor <init>(Ljava/lang/String;I)V
.locals 0
.parameter
.parameter
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
.prologue
.line 5
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
return-void
.end method
.method public static valueOf(Ljava/lang/String;)Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.locals 1
.parameter "name"
.prologue
.line 5
const-class v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
move-result-object v0
check-cast v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
return-object v0
.end method
.method public static values()[Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
.locals 1
.prologue
.line 5
sget-object v0, Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->$VALUES:[Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
invoke-virtual {v0}, [Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;->clone()Ljava/lang/Object;
move-result-object v0
check-cast v0, [Lcom/android/internal/policy/impl/sec/inkeffect/Def$ModeType;
return-object v0
.end method
| {
"content_hash": "1ac5d8c458c23e4612b835a1dea19ecf",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 160,
"avg_line_length": 31.5748031496063,
"alnum_prop": 0.728927680798005,
"repo_name": "baidurom/devices-n7108",
"id": "a03b274f9ce0e21385d1f4c99cfdc5f3b9a2235d",
"size": "4010",
"binary": false,
"copies": "2",
"ref": "refs/heads/coron-4.1",
"path": "android.policy.jar.out/smali/com/android/internal/policy/impl/sec/inkeffect/Def$ModeType.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Makefile",
"bytes": "12697"
},
{
"name": "Shell",
"bytes": "1974"
}
],
"symlink_target": ""
} |
//
// TestDoubleExecutionCommandExecutor.h
// Ambrogio
//
// Created by Gruppioni Michele on 20/11/2016.
// Copyright © 2016 Michele Gruppioni. All rights reserved.
//
#ifdef TEST
#ifndef TestDoubleExecutionCommandExecutor_h
#define TestDoubleExecutionCommandExecutor_h
#include "CommandExecutorDecorator.h"
class TestDoubleExecutionCommandExecutor: public CommandExecutorDecorator {
public:
TestDoubleExecutionCommandExecutor(CommandExecutor *commandExecutor);
virtual ~TestDoubleExecutionCommandExecutor(){};
virtual void executeCommand(Command *command);
};
#endif /* TestDoubleExecutionCommandExecutor_h */
#endif
| {
"content_hash": "f44596ed68460db5aa1d1a6eaa48a3fe",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 75,
"avg_line_length": 25.6,
"alnum_prop": 0.7984375,
"repo_name": "Gruppio/Ambrogio",
"id": "5dbf9bb9bec2ed4fcce9ff732db86279771ec95f",
"size": "641",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "TestDoubleExecutionCommandExecutor.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Arduino",
"bytes": "2441"
},
{
"name": "C",
"bytes": "7703"
},
{
"name": "C++",
"bytes": "123969"
},
{
"name": "JavaScript",
"bytes": "12804"
},
{
"name": "Shell",
"bytes": "39"
},
{
"name": "Swift",
"bytes": "6564"
}
],
"symlink_target": ""
} |
SharePla::Application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
end
| {
"content_hash": "ad7aa4d800b99345c5c3fb80ccf7233d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 37.03703703703704,
"alnum_prop": 0.759,
"repo_name": "RyuPiT/SharePla",
"id": "0f57c9717723c75a500129b99d8b6e6b3f54aa2a",
"size": "1000",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/environments/development.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24385"
},
{
"name": "Gherkin",
"bytes": "311"
},
{
"name": "HTML",
"bytes": "25569"
},
{
"name": "JavaScript",
"bytes": "19571"
},
{
"name": "Ruby",
"bytes": "39454"
}
],
"symlink_target": ""
} |
package perfect_match.models;
import java.util.Date;
public class AuthorEntity {
private int id;
private String name;
private Date bornOn;
public AuthorEntity() {
}
public AuthorEntity(int id, String name, Date bornOn) {
this.setId(id);
this.setName(name);
this.setBornOn(bornOn);
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getBornOn() {
return bornOn;
}
public void setBornOn(Date bornOn) {
this.bornOn = bornOn;
}
}
| {
"content_hash": "8bbcf936ed68b2935afb1cb321b5bd98",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 59,
"avg_line_length": 15.76086956521739,
"alnum_prop": 0.5682758620689655,
"repo_name": "ANSR-org/MagicMapper",
"id": "c3db4cf750f237387ce3fcb612b22c69902eb311",
"size": "725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/perfect_match/models/AuthorEntity.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "44936"
}
],
"symlink_target": ""
} |
@implementation MyAppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
| {
"content_hash": "59c01a855a6ac4827d9616aa6e1e0c9e",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 281,
"avg_line_length": 51.111111111111114,
"alnum_prop": 0.7885869565217392,
"repo_name": "HwangByungJo/RaPasscode",
"id": "0bfe492c30a58e42ad61f0a1266d5c29be390ef2",
"size": "2033",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Example/RaPasscode/MyAppDelegate.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "71472"
},
{
"name": "Ruby",
"bytes": "1910"
},
{
"name": "Shell",
"bytes": "20428"
},
{
"name": "Swift",
"bytes": "6166"
}
],
"symlink_target": ""
} |
module Citrus
module Core
class ConfigurationValidator
def validate(configuration)
Configuration === configuration &&
configuration.build_script &&
!configuration.build_script.empty?
end
end
end
end
| {
"content_hash": "fe5d3552bfc9de4b54aa02c034f910e0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 19.153846153846153,
"alnum_prop": 0.6586345381526104,
"repo_name": "pawelpacana/citrus-core",
"id": "8f56c339e5e26806ce919e17b5a0f8213f20959a",
"size": "249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/citrus/core/configuration_validator.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "26816"
}
],
"symlink_target": ""
} |
---
layout: post
title: "EventBus事件总线"
crawlertitle: "EventBus事件总线"
summary: "EventBus事件总线"
date: 2016-07-12 23:09:47 +0700
categories: posts
tags: 'Android源码分析'
author: hewking
---
> Android 常用事件传递有:BroadcastReceiver ,Interface回调,Handler,事件总线,这几种方式各有使用场景及优点和不足。本篇分析EventBus
### 基本使用
```
public void onCreate(){
EventBus bus = EventBus.getDefault();
bus.register(this);
bus.post("post message");
}
@Subscribe
public void onEvent(String message){
Log.i("TAG","receive message");
}
public void onDestory(){
EventBus.unregister(this);
}
```
从以上示例可知基本使用主要有四个步骤
- 获取EventBus 实例
- 订阅 register
- 发送消息 post
- 取消订阅
所以以下分析也是从四个步骤开始,先大致分析整体结构。
```
public static EventBus getDefault() {
if (defaultInstance == null) {
synchronized (EventBus.class) {
if (defaultInstance == null) {
defaultInstance = new EventBus();
}
}
}
return defaultInstance;
}
```
从getDefault方法看,是懒汉式单例模式。主要代码给defaultInstance 赋值对象,进入到EventBus构造方法看
```
public EventBus() {
this(DEFAULT_BUILDER);
}
EventBus(EventBusBuilder builder) {
subscriptionsByEventType = new HashMap<>();
typesBySubscriber = new HashMap<>();
stickyEvents = new ConcurrentHashMap<>();
mainThreadPoster = new HandlerPoster(this, Looper.getMainLooper(), 10);
backgroundPoster = new BackgroundPoster(this);
asyncPoster = new AsyncPoster(this);
indexCount = builder.subscriberInfoIndexes != null ? builder.subscriberInfoIndexes.size() : 0;
subscriberMethodFinder = new SubscriberMethodFinder(builder.subscriberInfoIndexes,
builder.strictMethodVerification, builder.ignoreGeneratedIndex);
logSubscriberExceptions = builder.logSubscriberExceptions;
logNoSubscriberMessages = builder.logNoSubscriberMessages;
sendSubscriberExceptionEvent = builder.sendSubscriberExceptionEvent;
sendNoSubscriberEvent = builder.sendNoSubscriberEvent;
throwSubscriberException = builder.throwSubscriberException;
eventInheritance = builder.eventInheritance;
executorService = builder.executorService;
}
```
在构造方法中,对EventBus 各个成员赋值。通过创建者模式。包括两个重要得Map
- subscriptionsByEventType
- typesBySubscriber
前者通过eventType 保存所订阅对象与订阅方法组成得对象newSubscription,后者保存所订阅对象与所有得已订阅方法。这两个重要的 map 再post 方法调用,有重要作用。
### 订阅
```
public void register(Object subscriber) {
Class<?> subscriberClass = subscriber.getClass();
List<SubscriberMethod> subscriberMethods = subscriberMethodFinder.findSubscriberMethods(subscriberClass);
synchronized (this) {
for (SubscriberMethod subscriberMethod : subscriberMethods) {
subscribe(subscriber, subscriberMethod);
}
}
}
// Must be called in synchronized block
private void subscribe(Object subscriber, SubscriberMethod subscriberMethod) {
Class<?> eventType = subscriberMethod.eventType;
Subscription newSubscription = new Subscription(subscriber, subscriberMethod);
CopyOnWriteArrayList<Subscription> subscriptions = subscriptionsByEventType.get(eventType);
if (subscriptions == null) {
subscriptions = new CopyOnWriteArrayList<>();
subscriptionsByEventType.put(eventType, subscriptions);
} else {
if (subscriptions.contains(newSubscription)) {
throw new EventBusException("Subscriber " + subscriber.getClass() + " already registered to event "
+ eventType);
}
}
int size = subscriptions.size();
for (int i = 0; i <= size; i++) {
if (i == size || subscriberMethod.priority > subscriptions.get(i).subscriberMethod.priority) {
subscriptions.add(i, newSubscription);
break;
}
}
List<Class<?>> subscribedEvents = typesBySubscriber.get(subscriber);
if (subscribedEvents == null) {
subscribedEvents = new ArrayList<>();
typesBySubscriber.put(subscriber, subscribedEvents);
}
subscribedEvents.add(eventType);
if (subscriberMethod.sticky) {
if (eventInheritance) {
// Existing sticky events of all subclasses of eventType have to be considered.
// Note: Iterating over all events may be inefficient with lots of sticky events,
// thus data structure should be changed to allow a more efficient lookup
// (e.g. an additional map storing sub classes of super classes: Class -> List<Class>).
Set<Map.Entry<Class<?>, Object>> entries = stickyEvents.entrySet();
for (Map.Entry<Class<?>, Object> entry : entries) {
Class<?> candidateEventType = entry.getKey();
if (eventType.isAssignableFrom(candidateEventType)) {
Object stickyEvent = entry.getValue();
checkPostStickyEventToSubscription(newSubscription, stickyEvent);
}
}
} else {
Object stickyEvent = stickyEvents.get(eventType);
checkPostStickyEventToSubscription(newSubscription, stickyEvent);
}
}
}
```
这段代码有点长,其实主要就做了两件事,更新了两个最重要的Map:subscriptionsByEventType和typesBySubscriber,已备我们在后面post事件时使用。其中,前者保存了已eventType为键的所有相关的subscription。
整体流程图如下:

### 发送事件
```
/** Posts the given event to the event bus. */
public void post(Object event) {
PostingThreadState postingState = currentPostingThreadState.get();
List<Object> eventQueue = postingState.eventQueue;
eventQueue.add(event);
if (!postingState.isPosting) {
postingState.isMainThread = Looper.getMainLooper() == Looper.myLooper();
postingState.isPosting = true;
if (postingState.canceled) {
throw new EventBusException("Internal error. Abort state was not reset");
}
try {
while (!eventQueue.isEmpty()) {
postSingleEvent(eventQueue.remove(0), postingState);
}
} finally {
postingState.isPosting = false;
postingState.isMainThread = false;
}
}
}
```
首先在发送事件所在的线程创建一个PostingThreadState对象,这个对象有一个事件队列,将新的事件添加到队列中,然后开始分发并将发送过的事件移除队列,直到将队列中所有的事件发送完毕。
```
private void postSingleEvent(Object event, PostingThreadState postingState) throws Error {
Class<?> eventClass = event.getClass();
boolean subscriptionFound = false;
if (eventInheritance) {
List<Class<?>> eventTypes = lookupAllEventTypes(eventClass);
int countTypes = eventTypes.size();
for (int h = 0; h < countTypes; h++) {
Class<?> clazz = eventTypes.get(h);
subscriptionFound |= postSingleEventForEventType(event, postingState, clazz);
}
} else {
subscriptionFound = postSingleEventForEventType(event, postingState, eventClass);
}
if (!subscriptionFound) {
if (logNoSubscriberMessages) {
Log.d(TAG, "No subscribers registered for event " + eventClass);
}
if (sendNoSubscriberEvent && eventClass != NoSubscriberEvent.class &&
eventClass != SubscriberExceptionEvent.class) {
post(new NoSubscriberEvent(this, event));
}
}
}
private boolean postSingleEventForEventType(Object event, PostingThreadState postingState, Class<?> eventClass) {
CopyOnWriteArrayList<Subscription> subscriptions;
synchronized (this) {
subscriptions = subscriptionsByEventType.get(eventClass);
}
if (subscriptions != null && !subscriptions.isEmpty()) {
for (Subscription subscription : subscriptions) {
postingState.event = event;
postingState.subscription = subscription;
boolean aborted = false;
try {
postToSubscription(subscription, event, postingState.isMainThread);
aborted = postingState.canceled;
} finally {
postingState.event = null;
postingState.subscription = null;
postingState.canceled = false;
}
if (aborted) {
break;
}
}
return true;
}
return false;
}
```
在这里,终于将发送的时间和subscriber联系了起来,根据发送事件的类型找到订阅了这个事件的订阅列表,通知列表中每个订阅者:
```
private void postToSubscription(Subscription subscription, Object event, boolean isMainThread) {
switch (subscription.subscriberMethod.threadMode) {
case POSTING:
invokeSubscriber(subscription, event);
break;
case MAIN:
if (isMainThread) {
invokeSubscriber(subscription, event);
} else {
mainThreadPoster.enqueue(subscription, event);
}
break;
case BACKGROUND:
if (isMainThread) {
backgroundPoster.enqueue(subscription, event);
} else {
invokeSubscriber(subscription, event);
}
break;
case ASYNC:
asyncPoster.enqueue(subscription, event);
break;
default:
throw new IllegalStateException("Unknown thread mode: " + subscription.subscriberMethod.threadMode);
}
}
void invokeSubscriber(Subscription subscription, Object event) {
try {
subscription.subscriberMethod.method.invoke(subscription.subscriber, event);
} catch (InvocationTargetException e) {
handleSubscriberException(subscription, event, e.getCause());
} catch (IllegalAccessException e) {
throw new IllegalStateException("Unexpected exception", e);
}
}
```
最后,看到了subscriber的subscriberMethod最终通过反射的方式被执行,整个事件分发的过程也就到此结束了。
\
### 取消订阅
通过typesBySubscriber这个HashMap找到订阅者订阅的所有事件,然后在subscriptionsByEventType的各个事件订阅列表中将这个订阅者对应的订阅事件移除,最后再将订阅者从typesBySubscriber移除。
### 总结
到这里,简单的EventBus事件流就算解释清楚了,主要就是两个方法,一个是register,一个是post,分别用于注册保存subscriber和消息通知subscriber, 在注册的过程中,通过subscriberMethodFinder将subscriber中所有的订阅方法都找出来,并根据两种不同的规则分别按照eventType和subscriber将订阅方法缓存在Map中,以供后续的步骤使用;在post事件中,是以线程为单位的,将事件放入当前线程的消息队列中,然后依次循环取出发送,直至队列为空,按照事件的类型找到当前事件类型相关的Subscription列表,如果当前bus还支持事件继承的话,还会找到当前事件类型的父类和父类接口对应的Subscription列表,找到这样的订阅列表之后,顺序取出每一个Subscription,然后通过反射调用subscriber的订阅方法,至此,整个事件的传递就结束了。
以下为类图:

依照这个图中,再回忆我们分析的整个过程:首先EventBus的实例都是依据EventBusBuilder创建的,我们可以自定义EventBusBuilder来达到定制EventBus的目的,SubscriberMethodFinder是用于找出订阅者中的所有的订阅方法,然后订阅方法和订阅者组成一个叫做Subscription的订阅事件,EventBus保存的就是Subscription的列表
| {
"content_hash": "d1899fa0375cea73e8aa779303046693",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 412,
"avg_line_length": 39.044368600682596,
"alnum_prop": 0.6451048951048951,
"repo_name": "hewking/hewking.github.io",
"id": "e5cf1d3116a74cbc5062774d915144e716f3f5b8",
"size": "13262",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2016-7-12-事件总线EventBus.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "19260"
},
{
"name": "HTML",
"bytes": "7830"
},
{
"name": "JavaScript",
"bytes": "2967"
}
],
"symlink_target": ""
} |
extern void adc_init();
#endif
| {
"content_hash": "d6f9fcc4d32869f540c09c7616295caf",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 23,
"avg_line_length": 10.666666666666666,
"alnum_prop": 0.6875,
"repo_name": "xizonghu/xf",
"id": "bafa71a88b8462c896a401ea1abebd33a5606338",
"size": "69",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "embed/xfbsp/adc.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "287701"
},
{
"name": "Objective-C",
"bytes": "398"
}
],
"symlink_target": ""
} |
namespace cc {
class ResourceUpdateQueue;
class TextureMailbox;
class TextureLayerClient {
public:
// Returns true and provides a mailbox if a new frame is available.
// Returns false if no new data is available
// and the old mailbox is to be reused.
virtual bool PrepareTextureMailbox(
TextureMailbox* mailbox,
std::unique_ptr<SingleReleaseCallback>* release_callback) = 0;
protected:
virtual ~TextureLayerClient() {}
};
} // namespace cc
#endif // CC_LAYERS_TEXTURE_LAYER_CLIENT_H_
| {
"content_hash": "3522f6956443fde3faa97855f29564e0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 25.75,
"alnum_prop": 0.7300970873786408,
"repo_name": "ssaroha/node-webrtc",
"id": "475309ae8ed9eea34d06a1f135d90615556b5d85",
"size": "817",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "third_party/webrtc/include/chromium/src/cc/layers/texture_layer_client.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "6179"
},
{
"name": "C",
"bytes": "2679"
},
{
"name": "C++",
"bytes": "54327"
},
{
"name": "HTML",
"bytes": "434"
},
{
"name": "JavaScript",
"bytes": "42707"
},
{
"name": "Python",
"bytes": "3835"
}
],
"symlink_target": ""
} |
<html>
<head>
<title>
Bitter election fight in New York transit union
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>
</head>
<body bgcolor="#FFFFCC" text="000000" link="990000" vlink="660000" alink="003366" leftmargin="0" topmargin="0">
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="474"><a name="Top"></a><?php include "../../legacy-includes/TopLogo.htmlf" ?></td>
<td width="270"><?php include "../../legacy-includes/TopAd.htmlf" ?>
</td></tr></table>
<table width="744" cellspacing="0" cellpadding="0" border="0">
<tr><td width="18" bgcolor="FFCC66"></td>
<td width="108" bgcolor="FFCC66" valign=top><?php include "../../legacy-includes/LeftButtons.htmlf" ?></td>
<td width="18"></td>
<td width="480" valign="top">
<?php include "../../legacy-includes/BodyInsert.htmlf" ?>
<font face="Times New Roman, Times, serif" size="5"><b>Bitter election fight in New York transit union</b></font><p>
<font face="Times New Roman, Times, serif" size="2"><b>By Peter Lamphere</b></font><font face="Arial, Helvetica, sans-serif" size="2"> | December 1, 2006 | Page 11</font><p>
<font face="Times New Roman, Times, serif" size="3">NEW YORK--One year after an illegal strike by transit workers that inspired workers across the U.S., the 30,000 members of Transport Workers Union (TWU) Local 100 are voting in a union election marked by a bitter campaign.<p>
Incumbent Local 100 President Roger Toussaint, who was briefly jailed as the result of the three-day strike, faces two challengers who are critical of both his handling of the strike and subsequent bargaining after the rank and file rejected a tentative contract by a seven-vote margin.<p>
This contract, which would deduct 1.5 percent of workers' gross wages towards health premiums, was subsequently accepted in an undemocratic "revote" engineered by Toussaint. It's now in the hands of state arbitrators.<p>
Toussaint was elected in a major victory in 2000 against the moribund old guard of the local. His electoral vehicle, New Directions, was the product of years of rank-and-file organizing at the grassroots. But since coming to power in 2000, Toussaint quickly fired many of his former allies, relying on a small group of loyalists to undemocratically run Local 100.<p>
Because of this chaos, Toussaint faces major anger in upcoming local elections. But Toussaint's transformation from reformer to autocrat has left the rank-and-file movement in Local 100 weak and divided.<p>
When rank-and-file discontent forced Toussaint to call the strike, there was no organized way to hold him accountable to the goals of stopping concessions--and even though an angry membership voted down the resulting contract, there was no cohesive rank-and-file organization to force the leadership to continue a fight to win a decent contract.<p>
Now the union faces a choice between Toussaint and candidates who could open the way for the restoration of the old guard that was kicked out in the 2000 elections.<p>
The main opposition slate is called Rail and Bus United and is a coalition of former Toussaint loyalists and supporters of the old guard.<p>
Rail and Bus has some valid critiques of the heavy-handed way Toussaint has run the union and justifiably cries foul at the health care concession. But the slate's presidential candidate, Barry Roberts, was himself an opponent of the strike. Sonny Hall, the old-guard former president of Local 100 and the TWU International, said, "I'd be happy if Barry Roberts were elected."<p>
Some of the most prominent voices opposing the concessionary contract, Ainsley Stewart and John Mooney, formed a slate called Union Democracy to oppose Toussaint. However, Stewart voted against the decision to strike and also is a vice president with the old guard-dominated Transport Workers Union International, which opposed the strike.<p>
Other candidates fall similarly short, such as Fresh Start slate candidate Michael Carrube.<p>
Finally, activists in the historically militant subway division of the union, which encompasses conductors and train operators, have put together an impressive independent team of candidates.<p>
This group is not contesting the presidency of the local and has not endorsed a candidate. But these activists have a clear position in favor of the strike, opposition to the concessionary contract, and a critique of the International union.<p>
Whoever wins the election, greater rank-and-file organization will be the key to rebuilding a fighting union.<p>
<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>
<td width="12"></td>
<td width="108" valign="top">
<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>
</td>
</tr>
</table>
</body>
</html>
| {
"content_hash": "e3f4f496eb9337347cf685e357de5e96",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 379,
"avg_line_length": 82.84482758620689,
"alnum_prop": 0.7654526534859522,
"repo_name": "ISO-tech/sw-d8",
"id": "ef5b04de1eae73ef356ed21115dbaa3afdf48bdc",
"size": "4805",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web/2006-2/611/611_11_TWU.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "30677"
},
{
"name": "Gherkin",
"bytes": "3374"
},
{
"name": "HTML",
"bytes": "269460"
},
{
"name": "Hack",
"bytes": "35936"
},
{
"name": "JavaScript",
"bytes": "104527"
},
{
"name": "PHP",
"bytes": "53430607"
},
{
"name": "SCSS",
"bytes": "50217"
},
{
"name": "Shell",
"bytes": "8234"
},
{
"name": "Twig",
"bytes": "57403"
}
],
"symlink_target": ""
} |
package org.apache.sshd.agent.unix;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.io.StreamCorruptedException;
import java.util.Objects;
import java.util.Queue;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.sshd.agent.common.AbstractAgentProxy;
import org.apache.sshd.common.FactoryManager;
import org.apache.sshd.common.FactoryManagerHolder;
import org.apache.sshd.common.PropertyResolverUtils;
import org.apache.sshd.common.SshException;
import org.apache.sshd.common.util.buffer.Buffer;
import org.apache.sshd.common.util.buffer.ByteArrayBuffer;
import org.apache.sshd.common.util.threads.CloseableExecutorService;
import org.apache.sshd.common.util.threads.ThreadUtils;
import org.apache.tomcat.jni.Local;
import org.apache.tomcat.jni.Pool;
import org.apache.tomcat.jni.Socket;
import org.apache.tomcat.jni.Status;
/**
* A client for a remote SSH agent
*/
public class AgentClient extends AbstractAgentProxy implements Runnable, FactoryManagerHolder {
/**
* Time to wait for new incoming messages before checking if the client is still active
*/
public static final String MESSAGE_POLL_FREQUENCY = "agent-client-message-poll-time";
/**
* Default value for {@value #MESSAGE_POLL_FREQUENCY}
*/
public static final long DEFAULT_MESSAGE_POLL_FREQUENCY = TimeUnit.MINUTES.toMillis(2L);
private final String authSocket;
private final FactoryManager manager;
private final long pool;
private final long handle;
private final Buffer receiveBuffer;
private final Queue<Buffer> messages;
private Future<?> pumper;
private final AtomicBoolean open = new AtomicBoolean(true);
public AgentClient(FactoryManager manager, String authSocket) throws IOException {
this(manager, authSocket, null);
}
public AgentClient(FactoryManager manager, String authSocket, CloseableExecutorService executor) throws IOException {
super((executor == null) ? ThreadUtils.newSingleThreadExecutor("AgentClient[" + authSocket + "]") : executor);
this.manager = Objects.requireNonNull(manager, "No factory manager instance provided");
this.authSocket = authSocket;
try {
AprLibrary aprLibInstance = AprLibrary.getInstance();
pool = Pool.create(aprLibInstance.getRootPool());
handle = Local.create(authSocket, pool);
int result = Local.connect(handle, 0);
if (result != Status.APR_SUCCESS) {
throwException(result);
}
receiveBuffer = new ByteArrayBuffer();
messages = new ArrayBlockingQueue<>(10);
CloseableExecutorService service = getExecutorService();
pumper = service.submit(this);
} catch (IOException e) {
throw e;
} catch (Exception e) {
throw new SshException(e);
}
}
@Override
public FactoryManager getFactoryManager() {
return manager;
}
public String getAuthSocket() {
return authSocket;
}
@Override
public boolean isOpen() {
return open.get();
}
@Override
public void run() {
try {
byte[] buf = new byte[1024];
while (isOpen()) {
int result = Socket.recv(handle, buf, 0, buf.length);
if (result < Status.APR_SUCCESS) {
throwException(result);
}
messageReceived(new ByteArrayBuffer(buf, 0, result));
}
} catch (Exception e) {
boolean debugEnabled = log.isDebugEnabled();
if (isOpen()) {
log.warn("run({}) {} while still open: {}",
this, e.getClass().getSimpleName(), e.getMessage());
if (debugEnabled) {
log.debug("run(" + this + ") open client exception", e);
}
} else {
if (debugEnabled) {
log.debug("run(" + this + ") closed client loop exception", e);
}
}
} finally {
try {
close();
} catch (IOException e) {
if (log.isDebugEnabled()) {
log.debug("run({}) {} while closing: {}",
this, e.getClass().getSimpleName(), e.getMessage());
}
}
}
}
protected void messageReceived(Buffer buffer) throws Exception {
Buffer message = null;
synchronized (receiveBuffer) {
receiveBuffer.putBuffer(buffer);
if (receiveBuffer.available() >= Integer.BYTES) {
int rpos = receiveBuffer.rpos();
int len = receiveBuffer.getInt();
// Protect against malicious or corrupted packets
if (len < 0) {
throw new StreamCorruptedException("Illogical message length: " + len);
}
receiveBuffer.rpos(rpos);
if (receiveBuffer.available() >= (Integer.BYTES + len)) {
message = new ByteArrayBuffer(receiveBuffer.getBytes());
receiveBuffer.compact();
}
}
}
if (message != null) {
synchronized (messages) {
messages.offer(message);
messages.notifyAll();
}
}
}
@Override
public void close() throws IOException {
if (open.getAndSet(false)) {
Socket.close(handle);
}
// make any waiting thread aware of the closure
synchronized (messages) {
messages.notifyAll();
}
if ((pumper != null) && (!pumper.isDone())) {
pumper.cancel(true);
}
super.close();
}
@Override
protected synchronized Buffer request(Buffer buffer) throws IOException {
int wpos = buffer.wpos();
buffer.wpos(0);
buffer.putUInt(wpos - 4);
buffer.wpos(wpos);
synchronized (messages) {
int result = Socket.send(handle, buffer.array(), buffer.rpos(), buffer.available());
if (result < Status.APR_SUCCESS) {
throwException(result);
}
return waitForMessageBuffer();
}
}
// NOTE: assumes messages lock is obtained prior to calling this method
protected Buffer waitForMessageBuffer() throws IOException {
FactoryManager mgr = getFactoryManager();
long idleTimeout = PropertyResolverUtils.getLongProperty(
mgr, MESSAGE_POLL_FREQUENCY, DEFAULT_MESSAGE_POLL_FREQUENCY);
if (idleTimeout <= 0L) {
idleTimeout = DEFAULT_MESSAGE_POLL_FREQUENCY;
}
boolean traceEnabled = log.isTraceEnabled();
for (int count = 1;; count++) {
if (!isOpen()) {
throw new SshException("Client is being closed");
}
if (!messages.isEmpty()) {
return messages.poll();
}
if (traceEnabled) {
log.trace("waitForMessageBuffer({}) wait iteration #{}", this, count);
}
try {
messages.wait(idleTimeout);
} catch (InterruptedException e) {
throw (IOException) new InterruptedIOException("Interrupted while waiting for messages at iteration #" + count)
.initCause(e);
}
}
}
/**
* transform an APR error number in a more fancy exception
*
* @param code APR error code
* @throws java.io.IOException the produced exception for the given APR error number
*/
protected void throwException(int code) throws IOException {
throw new IOException(org.apache.tomcat.jni.Error.strerror(-code) + " (code: " + code + ")");
}
@Override
public String toString() {
return getClass().getSimpleName() + "[socket=" + getAuthSocket() + "]";
}
}
| {
"content_hash": "bdc556e7de1db9e20125b9b383f35f6e",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 127,
"avg_line_length": 34.29707112970711,
"alnum_prop": 0.5869220446504819,
"repo_name": "apache/mina-sshd",
"id": "7d9ac354f57874cea8d24e57ee7ee9fb3542dda8",
"size": "8998",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sshd-core/src/main/java/org/apache/sshd/agent/unix/AgentClient.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "15035"
},
{
"name": "HTML",
"bytes": "6129"
},
{
"name": "Java",
"bytes": "8143189"
},
{
"name": "Python",
"bytes": "11690"
},
{
"name": "Shell",
"bytes": "36747"
}
],
"symlink_target": ""
} |
import { matrixFromTransformString } from './parseHelpers'
// everything in this module is to help build up data from the raw data
const assign = Object.assign
export function createModel (state, input) {
const {unit, version, requiredExtensions, scale} = input
state.unit = unit
state.version = version
state.requiredExtensions = requiredExtensions
state.transforms = {scale}
return state
}
export function createModelBuffers (modelData) {
// console.log("creating model buffers", modelData)//modelData, modelData._attributes)
// other implementation
const dataTypes = {'positions': Float32Array, 'indices': Uint32Array, 'normals': Float32Array, 'colors': Float32Array}
let output = ['positions', 'normals', 'colors'] // , "indices"]
.reduce(function (result, key) {
if (key in modelData._attributes) {
let data = modelData._attributes[key]
let dataBuff = new dataTypes[key](data.length)
// console.log('key',key, data, dataBuff)
dataBuff.set(data)
result[key] = dataBuff
}
return result
}, {})
return output
}
export function startObject (state, input) {
let {tag} = input
const object = ['id', 'name', 'type', 'pid', 'p']
.reduce(function (result, key) {
if (key in tag.attributes) {
result[key] = tag.attributes[key]
}
return result
}, {})
state.currentObject = assign({}, state.currentObject, object)
return state
}
export function finishObject (state, input) {
const object = state.currentObject
//FIXME, we should just copy keys from the currentObject, otherwise we lose stuff
state.objects[object.id] = Object.assign(
{id: object.id, name: object.name, type: object.type},
{pid: object.pid, p: object.p},
{geometry: createModelBuffers(object)},
{components: object.components})
state.currentObject = {
id: undefined,
name: undefined,
components: [],
positions: [],
_attributes: {
positions: [],
normals: [],
indices: [],
colors: []
}
}
return state
}
export function createMetadata (state, input) {
let metadata = assign({}, state.metadata, input)
state.metadata = metadata
return state
}
export function createVCoords (state, input) {
const positions = state.currentObject.positions
const A = [positions[ input[0] * 3 ], positions[input[0] * 3 + 1], positions[input[0] * 3 + 2]]
const B = [positions[ input[1] * 3 ], positions[input[1] * 3 + 1], positions[input[1] * 3 + 2]]
const C = [positions[ input[2] * 3 ], positions[input[2] * 3 + 1], positions[input[2] * 3 + 2]]
// console.log("createVCoords", positions, A, B, C)
state.currentObject._attributes.positions.push(...A, ...B, ...C) // state.currentObject._attributes.positions.concat(A).concat(B).concat(C)
return state
}
export function createVIndices (state, input) {
state.currentObject._attributes.indices.push(...input) // = state.currentObject._attributes.indices.concat(input)
return state
}
export function createVNormals (state, input) {
// see specs : A triangle face normal (for triangle ABC, in that order) throughout this specification is defined as
// a unit vector in the direction of the vector cross product (B - A) x (C - A).
// (B - A) x (C - A).
const normalIndices = [input[0], input[1], input[2]]
const positions = state.currentObject.positions
const A = [positions[ input[0] * 3 ], positions[input[0] * 3 + 1], positions[input[0] * 3 + 2]]
const B = [positions[ input[1] * 3 ], positions[input[1] * 3 + 1], positions[input[1] * 3 + 2]]
const C = [positions[ input[2] * 3 ], positions[input[2] * 3 + 1], positions[input[2] * 3 + 2]]
// console.log("indices",normalIndices,input[0], positions, "A",A,"B",B,"C",C)
function cross (a, b) {
let ax = a[0], ay = a[1], az = a[2]
let bx = b[0], by = b[1], bz = b[2]
let x = ay * bz - az * by
let y = az * bx - ax * bz
let z = ax * by - ay * bx
return [x, y, z]
}
function sub (a, b) {
return [
a[0] - b[0],
a[1] - b[1],
a[2] - b[2]
]
}
function length (v) {
return Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2])
}
function multiplyScalar (v, s) {
return [ v[0] * s, v[1] * s, v[2] * s ]
}
function divideScalar (vector, scalar) {
return multiplyScalar(vector, (1 / scalar))
}
function normalize (v) {
return divideScalar(v, length(v))
}
const normal = normalize(cross(sub(B, A), sub(C, A)))
function assignAtIndex (target, startIndex, data) {
for (let i = 0;i < 3;i++) {
//console.log('assign', target, startIndex, data, data[i])
target[startIndex + i] = data[i]
}
}
function assignAllAtIndices (target, indices, data) {
indices.forEach(function (cindex) {
assignAtIndex(target, cindex * 3, data)
})
}
state.currentObject._attributes.normals.push(...normal, ...normal, ...normal) // state.currentObject._attributes.normals.concat(normal).concat(normal).concat(normal)
return state
}
export function createItem (state, input) {
let {tag} = input
const item = ['objectid', 'transform', 'partnumber', 'path']
.reduce(function (result, key) {
// console.log('result', result)
if (key in tag.attributes) {
if (key === 'transform') {
result['transforms'] = matrixFromTransformString(tag.attributes[key]) // .split(' ').map(t => parseFloat(t))
} else {
result[key] = tag.attributes[key]
}
}
return result
}, {})
state.build.push(item)
if (item.path) {
state.subResources.push(item.path)
}
return state
}
export function createComponent (state, input) {
let {tag} = input
const component = ['id', 'objectid', 'transform', 'path'] // FIXME: no clear seperation of specs, path is production spec
.reduce(function (result, key) {
// console.log('result', result)
if (key in tag.attributes) {
if (key === 'transform') {
result['transforms'] = matrixFromTransformString(tag.attributes[key])
} else {
result[key] = tag.attributes[key]
}
}
return result
}, {})
// state.objects[state.currentObject.id]= item
state.currentObject.components.push(component)
const componentPath = component.path
if (componentPath && state.subResources.indexOf(componentPath) === -1) {
state.subResources.push(componentPath)
}
// console.log('createComponent', item)
}
| {
"content_hash": "65deec5cf262e4262b8cc81538d612d2",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 167,
"avg_line_length": 31.115384615384617,
"alnum_prop": 0.6283992583436341,
"repo_name": "usco/usco-3mf-parser",
"id": "e69cc095a0c638141d64205b0ed59b9cf2795cbf",
"size": "6472",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/specCoreCreate.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "41646"
}
],
"symlink_target": ""
} |
import { Component } from 'react';
import PageBase from '../components/PageBase';
import StopWatch from '../components/StopWatch';
export default class extends Component {
render() {
return (
<PageBase Comp={StopWatch} />
);
}
} | {
"content_hash": "19bb90a0e3dfd35f983c3e48150f0aff",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 22.636363636363637,
"alnum_prop": 0.6626506024096386,
"repo_name": "Williammer/FrontEnd-deliberate-practices",
"id": "e4eeb04df5a8a7a4d69fde95ba13dfdff881ea12",
"size": "249",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "react/next/pages/StopWatch.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9383"
},
{
"name": "HTML",
"bytes": "11806"
},
{
"name": "JavaScript",
"bytes": "107794"
},
{
"name": "TypeScript",
"bytes": "18478"
},
{
"name": "Vue",
"bytes": "2538"
}
],
"symlink_target": ""
} |
./install/brew.sh
./install/apps.sh
./install/cli.sh
./install/vscode.sh
./install/link.sh | {
"content_hash": "b85f23ef4cda6b21f1402c003706c37e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 19,
"avg_line_length": 18,
"alnum_prop": 0.7333333333333333,
"repo_name": "devinmcgloin/dotfiles",
"id": "09800b37d661ae31ba4a7e1f29682a3cec29567f",
"size": "102",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "install.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Emacs Lisp",
"bytes": "2782"
},
{
"name": "Shell",
"bytes": "8198"
},
{
"name": "Vim script",
"bytes": "2014423"
}
],
"symlink_target": ""
} |
import assignMergeValue from './_assignMergeValue.js';
import cloneBuffer from './_cloneBuffer.js';
import cloneTypedArray from './_cloneTypedArray.js';
import copyArray from './_copyArray.js';
import initCloneObject from './_initCloneObject.js';
import isArguments from './isArguments.js';
import isArray from './isArray.js';
import isArrayLikeObject from './isArrayLikeObject.js';
import isBuffer from './isBuffer.js';
import isFunction from './isFunction.js';
import isObject from './isObject.js';
import isPlainObject from './isPlainObject.js';
import isTypedArray from './isTypedArray.js';
import safeGet from './_safeGet.js';
import toPlainObject from './toPlainObject.js';
/**
* A specialized version of `baseMerge` for arrays and objects which performs
* deep merges and tracks traversed objects enabling objects with circular
* references to be merged.
*
* @private
* @param {Object} object The destination object.
* @param {Object} source The source object.
* @param {string} key The key of the value to merge.
* @param {number} srcIndex The index of `source`.
* @param {Function} mergeFunc The function to merge values.
* @param {Function} [customizer] The function to customize assigned values.
* @param {Object} [stack] Tracks traversed source values and their merged
* counterparts.
*/
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
var objValue = safeGet(object, key),
srcValue = safeGet(source, key),
stacked = stack.get(srcValue);
if (stacked) {
assignMergeValue(object, key, stacked);
return;
}
var newValue = customizer
? customizer(objValue, srcValue, (key + ''), object, source, stack)
: undefined;
var isCommon = newValue === undefined;
if (isCommon) {
var isArr = isArray(srcValue),
isBuff = !isArr && isBuffer(srcValue),
isTyped = !isArr && !isBuff && isTypedArray(srcValue);
newValue = srcValue;
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
}
else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
}
else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
}
else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
}
else {
newValue = [];
}
}
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
}
else if (!isObject(objValue) || isFunction(objValue)) {
newValue = initCloneObject(srcValue);
}
}
else {
isCommon = false;
}
}
if (isCommon) {
// Recursively merge objects and arrays (susceptible to call stack limits).
stack.set(srcValue, newValue);
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
stack['delete'](srcValue);
}
assignMergeValue(object, key, newValue);
}
export default baseMergeDeep;
| {
"content_hash": "b4e11d7ef1adfa2c6653e295ab28d068",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 85,
"avg_line_length": 32.62765957446808,
"alnum_prop": 0.6700358656667753,
"repo_name": "BigBoss424/portfolio",
"id": "756d63344822ca8d60e329a7bc7b08b7e7990811",
"size": "3067",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "v8/development/node_modules/lodash-es/_baseMergeDeep.js",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"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_21) on Thu Dec 12 11:16:51 BRST 2013 -->
<title>Serialized Form (Jason - AgentSpeak Java Interpreter)</title>
<meta name="date" content="2013-12-12">
<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="Serialized Form (Jason - AgentSpeak Java Interpreter)";
}
//-->
</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>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-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?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.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">
<h1 title="Serialized Form" class="title">Serialized Form</h1>
</div>
<div class="serializedFormContainer">
<ul class="blockList">
<li class="blockList">
<h2 title="Package">Package jason</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.JasonException">
<!-- -->
</a>
<h3>Class <a href="jason/JasonException.html" title="class in jason">jason.JasonException</a> extends java.lang.Exception implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>error</h4>
<pre><a href="jason/asSyntax/Term.html" title="interface in jason.asSyntax">Term</a> error</pre>
</li>
<li class="blockListLast">
<h4>errorAnnots</h4>
<pre><a href="jason/asSyntax/ListTerm.html" title="interface in jason.asSyntax">ListTerm</a> errorAnnots</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.NoValueException">
<!-- -->
</a>
<h3>Class <a href="jason/NoValueException.html" title="class in jason">jason.NoValueException</a> extends <a href="jason/JasonException.html" title="class in jason">JasonException</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.ReceiverNotFoundException">
<!-- -->
</a>
<h3>Class <a href="jason/ReceiverNotFoundException.html" title="class in jason">jason.ReceiverNotFoundException</a> extends java.lang.Exception implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.RevisionFailedException">
<!-- -->
</a>
<h3>Class <a href="jason/RevisionFailedException.html" title="class in jason">jason.RevisionFailedException</a> extends <a href="jason/JasonException.html" title="class in jason">JasonException</a> implements Serializable</h3>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.asSemantics</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.asSemantics.ActionExec">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/ActionExec.html" title="class in jason.asSemantics">jason.asSemantics.ActionExec</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>action</h4>
<pre><a href="jason/asSyntax/Literal.html" title="class in jason.asSyntax">Literal</a> action</pre>
</li>
<li class="blockList">
<h4>intention</h4>
<pre><a href="jason/asSemantics/Intention.html" title="class in jason.asSemantics">Intention</a> intention</pre>
</li>
<li class="blockList">
<h4>result</h4>
<pre>boolean result</pre>
</li>
<li class="blockList">
<h4>failureReason</h4>
<pre><a href="jason/asSyntax/Literal.html" title="class in jason.asSyntax">Literal</a> failureReason</pre>
</li>
<li class="blockListLast">
<h4>failureMsg</h4>
<pre>java.lang.String failureMsg</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.Circumstance">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/Circumstance.html" title="class in jason.asSemantics">jason.asSemantics.Circumstance</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>E</h4>
<pre>java.util.Queue<E> E</pre>
</li>
<li class="blockList">
<h4>I</h4>
<pre>java.util.Queue<E> I</pre>
</li>
<li class="blockList">
<h4>A</h4>
<pre><a href="jason/asSemantics/ActionExec.html" title="class in jason.asSemantics">ActionExec</a> A</pre>
</li>
<li class="blockList">
<h4>MB</h4>
<pre>java.util.Queue<E> MB</pre>
</li>
<li class="blockList">
<h4>RP</h4>
<pre>java.util.List<E> RP</pre>
</li>
<li class="blockList">
<h4>AP</h4>
<pre>java.util.List<E> AP</pre>
</li>
<li class="blockList">
<h4>SE</h4>
<pre><a href="jason/asSemantics/Event.html" title="class in jason.asSemantics">Event</a> SE</pre>
</li>
<li class="blockList">
<h4>SO</h4>
<pre><a href="jason/asSemantics/Option.html" title="class in jason.asSemantics">Option</a> SO</pre>
</li>
<li class="blockList">
<h4>SI</h4>
<pre><a href="jason/asSemantics/Intention.html" title="class in jason.asSemantics">Intention</a> SI</pre>
</li>
<li class="blockList">
<h4>AI</h4>
<pre><a href="jason/asSemantics/Intention.html" title="class in jason.asSemantics">Intention</a> AI</pre>
</li>
<li class="blockList">
<h4>AE</h4>
<pre><a href="jason/asSemantics/Event.html" title="class in jason.asSemantics">Event</a> AE</pre>
</li>
<li class="blockList">
<h4>atomicIntSuspended</h4>
<pre>boolean atomicIntSuspended</pre>
</li>
<li class="blockList">
<h4>PA</h4>
<pre>java.util.Map<K,V> PA</pre>
</li>
<li class="blockList">
<h4>FA</h4>
<pre>java.util.List<E> FA</pre>
</li>
<li class="blockList">
<h4>PI</h4>
<pre>java.util.Map<K,V> PI</pre>
</li>
<li class="blockList">
<h4>PE</h4>
<pre>java.util.Map<K,V> PE</pre>
</li>
<li class="blockList">
<h4>listeners</h4>
<pre>java.util.List<E> listeners</pre>
</li>
<li class="blockListLast">
<h4>ts</h4>
<pre><a href="jason/asSemantics/TransitionSystem.html" title="class in jason.asSemantics">TransitionSystem</a> ts</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.DefaultArithFunction">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">jason.asSemantics.DefaultArithFunction</a> extends java.lang.Object implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.asSemantics.DefaultInternalAction">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">jason.asSemantics.DefaultInternalAction</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.asSemantics.Event">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/Event.html" title="class in jason.asSemantics">jason.asSemantics.Event</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>trigger</h4>
<pre><a href="jason/asSyntax/Trigger.html" title="class in jason.asSyntax">Trigger</a> trigger</pre>
</li>
<li class="blockListLast">
<h4>intention</h4>
<pre><a href="jason/asSemantics/Intention.html" title="class in jason.asSemantics">Intention</a> intention</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.IntendedMeans">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/IntendedMeans.html" title="class in jason.asSemantics">jason.asSemantics.IntendedMeans</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>unif</h4>
<pre><a href="jason/asSemantics/Unifier.html" title="class in jason.asSemantics">Unifier</a> unif</pre>
</li>
<li class="blockList">
<h4>planBody</h4>
<pre><a href="jason/asSyntax/PlanBody.html" title="interface in jason.asSyntax">PlanBody</a> planBody</pre>
</li>
<li class="blockList">
<h4>plan</h4>
<pre><a href="jason/asSyntax/Plan.html" title="class in jason.asSyntax">Plan</a> plan</pre>
</li>
<li class="blockList">
<h4>trigger</h4>
<pre><a href="jason/asSyntax/Trigger.html" title="class in jason.asSyntax">Trigger</a> trigger</pre>
</li>
<li class="blockListLast">
<h4>renamedVars</h4>
<pre><a href="jason/asSemantics/Unifier.html" title="class in jason.asSemantics">Unifier</a> renamedVars</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.Intention">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/Intention.html" title="class in jason.asSemantics">jason.asSemantics.Intention</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>id</h4>
<pre>int id</pre>
</li>
<li class="blockList">
<h4>atomicCount</h4>
<pre>int atomicCount</pre>
</li>
<li class="blockList">
<h4>isSuspended</h4>
<pre>boolean isSuspended</pre>
</li>
<li class="blockListLast">
<h4>intendedMeans</h4>
<pre>java.util.Deque<E> intendedMeans</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.Message">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/Message.html" title="class in jason.asSemantics">jason.asSemantics.Message</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>ilForce</h4>
<pre>java.lang.String ilForce</pre>
</li>
<li class="blockList">
<h4>sender</h4>
<pre>java.lang.String sender</pre>
</li>
<li class="blockList">
<h4>receiver</h4>
<pre>java.lang.String receiver</pre>
</li>
<li class="blockList">
<h4>propCont</h4>
<pre>java.lang.Object propCont</pre>
</li>
<li class="blockList">
<h4>msgId</h4>
<pre>java.lang.String msgId</pre>
</li>
<li class="blockListLast">
<h4>inReplyTo</h4>
<pre>java.lang.String inReplyTo</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSemantics.Option">
<!-- -->
</a>
<h3>Class <a href="jason/asSemantics/Option.html" title="class in jason.asSemantics">jason.asSemantics.Option</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>plan</h4>
<pre><a href="jason/asSyntax/Plan.html" title="class in jason.asSyntax">Plan</a> plan</pre>
</li>
<li class="blockListLast">
<h4>unif</h4>
<pre><a href="jason/asSemantics/Unifier.html" title="class in jason.asSemantics">Unifier</a> unif</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.asSyntax</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.asSyntax.ArithExpr">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/ArithExpr.html" title="class in jason.asSyntax">jason.asSyntax.ArithExpr</a> extends <a href="jason/asSyntax/ArithFunctionTerm.html" title="class in jason.asSyntax">ArithFunctionTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>op</h4>
<pre><a href="jason/asSyntax/ArithExpr.ArithmeticOp.html" title="enum in jason.asSyntax">ArithExpr.ArithmeticOp</a> op</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.ArithFunctionTerm">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/ArithFunctionTerm.html" title="class in jason.asSyntax">jason.asSyntax.ArithFunctionTerm</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>value</h4>
<pre><a href="jason/asSyntax/NumberTerm.html" title="interface in jason.asSyntax">NumberTerm</a> value</pre>
</li>
<li class="blockList">
<h4>function</h4>
<pre><a href="jason/asSemantics/ArithFunction.html" title="interface in jason.asSemantics">ArithFunction</a> function</pre>
</li>
<li class="blockListLast">
<h4>agent</h4>
<pre><a href="jason/asSemantics/Agent.html" title="class in jason.asSemantics">Agent</a> agent</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Atom">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Atom.html" title="class in jason.asSyntax">jason.asSyntax.Atom</a> extends <a href="jason/asSyntax/Literal.html" title="class in jason.asSyntax">Literal</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>functor</h4>
<pre>java.lang.String functor</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.BinaryStructure">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/BinaryStructure.html" title="class in jason.asSyntax">jason.asSyntax.BinaryStructure</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.asSyntax.BodyLiteral">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/BodyLiteral.html" title="class in jason.asSyntax">jason.asSyntax.BodyLiteral</a> extends <a href="jason/asSyntax/PlanBodyImpl.html" title="class in jason.asSyntax">PlanBodyImpl</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.asSyntax.CyclicTerm">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/CyclicTerm.html" title="class in jason.asSyntax">jason.asSyntax.CyclicTerm</a> extends <a href="jason/asSyntax/LiteralImpl.html" title="class in jason.asSyntax">LiteralImpl</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>cyclicVar</h4>
<pre><a href="jason/asSyntax/VarTerm.html" title="class in jason.asSyntax">VarTerm</a> cyclicVar</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.DefaultTerm">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/DefaultTerm.html" title="class in jason.asSyntax">jason.asSyntax.DefaultTerm</a> extends java.lang.Object implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>hashCodeCache</h4>
<pre>java.lang.Integer hashCodeCache</pre>
</li>
<li class="blockListLast">
<h4>srcInfo</h4>
<pre><a href="jason/asSyntax/SourceInfo.html" title="class in jason.asSyntax">SourceInfo</a> srcInfo</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.InternalActionLiteral">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/InternalActionLiteral.html" title="class in jason.asSyntax">jason.asSyntax.InternalActionLiteral</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>ia</h4>
<pre><a href="jason/asSemantics/InternalAction.html" title="interface in jason.asSemantics">InternalAction</a> ia</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.ListTermImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/ListTermImpl.html" title="class in jason.asSyntax">jason.asSyntax.ListTermImpl</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>term</h4>
<pre><a href="jason/asSyntax/Term.html" title="interface in jason.asSyntax">Term</a> term</pre>
</li>
<li class="blockListLast">
<h4>next</h4>
<pre><a href="jason/asSyntax/Term.html" title="interface in jason.asSyntax">Term</a> next</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Literal">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Literal.html" title="class in jason.asSyntax">jason.asSyntax.Literal</a> extends <a href="jason/asSyntax/DefaultTerm.html" title="class in jason.asSyntax">DefaultTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>predicateIndicatorCache</h4>
<pre><a href="jason/asSyntax/PredicateIndicator.html" title="class in jason.asSyntax">PredicateIndicator</a> predicateIndicatorCache</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.LiteralImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/LiteralImpl.html" title="class in jason.asSyntax">jason.asSyntax.LiteralImpl</a> extends <a href="jason/asSyntax/Pred.html" title="class in jason.asSyntax">Pred</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>type</h4>
<pre>boolean type</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.LogExpr">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/LogExpr.html" title="class in jason.asSyntax">jason.asSyntax.LogExpr</a> extends <a href="jason/asSyntax/BinaryStructure.html" title="class in jason.asSyntax">BinaryStructure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>op</h4>
<pre><a href="jason/asSyntax/LogExpr.LogicalOp.html" title="enum in jason.asSyntax">LogExpr.LogicalOp</a> op</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.NumberTermImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/NumberTermImpl.html" title="class in jason.asSyntax">jason.asSyntax.NumberTermImpl</a> extends <a href="jason/asSyntax/DefaultTerm.html" title="class in jason.asSyntax">DefaultTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>value</h4>
<pre>double value</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.ObjectTermImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/ObjectTermImpl.html" title="class in jason.asSyntax">jason.asSyntax.ObjectTermImpl</a> extends <a href="jason/asSyntax/DefaultTerm.html" title="class in jason.asSyntax">DefaultTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>o</h4>
<pre>java.lang.Object o</pre>
</li>
<li class="blockList">
<h4>mclone</h4>
<pre>java.lang.reflect.Method mclone</pre>
</li>
<li class="blockListLast">
<h4>hasTestedClone</h4>
<pre>boolean hasTestedClone</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Plan">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Plan.html" title="class in jason.asSyntax">jason.asSyntax.Plan</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>label</h4>
<pre><a href="jason/asSyntax/Pred.html" title="class in jason.asSyntax">Pred</a> label</pre>
</li>
<li class="blockList">
<h4>tevent</h4>
<pre><a href="jason/asSyntax/Trigger.html" title="class in jason.asSyntax">Trigger</a> tevent</pre>
</li>
<li class="blockList">
<h4>context</h4>
<pre><a href="jason/asSyntax/LogicalFormula.html" title="interface in jason.asSyntax">LogicalFormula</a> context</pre>
</li>
<li class="blockList">
<h4>body</h4>
<pre><a href="jason/asSyntax/PlanBody.html" title="interface in jason.asSyntax">PlanBody</a> body</pre>
</li>
<li class="blockList">
<h4>isAtomic</h4>
<pre>boolean isAtomic</pre>
</li>
<li class="blockList">
<h4>isAllUnifs</h4>
<pre>boolean isAllUnifs</pre>
</li>
<li class="blockList">
<h4>hasBreakpoint</h4>
<pre>boolean hasBreakpoint</pre>
</li>
<li class="blockListLast">
<h4>isTerm</h4>
<pre>boolean isTerm</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.PlanBodyImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/PlanBodyImpl.html" title="class in jason.asSyntax">jason.asSyntax.PlanBodyImpl</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>term</h4>
<pre><a href="jason/asSyntax/Term.html" title="interface in jason.asSyntax">Term</a> term</pre>
</li>
<li class="blockList">
<h4>next</h4>
<pre><a href="jason/asSyntax/PlanBody.html" title="interface in jason.asSyntax">PlanBody</a> next</pre>
</li>
<li class="blockList">
<h4>formType</h4>
<pre><a href="jason/asSyntax/PlanBody.BodyType.html" title="enum in jason.asSyntax">PlanBody.BodyType</a> formType</pre>
</li>
<li class="blockListLast">
<h4>isTerm</h4>
<pre>boolean isTerm</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Pred">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Pred.html" title="class in jason.asSyntax">jason.asSyntax.Pred</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>annots</h4>
<pre><a href="jason/asSyntax/ListTerm.html" title="interface in jason.asSyntax">ListTerm</a> annots</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.PredicateIndicator">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/PredicateIndicator.html" title="class in jason.asSyntax">jason.asSyntax.PredicateIndicator</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>functor</h4>
<pre>java.lang.String functor</pre>
</li>
<li class="blockList">
<h4>arity</h4>
<pre>int arity</pre>
</li>
<li class="blockListLast">
<h4>hash</h4>
<pre>int hash</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.RelExpr">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/RelExpr.html" title="class in jason.asSyntax">jason.asSyntax.RelExpr</a> extends <a href="jason/asSyntax/BinaryStructure.html" title="class in jason.asSyntax">BinaryStructure</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>op</h4>
<pre><a href="jason/asSyntax/RelExpr.RelationalOp.html" title="enum in jason.asSyntax">RelExpr.RelationalOp</a> op</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Rule">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Rule.html" title="class in jason.asSyntax">jason.asSyntax.Rule</a> extends <a href="jason/asSyntax/LiteralImpl.html" title="class in jason.asSyntax">LiteralImpl</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>body</h4>
<pre><a href="jason/asSyntax/LogicalFormula.html" title="interface in jason.asSyntax">LogicalFormula</a> body</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.SourceInfo">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/SourceInfo.html" title="class in jason.asSyntax">jason.asSyntax.SourceInfo</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>source</h4>
<pre>java.lang.String source</pre>
</li>
<li class="blockList">
<h4>beginSrcLine</h4>
<pre>int beginSrcLine</pre>
</li>
<li class="blockListLast">
<h4>endSrcLine</h4>
<pre>int endSrcLine</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.StringTermImpl">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/StringTermImpl.html" title="class in jason.asSyntax">jason.asSyntax.StringTermImpl</a> extends <a href="jason/asSyntax/DefaultTerm.html" title="class in jason.asSyntax">DefaultTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>value</h4>
<pre>java.lang.String value</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Structure">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">jason.asSyntax.Structure</a> extends <a href="jason/asSyntax/Atom.html" title="class in jason.asSyntax">Atom</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>terms</h4>
<pre>java.util.List<E> terms</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.Trigger">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/Trigger.html" title="class in jason.asSyntax">jason.asSyntax.Trigger</a> extends <a href="jason/asSyntax/Structure.html" title="class in jason.asSyntax">Structure</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>operator</h4>
<pre><a href="jason/asSyntax/Trigger.TEOperator.html" title="enum in jason.asSyntax">Trigger.TEOperator</a> operator</pre>
</li>
<li class="blockList">
<h4>type</h4>
<pre><a href="jason/asSyntax/Trigger.TEType.html" title="enum in jason.asSyntax">Trigger.TEType</a> type</pre>
</li>
<li class="blockList">
<h4>literal</h4>
<pre><a href="jason/asSyntax/Literal.html" title="class in jason.asSyntax">Literal</a> literal</pre>
</li>
<li class="blockListLast">
<h4>isTerm</h4>
<pre>boolean isTerm</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.UnnamedVar">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/UnnamedVar.html" title="class in jason.asSyntax">jason.asSyntax.UnnamedVar</a> extends <a href="jason/asSyntax/VarTerm.html" title="class in jason.asSyntax">VarTerm</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>myId</h4>
<pre>int myId</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.asSyntax.VarTerm">
<!-- -->
</a>
<h3>Class <a href="jason/asSyntax/VarTerm.html" title="class in jason.asSyntax">jason.asSyntax.VarTerm</a> extends <a href="jason/asSyntax/LiteralImpl.html" title="class in jason.asSyntax">LiteralImpl</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.environment.grid</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.environment.grid.Area">
<!-- -->
</a>
<h3>Class <a href="jason/environment/grid/Area.html" title="class in jason.environment.grid">jason.environment.grid.Area</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>tl</h4>
<pre><a href="jason/environment/grid/Location.html" title="class in jason.environment.grid">Location</a> tl</pre>
</li>
<li class="blockListLast">
<h4>br</h4>
<pre><a href="jason/environment/grid/Location.html" title="class in jason.environment.grid">Location</a> br</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.environment.grid.GridWorldView">
<!-- -->
</a>
<h3>Class <a href="jason/environment/grid/GridWorldView.html" title="class in jason.environment.grid">jason.environment.grid.GridWorldView</a> extends javax.swing.JFrame implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>cellSizeW</h4>
<pre>int cellSizeW</pre>
</li>
<li class="blockList">
<h4>cellSizeH</h4>
<pre>int cellSizeH</pre>
</li>
<li class="blockList">
<h4>drawArea</h4>
<pre>jason.environment.grid.GridWorldView.GridCanvas drawArea</pre>
</li>
<li class="blockList">
<h4>model</h4>
<pre><a href="jason/environment/grid/GridWorldModel.html" title="class in jason.environment.grid">GridWorldModel</a> model</pre>
</li>
<li class="blockListLast">
<h4>defaultFont</h4>
<pre>java.awt.Font defaultFont</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.environment.grid.Location">
<!-- -->
</a>
<h3>Class <a href="jason/environment/grid/Location.html" title="class in jason.environment.grid">jason.environment.grid.Location</a> extends java.lang.Object implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>x</h4>
<pre>int x</pre>
</li>
<li class="blockListLast">
<h4>y</h4>
<pre>int y</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.functions</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.functions.Abs">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Abs.html" title="class in jason.functions">jason.functions.Abs</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Average">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Average.html" title="class in jason.functions">jason.functions.Average</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.ceil">
<!-- -->
</a>
<h3>Class <a href="jason/functions/ceil.html" title="class in jason.functions">jason.functions.ceil</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Count">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Count.html" title="class in jason.functions">jason.functions.Count</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.e">
<!-- -->
</a>
<h3>Class <a href="jason/functions/e.html" title="class in jason.functions">jason.functions.e</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.floor">
<!-- -->
</a>
<h3>Class <a href="jason/functions/floor.html" title="class in jason.functions">jason.functions.floor</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Length">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Length.html" title="class in jason.functions">jason.functions.Length</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.log">
<!-- -->
</a>
<h3>Class <a href="jason/functions/log.html" title="class in jason.functions">jason.functions.log</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Max">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Max.html" title="class in jason.functions">jason.functions.Max</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Min">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Min.html" title="class in jason.functions">jason.functions.Min</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.pi">
<!-- -->
</a>
<h3>Class <a href="jason/functions/pi.html" title="class in jason.functions">jason.functions.pi</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Random">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Random.html" title="class in jason.functions">jason.functions.Random</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Round">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Round.html" title="class in jason.functions">jason.functions.Round</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.RuleToFunction">
<!-- -->
</a>
<h3>Class <a href="jason/functions/RuleToFunction.html" title="class in jason.functions">jason.functions.RuleToFunction</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>literal</h4>
<pre>java.lang.String literal</pre>
</li>
<li class="blockListLast">
<h4>arity</h4>
<pre>int arity</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.functions.Sqrt">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Sqrt.html" title="class in jason.functions">jason.functions.Sqrt</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.StdDev">
<!-- -->
</a>
<h3>Class <a href="jason/functions/StdDev.html" title="class in jason.functions">jason.functions.StdDev</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.Sum">
<!-- -->
</a>
<h3>Class <a href="jason/functions/Sum.html" title="class in jason.functions">jason.functions.Sum</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.functions.time">
<!-- -->
</a>
<h3>Class <a href="jason/functions/time.html" title="class in jason.functions">jason.functions.time</a> extends <a href="jason/asSemantics/DefaultArithFunction.html" title="class in jason.asSemantics">DefaultArithFunction</a> implements Serializable</h3>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.infra.centralised</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.infra.centralised.BaseDialogGUI">
<!-- -->
</a>
<h3>Class <a href="jason/infra/centralised/BaseDialogGUI.html" title="class in jason.infra.centralised">jason.infra.centralised.BaseDialogGUI</a> extends javax.swing.JDialog implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>ok</h4>
<pre>javax.swing.JButton ok</pre>
</li>
<li class="blockList">
<h4>cancel</h4>
<pre>javax.swing.JButton cancel</pre>
</li>
<li class="blockList">
<h4>pFields</h4>
<pre>javax.swing.JPanel pFields</pre>
</li>
<li class="blockListLast">
<h4>pLabels</h4>
<pre>javax.swing.JPanel pLabels</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.infra.centralised.KillAgentGUI">
<!-- -->
</a>
<h3>Class <a href="jason/infra/centralised/KillAgentGUI.html" title="class in jason.infra.centralised">jason.infra.centralised.KillAgentGUI</a> extends <a href="jason/infra/centralised/BaseDialogGUI.html" title="class in jason.infra.centralised">BaseDialogGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>lAgs</h4>
<pre>javax.swing.JList<E> lAgs</pre>
</li>
<li class="blockListLast">
<h4>services</h4>
<pre><a href="jason/runtime/RuntimeServicesInfraTier.html" title="interface in jason.runtime">RuntimeServicesInfraTier</a> services</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.infra.centralised.StartNewAgentGUI">
<!-- -->
</a>
<h3>Class <a href="jason/infra/centralised/StartNewAgentGUI.html" title="class in jason.infra.centralised">jason.infra.centralised.StartNewAgentGUI</a> extends <a href="jason/infra/centralised/BaseDialogGUI.html" title="class in jason.infra.centralised">BaseDialogGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>agName</h4>
<pre>javax.swing.JTextField agName</pre>
</li>
<li class="blockList">
<h4>agSource</h4>
<pre>javax.swing.JTextField agSource</pre>
</li>
<li class="blockList">
<h4>archClass</h4>
<pre>javax.swing.JTextField archClass</pre>
</li>
<li class="blockList">
<h4>agClass</h4>
<pre>javax.swing.JTextField agClass</pre>
</li>
<li class="blockList">
<h4>nbAgs</h4>
<pre>javax.swing.JTextField nbAgs</pre>
</li>
<li class="blockList">
<h4>agHost</h4>
<pre>javax.swing.JTextField agHost</pre>
</li>
<li class="blockList">
<h4>verbose</h4>
<pre>javax.swing.JComboBox<E> verbose</pre>
</li>
<li class="blockListLast">
<h4>openDir</h4>
<pre>java.lang.String openDir</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.infra.jade</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.infra.jade.JadeAg">
<!-- -->
</a>
<h3>Class <a href="jason/infra/jade/JadeAg.html" title="class in jason.infra.jade">jason.infra.jade.JadeAg</a> extends jade.core.Agent implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>logger</h4>
<pre>java.util.logging.Logger logger</pre>
</li>
<li class="blockList">
<h4>running</h4>
<pre>boolean running</pre>
</li>
<li class="blockListLast">
<h4>conversationIds</h4>
<pre>java.util.Map<K,V> conversationIds</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.infra.jade.JadeAgArch">
<!-- -->
</a>
<h3>Class <a href="jason/infra/jade/JadeAgArch.html" title="class in jason.infra.jade">jason.infra.jade.JadeAgArch</a> extends <a href="jason/infra/jade/JadeAg.html" title="class in jason.infra.jade">JadeAg</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>jasonBridgeAgArch</h4>
<pre><a href="jason/infra/jade/JasonBridgeArch.html" title="class in jason.infra.jade">JasonBridgeArch</a> jasonBridgeAgArch</pre>
</li>
<li class="blockList">
<h4>enterInSleepMode</h4>
<pre>boolean enterInSleepMode</pre>
</li>
<li class="blockList">
<h4>controllerAID</h4>
<pre>jade.core.AID controllerAID</pre>
</li>
<li class="blockList">
<h4>tsBehaviour</h4>
<pre>jade.core.behaviours.Behaviour tsBehaviour</pre>
</li>
<li class="blockList">
<h4>ts</h4>
<pre>jade.lang.acl.MessageTemplate ts</pre>
</li>
<li class="blockListLast">
<h4>tc</h4>
<pre>jade.lang.acl.MessageTemplate tc</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.infra.jade.JadeEnvironment">
<!-- -->
</a>
<h3>Class <a href="jason/infra/jade/JadeEnvironment.html" title="class in jason.infra.jade">jason.infra.jade.JadeEnvironment</a> extends <a href="jason/infra/jade/JadeAg.html" title="class in jason.infra.jade">JadeAg</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>userEnv</h4>
<pre><a href="jason/environment/Environment.html" title="class in jason.environment">Environment</a> userEnv</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.infra.jade.JadeExecutionControl">
<!-- -->
</a>
<h3>Class <a href="jason/infra/jade/JadeExecutionControl.html" title="class in jason.infra.jade">jason.infra.jade.JadeExecutionControl</a> extends <a href="jason/infra/jade/JadeAg.html" title="class in jason.infra.jade">JadeAg</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>userControl</h4>
<pre><a href="jason/control/ExecutionControl.html" title="class in jason.control">ExecutionControl</a> userControl</pre>
</li>
<li class="blockList">
<h4>executor</h4>
<pre>java.util.concurrent.ExecutorService executor</pre>
</li>
<li class="blockList">
<h4>state</h4>
<pre>org.w3c.dom.Document state</pre>
</li>
<li class="blockListLast">
<h4>syncWaitState</h4>
<pre>java.lang.Object syncWaitState</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.jeditplugin</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.jeditplugin.Config">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/Config.html" title="class in jason.jeditplugin">jason.jeditplugin.Config</a> extends java.util.Properties implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.jeditplugin.JasonID">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/JasonID.html" title="class in jason.jeditplugin">jason.jeditplugin.JasonID</a> extends javax.swing.JPanel implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>view</h4>
<pre>org.gjt.sp.jedit.View view</pre>
</li>
<li class="blockList">
<h4>myOut</h4>
<pre><a href="jason/runtime/OutputStreamAdapter.html" title="class in jason.runtime">OutputStreamAdapter</a> myOut</pre>
</li>
<li class="blockList">
<h4>textArea</h4>
<pre>javax.swing.JTextArea textArea</pre>
</li>
<li class="blockList">
<h4>animation</h4>
<pre>org.gjt.sp.jedit.gui.AnimatedIcon animation</pre>
</li>
<li class="blockList">
<h4>btStop</h4>
<pre>javax.swing.JButton btStop</pre>
</li>
<li class="blockList">
<h4>btRun</h4>
<pre>javax.swing.JButton btRun</pre>
</li>
<li class="blockList">
<h4>btDebug</h4>
<pre>javax.swing.JButton btDebug</pre>
</li>
<li class="blockList">
<h4>listModel</h4>
<pre>javax.swing.DefaultListModel<E> listModel</pre>
</li>
<li class="blockList">
<h4>lstAgs</h4>
<pre>javax.swing.JList<E> lstAgs</pre>
</li>
<li class="blockList">
<h4>errorSource</h4>
<pre>errorlist.DefaultErrorSource errorSource</pre>
</li>
<li class="blockListLast">
<h4>masLauncher</h4>
<pre><a href="jason/jeditplugin/MASLauncherInfraTier.html" title="interface in jason.jeditplugin">MASLauncherInfraTier</a> masLauncher</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.jeditplugin.JasonIDOptionPanel">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/JasonIDOptionPanel.html" title="class in jason.jeditplugin">jason.jeditplugin.JasonIDOptionPanel</a> extends org.gjt.sp.jedit.AbstractOptionPane implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.jeditplugin.NewAgentGUI">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/NewAgentGUI.html" title="class in jason.jeditplugin">jason.jeditplugin.NewAgentGUI</a> extends <a href="jason/infra/centralised/StartNewAgentGUI.html" title="class in jason.infra.centralised">StartNewAgentGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>buffer</h4>
<pre>org.gjt.sp.jedit.Buffer buffer</pre>
</li>
<li class="blockListLast">
<h4>view</h4>
<pre>org.gjt.sp.jedit.View view</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.jeditplugin.NewEnvironmentGUI">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/NewEnvironmentGUI.html" title="class in jason.jeditplugin">jason.jeditplugin.NewEnvironmentGUI</a> extends <a href="jason/jeditplugin/NewAgentGUI.html" title="class in jason.jeditplugin">NewAgentGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>envClass</h4>
<pre>javax.swing.JTextField envClass</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.jeditplugin.NewInternalActionGUI">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/NewInternalActionGUI.html" title="class in jason.jeditplugin">jason.jeditplugin.NewInternalActionGUI</a> extends <a href="jason/jeditplugin/NewAgentGUI.html" title="class in jason.jeditplugin">NewAgentGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>iaClass</h4>
<pre>javax.swing.JTextField iaClass</pre>
</li>
<li class="blockListLast">
<h4>iaPkg</h4>
<pre>javax.swing.JTextField iaPkg</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.jeditplugin.NewProjectGUI">
<!-- -->
</a>
<h3>Class <a href="jason/jeditplugin/NewProjectGUI.html" title="class in jason.jeditplugin">jason.jeditplugin.NewProjectGUI</a> extends <a href="jason/jeditplugin/NewAgentGUI.html" title="class in jason.jeditplugin">NewAgentGUI</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockList">
<h4>projName</h4>
<pre>javax.swing.JTextField projName</pre>
</li>
<li class="blockList">
<h4>projDir</h4>
<pre>javax.swing.JTextField projDir</pre>
</li>
<li class="blockList">
<h4>projFinalDir</h4>
<pre>javax.swing.JLabel projFinalDir</pre>
</li>
<li class="blockList">
<h4>projInfra</h4>
<pre>javax.swing.JComboBox<E> projInfra</pre>
</li>
<li class="blockListLast">
<h4>jasonID</h4>
<pre><a href="jason/jeditplugin/JasonID.html" title="class in jason.jeditplugin">JasonID</a> jasonID</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList">
<h2 title="Package">Package jason.stdlib</h2>
<ul class="blockList">
<li class="blockList"><a name="jason.stdlib.abolish">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/abolish.html" title="class in jason.stdlib">jason.stdlib.abolish</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.add_annot">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/add_annot.html" title="class in jason.stdlib">jason.stdlib.add_annot</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.add_nested_source">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/add_nested_source.html" title="class in jason.stdlib">jason.stdlib.add_nested_source</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.add_plan">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/add_plan.html" title="class in jason.stdlib">jason.stdlib.add_plan</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.all_names">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/all_names.html" title="class in jason.stdlib">jason.stdlib.all_names</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.at">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/at.html" title="class in jason.stdlib">jason.stdlib.at</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>ats</h4>
<pre>java.util.Map<K,V> ats</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.stdlib.atom">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/atom.html" title="class in jason.stdlib">jason.stdlib.atom</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.broadcast">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/broadcast.html" title="class in jason.stdlib">jason.stdlib.broadcast</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.clone">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/clone.html" title="class in jason.stdlib">jason.stdlib.clone</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.concat">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/concat.html" title="class in jason.stdlib">jason.stdlib.concat</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.copy_term">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/copy_term.html" title="class in jason.stdlib">jason.stdlib.copy_term</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.count">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/count.html" title="class in jason.stdlib">jason.stdlib.count</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.create_agent">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/create_agent.html" title="class in jason.stdlib">jason.stdlib.create_agent</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.current_intention">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/current_intention.html" title="class in jason.stdlib">jason.stdlib.current_intention</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.date">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/date.html" title="class in jason.stdlib">jason.stdlib.date</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.delete">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/delete.html" title="class in jason.stdlib">jason.stdlib.delete</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.desire">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/desire.html" title="class in jason.stdlib">jason.stdlib.desire</a> extends <a href="jason/stdlib/intend.html" title="class in jason.stdlib">intend</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.difference">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/difference.html" title="class in jason.stdlib">jason.stdlib.difference</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_all_desires">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_all_desires.html" title="class in jason.stdlib">jason.stdlib.drop_all_desires</a> extends <a href="jason/stdlib/drop_all_intentions.html" title="class in jason.stdlib">drop_all_intentions</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_all_events">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_all_events.html" title="class in jason.stdlib">jason.stdlib.drop_all_events</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_all_intentions">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_all_intentions.html" title="class in jason.stdlib">jason.stdlib.drop_all_intentions</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_desire">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_desire.html" title="class in jason.stdlib">jason.stdlib.drop_desire</a> extends <a href="jason/stdlib/drop_intention.html" title="class in jason.stdlib">drop_intention</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_event">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_event.html" title="class in jason.stdlib">jason.stdlib.drop_event</a> extends <a href="jason/stdlib/drop_desire.html" title="class in jason.stdlib">drop_desire</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.drop_intention">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/drop_intention.html" title="class in jason.stdlib">jason.stdlib.drop_intention</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.empty">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/empty.html" title="class in jason.stdlib">jason.stdlib.empty</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.eval">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/eval.html" title="class in jason.stdlib">jason.stdlib.eval</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.fail">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/fail.html" title="class in jason.stdlib">jason.stdlib.fail</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.fail_goal">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/fail_goal.html" title="class in jason.stdlib">jason.stdlib.fail_goal</a> extends <a href="jason/stdlib/succeed_goal.html" title="class in jason.stdlib">succeed_goal</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.findall">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/findall.html" title="class in jason.stdlib">jason.stdlib.findall</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.foreach">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/foreach.html" title="class in jason.stdlib">jason.stdlib.foreach</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.ground">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/ground.html" title="class in jason.stdlib">jason.stdlib.ground</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.if_then_else">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/if_then_else.html" title="class in jason.stdlib">jason.stdlib.if_then_else</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.intend">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/intend.html" title="class in jason.stdlib">jason.stdlib.intend</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.intersection">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/intersection.html" title="class in jason.stdlib">jason.stdlib.intersection</a> extends <a href="jason/stdlib/difference.html" title="class in jason.stdlib">difference</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.kill_agent">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/kill_agent.html" title="class in jason.stdlib">jason.stdlib.kill_agent</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.length">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/length.html" title="class in jason.stdlib">jason.stdlib.length</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.list">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/list.html" title="class in jason.stdlib">jason.stdlib.list</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.list_plans">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/list_plans.html" title="class in jason.stdlib">jason.stdlib.list_plans</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.literal">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/literal.html" title="class in jason.stdlib">jason.stdlib.literal</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.loop">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/loop.html" title="class in jason.stdlib">jason.stdlib.loop</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.max">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/max.html" title="class in jason.stdlib">jason.stdlib.max</a> extends <a href="jason/stdlib/min.html" title="class in jason.stdlib">min</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.member">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/member.html" title="class in jason.stdlib">jason.stdlib.member</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.min">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/min.html" title="class in jason.stdlib">jason.stdlib.min</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.my_name">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/my_name.html" title="class in jason.stdlib">jason.stdlib.my_name</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.nth">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/nth.html" title="class in jason.stdlib">jason.stdlib.nth</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.number">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/number.html" title="class in jason.stdlib">jason.stdlib.number</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.perceive">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/perceive.html" title="class in jason.stdlib">jason.stdlib.perceive</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.plan_label">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/plan_label.html" title="class in jason.stdlib">jason.stdlib.plan_label</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.prefix">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/prefix.html" title="class in jason.stdlib">jason.stdlib.prefix</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-4736810884249871078L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.stdlib.print">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/print.html" title="class in jason.stdlib">jason.stdlib.print</a> extends <a href="jason/stdlib/println.html" title="class in jason.stdlib">println</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.println">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/println.html" title="class in jason.stdlib">jason.stdlib.println</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.puts">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/puts.html" title="class in jason.stdlib">jason.stdlib.puts</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>1L</dd>
</dl>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>regex</h4>
<pre>java.util.regex.Pattern regex</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.stdlib.random">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/random.html" title="class in jason.stdlib">jason.stdlib.random</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>random</h4>
<pre>java.util.Random random</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.stdlib.range">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/range.html" title="class in jason.stdlib">jason.stdlib.range</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.relevant_plans">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/relevant_plans.html" title="class in jason.stdlib">jason.stdlib.relevant_plans</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.remove_plan">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/remove_plan.html" title="class in jason.stdlib">jason.stdlib.remove_plan</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.resume">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/resume.html" title="class in jason.stdlib">jason.stdlib.resume</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.reverse">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/reverse.html" title="class in jason.stdlib">jason.stdlib.reverse</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.send">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/send.html" title="class in jason.stdlib">jason.stdlib.send</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>lastSendWasSynAsk</h4>
<pre>boolean lastSendWasSynAsk</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.stdlib.setof">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/setof.html" title="class in jason.stdlib">jason.stdlib.setof</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.shuffle">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/shuffle.html" title="class in jason.stdlib">jason.stdlib.shuffle</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.sort">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/sort.html" title="class in jason.stdlib">jason.stdlib.sort</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.stopMAS">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/stopMAS.html" title="class in jason.stdlib">jason.stdlib.stopMAS</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.string">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/string.html" title="class in jason.stdlib">jason.stdlib.string</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.structure">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/structure.html" title="class in jason.stdlib">jason.stdlib.structure</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.sublist">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/sublist.html" title="class in jason.stdlib">jason.stdlib.sublist</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>-1725808189703510112L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.stdlib.substring">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/substring.html" title="class in jason.stdlib">jason.stdlib.substring</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.succeed_goal">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/succeed_goal.html" title="class in jason.stdlib">jason.stdlib.succeed_goal</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.suffix">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/suffix.html" title="class in jason.stdlib">jason.stdlib.suffix</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<dl class="nameValue">
<dt>serialVersionUID:</dt>
<dd>2463927564326061873L</dd>
</dl>
</li>
<li class="blockList"><a name="jason.stdlib.suspend">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/suspend.html" title="class in jason.stdlib">jason.stdlib.suspend</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
<ul class="blockList">
<li class="blockList"><a name="serializedForm">
<!-- -->
</a>
<h3>Serialized Fields</h3>
<ul class="blockList">
<li class="blockListLast">
<h4>suspendIntention</h4>
<pre>boolean suspendIntention</pre>
</li>
</ul>
</li>
</ul>
</li>
<li class="blockList"><a name="jason.stdlib.suspended">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/suspended.html" title="class in jason.stdlib">jason.stdlib.suspended</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.term2string">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/term2string.html" title="class in jason.stdlib">jason.stdlib.term2string</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.time">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/time.html" title="class in jason.stdlib">jason.stdlib.time</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.union">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/union.html" title="class in jason.stdlib">jason.stdlib.union</a> extends <a href="jason/stdlib/difference.html" title="class in jason.stdlib">difference</a> implements Serializable</h3>
</li>
<li class="blockList"><a name="jason.stdlib.wait">
<!-- -->
</a>
<h3>Class <a href="jason/stdlib/wait.html" title="class in jason.stdlib">jason.stdlib.wait</a> extends <a href="jason/asSemantics/DefaultInternalAction.html" title="class in jason.asSemantics">DefaultInternalAction</a> implements Serializable</h3>
</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>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-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?serialized-form.html" target="_top">Frames</a></li>
<li><a href="serialized-form.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
| {
"content_hash": "ed3e2986a12314771fb98bda935bb86d",
"timestamp": "",
"source": "github",
"line_count": 2176,
"max_line_length": 300,
"avg_line_length": 36.911764705882355,
"alnum_prop": 0.7099850597609562,
"repo_name": "lsa-pucrs/jason-ros-releases",
"id": "e658f74683ba75349545178e7f19a82c4a5216fd",
"size": "80320",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Jason-1.4.0a/doc/api/serialized-form.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "552"
},
{
"name": "C++",
"bytes": "2070"
},
{
"name": "CSS",
"bytes": "16052"
},
{
"name": "Groff",
"bytes": "2222"
},
{
"name": "HTML",
"bytes": "10409774"
},
{
"name": "Java",
"bytes": "2797033"
},
{
"name": "Perl6",
"bytes": "320"
},
{
"name": "Pure Data",
"bytes": "236280"
},
{
"name": "Shell",
"bytes": "4492"
},
{
"name": "SourcePawn",
"bytes": "756"
},
{
"name": "XSLT",
"bytes": "38136"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:card" content="summary" />
<meta name="twitter:creator" content="@韩雨"/>
<meta name="twitter:title" content="sam的小窝"/>
<meta name="twitter:description" content="学习 &nbsp;&bull;&nbsp; 生活"/>
<meta name="twitter:image" content="http://www.samrainhan.com/images/avatar.png" />
<meta name="author" content="韩雨">
<meta name="description" content="学习 &nbsp;&bull;&nbsp; 生活">
<meta name="generator" content="Hugo 0.41" />
<title>Meeting Minutes · sam的小窝</title>
<link rel="shortcut icon" href="http://www.samrainhan.com/images/favicon.ico">
<link rel="stylesheet" href="http://www.samrainhan.com/css/style.css">
<link rel="stylesheet" href="http://www.samrainhan.com/css/highlight.css">
<link rel="stylesheet" href="http://www.samrainhan.com/css/font-awesome.min.css">
<link href="http://www.samrainhan.com/index.xml" rel="alternate" type="application/rss+xml" title="sam的小窝" />
</head>
<body>
<nav class="main-nav">
<a href='http://www.samrainhan.com/'> <span class="arrow">←</span>Home</a>
<a href='http://www.samrainhan.com/posts'>Archive</a>
<a href='http://www.samrainhan.com/tags'>Tags</a>
<a href='http://www.samrainhan.com/about'>About</a>
<a class="cta" href="http://www.samrainhan.com/index.xml">Subscribe</a>
</nav>
<div class="profile">
<section id="wrapper">
<header id="header">
<a href='http://www.samrainhan.com/about'>
<img id="avatar" class="2x" src="http://www.samrainhan.com/images/avatar.png"/>
</a>
<h1>sam的小窝</h1>
<h2>学习 & 生活</h2>
</header>
</section>
</div>
<section id="wrapper" class="home">
<div class="archive">
<h3>2013</h3>
<ul>
<div class="post-item">
<div class="post-time">Mar 25</div>
<a href="http://www.samrainhan.com/posts/2013-03-25-template-of-meeting-minutes/" class="post-link">
会议纪要模版
</a>
</div>
</ul>
</div>
<footer id="footer">
<div id="social">
<a class="symbol" href="">
<i class="fa fa-facebook-square"></i>
</a>
<a class="symbol" href="https://github.com/samrain">
<i class="fa fa-github-square"></i>
</a>
<a class="symbol" href="">
<i class="fa fa-twitter-square"></i>
</a>
</div>
<p class="small">
© Copyright 2018 <i class="fa fa-heart" aria-hidden="true"></i> 韩雨
</p>
<p class="small">
Powered by <a href="http://www.gohugo.io/">Hugo</a> Theme By <a href="https://github.com/nodejh/hugo-theme-cactus-plus">nodejh</a>
</p>
</footer>
</section>
<div class="dd">
</div>
<script src="http://www.samrainhan.com/js/jquery-3.3.1.min.js"></script>
<script src="http://www.samrainhan.com/js/main.js"></script>
<script src="http://www.samrainhan.com/js/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
var doNotTrack = false;
if (!doNotTrack) {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37708730-1', 'auto');
ga('send', 'pageview');
}
</script>
</body>
</html>
| {
"content_hash": "7efd1b294311403ffdd83b950d6c3c14",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 138,
"avg_line_length": 24.22875816993464,
"alnum_prop": 0.6023738872403561,
"repo_name": "samrain/NewBlog",
"id": "9d8fa581da2498df8827807ff838173dd64d673e",
"size": "3782",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tags/meeting-minutes/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18148"
},
{
"name": "HTML",
"bytes": "7943935"
},
{
"name": "JavaScript",
"bytes": "3132"
}
],
"symlink_target": ""
} |
from django.db import models
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from sorl.thumbnail import ImageField
from tinymce import models as tinymce_models
from taggit.managers import TaggableManager
try:
from PIL import Image, ImageOps
except ImportError:
import Image
import ImageOps
from econordeste.current_user import get_current_user
from econordeste.core.models import Category
class EntryManager(models.Manager):
'''
Esse manager carrega todos os objetos do model Entry sem filtros
'''
def get_queryset(self):
return super(EntryManager,
self).get_queryset().all()
class PublishedManager(models.Manager):
'''
Esse manager carrega todos os objetos do model Entry que estao marcados
como publish=True
'''
def get_queryset(self):
return super(PublishedManager,
self).get_queryset().filter(publish=True)
class Entry(models.Model):
created = models.DateTimeField(_(u'Data de Criação'))
title = models.CharField(_(u'Título da Notícia'), max_length=200)
slug = models.SlugField(_(u'Link no Site'), max_length=200,
unique=True)
image = ImageField(_(u'Imagem da Notícia'), upload_to='blog')
body = tinymce_models.HTMLField(_(u'Texto'))
publish = models.BooleanField(_(u'Publicar no site?'), default=True)
modified = models.DateTimeField(_(u'Data de Modificação'), auto_now=True)
author = models.ForeignKey(User, verbose_name=_(u'Autor'),
editable=False, default=get_current_user)
categories = models.ManyToManyField(Category,
verbose_name=_(u'Categorias'))
tags = TaggableManager()
# quando precisar chamar todos os objetos sem filtro:
# Entry.objects.all()
objects = EntryManager()
# quando precisar chamar apenas os objetos com publish=True:
# Entry.published.all()
published = PublishedManager()
def admin_image(self):
return '<img src="%s" width="200" />' % self.image.url
admin_image.allow_tags = True
admin_image.short_description = 'Imagem da Notícia'
def save(self, *args, **kwargs):
if not self.id and not self.image:
return
super(Entry, self).save(*args, **kwargs)
image = Image.open(self.image)
def scale_dimensions(width, height, longest_side):
if width > height:
if width > longest_side:
ratio = longest_side*1./width
return (int(width*ratio), int(height*ratio))
elif height > longest_side:
ratio = longest_side*1./height
return (int(width*ratio), int(height*ratio))
return (width, height)
(width, height) = image.size
(width, height) = scale_dimensions(width, height, longest_side=900)
size = (width, height)
""" redimensiona esticando """
# image = image.resize(size, Image.ANTIALIAS)
""" redimensiona proporcionalmente """
image.thumbnail(size, Image.ANTIALIAS)
""" redimensiona cortando para encaixar no tamanho """
# image = ImageOps.fit(image, size, Image.ANTIALIAS)
image.save(self.image.path, 'JPEG', quality=99)
def get_absolute_url(self):
return reverse('blog:entry_date_detail',
kwargs={'year': self.created.year,
'month': self.created.strftime('%m'),
'day': self.created.strftime('%d'),
'slug': self.slug})
def __unicode__(self):
return unicode(self.title)
class Meta:
verbose_name = _(u'Notícia')
verbose_name_plural = _(u'Notícias')
ordering = ['-created', 'title', 'author']
| {
"content_hash": "eb391d0a9f5d4d1b1acc330ac1a874ae",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 77,
"avg_line_length": 36.174311926605505,
"alnum_prop": 0.6132386507735227,
"repo_name": "klebercode/econordeste",
"id": "8647dc49a0399b1748ae1b3faf9ae735075b8377",
"size": "3969",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "econordeste/blog/models.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "148731"
},
{
"name": "HTML",
"bytes": "47249"
},
{
"name": "JavaScript",
"bytes": "86271"
},
{
"name": "Python",
"bytes": "45500"
}
],
"symlink_target": ""
} |
@implementation RXGetArea
+ (NSArray *)getAreaArray {
NSArray * networkArray = [self getNetWorkAreaArray];
if(ArrBool(networkArray)) {
return networkArray;
}
else {
return [self getLocalAreaArray];
}
}
///屏蔽 哪些 省份
+ (BOOL)screenmaskArea:(NSString *)nameCode {
NSArray * screenMaskArr = @[
@"630000", //青海省
@"540000", //西藏自治区
@"150303" //海南区
];
if([screenMaskArr containsObject:nameCode]) {
return YES;
}
return NO;
}
//获取网络地址
+ (NSArray *)getNetWorkAreaArray {
NSArray * areaArray = [TTCacheUtil objectFromFile: AddressLocalJson];
if(!ArrBool(areaArray)) {
[RXGetNetAddressJSON getNetWorkAddress];
return nil;
}
return areaArray;
}
//获取本地地址
+ (NSArray *)getLocalAreaArray {
NSString* path = [[NSBundle mainBundle] pathForResource:@"city" ofType:@"json"];
if(path.length <= 0) {
return nil;
}
NSData* data = [NSData dataWithContentsOfFile:path];
id JsonObject =
[NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingAllowFragments
error:nil];
NSArray * arr = [[NSArray arrayWithObject:JsonObject] objectAtIndex:0];
NSMutableArray * _allCitiesArr = [[NSMutableArray alloc] initWithArray:arr];
for(NSInteger i = 0; i < _allCitiesArr.count; i++) {
NSString * code = _allCitiesArr[i][@"code"];
if([self screenmaskArea:code]) {
[_allCitiesArr removeObjectAtIndex:i];
}
}
return _allCitiesArr;
}
@end
| {
"content_hash": "3578b419604bd006e596ae9e01f01451",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 84,
"avg_line_length": 26.50769230769231,
"alnum_prop": 0.5618107951247824,
"repo_name": "srxboys/RXExtenstion",
"id": "d82552ee38fc1d606edc40b7c89763aa8a64a4ff",
"size": "2054",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RXExtenstion/RXExtenstion/地址管理/Model/LocalJson/RXGetArea.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "4763"
},
{
"name": "Objective-C",
"bytes": "1010137"
},
{
"name": "Ruby",
"bytes": "6424"
},
{
"name": "Swift",
"bytes": "14325"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
// アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更してください。
[assembly: AssemblyTitle("AssemblyInfoCmdlet")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AssemblyInfoCmdlet")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから
// 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、
// その型の ComVisible 属性を true に設定してください。
[assembly: ComVisible(false)]
// このプロジェクトが COM に公開される場合、次の GUID が typelib の ID になります
[assembly: Guid("601ad923-baa2-4eef-9f24-bc655a24bd6c")]
// アセンブリのバージョン情報は次の 4 つの値で構成されています:
//
// メジャー バージョン
// マイナー バージョン
// ビルド番号
// Revision
//
// すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: InternalsVisibleTo("AssemblyInfoCmdletTest")] | {
"content_hash": "d833010a1a1a444f6c7e6363a469ca9f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 57,
"avg_line_length": 30.263157894736842,
"alnum_prop": 0.7521739130434782,
"repo_name": "yas-mnkornym/TaihaToolkit",
"id": "5a905108881e7ed09de9acd8842f2bd1f16977cd",
"size": "1719",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "extras/AssemblyInfoCmdlet/AssemblyInfoCmdlet/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "234758"
},
{
"name": "PowerShell",
"bytes": "767"
}
],
"symlink_target": ""
} |
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83.h
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE806.label.xml
Template File: sources-sink-83.tmpl.h
*/
/*
* @description
* CWE: 122 Heap Based Buffer Overflow
* BadSource: Initialize data as a large string
* GoodSource: Initialize data as a small string
* Sinks: memmove
* BadSink : Copy data to string using memmove
* Flow Variant: 83 Data flow: data passed to class constructor and destructor by declaring the class object on the stack
*
* */
#include "std_testcase.h"
#include <wchar.h>
namespace CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83
{
#ifndef OMITBAD
class CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_bad
{
public:
CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_bad(char * dataCopy);
~CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_bad();
private:
char * data;
};
#endif /* OMITBAD */
#ifndef OMITGOOD
class CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_goodG2B
{
public:
CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_goodG2B(char * dataCopy);
~CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83_goodG2B();
private:
char * data;
};
#endif /* OMITGOOD */
}
| {
"content_hash": "7052188e132ba011780e2e5d1e3891f3",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 121,
"avg_line_length": 26.653846153846153,
"alnum_prop": 0.7077922077922078,
"repo_name": "JianpingZeng/xcc",
"id": "7eba71d1a3005863ec9075afde494aee5543fd39",
"size": "1386",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s09/CWE122_Heap_Based_Buffer_Overflow__c_CWE806_char_memmove_83.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.tiny.demo.firstlinecode.parser.ActivityParser">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/btn_parser_json"
style="@style/btn_style_lower"
android:text="parser json map"/>
<Button
android:id="@+id/btn_select_location"
style="@style/btn_style_lower"
android:text="省市二级联动"/>
<TextView
android:id="@+id/txt_selected_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="xx省 xx市"
android:gravity="center"/>
<Button
android:id="@+id/btn_parse_plist"
style="@style/btn_style_lower"
android:text="parse plist"
/>
<Button
android:id="@+id/btn_parse_plist1"
style="@style/btn_style_lower"
android:text="parse plist1"
/>
</LinearLayout>
</ScrollView>
</android.support.constraint.ConstraintLayout>
| {
"content_hash": "7caa1e1c37e33393ceac13bbad5b3517",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 70,
"avg_line_length": 32.64150943396226,
"alnum_prop": 0.5549132947976878,
"repo_name": "tinyvampirepudge/Android_Basis_Demo",
"id": "3a82f2b759ef16cb12bea0693dbecc843feeb4fe",
"size": "1746",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "Android_Basis_Demo/app/src/main/res/layout/activity_parser.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "4434358"
}
],
"symlink_target": ""
} |
#include <pybind11/pybind11.h>
namespace py = pybind11;
namespace dart {
namespace python {
void dart_gui_osg(py::module& m);
void dart_gui(py::module& m)
{
auto sm = m.def_submodule("gui");
dart_gui_osg(sm);
}
} // namespace python
} // namespace dart
| {
"content_hash": "f1bd89e55ee0dbb610a300119560da98",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 35,
"avg_line_length": 13.25,
"alnum_prop": 0.6641509433962264,
"repo_name": "dartsim/dart",
"id": "06cc03916c141d1d440a99e4db9faa9cbe18c7d4",
"size": "1880",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "python/dartpy/gui/module.cpp",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "13809"
},
{
"name": "C++",
"bytes": "14864431"
},
{
"name": "CMake",
"bytes": "177235"
},
{
"name": "Dockerfile",
"bytes": "1493"
},
{
"name": "Python",
"bytes": "81308"
},
{
"name": "Roff",
"bytes": "1046"
},
{
"name": "Ruby",
"bytes": "353"
},
{
"name": "Shell",
"bytes": "18128"
},
{
"name": "TeX",
"bytes": "1801"
}
],
"symlink_target": ""
} |
<?php
namespace Kunstmaan\MenuBundle\Twig;
use Kunstmaan\MenuBundle\Entity\MenuItem;
use Kunstmaan\MenuBundle\Repository\MenuItemRepositoryInterface;
use Kunstmaan\MenuBundle\Service\RenderService;
use Twig\Environment;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
/**
* @final since 5.4
*/
class MenuTwigExtension extends AbstractExtension
{
/**
* @var RenderService
*/
private $renderService;
/**
* @var MenuItemRepositoryInterface
*/
private $repository;
/**
* @param MenuItemRepositoryInterface $repository
* @param RenderService $renderService
*/
public function __construct(MenuItemRepositoryInterface $repository, RenderService $renderService)
{
$this->renderService = $renderService;
$this->repository = $repository;
}
/**
* Returns a list of functions to add to the existing list.
*
* @return array An array of functions
*/
public function getFunctions()
{
return array(
new TwigFunction(
'get_menu',
array($this, 'getMenu'),
array(
'is_safe' => array('html'),
'needs_environment' => true,
)
),
new TwigFunction('get_menu_items', array($this, 'getMenuItems')),
);
}
/**
* Get a html representation of a menu.
*
* @param string $name
* @param string $lang
* @param array $options
*
* @return string
*/
public function getMenu(Environment $environment, $name, $lang, $options = array())
{
$options = array_merge($this->getDefaultOptions(), $options);
$renderService = $this->renderService;
$options['nodeDecorator'] = function ($node) use ($environment, $renderService, $options) {
return $renderService->renderMenuItemTemplate($environment, $node, $options);
};
$arrayResult = $this->getMenuItems($name, $lang);
return $this->repository->buildTree($arrayResult, $options);
}
/**
* Get an array with menu items of a menu.
*
* @param string $name
* @param string $lang
*
* @return array
*/
public function getMenuItems($name, $lang)
{
/** @var MenuItem $menuRepo */
$arrayResult = $this->repository->getMenuItemsForLanguage($name, $lang);
// Make sure the parent item is not offline
$foundIds = array();
foreach ($arrayResult as $array) {
$foundIds[] = $array['id'];
}
foreach ($arrayResult as $key => $array) {
if (!\is_null($array['parent']) && !\in_array($array['parent']['id'], $foundIds)) {
unset($arrayResult[$key]);
}
}
return $arrayResult;
}
/**
* Get the default options to render the html.
*
* @return array
*/
private function getDefaultOptions()
{
return array(
'decorate' => true,
'rootOpen' => '<ul>',
'rootClose' => '</ul>',
'childOpen' => '<li>',
'childClose' => '</li>',
);
}
}
| {
"content_hash": "7746964af3c6808055b822c60b16f670",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 102,
"avg_line_length": 26.442622950819672,
"alnum_prop": 0.555486670799752,
"repo_name": "mwoynarski/KunstmaanBundlesCMS",
"id": "9c325458f20e3ef1d6a13699fd1af1490f3ceaad",
"size": "3226",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/Kunstmaan/MenuBundle/Twig/MenuTwigExtension.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "204615"
},
{
"name": "Gherkin",
"bytes": "22178"
},
{
"name": "HTML",
"bytes": "441818"
},
{
"name": "JavaScript",
"bytes": "542691"
},
{
"name": "PHP",
"bytes": "3271429"
},
{
"name": "Shell",
"bytes": "220"
}
],
"symlink_target": ""
} |
package com.google.gxp.compiler.base;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
/**
* A value that indicates that its subexpression is eligible for space
* collapsing. Intuitively, all content immediately inside of an XML element
* will be placed inside of a {@code CollapseExpression} by {@link
* com.google.gxp.compiler.reparent.Reparenter Reparenter}. Note that space
* collapsing is purely a compile-time operation -- only the static parts of
* the subexpression will be altered by this.
*/
public class CollapseExpression extends Expression {
private final Expression subexpression;
private final SpaceOperatorSet spaceOperators;
private CollapseExpression(Expression subexpression,
SpaceOperatorSet spaceOperators) {
super(subexpression);
this.subexpression = Preconditions.checkNotNull(subexpression);
this.spaceOperators = Preconditions.checkNotNull(spaceOperators);
if (subexpression instanceof CollapseExpression) {
throw new IllegalArgumentException(
"CollapseExpressions can't be directly nested");
}
}
public static CollapseExpression create(Expression subexpression,
SpaceOperatorSet spaceOperators) {
if (subexpression instanceof CollapseExpression) {
CollapseExpression subCollapse = (CollapseExpression) subexpression;
spaceOperators =
subCollapse.getSpaceOperators().inheritFrom(spaceOperators);
if (spaceOperators.equals(subCollapse.getSpaceOperators())) {
return subCollapse;
} else {
subexpression = subCollapse.getSubexpression();
}
}
return new CollapseExpression(subexpression, spaceOperators);
}
public Expression getSubexpression() {
return subexpression;
}
public Expression withSubexpression(Expression newSubexpression) {
return newSubexpression.equals(subexpression)
? this
: new CollapseExpression(newSubexpression, spaceOperators);
}
public SpaceOperatorSet getSpaceOperators() {
return spaceOperators;
}
@Override
public boolean alwaysOnlyWhitespace() {
return subexpression.alwaysOnlyWhitespace();
}
@Override
public <T> T acceptVisitor(ExpressionVisitor<T> visitor) {
return visitor.visitCollapseExpression(this);
}
@Override
public boolean hasStaticString() {
return getSubexpression().hasStaticString();
}
@Override
public boolean equals(Object that) {
return this == that
|| (that instanceof CollapseExpression
&& equals((CollapseExpression) that));
}
public boolean equals(CollapseExpression that) {
return equalsExpression(that)
&& Objects.equal(getSubexpression(), that.getSubexpression())
&& Objects.equal(spaceOperators, that.getSpaceOperators());
}
@Override
public int hashCode() {
return Objects.hashCode(
expressionHashCode(),
getSubexpression(),
getSpaceOperators());
}
}
| {
"content_hash": "59ed1df2b6edf80c7d0e6c195d3ef335",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 76,
"avg_line_length": 31.88421052631579,
"alnum_prop": 0.7180587652690656,
"repo_name": "xenomachina/gxp",
"id": "bfd1f6dcac370caeb4ae99c884f5321e29ed52a5",
"size": "3623",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "java/src/com/google/gxp/compiler/base/CollapseExpression.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "27560"
},
{
"name": "CSS",
"bytes": "1391"
},
{
"name": "HTML",
"bytes": "8388855"
},
{
"name": "Java",
"bytes": "1887441"
},
{
"name": "JavaScript",
"bytes": "63313"
},
{
"name": "Scala",
"bytes": "638"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file documents the GNU Assembler "as".
Copyright (C) 1991-2014 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, with no Front-Cover Texts, and with no
Back-Cover Texts. A copy of the license is included in the
section entitled "GNU Free Documentation License".
-->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Using as: CRIS-Expand</title>
<meta name="description" content="Using as: CRIS-Expand">
<meta name="keywords" content="Using as: CRIS-Expand">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="CRIS_002dDependent.html#CRIS_002dDependent" rel="up" title="CRIS-Dependent">
<link href="CRIS_002dSymbols.html#CRIS_002dSymbols" rel="next" title="CRIS-Symbols">
<link href="CRIS_002dOpts.html#CRIS_002dOpts" rel="prev" title="CRIS-Opts">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="CRIS_002dExpand"></a>
<div class="header">
<p>
Next: <a href="CRIS_002dSymbols.html#CRIS_002dSymbols" accesskey="n" rel="next">CRIS-Symbols</a>, Previous: <a href="CRIS_002dOpts.html#CRIS_002dOpts" accesskey="p" rel="prev">CRIS-Opts</a>, Up: <a href="CRIS_002dDependent.html#CRIS_002dDependent" accesskey="u" rel="up">CRIS-Dependent</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="AS-Index.html#AS-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Instruction-expansion"></a>
<h4 class="subsection">9.8.2 Instruction expansion</h4>
<a name="index-instruction-expansion_002c-CRIS"></a>
<a name="index-CRIS-instruction-expansion"></a>
<p><code>as</code> will silently choose an instruction that fits
the operand size for ‘<samp>[register+constant]</samp>’ operands. For
example, the offset <code>127</code> in <code>move.d [r3+127],r4</code> fits
in an instruction using a signed-byte offset. Similarly,
<code>move.d [r2+32767],r1</code> will generate an instruction using a
16-bit offset. For symbolic expressions and constants that do
not fit in 16 bits including the sign bit, a 32-bit offset is
generated.
</p>
<p>For branches, <code>as</code> will expand from a 16-bit branch
instruction into a sequence of instructions that can reach a
full 32-bit address. Since this does not correspond to a single
instruction, such expansions can optionally be warned about.
See <a href="CRIS_002dOpts.html#CRIS_002dOpts">CRIS-Opts</a>.
</p>
<p>If the operand is found to fit the range, a <code>lapc</code> mnemonic
will translate to a <code>lapcq</code> instruction. Use <code>lapc.d</code>
to force the 32-bit <code>lapc</code> instruction.
</p>
<p>Similarly, the <code>addo</code> mnemonic will translate to the
shortest fitting instruction of <code>addoq</code>, <code>addo.w</code> and
<code>addo.d</code>, when used with a operand that is a constant known
at assembly time.
</p>
</body>
</html>
| {
"content_hash": "8ad9ccc808a5f93615733528c087e936",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 460,
"avg_line_length": 45.27450980392157,
"alnum_prop": 0.740147249891728,
"repo_name": "AlbandeCrevoisier/ldd-athens",
"id": "7d7e0026c7fa621c0b0371a9a13a9bd88896f311",
"size": "4618",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gcc-linaro-4.9-2015.02-3-x86_64_arm-linux-gnueabihf/share/doc/as.html/CRIS_002dExpand.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "10184236"
},
{
"name": "Awk",
"bytes": "40418"
},
{
"name": "Batchfile",
"bytes": "81753"
},
{
"name": "C",
"bytes": "566858455"
},
{
"name": "C++",
"bytes": "21399133"
},
{
"name": "Clojure",
"bytes": "971"
},
{
"name": "Cucumber",
"bytes": "5998"
},
{
"name": "FORTRAN",
"bytes": "11832"
},
{
"name": "GDB",
"bytes": "18113"
},
{
"name": "Groff",
"bytes": "2686457"
},
{
"name": "HTML",
"bytes": "34688334"
},
{
"name": "Lex",
"bytes": "56961"
},
{
"name": "Logos",
"bytes": "133810"
},
{
"name": "M4",
"bytes": "3325"
},
{
"name": "Makefile",
"bytes": "1685015"
},
{
"name": "Objective-C",
"bytes": "920162"
},
{
"name": "Perl",
"bytes": "752477"
},
{
"name": "Perl6",
"bytes": "3783"
},
{
"name": "Python",
"bytes": "533352"
},
{
"name": "Shell",
"bytes": "468244"
},
{
"name": "SourcePawn",
"bytes": "2711"
},
{
"name": "UnrealScript",
"bytes": "12824"
},
{
"name": "XC",
"bytes": "33970"
},
{
"name": "XS",
"bytes": "34909"
},
{
"name": "Yacc",
"bytes": "113516"
}
],
"symlink_target": ""
} |
<?php
namespace DEPI\ProyectosProductosBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use DEPI\ProyectosProductosBundle\Entity\ProyectosProductos;
use DEPI\ProyectosProductosBundle\Form\ProyectosProductosType;
/**
* ProyectosProductos controller.
*
* @Route("/proyectosproductos")
*/
class ProyectosProductosController extends Controller
{
/**
* Lists all ProyectosProductos entities.
*
* @Route("/", name="proyectosproductos")
* @Method("GET")
* @Template()
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository('ProyectosProductosBundle:ProyectosProductos')->findProyectosProductos();
return $this->render('ProyectosProductosBundle:ProyectosProductos:index.html.twig',
array('entities' => $entities,));
}
/**
* Creates a new ProyectosProductos entity.
*
* @Route("/", name="proyectosproductos_create")
* @Method("POST")
* @Template("ProyectosProductosBundle:ProyectosProductos:new.html.twig")
*/
public function createAction(Request $request)
{
$entity = new ProyectosProductos();
$form = $this->createCreateForm($entity);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('proyectosproductos'));
}
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Creates a form to create a ProyectosProductos entity.
*
* @param ProyectosProductos $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(ProyectosProductos $entity)
{
$form = $this->createForm(new ProyectosProductosType(), $entity, array(
'action' => $this->generateUrl('proyectosproductos_create'),
'method' => 'POST',
));
$form->add('submit', 'submit', array('label' => 'Guardar'));
return $form;
}
/**
* Displays a form to create a new ProyectosProductos entity.
*
* @Route("/new", name="proyectosproductos_new")
* @Method("GET")
* @Template()
*/
public function newAction()
{
$entity = new ProyectosProductos();
$form = $this->createCreateForm($entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
}
/**
* Displays a form to edit an existing ProyectosProductos entity.
*
* @Route("/{id}/edit", name="proyectosproductos_edit")
* @Method("GET")
* @Template()
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ProyectosProductosBundle:ProyectosProductos')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ProyectosProductos entity.');
}
$editForm = $this->createEditForm($entity);
$deleteForm = $this->createDeleteForm($id);
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Creates a form to edit a ProyectosProductos entity.
*
* @param ProyectosProductos $entity The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(ProyectosProductos $entity)
{
$form = $this->createForm(new ProyectosProductosType(), $entity, array(
'action' => $this->generateUrl('proyectosproductos_update', array('id' => $entity->getId())),
'method' => 'PUT',
));
$form->add('submit', 'submit', array('label' => 'Actualizar'));
return $form;
}
/**
* Edits an existing ProyectosProductos entity.
*
* @Route("/{id}", name="proyectosproductos_update")
* @Method("PUT")
* @Template("ProyectosProductosBundle:ProyectosProductos:edit.html.twig")
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ProyectosProductosBundle:ProyectosProductos')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ProyectosProductos entity.');
}
$deleteForm = $this->createDeleteForm($id);
$editForm = $this->createEditForm($entity);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('proyectosproductos'));
}
return array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
);
}
/**
* Deletes a ProyectosProductos entity.
*
* @Route("/{id}", name="proyectosproductos_delete")
* @Method("DELETE")
*/
public function deleteAction(Request $request, $id)
{
$form = $this->createDeleteForm($id);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('ProyectosProductosBundle:ProyectosProductos')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find ProyectosProductos entity.');
}
$em->remove($entity);
$em->flush();
}
return $this->redirect($this->generateUrl('proyectosproductos'));
}
/**
* Creates a form to delete a ProyectosProductos entity by id.
*
* @param mixed $id The entity id
*
* @return \Symfony\Component\Form\Form The form
*/
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('proyectosproductos_delete', array('id' => $id)))
->setMethod('DELETE')
->add('submit', 'submit', array('label' => 'Eliminar'))
->getForm()
;
}
}
| {
"content_hash": "4cc79c93d03fb336ea346e4529cfa43b",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 112,
"avg_line_length": 30.09502262443439,
"alnum_prop": 0.5860772816117877,
"repo_name": "fralan123/DEPISite",
"id": "620c08e5a5b7e2588dc5571e32560c4205a49a6a",
"size": "6651",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/DEPI/ProyectosProductosBundle/Controller/ProyectosProductosController.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "259001"
},
{
"name": "JavaScript",
"bytes": "186215"
},
{
"name": "PHP",
"bytes": "347381"
}
],
"symlink_target": ""
} |
import os
import sys
import shutil
import support
import process_cfg
from process_cfg import bool_to_str
from site import addsitedir
from distutils import dir_util
import options_storage
BASE_STAGE = "construction"
READS_TYPES_USED_IN_CONSTRUCTION = ["paired-end", "single", "hq-mate-pairs"]
def prepare_config_spades(filename, cfg, log, additional_contigs_fname, K, stage, saves_dir, last_one):
subst_dict = dict()
subst_dict["K"] = str(K)
subst_dict["run_mode"] = "false"
if "diploid_mode" in cfg.__dict__:
subst_dict["diploid_mode"] = bool_to_str(cfg.diploid_mode)
subst_dict["dataset"] = process_cfg.process_spaces(cfg.dataset)
subst_dict["output_base"] = process_cfg.process_spaces(cfg.output_dir)
subst_dict["tmp_dir"] = process_cfg.process_spaces(cfg.tmp_dir)
if additional_contigs_fname:
subst_dict["additional_contigs"] = process_cfg.process_spaces(additional_contigs_fname)
subst_dict["use_additional_contigs"] = bool_to_str(True)
else:
subst_dict["use_additional_contigs"] = bool_to_str(False)
subst_dict["main_iteration"] = bool_to_str(last_one)
subst_dict["entry_point"] = stage
subst_dict["load_from"] = saves_dir
subst_dict["developer_mode"] = bool_to_str(cfg.developer_mode)
subst_dict["gap_closer_enable"] = bool_to_str(last_one or K >= 55)
subst_dict["rr_enable"] = bool_to_str(last_one and cfg.rr_enable)
# subst_dict["topology_simplif_enabled"] = bool_to_str(last_one)
subst_dict["max_threads"] = cfg.max_threads
subst_dict["max_memory"] = cfg.max_memory
subst_dict["correct_mismatches"] = bool_to_str(last_one)
if "resolving_mode" in cfg.__dict__:
subst_dict["resolving_mode"] = cfg.resolving_mode
if "careful" in cfg.__dict__:
subst_dict["mismatch_careful"] = bool_to_str(cfg.careful)
if "pacbio_mode" in cfg.__dict__:
subst_dict["pacbio_test_on"] = bool_to_str(cfg.pacbio_mode)
subst_dict["pacbio_reads"] = process_cfg.process_spaces(cfg.pacbio_reads)
if cfg.cov_cutoff == "off":
subst_dict["use_coverage_threshold"] = bool_to_str(False)
else:
subst_dict["use_coverage_threshold"] = bool_to_str(True)
if cfg.cov_cutoff == "auto":
subst_dict["coverage_threshold"] = 0.0
else:
subst_dict["coverage_threshold"] = cfg.cov_cutoff
process_cfg.substitute_params(filename, subst_dict, log)
def get_read_length(output_dir, K, ext_python_modules_home, log):
est_params_filename = os.path.join(output_dir, "K%d" % K, "final.lib_data")
max_read_length = 0
if os.path.isfile(est_params_filename):
addsitedir(ext_python_modules_home)
if sys.version.startswith('2.'):
import pyyaml2 as pyyaml
elif sys.version.startswith('3.'):
import pyyaml3 as pyyaml
est_params_data = pyyaml.load(open(est_params_filename, 'r'))
for reads_library in est_params_data:
if reads_library['type'] in READS_TYPES_USED_IN_CONSTRUCTION:
if int(reads_library["read length"]) > max_read_length:
max_read_length = int(reads_library["read length"])
if max_read_length == 0:
support.error("Failed to estimate maximum read length! File with estimated params: " + est_params_filename, log)
return max_read_length
def update_k_mers_in_special_cases(cur_k_mers, RL, log, silent=False):
if options_storage.auto_K_allowed():
if RL >= 250:
if not silent:
support.warning("Default k-mer sizes were set to %s because estimated "
"read length (%d) is equal to or greater than 250" % (str(options_storage.K_MERS_250), RL), log)
return options_storage.K_MERS_250
if RL >= 150:
if not silent:
support.warning("Default k-mer sizes were set to %s because estimated "
"read length (%d) is equal to or greater than 150" % (str(options_storage.K_MERS_150), RL), log)
return options_storage.K_MERS_150
return cur_k_mers
def reveal_original_k_mers(RL):
if options_storage.original_k_mers is None or options_storage.original_k_mers == 'auto':
cur_k_mers = options_storage.k_mers
options_storage.k_mers = options_storage.original_k_mers
original_k_mers = update_k_mers_in_special_cases(options_storage.K_MERS_SHORT, RL, None, silent=True)
options_storage.k_mers = cur_k_mers
else:
original_k_mers = options_storage.original_k_mers
original_k_mers = [k for k in original_k_mers if k < RL]
return original_k_mers
def run_iteration(configs_dir, execution_home, cfg, log, K, prev_K, last_one):
data_dir = os.path.join(cfg.output_dir, "K%d" % K)
stage = BASE_STAGE
saves_dir = os.path.join(data_dir, 'saves')
dst_configs = os.path.join(data_dir, "configs")
cfg_file_name = os.path.join(dst_configs, "config.info")
if options_storage.continue_mode:
if os.path.isfile(os.path.join(data_dir, "final_contigs.fasta")) and not (options_storage.restart_from and
(options_storage.restart_from == ("k%d" % K) or options_storage.restart_from.startswith("k%d:" % K))):
log.info("\n== Skipping assembler: " + ("K%d" % K) + " (already processed)")
return
if options_storage.restart_from and options_storage.restart_from.find(":") != -1:
stage = options_storage.restart_from[options_storage.restart_from.find(":") + 1:]
support.continue_from_here(log)
if stage != BASE_STAGE:
if not os.path.isdir(saves_dir):
support.error("Cannot restart from stage %s: saves were not found (%s)!" % (stage, saves_dir))
else:
if os.path.exists(data_dir):
shutil.rmtree(data_dir)
os.makedirs(data_dir)
dir_util.copy_tree(os.path.join(configs_dir, "debruijn"), dst_configs, preserve_times=False)
# removing template configs
for root, dirs, files in os.walk(dst_configs):
for cfg_file in files:
cfg_file = os.path.join(root, cfg_file)
if cfg_file.endswith('.info.template'):
if os.path.isfile(cfg_file.split('.template')[0]):
os.remove(cfg_file)
else:
os.rename(cfg_file, cfg_file.split('.template')[0])
log.info("\n== Running assembler: " + ("K%d" % K) + "\n")
if prev_K:
additional_contigs_fname = os.path.join(cfg.output_dir, "K%d" % prev_K, "simplified_contigs.fasta")
if not os.path.isfile(additional_contigs_fname):
support.warning("additional contigs for K=%d were not found (%s)!" % (K, additional_contigs_fname), log)
additional_contigs_fname = None
else:
additional_contigs_fname = None
if "read_buffer_size" in cfg.__dict__:
construction_cfg_file_name = os.path.join(dst_configs, "construction.info")
process_cfg.substitute_params(construction_cfg_file_name, {"read_buffer_size": cfg.read_buffer_size}, log)
if "min_complete_transcript" in cfg.__dict__:
simplification_cfg_file_name = os.path.join(dst_configs, "simplification.info")
process_cfg.substitute_params(simplification_cfg_file_name, {"max_length": cfg.min_complete_transcript}, log)
prepare_config_spades(cfg_file_name, cfg, log, additional_contigs_fname, K, stage, saves_dir, last_one)
command = [os.path.join(execution_home, "spades"), cfg_file_name]
## this code makes sense for src/debruijn/simplification.cpp: corrected_and_save_reads() function which is not used now
# bin_reads_dir = os.path.join(cfg.output_dir, ".bin_reads")
# if os.path.isdir(bin_reads_dir):
# if glob.glob(os.path.join(bin_reads_dir, "*_cor*")):
# for cor_filename in glob.glob(os.path.join(bin_reads_dir, "*_cor*")):
# cor_index = cor_filename.rfind("_cor")
# new_bin_filename = cor_filename[:cor_index] + cor_filename[cor_index + 4:]
# shutil.move(cor_filename, new_bin_filename)
support.sys_call(command, log)
def run_spades(configs_dir, execution_home, cfg, dataset_data, ext_python_modules_home, log):
if not isinstance(cfg.iterative_K, list):
cfg.iterative_K = [cfg.iterative_K]
cfg.iterative_K = sorted(cfg.iterative_K)
# checking and removing conflicting K-mer directories
if options_storage.restart_from:
processed_K = []
for k in range(options_storage.MIN_K, options_storage.MAX_K, 2):
cur_K_dir = os.path.join(cfg.output_dir, "K%d" % k)
if os.path.isdir(cur_K_dir) and os.path.isfile(os.path.join(cur_K_dir, "final_contigs.fasta")):
processed_K.append(k)
if processed_K:
RL = get_read_length(cfg.output_dir, processed_K[0], ext_python_modules_home, log)
needed_K = update_k_mers_in_special_cases(cfg.iterative_K, RL, log, silent=True)
needed_K = [k for k in needed_K if k < RL]
original_K = reveal_original_k_mers(RL)
k_to_delete = []
for id, k in enumerate(needed_K):
if len(processed_K) == id:
if processed_K[-1] == original_K[-1]: # the last K in the original run was processed in "last_one" mode
k_to_delete = [original_K[-1]]
break
if processed_K[id] != k:
k_to_delete = processed_K[id:]
break
if not k_to_delete and (len(processed_K) > len(needed_K)):
k_to_delete = processed_K[len(needed_K) - 1:]
if k_to_delete:
log.info("Restart mode: removing previously processed directories for K=%s "
"to avoid conflicts with K specified with --restart-from" % (str(k_to_delete)))
for k in k_to_delete:
shutil.rmtree(os.path.join(cfg.output_dir, "K%d" % k))
bin_reads_dir = os.path.join(cfg.output_dir, ".bin_reads")
if os.path.isdir(bin_reads_dir) and not options_storage.continue_mode:
shutil.rmtree(bin_reads_dir)
cfg.tmp_dir = support.get_tmp_dir(prefix="spades_")
if len(cfg.iterative_K) == 1:
run_iteration(configs_dir, execution_home, cfg, log, cfg.iterative_K[0], None, True)
K = cfg.iterative_K[0]
else:
run_iteration(configs_dir, execution_home, cfg, log, cfg.iterative_K[0], None, False)
prev_K = cfg.iterative_K[0]
RL = get_read_length(cfg.output_dir, cfg.iterative_K[0], ext_python_modules_home, log)
cfg.iterative_K = update_k_mers_in_special_cases(cfg.iterative_K, RL, log)
if cfg.iterative_K[1] + 1 > RL:
if cfg.rr_enable:
support.warning("Second value of iterative K (%d) exceeded estimated read length (%d). "
"Rerunning for the first value of K (%d) with Repeat Resolving" %
(cfg.iterative_K[1], RL, cfg.iterative_K[0]), log)
run_iteration(configs_dir, execution_home, cfg, log, cfg.iterative_K[0], None, True)
K = cfg.iterative_K[0]
else:
rest_of_iterative_K = cfg.iterative_K
rest_of_iterative_K.pop(0)
count = 0
for K in rest_of_iterative_K:
count += 1
last_one = count == len(cfg.iterative_K) or (rest_of_iterative_K[count] + 1 > RL)
run_iteration(configs_dir, execution_home, cfg, log, K, prev_K, last_one)
prev_K = K
if last_one:
break
if count < len(cfg.iterative_K):
support.warning("Iterations stopped. Value of K (%d) exceeded estimated read length (%d)" %
(cfg.iterative_K[count], RL), log)
latest = os.path.join(cfg.output_dir, "K%d" % K)
for format in [".fasta", ".fastg"]:
if os.path.isfile(os.path.join(latest, "before_rr" + format)):
result_before_rr_contigs = os.path.join(os.path.dirname(cfg.result_contigs), "before_rr" + format)
if not os.path.isfile(result_before_rr_contigs) or not options_storage.continue_mode:
shutil.copyfile(os.path.join(latest, "before_rr" + format), result_before_rr_contigs)
if os.path.isfile(os.path.join(latest, "final_contigs" + format)):
if not os.path.isfile(cfg.result_contigs[:-6] + format) or not options_storage.continue_mode:
shutil.copyfile(os.path.join(latest, "final_contigs" + format), cfg.result_contigs[:-6] + format)
if cfg.rr_enable:
if os.path.isfile(os.path.join(latest, "scaffolds" + format)):
if not os.path.isfile(cfg.result_scaffolds[:-6] + format) or not options_storage.continue_mode:
shutil.copyfile(os.path.join(latest, "scaffolds" + format), cfg.result_scaffolds[:-6] + format)
if cfg.developer_mode:
# saves
saves_link = os.path.join(os.path.dirname(cfg.result_contigs), "saves")
if os.path.lexists(saves_link): # exists return False for broken link! lexists return True
os.remove(saves_link)
os.symlink(os.path.join(latest, "saves"), saves_link)
if os.path.isdir(bin_reads_dir):
shutil.rmtree(bin_reads_dir)
if os.path.isdir(cfg.tmp_dir):
shutil.rmtree(cfg.tmp_dir)
return latest
| {
"content_hash": "9727b2e93bc993f53dd4cf5d6f89d879",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 128,
"avg_line_length": 50.81578947368421,
"alnum_prop": 0.6116741880594807,
"repo_name": "fmaguire/BayeHem",
"id": "de550582f7464b8e4728f7f6194c77289d223997",
"size": "13812",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bayehem/assembler/rnaSPAdes-0.1.1-Linux/share/spades/spades_pipeline/spades_logic.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "10914"
},
{
"name": "Batchfile",
"bytes": "23271"
},
{
"name": "C",
"bytes": "3837551"
},
{
"name": "C++",
"bytes": "33218177"
},
{
"name": "CSS",
"bytes": "1556"
},
{
"name": "Groff",
"bytes": "59793"
},
{
"name": "HTML",
"bytes": "365248"
},
{
"name": "IDL",
"bytes": "14"
},
{
"name": "Java",
"bytes": "13433"
},
{
"name": "Lua",
"bytes": "23713"
},
{
"name": "M4",
"bytes": "19951"
},
{
"name": "Makefile",
"bytes": "118962"
},
{
"name": "Objective-C",
"bytes": "8790"
},
{
"name": "Perl",
"bytes": "272990"
},
{
"name": "Python",
"bytes": "6200881"
},
{
"name": "QML",
"bytes": "593"
},
{
"name": "R",
"bytes": "4898"
},
{
"name": "Shell",
"bytes": "270614"
},
{
"name": "TeX",
"bytes": "8434"
},
{
"name": "XSLT",
"bytes": "759"
},
{
"name": "Yacc",
"bytes": "18910"
}
],
"symlink_target": ""
} |
FROM balenalib/asus-tinker-board-s-debian:stretch-run
ENV GO_VERSION 1.15.7
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
git \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& fetchDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $fetchDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/local/go \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-armv7hf.tar.gz" \
&& echo "16da0e296dabb6c1199ccaa2de1a83e679ae2512263f6e05923319f4903beac1 go$GO_VERSION.linux-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-armv7hf.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
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@golang.sh" \
&& echo "Running test-stack@golang" \
&& chmod +x test-stack@golang.sh \
&& bash test-stack@golang.sh \
&& rm -rf test-stack@golang.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: Debian Stretch \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.15.7 \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": "ffb869b9c21ae452364a962c38451ae3",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 673,
"avg_line_length": 50.95652173913044,
"alnum_prop": 0.7069112627986348,
"repo_name": "nghiant2710/base-images",
"id": "87becf5304a4479b6f675676c3dbd72cf458bafb",
"size": "2365",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/golang/asus-tinker-board-s/debian/stretch/1.15.7/run/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
import path from 'path';
import React from 'react';
import {renderToStaticMarkup} from 'react-dom/server';
import {match, RouterContext} from 'react-router';
import {STATIC, UPLOAD, BUILD} from '../../config/folders';
import Page from '../components/Page';
import indexRoutes from '../../../shared/common/routes';
import mediaRoutes from '../../media/routes/mediaRoutes';
import userRoutes from '../../user/routes/userRoutes';
import fileApi from '../../files/routes/fileRoutes';
const staticRoot = {
method: 'GET',
path: '/static/{param*}',
config: {
auth: false,
handler: {
directory: {
path: STATIC
}
}
}
};
const staticIcons = {
method: 'GET',
path: '/static/icons/{param*}',
config: {
auth: false,
handler: {
directory: {
path: path.join(STATIC, 'icons')
}
}
}
};
const staticImages = {
method: 'GET',
path: '/static/img/{param*}',
config: {
auth: false,
handler: {
directory: {
path: path.join(STATIC, 'img')
}
}
}
};
const uploads = {
method: 'GET',
path: '/uploads/{param*}',
config: {
auth: false,
handler: {
directory: {
path: path.join(UPLOAD)
}
}
}
};
const buildFiles = {
method: 'GET',
path: '/build/{param*}',
config: {
auth: false,
handler: {
directory: {
path: path.join(BUILD)
}
}
}
};
const health = {
method: 'GET',
path: '/health',
config: {
auth: false,
handler: (req, reply) => reply({
status: 'UP'
})
}
};
const homepage = {
method: 'GET',
path: '/{page*}',
config: {
auth: false,
handler: (req, reply) => {
match({routes: indexRoutes, location: req.url}, (error, redirectLocation, renderProps) => {
if (error) {
reply(error.message).code(500);
} else if (redirectLocation) {
reply.redirect(`${redirectLocation.pathname}${redirectLocation.search}`);
} else if (renderProps) {
const html = renderToStaticMarkup(
<Page>
<RouterContext {...renderProps} />
</Page>
);
reply(html);
} else {
reply('page not found').code(404);
}
});
}
}
};
export default [
...mediaRoutes,
...userRoutes,
...fileApi,
staticRoot,
staticIcons,
staticImages,
uploads,
buildFiles,
health,
homepage
];
| {
"content_hash": "deff1c7a50542ea3ff8a706180bb1bb4",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 97,
"avg_line_length": 18.8062015503876,
"alnum_prop": 0.5478153338829349,
"repo_name": "chrishelgert/mediathek",
"id": "e912e4351cedaebd42c206d1fbf094fa10c1c0da",
"size": "2426",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/server/common/routes/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4553"
},
{
"name": "JavaScript",
"bytes": "52950"
}
],
"symlink_target": ""
} |
require 'trusty/errors/exception_handlers'
module Trusty
module Errors
module Retry
include ExceptionHandlers
# retry a block of code
def retry_block(options = {}, &block)
options = {
:retry => 1,
:data => {},
:type => StandardError
}.merge(options)
retries = case options[:retry]
when true
1
when Integer
options[:retry]
else
0
end
types = [ options[:type] ].flatten.compact
begin
yield
rescue *types => ex
if retries > 0
return self.send(__method__, options.merge(:retry => retries - 1), &block)
else
notify_exception(ex, :data => options[:data], :raise => true)
end
end
end
# helper method to redefine method (a la alias_method_chain, etc)
def retry_method(method, options = {})
define_method method do |*args, &block|
super_method = method(:super)
retry_block options do
super_method(*args, &block)
end
end
end
end
end
end | {
"content_hash": "240236d8bc7384555fb2c81380a7aede",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 86,
"avg_line_length": 24.26,
"alnum_prop": 0.49299258037922505,
"repo_name": "joelvh/trusty",
"id": "41b61a9b35e4592697ed01363f88a0af4dec7b43",
"size": "1213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/trusty/errors/retry.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "32585"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Code Viewer</title>
<link id="codestyle" rel="stylesheet" type="text/css" href="../../../css/theme.css" media="all" />
<script type="text/javascript" src="../../../js/syntaxhighlighter.js"></script>
<style>
.syntaxhighlighter {
overflow-y: hidden !important;
}
</style>
</head>
<body>
<pre id="code" class="brush: csharp">import * as React from 'react';
import * as ReactDOM from "react-dom";
import { createStore, combineReducers,compose,applyMiddleware } from "redux";
import { Provider,connect } from "react-redux";
import App from "./App";
import {AppReducer, AppActionDispatcher,IAppState} from "./AppReducer"
const rootReducer = combineReducers({ AppReducer });
const store = createStore(rootReducer);
store.subscribe(() => console.log(store.getState()));
function mapStateToProps(state : any) {
return state.AppReducer;
}
declare var __data: any;
function myAjax(url:string, onRecieved:(data:any)=>void):void {
var s = document.createElement("script");
s.src = url;
s.onload = () => {
onRecieved(__data);
}
var ele = document.getElementById("script");
ele.appendChild(s);
}
function mapDispatchToProps(dispatch: any) {
return {
actions:new AppActionDispatcher(dispatch, ()=>(store.getState() as any).AppReducer as IAppState, myAjax)
}
}
var AppComponent = connect(
mapStateToProps,
mapDispatchToProps)(App);
ReactDOM.render(
<Provider store={store}>
<AppComponent />
</Provider>
,document.getElementById("app")
);
</pre>
<script type="text/javascript" src="../../../js/code.js">
</script>
</body>
</html> | {
"content_hash": "4e80130daf8665b188d5020f2243e31c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 111,
"avg_line_length": 26.366197183098592,
"alnum_prop": 0.6490384615384616,
"repo_name": "banban525/InspectCodeViewer",
"id": "165c78ddd525065d9eda833a464bafb0ee4d0b39",
"size": "1874",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/revisions/00011/codes/src_js_Index.tsx.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "43972"
},
{
"name": "CSS",
"bytes": "18217"
},
{
"name": "HTML",
"bytes": "1056"
},
{
"name": "JavaScript",
"bytes": "230814"
},
{
"name": "PowerShell",
"bytes": "1378"
},
{
"name": "TypeScript",
"bytes": "76334"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "999c4ae7841514ce6bca43bc4d472c20",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "38b6556eeed5a2152397f9632816d9f9fb0e015d",
"size": "183",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Fagales/Fagaceae/Castanopsis/Castanopsis jucunda/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package smartag
//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)
// ModifySagStaticRoute invokes the smartag.ModifySagStaticRoute API synchronously
func (client *Client) ModifySagStaticRoute(request *ModifySagStaticRouteRequest) (response *ModifySagStaticRouteResponse, err error) {
response = CreateModifySagStaticRouteResponse()
err = client.DoAction(request, response)
return
}
// ModifySagStaticRouteWithChan invokes the smartag.ModifySagStaticRoute API asynchronously
func (client *Client) ModifySagStaticRouteWithChan(request *ModifySagStaticRouteRequest) (<-chan *ModifySagStaticRouteResponse, <-chan error) {
responseChan := make(chan *ModifySagStaticRouteResponse, 1)
errChan := make(chan error, 1)
err := client.AddAsyncTask(func() {
defer close(responseChan)
defer close(errChan)
response, err := client.ModifySagStaticRoute(request)
if err != nil {
errChan <- err
} else {
responseChan <- response
}
})
if err != nil {
errChan <- err
close(responseChan)
close(errChan)
}
return responseChan, errChan
}
// ModifySagStaticRouteWithCallback invokes the smartag.ModifySagStaticRoute API asynchronously
func (client *Client) ModifySagStaticRouteWithCallback(request *ModifySagStaticRouteRequest, callback func(response *ModifySagStaticRouteResponse, err error)) <-chan int {
result := make(chan int, 1)
err := client.AddAsyncTask(func() {
var response *ModifySagStaticRouteResponse
var err error
defer close(result)
response, err = client.ModifySagStaticRoute(request)
callback(response, err)
result <- 1
})
if err != nil {
defer close(result)
callback(nil, err)
result <- 0
}
return result
}
// ModifySagStaticRouteRequest is the request struct for api ModifySagStaticRoute
type ModifySagStaticRouteRequest struct {
*requests.RpcRequest
ResourceOwnerId requests.Integer `position:"Query" name:"ResourceOwnerId"`
Vlan string `position:"Query" name:"Vlan"`
ResourceOwnerAccount string `position:"Query" name:"ResourceOwnerAccount"`
OwnerAccount string `position:"Query" name:"OwnerAccount"`
OwnerId requests.Integer `position:"Query" name:"OwnerId"`
NextHop string `position:"Query" name:"NextHop"`
SmartAGId string `position:"Query" name:"SmartAGId"`
SmartAGSn string `position:"Query" name:"SmartAGSn"`
PortName string `position:"Query" name:"PortName"`
DestinationCidr string `position:"Query" name:"DestinationCidr"`
}
// ModifySagStaticRouteResponse is the response struct for api ModifySagStaticRoute
type ModifySagStaticRouteResponse struct {
*responses.BaseResponse
RequestId string `json:"RequestId" xml:"RequestId"`
}
// CreateModifySagStaticRouteRequest creates a request to invoke ModifySagStaticRoute API
func CreateModifySagStaticRouteRequest() (request *ModifySagStaticRouteRequest) {
request = &ModifySagStaticRouteRequest{
RpcRequest: &requests.RpcRequest{},
}
request.InitWithApiInfo("Smartag", "2018-03-13", "ModifySagStaticRoute", "smartag", "openAPI")
request.Method = requests.POST
return
}
// CreateModifySagStaticRouteResponse creates a response to parse from ModifySagStaticRoute response
func CreateModifySagStaticRouteResponse() (response *ModifySagStaticRouteResponse) {
response = &ModifySagStaticRouteResponse{
BaseResponse: &responses.BaseResponse{},
}
return
}
| {
"content_hash": "50ff84b1b5cfbdc0579b7f2caad84b83",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 171,
"avg_line_length": 39.101851851851855,
"alnum_prop": 0.7506511958323466,
"repo_name": "aliyun/alibaba-cloud-sdk-go",
"id": "bd02ce442aacda04048e10f30cf93bd423db6ee5",
"size": "4223",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "services/smartag/modify_sag_static_route.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "734307"
},
{
"name": "Makefile",
"bytes": "183"
}
],
"symlink_target": ""
} |
[](https://travis-ci.org/drewmoore/currency_chameleon)
# Currency Chameleon
This is a simple currency tool for converting, calculating, and comparing monetary values between currencies.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'currency_chameleon', git: 'git://github.com/drewmoore/currency_chameleon'
```
And then execute:
$ bundle
## Usage
First, you will need to setup a table of conversion rates between currencies. For example:
```ruby
CurrencyChameleon::Money.conversion_rates(
'EUR', 'USD' => 1.05507, 'Bitcoin' => 0.00137
)
```
Then, you can instantiate a new CurrencyChameleon::Money object in a currency:
`euros = CurrencyChameleon::Money.new(23, 'EUR')`
To simply return the amount:
`euros.amount # => 23`
or return the currency:
`euros.currency # => "EUR"`
You can also convert the amount to a secondary currency, which returns a new money instance:
```ruby
dollars = euros.convert_to('USD') # => 24.27 USD
dollars.currency # => "USD"
```
Money objects can perform mathematical operations between currencies, returning an instance in base currency:
```ruby
dollars = CurrencyChameleon::Money.new(47, 'USD')
euros = CurrencyChameleon::Money.new(12, 'EUR')
total = dollars + euros # => 59.66 USD
total.class # => CurrencyChameleon::Money
```
Money objects can also be compared against each other with any operator:
```ruby
euros = CurrencyChameleon::Money.new(2, 'EUR')
bitcoins = CurrencyChameleon::Money.new(2, 'Bitcoin')
euros == bitcoins # => false
euros > bitcoins # => false
euros < bitcoins # => true
```
## License
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
| {
"content_hash": "a3adeb1a5db45ad4c0545e5e94bf32be",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 139,
"avg_line_length": 26.441176470588236,
"alnum_prop": 0.7252502780867631,
"repo_name": "drewmoore/currency_chameleon",
"id": "878e34273401cfc58f343f31c4bf3f236c3c7860",
"size": "1798",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "7769"
}
],
"symlink_target": ""
} |
// Copyright 2017 The Ray Authors.
//
// 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.
#pragma once
#include "ray/rpc/client_call.h"
#include "ray/rpc/grpc_client.h"
#include "src/ray/protobuf/runtime_env_agent.grpc.pb.h"
namespace ray {
namespace rpc {
class RuntimeEnvAgentClientInterface {
public:
virtual void GetOrCreateRuntimeEnv(
const rpc::GetOrCreateRuntimeEnvRequest &request,
const rpc::ClientCallback<rpc::GetOrCreateRuntimeEnvReply> &callback) = 0;
virtual void DeleteRuntimeEnvIfPossible(
const rpc::DeleteRuntimeEnvIfPossibleRequest &request,
const rpc::ClientCallback<rpc::DeleteRuntimeEnvIfPossibleReply> &callback) = 0;
virtual ~RuntimeEnvAgentClientInterface(){};
};
/// Client used for communicating with a remote runtime env agent server.
class RuntimeEnvAgentClient : public RuntimeEnvAgentClientInterface {
public:
/// Constructor.
///
/// \param[in] address Address of the server.
/// \param[in] port Port of the server.
/// \param[in] client_call_manager The `ClientCallManager` used for managing requests.
RuntimeEnvAgentClient(const std::string &address,
const int port,
ClientCallManager &client_call_manager) {
grpc_client_ = std::make_unique<GrpcClient<RuntimeEnvService>>(
address, port, client_call_manager);
};
/// Create runtime env.
///
/// \param request The request message
/// \param callback The callback function that handles reply
VOID_RPC_CLIENT_METHOD(RuntimeEnvService,
GetOrCreateRuntimeEnv,
grpc_client_,
/*method_timeout_ms*/ -1, )
/// Delete URIs.
///
/// \param request The request message
/// \param callback The callback function that handles reply
VOID_RPC_CLIENT_METHOD(RuntimeEnvService,
DeleteRuntimeEnvIfPossible,
grpc_client_,
/*method_timeout_ms*/ -1, )
private:
/// The RPC client.
std::unique_ptr<GrpcClient<RuntimeEnvService>> grpc_client_;
};
} // namespace rpc
} // namespace ray
| {
"content_hash": "dccf862d993da962da198732f2fedb69",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 88,
"avg_line_length": 35.67567567567568,
"alnum_prop": 0.6821969696969697,
"repo_name": "ray-project/ray",
"id": "b821a4cfaab4550bc4eb9cc76b981be565885b87",
"size": "2640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/ray/rpc/runtime_env/runtime_env_client.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "37490"
},
{
"name": "C++",
"bytes": "5972422"
},
{
"name": "CSS",
"bytes": "10912"
},
{
"name": "Cython",
"bytes": "227477"
},
{
"name": "Dockerfile",
"bytes": "20210"
},
{
"name": "HTML",
"bytes": "30382"
},
{
"name": "Java",
"bytes": "1160849"
},
{
"name": "JavaScript",
"bytes": "1128"
},
{
"name": "Jinja",
"bytes": "6371"
},
{
"name": "Jupyter Notebook",
"bytes": "1615"
},
{
"name": "Makefile",
"bytes": "234"
},
{
"name": "PowerShell",
"bytes": "1114"
},
{
"name": "Python",
"bytes": "19539109"
},
{
"name": "Shell",
"bytes": "134583"
},
{
"name": "Starlark",
"bytes": "334862"
},
{
"name": "TypeScript",
"bytes": "190599"
}
],
"symlink_target": ""
} |
var Board = React.createClass({displayName: "Board",
getInitialState: function() {
var tempUnits = [];
for (var i = 0; i < this.props.size; i++) {
tempUnits.push([]);
for(var j = 0; j< this.props.size ; j++){
tempUnits[i].push({
checked: false,
firstHand: true
});
}
}
return {
units: tempUnits,
endGame: false,
info:"",
rule: "freestyle",
AI: "off",
showRuleOption: false,
showAIOption: false,
currentPlayer: true
};
},
toggleShowRuleOption: function() {
this.setState({
showRuleOption:!this.state.showRuleOption,
showAIOption: false,
info: ""
});
},
toggleShowAIOption: function() {
this.setState({
showAIOption:!this.state.showAIOption,
showRuleOption: false,
info: ""
});
},
newGame: function(newRule) {
gomoku.setUp(this.props.size, newRule);
var tempUnits = [];
for (var i = 0; i < this.props.size; i++) {
tempUnits.push([]);
for(var j = 0; j< this.props.size ; j++){
tempUnits[i].push({
checked: false,
firstHand: true
});
}
}
this.setState({
units:tempUnits,
endGame: false,
info:"",
rule: newRule,
AI: "off",
showRuleOption: false,
showAIOption: false
});
},
setAI: function(AIColor){
var tempAIColor = AIColor;
if(this.state.AI === tempAIColor){
tempAIColor = "off";
}
this.setState({
AI:tempAIColor,
showAIOption:false
});
alert(this.state.currentPlayer);
if(tempAIColor === "black" && this.state.currentPlayer){
var tempPos = gomoku.AIMove(true);
this.putChess([tempPos.i, tempPos.j]);
}
else if(tempAIColor === "white" && this.state.currentPlayer){
var tempPos = gomoku.AIMove(false);
this.putChess([tempPos.i, tempPos.j]);
}
},
putChess: function(key) {
if(!this.state.endGame){
var newArr = this.state.units;
if(!newArr[key[0]][key[1]].checked){
this.handleCheck(key,newArr);
this.colorChange(newArr);
}
this.setState({units:newArr});
gomoku.updateUnits(newArr);
if(gomoku.gameWin(key[0], key[1], gomoku.getColor(key[0], key[1]))){
this.setState({
endGame:true,
showAIOption: false,
showRuleOption: false,
});
if(this.state.units[key[0]][key[1]].firstHand){
this.setState({info:"Black Wins"});
}
else{
this.setState({info:"White Wins"});
}
}
else if(this.state.AI === "black" && !this.state.units[key[0]][key[1]].firstHand){
var tempPos = gomoku.AIMove(true);
this.putChess([tempPos.i, tempPos.j]);
}
else if(this.state.AI === "white" && this.state.units[key[0]][key[1]].firstHand){
var tempPos = gomoku.AIMove(false);
this.putChess([tempPos.i, tempPos.j]);
}
}
},
handleCheck: function(key, newArr) {
newArr[key[0]][key[1]].checked = true;
},
colorChange: function(newArr) {
this.setState({currentPlayer: !this.state.currentPlayer});
for(var i=0; i < this.props.size; i++){
for(var j=0;j< this.props.size; j++){
if(!newArr[i][j].checked){
newArr[i][j].firstHand = !newArr[i][j].firstHand;
}
}
}
},
render: function() {
var nodes = [],
menuNewClass = this.state.showRuleOption ? "active":"",
menuAIClass = this.state.showAIOption ? "active":"";
if(this.state.AI!=="off"){
menuAIClass = "active";
}
for (var i = 0; i < this.props.size; i++) {
for(var j = 0; j< this.props.size ; j++){
var index= i.toString() +"_"+ j.toString(),
color;
if(this.state.units[i][j].firstHand){
color = "black";
}else{
color = "white";
}
nodes.push(
React.createElement("div", {className: color},
React.createElement("input", {type: "checkbox", id: index, checked: this.state.units[i][j].checked}),
React.createElement("label", {htmlFor: index, onClick: this.putChess.bind(this,[i,j])})
)
);
}
}
return (
React.createElement("div", {className: "gomoku"},
React.createElement("div", {className: "board"},
nodes
),
React.createElement("div", {className: "menu"},
React.createElement("div", {id: "new", className: menuNewClass, onClick: this.toggleShowRuleOption},
"NEW"
),
this.state.showRuleOption ? React.createElement(Rules, {newGame: this.newGame}) : null,
React.createElement("p", {id: "winner"}, this.state.info),
this.state.showAIOption ? React.createElement(AIOption, {setAI: this.setAI, AI: this.state.AI}) : null,
React.createElement("div", {id: "AI", className: menuAIClass, onClick: this.toggleShowAIOption},
"AI"
)
)
)
);
}
});
var Rules = React.createClass({displayName: "Rules",
render: function() {
return (
React.createElement("div", {id: "rules"},
React.createElement("div", {id: "standard", onClick: this.props.newGame.bind(this,"standard")}, "STANDARD"),
React.createElement("div", {id: "freestyle", onClick: this.props.newGame.bind(this,"freestyle")}, "FREESTYLE")
)
);
}
});
var AIOption = React.createClass({displayName: "AIOption",
render: function() {
var menuAIblackClass = "",
menuAIwhiteClass = "";
switch (this.props.AI) {
case 'off':
menuAIblackClass = "";
menuAIwhiteClass = "";
break;
case 'black':
menuAIblackClass = "active";
menuAIwhiteClass = "";
break;
case 'white':
menuAIblackClass = "";
menuAIwhiteClass = "active";
break;
default:
menuAIblackClass = "";
menuAIwhiteClass = "";
}
return (
React.createElement("div", {id: "AIOption"},
React.createElement("div", {id: "AIblack", className: menuAIblackClass, onClick: this.props.setAI.bind(this,"black")}, "BLACK"),
React.createElement("div", {id: "AIwhite", className: menuAIwhiteClass, onClick: this.props.setAI.bind(this,"white")}, "WHITE")
)
);
}
}); | {
"content_hash": "46b4f03535c6a3527809303bbd0d568e",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 145,
"avg_line_length": 38.49590163934426,
"alnum_prop": 0.3773022463536676,
"repo_name": "johanye/JavascriptGOMOKU",
"id": "0eed79931805f659fd37d1b039ee3f4be7aca18f",
"size": "9394",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build/.module-cache/48788b29cab73f530e7e9ff14e54fca7e88cb50a.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4367"
},
{
"name": "HTML",
"bytes": "1029"
},
{
"name": "JavaScript",
"bytes": "1239137"
}
],
"symlink_target": ""
} |
package com.at.feign;
public class GitHubServerException extends GitHubException {
private static final long serialVersionUID = -3692993409405311554L;
public GitHubServerException(int status, String reason) {
super("server", status, reason);
}
}
| {
"content_hash": "b27958331d9cb50c33e9f4099b9a447e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 68,
"avg_line_length": 29.11111111111111,
"alnum_prop": 0.7633587786259542,
"repo_name": "alphatan/workspace_java",
"id": "faea5244ad37cce38c5b79da63e9be9d8e694f6c",
"size": "262",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "feign-demo/src/main/java/com/at/feign/GitHubServerException.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2717"
},
{
"name": "HTML",
"bytes": "47728"
},
{
"name": "Java",
"bytes": "1784425"
},
{
"name": "JavaScript",
"bytes": "5421"
},
{
"name": "TSQL",
"bytes": "8062"
},
{
"name": "XSLT",
"bytes": "1335"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
namespace Ardenian.Libraries.CSharp.ExpressionParser.Data
{
public static class ParserDataFactory
{
public static IParserData<T> CreateData<T>()
{
return Create<T>();
}
private static IParserData<T> Create<T>()
{
switch (typeof(T).ToString())
{
case "System.Int32":
return new DefaultParserData_Int32() as IParserData<T>;
case "System.Single":
return new DefaultParserData_Float() as IParserData<T>;
case "System.Double":
return new DefaultParserData_Double() as IParserData<T>;
default:
throw new ParserException($"Type \'{typeof(T)}\' is not supported for parameterless parser construction.");
}
}
}
}
| {
"content_hash": "b062a3316bf6b06d97f80bfb3b6526bf",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 127,
"avg_line_length": 33.035714285714285,
"alnum_prop": 0.5556756756756757,
"repo_name": "Ardenian/ExpressionParser",
"id": "d3730d6f3e7c8f2a5062d3fa6328f403f61da1ce",
"size": "927",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ExpressionParser/Ardenian/Libraries/ExpressionParser/Data/Example/ParserDataFactory.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "21822"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>sqlplus — sqlplus documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="sqlplus">
<h1>sqlplus<a class="headerlink" href="#sqlplus" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="sqlplus.html">sqlplus package</a><ul>
<li class="toctree-l2"><a class="reference internal" href="sqlplus.html#module-sqlplus">Module contents</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">sqlplus</a></h1>
<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="sqlplus.html">sqlplus package</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2018, nalssee.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.6</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
<a href="_sources/modules.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html> | {
"content_hash": "4e2c864d4a7c686801b2837e91ae35c1",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 112,
"avg_line_length": 29.38532110091743,
"alnum_prop": 0.6063065875741492,
"repo_name": "nalssee/sqlplus",
"id": "3b6595e820b34e6b72d51e6c2311ffbf4626b0f0",
"size": "3205",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_build/html/modules.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "33895"
},
{
"name": "HTML",
"bytes": "40923"
},
{
"name": "JavaScript",
"bytes": "99923"
},
{
"name": "Makefile",
"bytes": "609"
},
{
"name": "Python",
"bytes": "63041"
}
],
"symlink_target": ""
} |
#import <Foundation/Foundation.h>
@interface NSDate (RFKit)
- (BOOL)isSameDayWithDate:(NSDate *)date;
+ (NSString *)nowDate;
+(NSDate *)NSStringDateToNSDate:(NSString *)string;
+(NSDate *)NSStringDateToNSDateWithT:(NSString *)string;
+(NSDate *)NSStringDateToNSDateWithSecond:(NSString *)string;
+ (NSDate *)localNowDate;
- (NSString *)showSelf;
- (NSString *)showSelfWithoutTime;
@end
| {
"content_hash": "7621d380170081a17338c4c41e3ed466",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 61,
"avg_line_length": 23.058823529411764,
"alnum_prop": 0.7448979591836735,
"repo_name": "jkyowt/RFUICore",
"id": "ad1d2eed3b37b6af5e696d94a52383a5b55398c6",
"size": "580",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "RFKit/category/Foundation/NSDate+RFKit.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2227"
},
{
"name": "C++",
"bytes": "2726"
},
{
"name": "Objective-C",
"bytes": "102402"
}
],
"symlink_target": ""
} |
Agecoin integration/staging tree
================================
http://www.agecoin.org
Copyright (c) 2009-2014 Bitcoin Developers
Copyright (c) 2011-2014 Agecoin Developers
What is Agecoin?
----------------
Agecoin is a lite version of Bitcoin using scrypt as a proof-of-work algorithm.
- 2.5 minute block targets
- subsidy halves in 840k blocks (~4 years)
- ~84 million total coins
The rest is the same as Bitcoin.
- 50 coins per block
- 2016 blocks to retarget difficulty
For more information, as well as an immediately useable, binary version of
the Agecoin client sofware, see http://www.agecoin.org.
License
-------
Agecoin is released under the terms of the MIT license. See `COPYING` for more
information or see http://opensource.org/licenses/MIT.
Development process
-------------------
Developers work in their own trees, then submit pull requests when they think
their feature or bug fix is ready.
If it is a simple/trivial/non-controversial change, then one of the Agecoin
development team members simply pulls it.
If it is a *more complicated or potentially controversial* change, then the patch
submitter will be asked to start a discussion with the devs and community.
The patch will be accepted if there is broad consensus that it is a good thing.
Developers should expect to rework and resubmit patches if the code doesn't
match the project's coding conventions (see `doc/coding.txt`) or are
controversial.
The `master` branch is regularly built and tested, but is not guaranteed to be
completely stable. [Tags](https://github.com/agecoin-project/agecoin/tags) are created
regularly to indicate new official, stable release versions of Agecoin.
Testing
-------
Testing and code review is the bottleneck for development; we get more pull
requests than we can review and test. Please be patient and help out, and
remember this is a security-critical project where any mistake might cost people
lots of money.
### Automated Testing
Developers are strongly encouraged to write unit tests for new code, and to
submit new unit tests for old code.
Unit tests for the core code are in `src/test/`. To compile and run them:
cd src; make -f makefile.unix test
Unit tests for the GUI code are in `src/qt/test/`. To compile and run them:
qmake BITCOIN_QT_TEST=1 -o Makefile.test bitcoin-qt.pro
make -f Makefile.test
./agecoin-qt_test
| {
"content_hash": "27978b350f962cf3db874224cf531fb4",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 86,
"avg_line_length": 32.657534246575345,
"alnum_prop": 0.7491610738255033,
"repo_name": "agecoin/agecoin",
"id": "2db1f19d8035411b0b13287e7274ad0782df65eb",
"size": "2384",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "32790"
},
{
"name": "C++",
"bytes": "2605363"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "Groff",
"bytes": "18284"
},
{
"name": "HTML",
"bytes": "50615"
},
{
"name": "Makefile",
"bytes": "13377"
},
{
"name": "NSIS",
"bytes": "5918"
},
{
"name": "Objective-C",
"bytes": "1052"
},
{
"name": "Objective-C++",
"bytes": "5864"
},
{
"name": "Python",
"bytes": "11610"
},
{
"name": "QMake",
"bytes": "14749"
},
{
"name": "Shell",
"bytes": "11790"
}
],
"symlink_target": ""
} |
#import "NSObject.h"
#import "SKUICacheCoding-Protocol.h"
#import "SSMetricsEventFieldProvider-Protocol.h"
@class NSArray, NSMutableDictionary, NSString, NSURL, SKUIArtworkList, SKUIItemOffer;
@interface SKUIItem : NSObject <SKUICacheCoding, SSMetricsEventFieldProvider>
{
struct _NSRange _ageBandRange;
NSString *_artistName;
SKUIArtworkList *_artworks;
NSString *_bundleID;
NSString *_categoryName;
unsigned long long _deviceFamilies;
long long _itemIdentifier;
long long _itemKind;
NSString *_itemKindString;
SKUIItemOffer *_itemOffer;
_Bool _newsstandApp;
long long _newsstandBindingEdge;
long long _newsstandBindingType;
SKUIArtworkList *_newsstandArtworks;
long long _numberOfUserRatings;
long long _parentalControlsRank;
_Bool _prerenderedArtwork;
NSString *_productPageURLString;
NSArray *_requiredCapabilities;
NSString *_title;
float _userRating;
long long _versionIdentifier;
NSString *_versionString;
}
@property(readonly, nonatomic) NSString *itemKindString; // @synthesize itemKindString=_itemKindString;
@property(readonly, nonatomic) long long itemKind; // @synthesize itemKind=_itemKind;
@property(readonly, nonatomic) NSString *versionString; // @synthesize versionString=_versionString;
@property(readonly, nonatomic) long long versionIdentifier; // @synthesize versionIdentifier=_versionIdentifier;
@property(readonly, nonatomic) float userRating; // @synthesize userRating=_userRating;
@property(readonly, nonatomic) NSString *title; // @synthesize title=_title;
@property(readonly, nonatomic) NSArray *requiredCapabilities; // @synthesize requiredCapabilities=_requiredCapabilities;
@property(readonly, nonatomic) NSString *productPageURLString; // @synthesize productPageURLString=_productPageURLString;
@property(readonly, nonatomic) SKUIItemOffer *primaryItemOffer; // @synthesize primaryItemOffer=_itemOffer;
@property(readonly, nonatomic, getter=hasPrerenderedArtwork) _Bool prerenderedArtwork; // @synthesize prerenderedArtwork=_prerenderedArtwork;
@property(readonly, nonatomic) long long parentalControlsRank; // @synthesize parentalControlsRank=_parentalControlsRank;
@property(readonly, nonatomic) long long numberOfUserRatings; // @synthesize numberOfUserRatings=_numberOfUserRatings;
@property(readonly, nonatomic) long long newsstandBindingType; // @synthesize newsstandBindingType=_newsstandBindingType;
@property(readonly, nonatomic) long long newsstandBindingEdge; // @synthesize newsstandBindingEdge=_newsstandBindingEdge;
@property(readonly, nonatomic) SKUIArtworkList *newsstandArtworks; // @synthesize newsstandArtworks=_newsstandArtworks;
@property(readonly, nonatomic, getter=isNewsstandApp) _Bool newsstandApp; // @synthesize newsstandApp=_newsstandApp;
@property(readonly, nonatomic) long long itemIdentifier; // @synthesize itemIdentifier=_itemIdentifier;
@property(readonly, nonatomic) unsigned long long deviceFamilies; // @synthesize deviceFamilies=_deviceFamilies;
@property(readonly, nonatomic) NSString *categoryName; // @synthesize categoryName=_categoryName;
@property(readonly, nonatomic) NSString *bundleIdentifier; // @synthesize bundleIdentifier=_bundleID;
@property(readonly, nonatomic) SKUIArtworkList *artworks; // @synthesize artworks=_artworks;
@property(readonly, nonatomic) NSString *artistName; // @synthesize artistName=_artistName;
@property(readonly, nonatomic) struct _NSRange ageBandRange; // @synthesize ageBandRange=_ageBandRange;
- (void).cxx_destruct;
- (id)valueForMetricsField:(id)arg1;
@property(readonly, nonatomic) NSMutableDictionary *cacheRepresentation;
- (id)initWithCacheRepresentation:(id)arg1;
- (_Bool)isEqual:(id)arg1;
- (unsigned long long)hash;
@property(readonly, nonatomic) NSURL *largestArtworkURL;
- (id)artworkURLForSize:(long long)arg1;
- (id)initWithLookupDictionary:(id)arg1;
@end
| {
"content_hash": "ffc9616e10f87e2022009776f1d8dde0",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 141,
"avg_line_length": 54.66197183098591,
"alnum_prop": 0.795413553207936,
"repo_name": "matthewsot/CocoaSharp",
"id": "f6e98d1c56e46808aa15cccd519af6324d936aeb",
"size": "4021",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Headers/PrivateFrameworks/StoreKitUI/SKUIItem.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "259784"
},
{
"name": "C#",
"bytes": "2789005"
},
{
"name": "C++",
"bytes": "252504"
},
{
"name": "Objective-C",
"bytes": "24301417"
},
{
"name": "Smalltalk",
"bytes": "167909"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
Oesterr. Bot. Z. 12:253. 1862
#### Original name
Althaea kurdica Schltdl.
### Remarks
null | {
"content_hash": "1b2b9a731019454938b706b2b83e293f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 13.153846153846153,
"alnum_prop": 0.7134502923976608,
"repo_name": "mdoering/backbone",
"id": "f7bd2d3a2431d4c9096b42d3656bb15a265ad24d",
"size": "225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Malvaceae/Alcea/Alcea kurdica/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
var View = require('./abstract'),
util = require('util'),
url = require('url'),
Handlebars = require('handlebars'),
Log;
Log = function (minion, request, response) {
View.apply(this, arguments);
};
util.inherits(Log, View);
module.exports = Log;
Log.prototype.init = function () {
var id = this.getQuery('id'),
onlyFailures = this.getQuery('onlyFailures'),
dataOnly = this.getQuery('data'),
page = parseInt(this.getQuery('page'), 10),
filterCriteria = {},
sortCriteria = {$natural: -1},
self = this;
if (id) {
this._site = this._minion.findSiteById(id);
}
if (page <= 0) {
page = 1;
}
if (parseInt(onlyFailures, 10)) {
this._onlyFailures = true;
} else {
this._onlyFailures = false;
}
if (!parseInt(dataOnly, 10)) {
this._dataOnly = false;
this._renderLayout = true;
} else {
this._dataOnly = true;
this._renderLayout = false;
}
if (!this._site) {
this.redirect('/');
}
filterCriteria.siteId = this._site.getId();
if (this._onlyFailures) {
filterCriteria.status = false;
sortCriteria = {dateChecked: -1};
}
this._minion.getDb().collection('log', function (err, collection) {
collection
.find(filterCriteria)
.limit(200)
.skip((page - 1) * 200)
.sort(sortCriteria)
.toArray(function (err, items) {
self._entries = items;
self.initComplete();
});
});
};
Log.prototype.getTemplateName = function () {
if (this._dataOnly) {
return 'log-body';
} else {
return 'log';
}
};
Log.prototype.getTemplateData = function () {
this.registerHelper('status', this.renderStatus)
.registerHelper('onlyFailures', this.renderOnlyFailuresCheckbox)
.registerHelper('responseTime', this.renderResponseTime);
return {
entries: this._entries,
url: this._site.getUrl(),
id: this._site.getId()
};
};
Log.prototype.renderStatus = function (result) {
var id;
if (result.status) {
return new Handlebars.SafeString(
'<span class="all_clear">No Errors</span>'
);
} else {
id = String(result._id);
return new Handlebars.SafeString(
'<a href="/log-details?id=' + id + '" class="error">' + result.reason + '</a>'
);
}
};
Log.prototype.renderOnlyFailuresCheckbox = function () {
var out = '<input type="checkbox" name="onlyFailures" id="onlyFailures" value="1" ';
if (this._onlyFailures) {
out += 'checked="checked"';
}
out += ' />';
return new Handlebars.SafeString(out);
};
Log.prototype.renderResponseTime = function (responseTime) {
if (responseTime) {
return responseTime + 'ms';
} else {
return new Handlebars.SafeString(
'<span class="all_clear">Not Available</span>'
);
}
};
| {
"content_hash": "64c8708f3856ce5778e69ce4913e3921",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 90,
"avg_line_length": 24.421875,
"alnum_prop": 0.5406269993602048,
"repo_name": "griffbrad/Minion",
"id": "5ff4032f56497c5cb3d446ed1109a624aa4db4f3",
"size": "4739",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "minion/views/log.js",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "118548"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Sun Dec 11 02:02:02 EET 2011 -->
<TITLE>
Uses of Class edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor.CompositeComponentElementPanel
</TITLE>
<META NAME="date" CONTENT="2011-12-11">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor.CompositeComponentElementPanel";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../../index.html?edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor//class-useCompositeComponentElementPanel.html" target="_top"><B>FRAMES</B></A>
<A HREF="CompositeComponentElementPanel.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor.CompositeComponentElementPanel</B></H2>
</CENTER>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Packages that use <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor"><B>edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor"><B>edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor"><B>edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor</B></A></TD>
<TD> </TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><A HREF="#edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor"><B>edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor</B></A></TD>
<TD> </TD>
</TR>
</TABLE>
<P>
<A NAME="edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/behaviorgroupseditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/behaviorgroupseditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/behaviorgroupseditor/CompositeComponentBehaviorPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor">CompositeComponentBehaviorPanel</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/behaviorgroupseditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.behaviorgroupseditor</A> that return <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A></CODE></FONT></TD>
<TD><CODE><B>BehaviorGroupEditor.</B><B><A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/behaviorgroupseditor/BehaviorGroupEditor.html#getComponentPanel()">getComponentPanel</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor</A> that return <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A></CODE></FONT></TD>
<TD><CODE><B>CompositeElementPanel.</B><B><A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeElementPanel.html#getComponentPanel()">getComponentPanel</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<P>
<A NAME="edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/questioneditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/questioneditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/questioneditor/CompositeComponentQuestionPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.questioneditor">CompositeComponentQuestionPanel</A></B></CODE>
<BR>
Title:</TD>
</TR>
</TABLE>
<P>
<A NAME="edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
Uses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/responseeditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor</A></FONT></TH>
</TR>
</TABLE>
<P>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left" COLSPAN="2">Subclasses of <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor">CompositeComponentElementPanel</A> in <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/responseeditor/package-summary.html">edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor</A></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/responseeditor/CompositeComponentResponsePanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.responseeditor">CompositeComponentResponsePanel</A></B></CODE>
<BR>
Title:
Description:
Copyright: Copyright (c) 2001
Company:</TD>
</TR>
</TABLE>
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/CompositeComponentElementPanel.html" title="class in edu.cmu.cs.stage3.alice.authoringtool.editors.compositeeditor"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../../../index.html?edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor//class-useCompositeComponentElementPanel.html" target="_top"><B>FRAMES</B></A>
<A HREF="CompositeComponentElementPanel.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| {
"content_hash": "917dfa70cf14c5c7275e8c5c06f53890",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 508,
"avg_line_length": 59.82517482517483,
"alnum_prop": 0.6752776154295733,
"repo_name": "ai-ku/langvis",
"id": "f67fcfb9fb53c556ec69ac2a37219e8f121f5aec",
"size": "17110",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/edu/cmu/cs/stage3/alice/authoringtool/editors/compositeeditor/class-use/CompositeComponentElementPanel.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1391"
},
{
"name": "Haskell",
"bytes": "1005"
},
{
"name": "Java",
"bytes": "7426611"
},
{
"name": "Perl",
"bytes": "10563"
},
{
"name": "Python",
"bytes": "1744764"
},
{
"name": "Ruby",
"bytes": "691"
},
{
"name": "Shell",
"bytes": "701"
}
],
"symlink_target": ""
} |
package org.bubblecloud.zigbee.v3.zdo.command;
import org.bubblecloud.zigbee.v3.zdo.ZdoCommand;
import org.bubblecloud.zigbee.v3.ZdoResponse;
import java.util.Arrays;
/**
* SimpleDescriptorResponse.
*/
public class SimpleDescriptorResponse extends ZdoCommand implements ZdoResponse {
/**
* The source address.
*/
public int sourceAddress;
/**
* The status.
*/
public int status;
/**
* The profile ID.
*/
public int profileId;
/**
* The device ID.
*/
public int deviceId;
/**
* The device version.
*/
public int deviceVersion;
/**
* The network address.
*/
public int networkAddress;
/**
* The endpoint.
*/
public int endpoint;
/**
* The input clusters.
*/
private int[] inputClusters;
/**
* The output clusters.
*/
private int[] outputClusters;
public SimpleDescriptorResponse() {
}
public SimpleDescriptorResponse(int sourceAddress, int status, int profileId, int deviceId, int deviceVersion, int networkAddress, int endpoint, int[] inputClusters, int[] outputClusters) {
this.sourceAddress = sourceAddress;
this.status = status;
this.profileId = profileId;
this.deviceId = deviceId;
this.deviceVersion = deviceVersion;
this.networkAddress = networkAddress;
this.endpoint = endpoint;
this.inputClusters = inputClusters;
this.outputClusters = outputClusters;
}
public int getDeviceId() {
return deviceId;
}
public void setDeviceId(int deviceId) {
this.deviceId = deviceId;
}
public int getDeviceVersion() {
return deviceVersion;
}
public void setDeviceVersion(int deviceVersion) {
this.deviceVersion = deviceVersion;
}
public int getEndpoint() {
return endpoint;
}
public void setEndpoint(int endpoint) {
this.endpoint = endpoint;
}
public int[] getInputClusters() {
return inputClusters;
}
public void setInputClusters(int[] inputClusters) {
this.inputClusters = inputClusters;
}
public int getNetworkAddress() {
return networkAddress;
}
public void setNetworkAddress(int networkAddress) {
this.networkAddress = networkAddress;
}
public int[] getOutputClusters() {
return outputClusters;
}
public void setOutputClusters(int[] outputClusters) {
this.outputClusters = outputClusters;
}
public int getProfileId() {
return profileId;
}
public void setProfileId(int profileId) {
this.profileId = profileId;
}
public int getSourceAddress() {
return sourceAddress;
}
public void setSourceAddress(int sourceAddress) {
this.sourceAddress = sourceAddress;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
@Override
public String toString() {
return "Simple Descriptor Response " +
"deviceId=" + deviceId +
", sourceAddress=" + sourceAddress +
", status=" + status +
", profileId=" + profileId +
", deviceVersion=" + deviceVersion +
", networkAddress=" + networkAddress +
", endpoint=" + endpoint +
", inputClusters=" + Arrays.toString(inputClusters) +
", outputClusters=" + Arrays.toString(outputClusters);
}
}
| {
"content_hash": "f8b241dd6712d1a3d34ffd55925aa41c",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 193,
"avg_line_length": 23.906666666666666,
"alnum_prop": 0.605409927495817,
"repo_name": "tlaukkan/zigbee4java",
"id": "708b636c94570e1de57a63794dd2d609f8a3cf2a",
"size": "3586",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "zigbee-common/src/main/java/org/bubblecloud/zigbee/v3/zdo/command/SimpleDescriptorResponse.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "209"
},
{
"name": "HTML",
"bytes": "4267"
},
{
"name": "Java",
"bytes": "3024040"
},
{
"name": "Shell",
"bytes": "251"
}
],
"symlink_target": ""
} |
package skype.utils.youtube;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import skype.exceptions.InvalidYoutubeKeywordsException;
import skype.exceptions.NoSuchVideoException;
import skype.net.YoutubeHttpConnection;
import skype.utils.StringUtil;
/**
* This class creates a http connection with youtube's search url and reads the
* source code to find the first id of the videos which found.
*
* Youtube's source format: All the videos are inside a list. The list id is:
*
* <pre>
* "< ol id="item-section-XXXXXX" class="item-section" >"
* </pre>
*
* Now inside that list we are searching for
*
* <pre>
* "data-context-item-id"
* </pre>
*
* div tag. If we can find that tag then our list contains videos. The first
* occurrence of this tag is the first video, the second occurrence is the second
* video and so on. If this list does not contain that tag then youtube was not able
* to find any videos with the given keywords.
*
* @author UniQ
* @since 1.0
*/
public class YoutubeVideoSearcher {
private static final String YOUTUBE_SEARCH_URL = "https://www.youtube.com/results?search_query=";
private static final String YOUTUBE_VIDEO_URL = "https://www.youtube.com/watch?v=";
/**
* This magic number is the length of "<li><div class="yt-lockup yt-lockup-tile
* yt-lockup-video vve-check clearfix" data-context-item-id=" inside the source
* code.
*/
private static final int VIDEO_ID_STARTING_POS = 99;
/**
* The size of video ID is always 11 so we 99+11=110
*/
private static final int VIDEO_ID_ENDING_POS = 110;
private final YoutubeHttpConnection youtubeConnection;
public YoutubeVideoSearcher() {
this.youtubeConnection = new YoutubeHttpConnection();
}
public String getFirstVideoURL() throws NoSuchVideoException {
try {
BufferedReader in =
new BufferedReader(new InputStreamReader(youtubeConnection.getHttpConnection().getInputStream()));
String inputLine;
//Find the item section
while (!in.readLine().contains("<ol id=\"item-section"));
//Search if it is contains "data-context-item-id" tag
while ((inputLine = in.readLine()) != null){
if(inputLine.contains("data-context-item-id"))
return YOUTUBE_VIDEO_URL + inputLine.substring(VIDEO_ID_STARTING_POS, VIDEO_ID_ENDING_POS);
}
} catch (IOException e) {
//Some http error ignore
}
throw new NoSuchVideoException("Can not find a find a video with the given keywords");
}
public void setKeywords(String[] words) throws InvalidYoutubeKeywordsException {
final String searchKeywords = StringUtil.wordConcatenation(words, '+').replace("\\", "\\\\");
if (searchKeywords.length() == 0)
throw new InvalidYoutubeKeywordsException("You must send at least one keyword");
String searchQuery = YOUTUBE_SEARCH_URL + searchKeywords;
youtubeConnection.setYoutubeURL(searchQuery);
}
}
| {
"content_hash": "b26e1ac4d36cc1f50826b110e9421206",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 102,
"avg_line_length": 32.60674157303371,
"alnum_prop": 0.7284631288766368,
"repo_name": "Cuniq/SkypeBot",
"id": "66e882e231e4616d21e9f2ed6c6bbfa02c499908",
"size": "2902",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/skype/utils/youtube/YoutubeVideoSearcher.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "135570"
}
],
"symlink_target": ""
} |
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>Click-to-play overlay for amp-video</title>
<script async custom-element="amp-video" src="https://cdn.ampproject.org/v0/amp-video-0.1.js"></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<link rel="canonical" href="https://example.com/advanced/click-to-play_overlay_for_amp-video/">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<style amp-custom>
/* Wrapper that hosts the video and the overlay */
.video-player {
position: relative;
overflow: hidden;
}
/* Overlay fills the parent and sits on top of the video */
.click-to-play-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.poster-image {
position: absolute;
z-index: 1;
}
.poster-image img {
object-fit: cover;
}
.video-title {
position: absolute;
z-index: 2;
/* Align to the top left */
top: 0;
left: 0;
font-size: 1.3em;
background-color: rgba(0,0,0,0.8);
color: #fafafa;
padding: 0.5rem;
margin: 0px;
}
.play-icon {
position: absolute;
z-index: 2;
width: 100px;
height: 100px;
background-image: url(https://example.com/img/play-icon.png);
background-repeat: no-repeat;
background-size: 100% 100%;
/* Align to the middle */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
cursor: pointer;
opacity: 0.9;
}
.play-icon:hover, .play-icon:focus {
opacity: 1;
}
</style>
</head>
<body>
<div class="video-player">
<amp-video id="myVideo" controls
width="1280" height="720" layout="responsive"
src="/video/bullfinch.mp4">
</amp-video>
<div id="myOverlay" class="click-to-play-overlay">
<h3 class="video-title">Title of the video</h3>
<div class="play-icon"
role="button" tabindex="0"
on="tap:myOverlay.hide, myVideo.play"></div>
<amp-img class="poster-image"
layout="fill"
src="/img/bullfinch_poster.jpg"></amp-img>
</div>
</div>
</body>
</html>
| {
"content_hash": "53696e41ef2de5c562246b65696422ef",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 765,
"avg_line_length": 28.339449541284402,
"alnum_prop": 0.6131434121074781,
"repo_name": "ampproject/amp-toolbox",
"id": "e4d94a019f04f8f0d1c6d4b5f7e4b1159918c2e0",
"size": "3091",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "packages/optimizer/spec/valid-amp/files/Click-to-play_overlay_for_amp-video.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "80764"
},
{
"name": "Dockerfile",
"bytes": "447"
},
{
"name": "HTML",
"bytes": "2698542"
},
{
"name": "Handlebars",
"bytes": "234"
},
{
"name": "JavaScript",
"bytes": "528029"
},
{
"name": "Shell",
"bytes": "147"
},
{
"name": "TypeScript",
"bytes": "115320"
}
],
"symlink_target": ""
} |
import UsersDataService from 'src/users/services/UsersDataService';
import UsersList from 'src/users/components/list/UsersList';
import UserDetails from 'src/users/components/details/UserDetails';
// Define the Angular 'users' module
export default angular
.module("users", ['ngMaterial'])
.component(UsersList.name, UsersList.config)
.component(UserDetails.name, UserDetails.config)
.service("UsersDataService", UsersDataService);
| {
"content_hash": "5bde882c604b553201ebce7aefb425a9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.7216494845360825,
"repo_name": "ceddecedric/qwirk",
"id": "c8c43d7042d23a3072729d05d9ec23b53b8e3404",
"size": "521",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/users/Users.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "319808"
},
{
"name": "CoffeeScript",
"bytes": "3009"
},
{
"name": "HTML",
"bytes": "72855"
},
{
"name": "JavaScript",
"bytes": "327116"
}
],
"symlink_target": ""
} |
<?php
/**
* Zend_Mail_Storage_Mbox
*/
require_once 'Zend/Mail/Storage/Mbox.php';
/**
* @category Zend
* @package Zend_Mail
* @subpackage UnitTests
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @group Zend_Mail
*/
class Zend_Mail_InterfaceTest extends PHPUnit_Framework_TestCase
{
protected $_mboxFile;
public function setUp()
{
$this->_mboxFile = dirname(__FILE__) . '/_files/test.mbox/INBOX';
}
public function testCount()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$count = count($list);
$this->assertEquals(7, $count);
}
public function testIsset()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$this->assertTrue(isset($list[1]));
}
public function testNotIsset()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$this->assertFalse(isset($list[10]));
}
public function testArrayGet()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$subject = $list[1]->subject;
$this->assertEquals('Simple Message', $subject);
}
public function testArraySetFail()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
try {
$list[1] = 'test';
} catch (Exception $e) {
return; // test ok
}
$this->fail('no exception thrown while writing to array access');
}
public function testIterationKey()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$pos = 1;
foreach ($list as $key => $message) {
$this->assertEquals($key, $pos, "wrong key in iteration $pos");
++$pos;
}
}
public function testIterationIsMessage()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
foreach ($list as $key => $message) {
$this->assertTrue($message instanceof Zend_Mail_Message_Interface, 'value in iteration is not a mail message');
}
}
public function testIterationRounds()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$count = 0;
foreach ($list as $key => $message) {
++$count;
}
$this->assertEquals(7, $count);
}
public function testIterationWithSeek()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$count = 0;
foreach (new LimitIterator($list, 1, 3) as $key => $message) {
++$count;
}
$this->assertEquals(3, $count);
}
public function testIterationWithSeekCapped()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$count = 0;
foreach (new LimitIterator($list, 3, 7) as $key => $message) {
++$count;
}
$this->assertEquals(5, $count);
}
public function testFallback()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
try {
$result = $list->noop();
$this->assertTrue($result);
} catch (Exception $e) {
$this->fail('exception raised while calling noop thru fallback');
}
}
public function testWrongVariable()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
try {
$list->thisdoesnotexist;
} catch (Exception $e) {
return; // test ok
}
$this->fail('no exception thrown while reading wrong variable (via __get())');
}
public function testGetHeaders()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
$headers = $list[1]->getHeaders();
$this->assertTrue(count($headers) > 0);
}
public function testWrongHeader()
{
$list = new Zend_Mail_Storage_Mbox(array('filename' => $this->_mboxFile));
try {
$list[1]->thisdoesnotexist;
} catch (Exception $e) {
return; // test ok
}
$this->fail('no exception thrown while reading wrong header');
}
}
| {
"content_hash": "ab4b33686881d5b3615a0aeec78bc347",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 123,
"avg_line_length": 26.31360946745562,
"alnum_prop": 0.555655498088599,
"repo_name": "karthiksekarnz/educulas",
"id": "adc33d398ec41988bc7170349e24719d687aa083",
"size": "5217",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/Zend/Mail/InterfaceTest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "19954"
},
{
"name": "Java",
"bytes": "123492"
},
{
"name": "JavaScript",
"bytes": "8306153"
},
{
"name": "PHP",
"bytes": "32985843"
},
{
"name": "Ruby",
"bytes": "911"
},
{
"name": "Shell",
"bytes": "20173"
}
],
"symlink_target": ""
} |
package com.gtm.cpims.sync;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import com.gtm.cpims.jaas.UserCredentialName;
public class CcmBaseInfoSynchronizer implements BaseInfoSynchronizer {
private JdbcTemplate jdbcTemplate;
public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
/**
* 删除用户
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String deleteSubject(String login) {
int userid;
try {
userid = jdbcTemplate
.queryForInt(
"SELECT user_id FROM jg_credential WHERE cred_name=? AND cred_value=?",
new Object[] { "login", login });
} catch (org.springframework.dao.EmptyResultDataAccessException e) {
return "NO ENTRY NEED TO DELETE";
}
jdbcTemplate.execute("DELETE FROM jg_credential WHERE user_id = "
+ userid);// 删除用户表credential
jdbcTemplate.execute("DELETE FROM jg_user_principal WHERE user_id = "
+ userid);// 删除用户表角色
jdbcTemplate.execute("DELETE FROM jg_user WHERE id = " + userid);// 删除用户表id
return "DELETE OK";
}
/**
* 添加用户
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String insertSubject(String login, String password, String nickName,
String area, String organization, String department) {
GeneratedKeyHolder gkHolder = new GeneratedKeyHolder();
jdbcTemplate.update(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con)
throws SQLException {
PreparedStatement ps = con.prepareStatement(
"INSERT INTO jg_user (foo) VALUES(?)",
new String[] { "id" });
ps.setLong(1, 1);
return ps;
}
}, gkHolder);// 插入用户表ID
long userid = gkHolder.getKey().longValue();// 返回自动生成ID
jdbcTemplate
.update(
"INSERT INTO jg_credential (user_id,public_visibility,cred_name,cred_value) values(?,?,?,?)",
new Object[] { userid, 0,
UserCredentialName.login.name(), login });// 插入用户login
jdbcTemplate
.update(
"INSERT INTO jg_credential (user_id,public_visibility,cred_name,cred_value) values(?,?,?,?)",
new Object[] { userid, 0,
UserCredentialName.password.name(), password });// 插入用户password
jdbcTemplate
.update(
"INSERT INTO jg_credential (user_id,public_visibility,cred_name,cred_value) values(?,?,?,?)",
new Object[] { userid, 1,
UserCredentialName.nickname.name(), nickName });// 插入用户nickname
// jdbcTemplate
// .update(
// "INSERT INTO jg_credential (user_id,public_visibility,cred_name,cred_value) values(?,?,?,?)",
// new Object[] { userid, 1,
// UserCredentialName.area.name(), area });// 插入用户area
jdbcTemplate
.update(
"INSERT INTO jg_credential (user_id,public_visibility,cred_name,cred_value) values(?,?,?,?)",
new Object[] { userid, 1,
UserCredentialName.organization.name(),
organization });// 插入用户organization
// TODO 需要同步部门信息,
return "INSERT SUCESSFULLY";
}
/**
* 修改用户
*/
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public String updateSubject(String login, String password, String nickName,
String area, String organization, String department) {
int userid;
try {
userid = jdbcTemplate
.queryForInt(
"SELECT user_id FROM jg_credential WHERE cred_name=? AND cred_value=?",
new Object[] { "login", login });
} catch (org.springframework.dao.EmptyResultDataAccessException e) {
return "NO ENTRY NEED TO UPDATE";
}
if (password != null && !password.trim().equals(""))
jdbcTemplate
.update(
"UPDATE jg_credential SET cred_value = ? WHERE cred_name = ? AND user_id = ?",
new Object[] { password,
UserCredentialName.password.name(), userid });// 修改用户password
if (nickName != null && !nickName.trim().equals(""))
jdbcTemplate
.update(
"UPDATE jg_credential SET cred_value = ? WHERE cred_name = ? AND user_id = ?",
new Object[] { nickName,
UserCredentialName.nickname.name(), userid });// 修改用户nickName
return "UPDATE OK";
}
}
| {
"content_hash": "2e80ee85347ee9206d38b49993d94e4b",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 101,
"avg_line_length": 35.33846153846154,
"alnum_prop": 0.673269481932956,
"repo_name": "YangYongZhi/cpims",
"id": "1e61635d768a95bd4ce6bda46af27f38fe1d4f1d",
"size": "4748",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/gtm/cpims/sync/CcmBaseInfoSynchronizer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "363939"
},
{
"name": "HTML",
"bytes": "7662"
},
{
"name": "Java",
"bytes": "3601698"
},
{
"name": "JavaScript",
"bytes": "2979120"
},
{
"name": "PLpgSQL",
"bytes": "1964"
}
],
"symlink_target": ""
} |
namespace Application.Web.Models
{
public class ExternalLoginListViewModel
{
public string Action { get; set; }
public string ReturnUrl { get; set; }
}
} | {
"content_hash": "ae9c06810ae05711c063fcc6bc0e11d3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.639344262295082,
"repo_name": "d-kostov-dev/ASP.NET-MVC-5-Application-Skeleton",
"id": "0feeea240c81ff059747adc2b94a487da110fbff",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ApplicationSkeleton/Application.Web/Models/Account/ExternalLoginListViewModel.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "106"
},
{
"name": "C#",
"bytes": "118474"
},
{
"name": "CSS",
"bytes": "3357"
},
{
"name": "JavaScript",
"bytes": "10318"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<meta http-equiv="Content-Language" content="en-US"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Language" content="en-US"/>
<title>megaUNI</title>
<link type="image/x-icon" rel="shortcut icon" href="/favicon.ico"/>
<link type="text/css" rel="stylesheet" media="screen" href="/styles/index.css"/>
</head>
<body id="the_body">
<div id="the_content">
<p>Come back next month. I'm still not done writing the code for this site.</p>
<div class="col" id="middle">
<div id="nav_bar">
<h4>Read this in the meantime:</h4>
<ul class="nav_bar old_clubs">
<li>
<a href="http://knowledgeofhealth.com/">http://knowledgeofhealth.com/</a>
</li>
<li>
<a href="http://longevinex.com/">http://longevinex.com</a>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
| {
"content_hash": "1dd92f52b085b6399248d1b7188ebc0a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 148,
"avg_line_length": 32.05,
"alnum_prop": 0.5733229329173167,
"repo_name": "da99/megauni",
"id": "3db83e4eab36058fd4e77688c5f8252f22061ac2",
"size": "1282",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Public/index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "62577"
},
{
"name": "Crystal",
"bytes": "80248"
},
{
"name": "HTML",
"bytes": "4700"
},
{
"name": "PLpgSQL",
"bytes": "35610"
},
{
"name": "Shell",
"bytes": "4977"
},
{
"name": "TSQL",
"bytes": "2987"
}
],
"symlink_target": ""
} |
using System.Reflection;
using System.Runtime.CompilerServices;
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("02. Passed or Failed")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("02. Passed or Failed")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[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("a0aff313-01ca-49f2-8355-f4f3c80b186a")]
// 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.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| {
"content_hash": "72c908063e823e34c46031d29c0c5fc3",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.25,
"alnum_prop": 0.7423920736022647,
"repo_name": "plamenrusanov/Programming-Fundamentals",
"id": "20d6a3d4ccd6b6a7b4d3af7cba8f9a8be7d29c85",
"size": "1416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Conditional Statements and Loops - Lab/02. Passed or Failed/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "901980"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<title>sono - examples - PixiJS / Multi play</title>
<link href="favicon.ico" rel="shortcut icon">
<link href="css/styles.css" rel="stylesheet">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/styles/darcula.min.css">
</head>
<body>
<div>
<section>
<header>
<h2>PixiJS</h2>
</header>
<div class="Controls">
<p>Arrow keys to move around, space to shoot.</p>
</div>
<div class="Controls" data-container></div>
<div class="Controls" data-info></div>
<pre>
<code class="js">
import sono from 'sono';
import {loaders} from 'pixi.js';
const ext = sono.canPlay.ogg ? 'ogg' : 'mp3';
if (sono.hasWebAudio) {
const {Resource} = loaders;
Resource.setExtensionLoadType(ext, Resource.LOAD_TYPE.XHR);
Resource.setExtensionXhrType(ext, Resource.XHR_RESPONSE_TYPE.BUFFER);
}
const sounds = [{
name: 'music',
url: `audio/space-shooter.${ext}`,
loop: true,
volume: 0.8
}, {
name: 'shoot',
url: `audio/shoot3.${ext}`,
volume: 0.4
}, {
name: 'explode',
url: `audio/explode2.${ext}`,
volume: 0.9
}];
const loader = new loaders.Loader();
loader.add(sounds);
loader.onComplete.once(() => {
sounds.forEach(sound => {
const src = loader.resources[sound.name].data;
const config = Object.assign({}, sound, {src});
sono.create(config);
});
sono.get('shoot').effects.add(reverb();
sono.play('music');
});
loader.load();
</code>
</pre>
</section>
</div>
<script src="js/disable.js"></script>
<script src="../dist/sono.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.4.0/pixi.min.js"></script>
<script src="js/pixi.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.10.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>
| {
"content_hash": "e3edff7ba5bf582dee1673de3bb01a97",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 114,
"avg_line_length": 29.91764705882353,
"alnum_prop": 0.5292961069602832,
"repo_name": "Stinkstudios/sono",
"id": "112159c8e2efcf5409818704e4f4e58dd80897e6",
"size": "2543",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/pixi.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "9817"
},
{
"name": "JavaScript",
"bytes": "165932"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Specialized;
using System.Diagnostics;
using SimpleAuthentication.Core.Tracing;
namespace SimpleAuthentication.Core.Providers
{
public abstract class BaseProvider : IAuthenticationProvider
{
private string _stateKey;
protected BaseProvider(string name, string authenticationType)
{
if (string.IsNullOrEmpty(name))
{
throw new ArgumentNullException("name");
}
if (string.IsNullOrEmpty(authenticationType))
{
throw new ArgumentNullException("authenticationType");
}
Name = name;
AuthenticationType = authenticationType;
TraceManager = new Lazy<ITraceManager>(() => new TraceManager()).Value;
}
#region IAuthentionProvider Implementation
public string StateKey
{
get { return (string.IsNullOrEmpty(_stateKey) ? "state" : _stateKey); }
set { _stateKey = value; }
}
public string Name { get; private set; }
public string AuthenticationType { get; private set; }
public Uri AuthenticateRedirectionUrl { get; set; }
public AccessToken AccessToken { get; set; }
public abstract RedirectToAuthenticateSettings RedirectToAuthenticate(Uri requestUri);
public abstract IAuthenticatedClient AuthenticateClient(NameValueCollection queryStringParameters,
string state,
Uri callbackUri);
public ITraceManager TraceManager { set; protected get; }
#endregion
protected TraceSource TraceSource
{
get { return TraceManager["SimpleAuthentication.Providers." + Name]; }
}
protected string GetQuerystringState(string state)
{
if (string.IsNullOrWhiteSpace(state))
{
throw new ArgumentNullException("state");
}
return string.Format("&{0}={1}", StateKey, state);
}
}
} | {
"content_hash": "cc05abdb98e8e3ec5e62dc1625ecff50",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 106,
"avg_line_length": 31.366197183098592,
"alnum_prop": 0.56757970363718,
"repo_name": "SimpleAuthentication/SimpleAuthentication",
"id": "c5e60f83e28fe2fe045235289f9ee08ac2ad37fd",
"size": "2229",
"binary": false,
"copies": "3",
"ref": "refs/heads/dev",
"path": "Code/SimpleAuthentication.Core/Providers/BaseProvider.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "467014"
}
],
"symlink_target": ""
} |
jQuery(function() {
//
// Extend jQuery feature detection
//
jQuery.extend(jQuery.support, {
touch: "ontouchend" in document
});
//
// Hook up touch events
//
if (jQuery.support.touch) {
var obj = document.getElementsByClassName('QapTcha');
for(i=0; i<obj.length;i++){
obj[i].addEventListener("touchstart", iPadTouchHandler, false);
obj[i].addEventListener("touchmove", iPadTouchHandler, false);
obj[i].addEventListener("touchend", iPadTouchHandler, false);
obj[i].addEventListener("touchcancel", iPadTouchHandler, false);
}}
});
var lastTap = null; // Holds last tapped element (so we can compare for double tap)
var tapValid = false; // Are we still in the .6 second window where a double tap can occur
var tapTimeout = null; // The timeout reference
function cancelTap() {
tapValid = false;
}
var rightClickPending = false; // Is a right click still feasible
var rightClickEvent = null; // the original event
var holdTimeout = null; // timeout reference
var cancelMouseUp = false; // prevents a click from occuring as we want the context menu
function cancelHold() {
if (rightClickPending) {
window.clearTimeout(holdTimeout);
rightClickPending = false;
rightClickEvent = null;
}
}
function startHold(event) {
if (rightClickPending)
return;
rightClickPending = true; // We could be performing a right click
rightClickEvent = (event.changedTouches)[0];
holdTimeout = window.setTimeout("doRightClick();", 800);
}
function doRightClick() {
rightClickPending = false;
//
// We need to mouse up (as we were down)
//
var first = rightClickEvent,
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0, null);
first.target.dispatchEvent(simulatedEvent);
//
// emulate a right click
//
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 2, null);
first.target.dispatchEvent(simulatedEvent);
//
// Show a context menu
//
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5,
false, false, false, false, 2, null);
first.target.dispatchEvent(simulatedEvent);
//
// Note:: I don't mouse up the right click here however feel free to add if required
//
cancelMouseUp = true;
rightClickEvent = null; // Release memory
}
//
// mouse over event then mouse down
//
function iPadTouchStart(event) {
var touches = event.changedTouches,
first = touches[0],
type = "mouseover",
simulatedEvent = document.createEvent("MouseEvent");
//
// Mouse over first - I have live events attached on mouse over
//
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0, null);
first.target.dispatchEvent(simulatedEvent);
type = "mousedown";
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0, null);
first.target.dispatchEvent(simulatedEvent);
if (!tapValid) {
lastTap = first.target;
tapValid = true;
tapTimeout = window.setTimeout("cancelTap();", 600);
startHold(event);
}
else {
window.clearTimeout(tapTimeout);
//
// If a double tap is still a possibility and the elements are the same
// Then perform a double click
//
if (first.target == lastTap) {
lastTap = null;
tapValid = false;
type = "click";
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0/*left*/, null);
first.target.dispatchEvent(simulatedEvent);
type = "dblclick";
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, 0/*left*/, null);
first.target.dispatchEvent(simulatedEvent);
}
else {
lastTap = first.target;
tapValid = true;
tapTimeout = window.setTimeout("cancelTap();", 600);
startHold(event);
}
}
}
function iPadTouchHandler(event) {
var type = "",
button = 0; /*left*/
if (event.touches.length > 1)
return;
switch (event.type) {
case "touchstart":
if (jQuery(event.changedTouches[0].target).is("select")) {
return;
}
iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
event.preventDefault();
return false;
break;
case "touchmove":
cancelHold();
type = "mousemove";
event.preventDefault();
break;
case "touchend":
if (cancelMouseUp) {
cancelMouseUp = false;
event.preventDefault();
return false;
}
cancelHold();
type = "mouseup";
break;
default:
return;
}
var touches = event.changedTouches,
first = touches[0],
simulatedEvent = document.createEvent("MouseEvent");
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, button, null);
first.target.dispatchEvent(simulatedEvent);
if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipads default behaviour (which we prevented)
simulatedEvent = document.createEvent("MouseEvent"); // This check avoids click being emulated on a double tap
simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
false, false, false, false, button, null);
first.target.dispatchEvent(simulatedEvent);
}
}
| {
"content_hash": "a100aa91608b35f10825bf4137e7abb0",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 146,
"avg_line_length": 28.84722222222222,
"alnum_prop": 0.6884930187770824,
"repo_name": "Adsun/adsun.github.io",
"id": "563f756abcb2adb33c1c1ea3e55c5d988568ab88",
"size": "6418",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "blog/Shadowsocks_files/jquery.ui.touch.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "126773"
},
{
"name": "HTML",
"bytes": "65000"
},
{
"name": "JavaScript",
"bytes": "59467"
}
],
"symlink_target": ""
} |
package org.eclipse.jetty.io;
public class BuffersFactory
{
public static Buffers newBuffers(Buffers.Type headerType, int headerSize, Buffers.Type bufferType, int bufferSize, Buffers.Type otherType,int maxSize)
{
if (maxSize>=0)
return new PooledBuffers(headerType,headerSize,bufferType,bufferSize,otherType,maxSize);
return new ThreadLocalBuffers(headerType,headerSize,bufferType,bufferSize,otherType);
}
}
| {
"content_hash": "a3298efb4deca3d779a7852eebb35ef6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 154,
"avg_line_length": 41.81818181818182,
"alnum_prop": 0.7391304347826086,
"repo_name": "wang88/jetty",
"id": "5bab5f2e2375c4340c2ff5743a7baaf78cc9381f",
"size": "460",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "jetty-io/src/main/java/org/eclipse/jetty/io/BuffersFactory.java",
"mode": "33261",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using UIKit;
namespace osu.Game.Rulesets.Catch.Tests.iOS
{
public class Application
{
public static void Main(string[] args)
{
UIApplication.Main(args, null, "AppDelegate");
}
}
}
| {
"content_hash": "bd96d6a9129ad5dc87e111aafb96567b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 79,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6473684210526316,
"repo_name": "naoey/osu",
"id": "44817c1304dd90e5000d1fd82f44f94cd519a021",
"size": "382",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "osu.Game.Rulesets.Catch.Tests.iOS/Application.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "4122627"
},
{
"name": "PowerShell",
"bytes": "2550"
},
{
"name": "Ruby",
"bytes": "6173"
},
{
"name": "Shell",
"bytes": "1031"
}
],
"symlink_target": ""
} |
module Pomo
class Task
##
# Task name.
attr_accessor :name
##
# Length in minutes.
attr_accessor :length
##
# Verbose task description.
attr_accessor :description
##
# Task currently running bool.
attr_accessor :running
##
# Task completion bool.
attr_accessor :complete
##
# Initialize with _name_ and _options_.
def initialize(name = nil, options = {})
@name = name or raise '<task> required'
@description = options.delete :description
@length = options.fetch :length, 25
@running = false
@complete = false
end
##
# Quoted task name.
def to_s
name
end
##
# Check if the task currently running.
def running?
running
end
##
# Check if the task has been completed.
def complete?
complete
end
##
# Output verbose task information
def verbose_output(format)
say format % ['name', self]
say format % ['length', "#{length} minutes"]
say format % ['description', description] if description and not description.empty?
say format % ['complete', complete ? '[✓]' : '[ ]']
end
##
# Start timing the task.
def start(config, options = {})
list = options[:list]
progress = options[:progress]
@running = true
list.save unless list.nil?
if progress
foreground_progress(config)
else
background_progress(config)
end
end
private
def foreground_progress(config)
notifier = Pomo::Notifier.new(config)
say "Started #{self}, you have #{length} minutes :)"
complete_message = "Time is up! Hope you are finished #{self}"
format_message = '(:progress_bar) :remaining minutes remaining'
progress(
(0..length).to_a.reverse,
:format => format_message,
:tokens => { :remaining => length },
:complete_message => complete_message
) do |remaining|
if remaining == length / 2
notifier.notify 'Half way there!', :header => "#{remaining} minutes remaining"
elsif remaining == 5
notifier.notify 'Almost there!', :header => '5 minutes remaining'
end
sleep 60 unless ENV['POMO_ENV']=='test'
{ :remaining => remaining }
end
notifier.notify "Hope you are finished #{self}", :header => 'Time is up!', :type => :warning
list = Pomo::List.new
if task = list.running
task.running = false
task.complete = true
list.save
end
end
def background_progress(config)
notifier = Pomo::Notifier.new(config)
notifier.notify "Started #{self}", :header => "You have #{length} minutes"
pid = Process.fork do
length.downto(1) do |remaining|
write_tmux_time(remaining) if config.tmux
refresh_tmux_status_bar if config.tmux
if remaining == length / 2
notifier.notify 'Half way there!', :header => "#{remaining} minutes remaining"
elsif remaining == 5
notifier.notify 'Almost there!', :header => '5 minutes remaining'
end
sleep 60 unless ENV['POMO_ENV']=='test'
end
write_tmux_time(0) if config.tmux
refresh_tmux_status_bar if config.tmux
notifier.notify "Hope you are finished #{self}", :header => 'Time is up!', :type => :warning
list = Pomo::List.new
if task = list.running
task.running = false
task.complete = true
list.save
end
end
Process.detach(pid)
end
def tmux_time(time)
case time
when 0
"#{time}:00"
when 1..5
"#[default]#[fg=red]#{time}:00#[default]"
when 6..100
"#[default]#[fg=green]#{time}:00#[default]"
end
end
def write_tmux_time(time)
path = File.join(ENV['HOME'],'.pomo_stat')
File.open(path, 'w') do |file|
file.write tmux_time(time)
end
end
def refresh_tmux_status_bar
pid = Process.fork do
exec "tmux refresh-client -S -t $(tmux list-clients -F '\#{client_tty}')"
end
Process.detach(pid)
end
end
end
| {
"content_hash": "57e02d887d3d45064529a3291fa1298b",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 100,
"avg_line_length": 23.522222222222222,
"alnum_prop": 0.5684931506849316,
"repo_name": "tj/pomo",
"id": "8b621c28aa5a28f6fef4502b8e31950f76d26608",
"size": "4253",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/pomo/task.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "34662"
}
],
"symlink_target": ""
} |
WebInspector.CSSRule = function (nodeStyles, ownerStyleSheet, id, type, sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList) {
WebInspector.Object.call(this);
console.assert(nodeStyles);
this._nodeStyles = nodeStyles;
this._ownerStyleSheet = ownerStyleSheet || null;
this._id = id || null;
this._type = type || null;
this.update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, true);
};
WebInspector.Object.addConstructorFunctions(WebInspector.CSSRule);
WebInspector.CSSRule.Event = {
Changed: "css-rule-changed"
};
WebInspector.CSSRule.Type = {
Author: "css-rule-type-author",
User: "css-rule-type-user",
UserAgent: "css-rule-type-user-agent",
Inspector: "css-rule-type-inspector"
};
WebInspector.CSSRule.prototype = Object.defineProperties({
constructor: WebInspector.CSSRule,
update: function update(sourceCodeLocation, selectorText, selectors, matchedSelectorIndices, style, mediaList, dontFireEvents) {
sourceCodeLocation = sourceCodeLocation || null;
selectorText = selectorText || "";
selectors = selectors || [];
matchedSelectorIndices = matchedSelectorIndices || [];
style = style || null;
mediaList = mediaList || [];
var changed = false;
if (!dontFireEvents) {
changed = this._selectorText !== selectorText || !Object.shallowEqual(this._selectors, selectors) || !Object.shallowEqual(this._matchedSelectorIndices, matchedSelectorIndices) || this._style !== style || !!this._sourceCodeLocation !== !!sourceCodeLocation || this._mediaList.length !== mediaList.length;
// FIXME: Look for differences in the media list arrays.
}
if (this._style) this._style.ownerRule = null;
this._sourceCodeLocation = sourceCodeLocation;
this._selectorText = selectorText;
this._selectors = selectors;
this._matchedSelectorIndices = matchedSelectorIndices;
this._style = style;
this._mediaList = mediaList;
delete this._matchedSelectors;
delete this._matchedSelectorText;
if (this._style) this._style.ownerRule = this;
if (changed) this.dispatchEventToListeners(WebInspector.CSSRule.Event.Changed);
}
}, {
id: { // Public
get: function get() {
return this._id;
},
configurable: true,
enumerable: true
},
ownerStyleSheet: {
get: function get() {
return this._ownerStyleSheet;
},
configurable: true,
enumerable: true
},
editable: {
get: function get() {
return !!this._id && (this._type === WebInspector.CSSRule.Type.Author || this._type === WebInspector.CSSRule.Type.Inspector);
},
configurable: true,
enumerable: true
},
type: {
get: function get() {
return this._type;
},
configurable: true,
enumerable: true
},
sourceCodeLocation: {
get: function get() {
return this._sourceCodeLocation;
},
configurable: true,
enumerable: true
},
selectorText: {
get: function get() {
return this._selectorText;
},
set: function set(selectorText) {
console.assert(this.editable);
if (!this.editable) return;
if (this._selectorText === selectorText) return;
this._nodeStyles.changeRuleSelector(this, selectorText);
},
configurable: true,
enumerable: true
},
selectors: {
get: function get() {
return this._selectors;
},
set: function set(selectors) {
this.selectorText = (selectors || []).join(", ");
},
configurable: true,
enumerable: true
},
matchedSelectorIndices: {
get: function get() {
return this._matchedSelectorIndices;
},
configurable: true,
enumerable: true
},
matchedSelectors: {
get: function get() {
// COMPATIBILITY (iOS 6): The selectors array is always empty, so just return an empty array.
if (!this._selectors.length) {
console.assert(!this._matchedSelectorIndices.length);
return [];
}
if (this._matchedSelectors) return this._matchedSelectors;
this._matchedSelectors = this._selectors.filter(function (element, index) {
return this._matchedSelectorIndices.contains(index);
}, this);
return this._matchedSelectors;
},
configurable: true,
enumerable: true
},
matchedSelectorText: {
get: function get() {
// COMPATIBILITY (iOS 6): The selectors array is always empty, so just return the whole selector.
if (!this._selectors.length) {
console.assert(!this._matchedSelectorIndices.length);
return this._selectorText;
}
if ("_matchedSelectorText" in this) return this._matchedSelectorText;
this._matchedSelectorText = this.matchedSelectors.join(", ");
return this._matchedSelectorText;
},
configurable: true,
enumerable: true
},
style: {
get: function get() {
return this._style;
},
configurable: true,
enumerable: true
},
mediaList: {
get: function get() {
return this._mediaList;
},
configurable: true,
enumerable: true
},
nodeStyles: {
// Protected
get: function get() {
return this._nodeStyles;
},
configurable: true,
enumerable: true
}
});
WebInspector.CSSRule.prototype.__proto__ = WebInspector.Object.prototype;
| {
"content_hash": "16ecbaf263c986bfb52542a6aa6dc9c0",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 315,
"avg_line_length": 30.63917525773196,
"alnum_prop": 0.5921938088829072,
"repo_name": "artygus/webkit-webinspector",
"id": "255278215e151984dcac26f7f8ae6c5645d513fd",
"size": "7298",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/WebInspectorUI/v8/Models/CSSRule.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1009335"
},
{
"name": "HTML",
"bytes": "103706"
},
{
"name": "JavaScript",
"bytes": "12679719"
}
],
"symlink_target": ""
} |
namespace base {
namespace {
using ::testing::ElementsAre;
class TestProfileBuilder : public ProfileBuilder {
public:
TestProfileBuilder(ModuleCache* module_cache) : module_cache_(module_cache) {}
TestProfileBuilder(const TestProfileBuilder&) = delete;
TestProfileBuilder& operator=(const TestProfileBuilder&) = delete;
// ProfileBuilder
ModuleCache* GetModuleCache() override { return module_cache_; }
void RecordMetadata(
const MetadataRecorder::MetadataProvider& metadata_provider) override {}
void OnSampleCompleted(std::vector<Frame> frames,
TimeTicks sample_timestamp) override {
last_timestamp_ = sample_timestamp;
}
void OnProfileCompleted(TimeDelta profile_duration,
TimeDelta sampling_period) override {}
TimeTicks last_timestamp() { return last_timestamp_; }
private:
raw_ptr<ModuleCache> module_cache_;
TimeTicks last_timestamp_;
};
// A stack copier for use in tests that provides the expected behavior when
// operating on the supplied fake stack.
class TestStackCopier : public StackCopier {
public:
TestStackCopier(const std::vector<uintptr_t>& fake_stack,
TimeTicks timestamp = TimeTicks())
: fake_stack_(fake_stack), timestamp_(timestamp) {}
bool CopyStack(StackBuffer* stack_buffer,
uintptr_t* stack_top,
TimeTicks* timestamp,
RegisterContext* thread_context,
Delegate* delegate) override {
std::memcpy(stack_buffer->buffer(), &fake_stack_[0], fake_stack_.size());
*stack_top =
reinterpret_cast<uintptr_t>(&fake_stack_[0] + fake_stack_.size());
// Set the stack pointer to be consistent with the provided fake stack.
*thread_context = {};
RegisterContextStackPointer(thread_context) =
reinterpret_cast<uintptr_t>(&fake_stack_[0]);
*timestamp = timestamp_;
return true;
}
private:
// Must be a reference to retain the underlying allocation from the vector
// passed to the constructor.
const std::vector<uintptr_t>& fake_stack_;
const TimeTicks timestamp_;
};
// A StackCopier that just invokes the expected functions on the delegate.
class DelegateInvokingStackCopier : public StackCopier {
public:
bool CopyStack(StackBuffer* stack_buffer,
uintptr_t* stack_top,
TimeTicks* timestamp,
RegisterContext* thread_context,
Delegate* delegate) override {
delegate->OnStackCopy();
return true;
}
};
// Trivial unwinder implementation for testing.
class TestUnwinder : public Unwinder {
public:
TestUnwinder(size_t stack_size = 0,
std::vector<uintptr_t>* stack_copy = nullptr,
// Variable to fill in with the bottom address of the
// copied stack. This will be different than
// &(*stack_copy)[0] because |stack_copy| is a copy of the
// copy so does not share memory with the actual copy.
uintptr_t* stack_copy_bottom = nullptr)
: stack_size_(stack_size),
stack_copy_(stack_copy),
stack_copy_bottom_(stack_copy_bottom) {}
bool CanUnwindFrom(const Frame& current_frame) const override { return true; }
UnwindResult TryUnwind(RegisterContext* thread_context,
uintptr_t stack_top,
std::vector<Frame>* stack) const override {
if (stack_copy_) {
auto* bottom = reinterpret_cast<uintptr_t*>(
RegisterContextStackPointer(thread_context));
auto* top = bottom + stack_size_;
*stack_copy_ = std::vector<uintptr_t>(bottom, top);
}
if (stack_copy_bottom_)
*stack_copy_bottom_ = RegisterContextStackPointer(thread_context);
return UnwindResult::kCompleted;
}
private:
size_t stack_size_;
raw_ptr<std::vector<uintptr_t>> stack_copy_;
raw_ptr<uintptr_t> stack_copy_bottom_;
};
// Records invocations of calls to OnStackCapture()/UpdateModules().
class CallRecordingUnwinder : public Unwinder {
public:
void OnStackCapture() override { on_stack_capture_was_invoked_ = true; }
void UpdateModules() override { update_modules_was_invoked_ = true; }
bool CanUnwindFrom(const Frame& current_frame) const override { return true; }
UnwindResult TryUnwind(RegisterContext* thread_context,
uintptr_t stack_top,
std::vector<Frame>* stack) const override {
return UnwindResult::kUnrecognizedFrame;
}
bool on_stack_capture_was_invoked() const {
return on_stack_capture_was_invoked_;
}
bool update_modules_was_invoked() const {
return update_modules_was_invoked_;
}
private:
bool on_stack_capture_was_invoked_ = false;
bool update_modules_was_invoked_ = false;
};
class TestModule : public ModuleCache::Module {
public:
TestModule(uintptr_t base_address, size_t size, bool is_native = true)
: base_address_(base_address), size_(size), is_native_(is_native) {}
uintptr_t GetBaseAddress() const override { return base_address_; }
std::string GetId() const override { return ""; }
FilePath GetDebugBasename() const override { return FilePath(); }
size_t GetSize() const override { return size_; }
bool IsNative() const override { return is_native_; }
private:
const uintptr_t base_address_;
const size_t size_;
const bool is_native_;
};
// Utility function to form a vector from a single module.
std::vector<std::unique_ptr<const ModuleCache::Module>> ToModuleVector(
std::unique_ptr<const ModuleCache::Module> module) {
return std::vector<std::unique_ptr<const ModuleCache::Module>>(
std::make_move_iterator(&module), std::make_move_iterator(&module + 1));
}
// Injects a fake module covering the initial instruction pointer value, to
// avoid asking the OS to look it up. Windows doesn't return a consistent error
// code when doing so, and we DCHECK_EQ the expected error code.
void InjectModuleForContextInstructionPointer(
const std::vector<uintptr_t>& stack,
ModuleCache* module_cache) {
module_cache->AddCustomNativeModule(
std::make_unique<TestModule>(stack[0], sizeof(uintptr_t)));
}
// Returns a plausible instruction pointer value for use in tests that don't
// care about the instruction pointer value in the context, and hence don't need
// InjectModuleForContextInstructionPointer().
uintptr_t GetTestInstructionPointer() {
return reinterpret_cast<uintptr_t>(&GetTestInstructionPointer);
}
// An unwinder fake that replays the provided outputs.
class FakeTestUnwinder : public Unwinder {
public:
struct Result {
Result(bool can_unwind)
: can_unwind(can_unwind), result(UnwindResult::kUnrecognizedFrame) {}
Result(UnwindResult result, std::vector<uintptr_t> instruction_pointers)
: can_unwind(true),
result(result),
instruction_pointers(instruction_pointers) {}
bool can_unwind;
UnwindResult result;
std::vector<uintptr_t> instruction_pointers;
};
// Construct the unwinder with the outputs. The relevant unwinder functions
// are expected to be invoked at least as many times as the number of values
// specified in the arrays (except for CanUnwindFrom() which will always
// return true if provided an empty array.
explicit FakeTestUnwinder(std::vector<Result> results)
: results_(std::move(results)) {}
FakeTestUnwinder(const FakeTestUnwinder&) = delete;
FakeTestUnwinder& operator=(const FakeTestUnwinder&) = delete;
bool CanUnwindFrom(const Frame& current_frame) const override {
bool can_unwind = results_[current_unwind_].can_unwind;
// NB: If CanUnwindFrom() returns false then TryUnwind() will not be
// invoked, so current_unwind_ is guarantee to be incremented only once for
// each result.
if (!can_unwind)
++current_unwind_;
return can_unwind;
}
UnwindResult TryUnwind(RegisterContext* thread_context,
uintptr_t stack_top,
std::vector<Frame>* stack) const override {
CHECK_LT(current_unwind_, results_.size());
const Result& current_result = results_[current_unwind_];
++current_unwind_;
CHECK(current_result.can_unwind);
for (const auto instruction_pointer : current_result.instruction_pointers)
stack->emplace_back(
instruction_pointer,
module_cache()->GetModuleForAddress(instruction_pointer));
return current_result.result;
}
private:
mutable size_t current_unwind_ = 0;
std::vector<Result> results_;
};
StackSampler::UnwindersFactory MakeUnwindersFactory(
std::unique_ptr<Unwinder> unwinder) {
return BindOnce(
[](std::unique_ptr<Unwinder> unwinder) {
std::vector<std::unique_ptr<Unwinder>> unwinders;
unwinders.push_back(std::move(unwinder));
return unwinders;
},
std::move(unwinder));
}
base::circular_deque<std::unique_ptr<Unwinder>> MakeUnwinderCircularDeque(
std::unique_ptr<Unwinder> native_unwinder,
std::unique_ptr<Unwinder> aux_unwinder) {
base::circular_deque<std::unique_ptr<Unwinder>> unwinders;
if (native_unwinder)
unwinders.push_front(std::move(native_unwinder));
if (aux_unwinder)
unwinders.push_front(std::move(aux_unwinder));
return unwinders;
}
} // namespace
// TODO(crbug.com/1001923): Fails on Linux MSan.
#if defined(OS_LINUX) || defined(OS_CHROMEOS)
#define MAYBE_CopyStack DISABLED_MAYBE_CopyStack
#else
#define MAYBE_CopyStack CopyStack
#endif
TEST(StackSamplerImplTest, MAYBE_CopyStack) {
ModuleCache module_cache;
const std::vector<uintptr_t> stack = {0, 1, 2, 3, 4};
InjectModuleForContextInstructionPointer(stack, &module_cache);
std::vector<uintptr_t> stack_copy;
StackSamplerImpl stack_sampler_impl(
std::make_unique<TestStackCopier>(stack),
MakeUnwindersFactory(
std::make_unique<TestUnwinder>(stack.size(), &stack_copy)),
&module_cache);
stack_sampler_impl.Initialize();
std::unique_ptr<StackBuffer> stack_buffer =
std::make_unique<StackBuffer>(stack.size() * sizeof(uintptr_t));
TestProfileBuilder profile_builder(&module_cache);
stack_sampler_impl.RecordStackFrames(stack_buffer.get(), &profile_builder);
EXPECT_EQ(stack, stack_copy);
}
TEST(StackSamplerImplTest, CopyStackTimestamp) {
ModuleCache module_cache;
const std::vector<uintptr_t> stack = {0};
InjectModuleForContextInstructionPointer(stack, &module_cache);
std::vector<uintptr_t> stack_copy;
TimeTicks timestamp = TimeTicks::UnixEpoch();
StackSamplerImpl stack_sampler_impl(
std::make_unique<TestStackCopier>(stack, timestamp),
MakeUnwindersFactory(
std::make_unique<TestUnwinder>(stack.size(), &stack_copy)),
&module_cache);
stack_sampler_impl.Initialize();
std::unique_ptr<StackBuffer> stack_buffer =
std::make_unique<StackBuffer>(stack.size() * sizeof(uintptr_t));
TestProfileBuilder profile_builder(&module_cache);
stack_sampler_impl.RecordStackFrames(stack_buffer.get(), &profile_builder);
EXPECT_EQ(timestamp, profile_builder.last_timestamp());
}
TEST(StackSamplerImplTest, UnwinderInvokedWhileRecordingStackFrames) {
std::unique_ptr<StackBuffer> stack_buffer = std::make_unique<StackBuffer>(10);
auto owned_unwinder = std::make_unique<CallRecordingUnwinder>();
CallRecordingUnwinder* unwinder = owned_unwinder.get();
ModuleCache module_cache;
TestProfileBuilder profile_builder(&module_cache);
StackSamplerImpl stack_sampler_impl(
std::make_unique<DelegateInvokingStackCopier>(),
MakeUnwindersFactory(std::move(owned_unwinder)), &module_cache);
stack_sampler_impl.Initialize();
stack_sampler_impl.RecordStackFrames(stack_buffer.get(), &profile_builder);
EXPECT_TRUE(unwinder->on_stack_capture_was_invoked());
EXPECT_TRUE(unwinder->update_modules_was_invoked());
}
TEST(StackSamplerImplTest, AuxUnwinderInvokedWhileRecordingStackFrames) {
std::unique_ptr<StackBuffer> stack_buffer = std::make_unique<StackBuffer>(10);
ModuleCache module_cache;
TestProfileBuilder profile_builder(&module_cache);
StackSamplerImpl stack_sampler_impl(
std::make_unique<DelegateInvokingStackCopier>(),
MakeUnwindersFactory(std::make_unique<CallRecordingUnwinder>()),
&module_cache);
stack_sampler_impl.Initialize();
auto owned_aux_unwinder = std::make_unique<CallRecordingUnwinder>();
CallRecordingUnwinder* aux_unwinder = owned_aux_unwinder.get();
stack_sampler_impl.AddAuxUnwinder(std::move(owned_aux_unwinder));
stack_sampler_impl.RecordStackFrames(stack_buffer.get(), &profile_builder);
EXPECT_TRUE(aux_unwinder->on_stack_capture_was_invoked());
EXPECT_TRUE(aux_unwinder->update_modules_was_invoked());
}
TEST(StackSamplerImplTest, WalkStack_Completed) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) =
GetTestInstructionPointer();
module_cache.AddCustomNativeModule(std::make_unique<TestModule>(1u, 1u));
auto native_unwinder =
WrapUnique(new FakeTestUnwinder({{UnwindResult::kCompleted, {1u}}}));
native_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(std::move(native_unwinder), nullptr));
ASSERT_EQ(2u, stack.size());
EXPECT_EQ(1u, stack[1].instruction_pointer);
}
TEST(StackSamplerImplTest, WalkStack_Aborted) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) =
GetTestInstructionPointer();
module_cache.AddCustomNativeModule(std::make_unique<TestModule>(1u, 1u));
auto native_unwinder =
WrapUnique(new FakeTestUnwinder({{UnwindResult::kAborted, {1u}}}));
native_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(std::move(native_unwinder), nullptr));
ASSERT_EQ(2u, stack.size());
EXPECT_EQ(1u, stack[1].instruction_pointer);
}
TEST(StackSamplerImplTest, WalkStack_NotUnwound) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) =
GetTestInstructionPointer();
auto native_unwinder = WrapUnique(
new FakeTestUnwinder({{UnwindResult::kUnrecognizedFrame, {}}}));
native_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(std::move(native_unwinder), nullptr));
ASSERT_EQ(1u, stack.size());
}
TEST(StackSamplerImplTest, WalkStack_AuxUnwind) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) =
GetTestInstructionPointer();
// Treat the context instruction pointer as being in the aux unwinder's
// non-native module.
module_cache.UpdateNonNativeModules(
{}, ToModuleVector(std::make_unique<TestModule>(
GetTestInstructionPointer(), 1u, false)));
auto aux_unwinder =
WrapUnique(new FakeTestUnwinder({{UnwindResult::kAborted, {1u}}}));
aux_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(nullptr, std::move(aux_unwinder)));
ASSERT_EQ(2u, stack.size());
EXPECT_EQ(GetTestInstructionPointer(), stack[0].instruction_pointer);
EXPECT_EQ(1u, stack[1].instruction_pointer);
}
TEST(StackSamplerImplTest, WalkStack_AuxThenNative) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) = 0u;
// Treat the context instruction pointer as being in the aux unwinder's
// non-native module.
module_cache.UpdateNonNativeModules(
{}, ToModuleVector(std::make_unique<TestModule>(0u, 1u, false)));
// Inject a fake native module for the second frame.
module_cache.AddCustomNativeModule(std::make_unique<TestModule>(1u, 1u));
auto aux_unwinder = WrapUnique(
new FakeTestUnwinder({{UnwindResult::kUnrecognizedFrame, {1u}}, false}));
aux_unwinder->Initialize(&module_cache);
auto native_unwinder =
WrapUnique(new FakeTestUnwinder({{UnwindResult::kCompleted, {2u}}}));
native_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(std::move(native_unwinder),
std::move(aux_unwinder)));
ASSERT_EQ(3u, stack.size());
EXPECT_EQ(0u, stack[0].instruction_pointer);
EXPECT_EQ(1u, stack[1].instruction_pointer);
EXPECT_EQ(2u, stack[2].instruction_pointer);
}
TEST(StackSamplerImplTest, WalkStack_NativeThenAux) {
ModuleCache module_cache;
RegisterContext thread_context;
RegisterContextInstructionPointer(&thread_context) = 0u;
// Inject fake native modules for the instruction pointer from the context and
// the third frame.
module_cache.AddCustomNativeModule(std::make_unique<TestModule>(0u, 1u));
module_cache.AddCustomNativeModule(std::make_unique<TestModule>(2u, 1u));
// Treat the second frame's pointer as being in the aux unwinder's non-native
// module.
module_cache.UpdateNonNativeModules(
{}, ToModuleVector(std::make_unique<TestModule>(1u, 1u, false)));
auto aux_unwinder = WrapUnique(new FakeTestUnwinder(
{{false}, {UnwindResult::kUnrecognizedFrame, {2u}}, {false}}));
aux_unwinder->Initialize(&module_cache);
auto native_unwinder =
WrapUnique(new FakeTestUnwinder({{UnwindResult::kUnrecognizedFrame, {1u}},
{UnwindResult::kCompleted, {3u}}}));
native_unwinder->Initialize(&module_cache);
std::vector<Frame> stack = StackSamplerImpl::WalkStackForTesting(
&module_cache, &thread_context, 0u,
MakeUnwinderCircularDeque(std::move(native_unwinder),
std::move(aux_unwinder)));
ASSERT_EQ(4u, stack.size());
EXPECT_EQ(0u, stack[0].instruction_pointer);
EXPECT_EQ(1u, stack[1].instruction_pointer);
EXPECT_EQ(2u, stack[2].instruction_pointer);
EXPECT_EQ(3u, stack[3].instruction_pointer);
}
} // namespace base
| {
"content_hash": "7f657156b8c9d25749cd17ae4c05c9cf",
"timestamp": "",
"source": "github",
"line_count": 494,
"max_line_length": 80,
"avg_line_length": 37.121457489878544,
"alnum_prop": 0.7076562329588832,
"repo_name": "ric2b/Vivaldi-browser",
"id": "f58a96d6de87a9dc18ce6d24815538c5f1493a71",
"size": "19138",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chromium/base/profiler/stack_sampler_impl_unittest.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
package com.blackducksoftware.tools.commonframework.standard.codecenter.dao;
import java.util.List;
import java.util.SortedSet;
import com.blackducksoftware.tools.commonframework.standard.codecenter.pojo.ApplicationPojo;
import com.blackducksoftware.tools.commonframework.standard.codecenter.pojo.ComponentPojo;
import com.blackducksoftware.tools.commonframework.standard.codecenter.pojo.ComponentUsePojo;
import com.blackducksoftware.tools.commonframework.standard.codecenter.pojo.VulnerabilityPojo;
/**
* Manages components/vulnerabilities/metadata for a single application.
*
* @author sbillings
*
*/
public interface ApplicationDao {
/**
* Get the application as a POJO.
*
* @return the application as a POJO.
* @throws Exception
*/
ApplicationPojo getApplication() throws Exception;
/**
* Get the list of component uses.
*
* @return
* @throws Exception
*/
List<ComponentUsePojo> getComponentUses() throws Exception;
/**
* Get the list of components.
*
* @return
* @throws Exception
*/
List<ComponentPojo> getComponents() throws Exception;
/**
* Get the components as a sorted list.
*
* @return
* @throws Exception
*/
SortedSet<ComponentPojo> getComponentsSorted() throws Exception;
/**
* Get a component given its component use.
*
* @param componentUse
* @return
* @throws Exception
*/
ComponentPojo getComponent(ComponentUsePojo componentUse) throws Exception;
/**
* Get the list of vulnerabilities for a component.
*
* @param component
* @param compUse
* @return
* @throws Exception
*/
List<VulnerabilityPojo> getVulnerabilities(ComponentPojo component,
ComponentUsePojo compUse) throws Exception;
/**
* get the vulnerabilities for a component as a sorted list.
*
* @param compPojo
* @param compUsePojo
* @return
* @throws Exception
*/
SortedSet<VulnerabilityPojo> getVulnerabilitiesSorted(
ComponentPojo compPojo, ComponentUsePojo compUsePojo)
throws Exception;
/**
* Update the vulnerability data for a component.
*
* @param compUse
* @param vuln
* @throws Exception
*/
void updateCompUseVulnData(ComponentUsePojo compUse, VulnerabilityPojo vuln)
throws Exception;
}
| {
"content_hash": "287de0da03acf37a77254932d6471360",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 94,
"avg_line_length": 25.989247311827956,
"alnum_prop": 0.6793545717832024,
"repo_name": "blackducksoftware/common-framework",
"id": "53266fe0e1ed6aa7959bd60a3a46428addff954e",
"size": "3329",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/blackducksoftware/tools/commonframework/standard/codecenter/dao/ApplicationDao.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "4224051"
},
{
"name": "HTML",
"bytes": "7695131"
},
{
"name": "Java",
"bytes": "630365"
},
{
"name": "Ruby",
"bytes": "6887"
}
],
"symlink_target": ""
} |
package tiffit.todolist;
import net.minecraft.client.Minecraft;
import net.minecraft.nbt.NBTTagCompound;
public class TaskClock {
private int hours;
private int minutes;
private int seconds;
private int stage;
private long lastCheckTime;
private boolean time_left = true;
public TaskClock(int hours, int minutes, int seconds){
this.hours = hours;
this.minutes = minutes;
this.seconds = seconds;
lastCheckTime = Minecraft.getSystemTime();
}
public void tick(){
if(Minecraft.getSystemTime() - lastCheckTime >= 1000){
seconds--;
stage++;
if(stage >= 4) stage = 0;
calculateReadable();
lastCheckTime = Minecraft.getSystemTime();
if(hours == 0 && minutes == 1 && seconds == 0){
TODOListMod.message.setMessage("Deadline", "1 minute left!", false);
}
if(hours == 0 && minutes == 5 && seconds == 0){
TODOListMod.message.setMessage("Deadline", "5 minutes left!", false);
}
if(seconds <= 0 && minutes <= 0 && hours <= 0){
time_left = false;
TODOListMod.message.setMessage("Deadline", "Task has reached deadline!", false);
}
}
}
public int getStage(){
return stage;
}
public boolean enabled(){
return time_left;
}
private void calculateReadable(){
int seconds = this.seconds + (((this.hours*60) + minutes)*60);
int minutes = 0;
int hours = 0;
while(seconds > 59){
seconds-=60;
minutes++;
}
while(minutes > 59){
minutes-=60;
hours++;
}
this.seconds = seconds;
this.minutes = minutes;
this.hours = hours;
}
public int getHours(){ return hours; }
public int getMinutes(){ return minutes; }
public int getSeconds(){ return seconds; }
public NBTTagCompound toNBT(){
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("hours", hours);
tag.setInteger("minutes", minutes);
tag.setInteger("seconds", seconds);
return tag;
}
public static TaskClock fromNBT(NBTTagCompound tag){
int hours = tag.getInteger("hours");
int minutes = tag.getInteger("minutes");
int seconds = tag.getInteger("seconds");
return new TaskClock(hours, minutes, seconds);
}
@Override
public String toString(){
calculateReadable();
return hours + ":" + minutes + ":" + seconds;
}
public int getTextColor(){
if(hours == 0 && minutes == 0 && minutes <= 59){
return 0xbb0000;
}
return 0xdddddd;
}
public static TaskClock fromString(String str){
if(str.equals("")) return null;
String[] times = str.split(":");
int hours = Integer.valueOf(times[0]);
int minutes = Integer.valueOf(times[1]);
int seconds = Integer.valueOf(times[2]);
return new TaskClock(hours, minutes, seconds);
}
public static boolean validate(String str){
if(str.equals("")) return true;
String[] times = str.split(":");
if(times.length != 3) return false;
for(String time : times){
try{
Integer.valueOf(time);
}catch(NumberFormatException e){
return false;
}
}
return true;
}
public boolean hasMoreTime(TaskClock clock){
if(clock.getHours() > getHours()) return true;
if(clock.getMinutes() > getMinutes()) return true;
if(clock.getSeconds() > getSeconds()) return true;
return false;
}
}
| {
"content_hash": "ca225ff7d78a37e9b4671e75fb879ec9",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 84,
"avg_line_length": 24.284615384615385,
"alnum_prop": 0.6632879315806145,
"repo_name": "tiffit/TODOList",
"id": "91797684df1a4808dbbd127558a5aee6b720d06e",
"size": "3157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/tiffit/todolist/TaskClock.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "73921"
}
],
"symlink_target": ""
} |
@implementation Department
@end
| {
"content_hash": "51923b2e54485de03bbc8645a4c9ec67",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 11,
"alnum_prop": 0.8181818181818182,
"repo_name": "ThaiLanKing/zDesignPattern-OC",
"id": "de9c005711f14369e91d77b856c3d895cabb1d01",
"size": "188",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "zDesignPattern-OC/DesignPatterns/24_Visitor/Visitor/Department.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "174050"
}
],
"symlink_target": ""
} |
module GitlabVerifyHelpers
def collect_ranges(args = {})
verifier = described_class.new(args.merge(batch_size: 1))
collect_results(verifier).map { |range, _| range }
end
def collect_failures
verifier = described_class.new(batch_size: 1)
out = {}
collect_results(verifier).map { |_, failures| out.merge!(failures) }
out
end
def collect_results(verifier)
out = []
verifier.run_batches { |*args| out << args }
out
end
end
| {
"content_hash": "3facb4a214695428c749079b4f2baa36",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 19,
"alnum_prop": 0.64,
"repo_name": "mmkassem/gitlabhq",
"id": "9901ce374ed1e571941e49efc728bb603c965a1e",
"size": "506",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "spec/support/helpers/gitlab_verify_helpers.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "113683"
},
{
"name": "CoffeeScript",
"bytes": "139197"
},
{
"name": "Cucumber",
"bytes": "119759"
},
{
"name": "HTML",
"bytes": "447030"
},
{
"name": "JavaScript",
"bytes": "29805"
},
{
"name": "Ruby",
"bytes": "2417833"
},
{
"name": "Shell",
"bytes": "14336"
}
],
"symlink_target": ""
} |
A Backbone/jQuery Scroll Spy with HTML5 pushState
##Goals
- __Should actively attach to all views at all times in a backbone views.__
- __Should update the url with the id of the closest item in the viewPort using html pushState__
- [https://github.com/vvo/in-viewport](https://github.com/vvo/in-viewport)
- insert research about html5PushState
| {
"content_hash": "3cf97591de7e5e6d0ad4f5d2a1e1c748",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 96,
"avg_line_length": 50.57142857142857,
"alnum_prop": 0.7457627118644068,
"repo_name": "blairanderson/scroll-track-star",
"id": "875f3a356c6731d29a3cfcdbb0848cc0a3abfa0c",
"size": "373",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "23feec523fa6d5c674eab94a2922e487",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "1ef26fd12a5e48e923b053862d9e6c62ef047dac",
"size": "171",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Panicum/Panicum mariae/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace backend\controllers;
use Yii;
use backend\models\Product;
use backend\models\ProductSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\filters\AccessControl;
/**
* ProductController implements the CRUD actions for Product model.
*/
class ProductController extends Controller
{
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'actions' => ['index', 'create', 'update', 'view', 'delete'],
'allow' => false,
'roles' => ['?'],
],
[
'actions' => ['index', 'create', 'update', 'view', 'delete'],
'allow' => true,
'roles' => ['admin'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all Product models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new ProductSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Product model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Product model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Product();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Product model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Product model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Product model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Product the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Product::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}
| {
"content_hash": "9f9ca42cc00f8a3d6ebca4353bb06669",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 85,
"avg_line_length": 26.920289855072465,
"alnum_prop": 0.49071332436069987,
"repo_name": "tutoriorg/lld-diamonds",
"id": "b83deb2c2ba7bc0836a835e6adacc91ea0f1824b",
"size": "3715",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/controllers/ProductController.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "2415"
},
{
"name": "CSS",
"bytes": "456886"
},
{
"name": "HTML",
"bytes": "18730"
},
{
"name": "JavaScript",
"bytes": "3670114"
},
{
"name": "PHP",
"bytes": "267824"
}
],
"symlink_target": ""
} |
const chai = require('chai');
const chaiHttp = require('chai-http');
const expect = chai.expect;
chai.use(chaiHttp);
const request = chai.request;
const setup = require(__dirname + '/test_setup');
const teardown = require(__dirname + '/test_teardown');
const port = process.env.PORT = 5050;
var User = require(__dirname + '/../models/user');
describe('server', () => {
before((done) => {
setup(done);
});
after((done) => {
teardown(done);
});
describe('zipcode routes', () => {
beforeEach((done) => {
var newUser = new User({
username: 'rick',
password: 'mustache',
encodedId: '1',
zipCode: '98144',
todaySteps: 100
});
newUser.generateHash(newUser.password);
newUser.save((err, user) => {
if (err) console.log(err);
user.generateToken((err, token) => {
if (err) console.log(err);
this.token = token;
this.user = user;
done();
});
});
});
afterEach((done) => {
this.user.remove((err) => {
if (err) console.log(err);
done();
});
});
it('should get all the zipcodes', (done) => {
request('localhost:' + port)
.get('/api/zipcode')
.set('token', this.token)
.end((err, res) => {
expect(err).to.eql(null);
expect(typeof res.body['98144']).to.eql('object');
expect(Array.isArray(res.body['98144'].data)).to.eql(true);
expect(res.body['98144'].data[0].username).to.eql('rick');
done();
});
});
it('should get a zipcode', (done) => {
request('localhost:' + port)
.get('/api/zipcode/98144')
.set('token', this.token)
.end((err, res) => {
expect(err).to.eql(null);
expect(typeof res.body).to.eql('object');
expect(res.body.zipTotalTodaySteps).to.eql(100);
expect(res.body.users[0].username).to.eql('rick');
done();
});
});
});
});
| {
"content_hash": "c80d0a25772a28e3b70539f880f14e0b",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 69,
"avg_line_length": 26.906666666666666,
"alnum_prop": 0.5168483647175421,
"repo_name": "fit-cliques/fit_cliques",
"id": "742389a0234a0f22226ad250f7a8f6accedaebee",
"size": "2018",
"binary": false,
"copies": "1",
"ref": "refs/heads/staging",
"path": "test/zipcode_test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "4860"
},
{
"name": "HTML",
"bytes": "4732"
},
{
"name": "JavaScript",
"bytes": "74607"
}
],
"symlink_target": ""
} |
import os.path as op
import numpy as np
import pytest
from mne.datasets import testing
from mne.utils import _TempDir, _url_to_local_path, buggy_mkl_svd
def test_buggy_mkl():
"""Test decorator for buggy MKL issues."""
from unittest import SkipTest
@buggy_mkl_svd
def foo(a, b):
raise np.linalg.LinAlgError('SVD did not converge')
with pytest.warns(RuntimeWarning, match='convergence error'):
with pytest.raises(SkipTest):
foo(1, 2)
@buggy_mkl_svd
def bar(c, d, e):
raise RuntimeError('SVD did not converge')
pytest.raises(RuntimeError, bar, 1, 2, 3)
def test_tempdir():
"""Test TempDir."""
tempdir2 = _TempDir()
assert (op.isdir(tempdir2))
x = str(tempdir2)
del tempdir2
assert (not op.isdir(x))
def test_datasets(monkeypatch, tmp_path):
"""Test dataset config."""
# gh-4192
fake_path = tmp_path / 'MNE-testing-data'
fake_path.mkdir()
with open(fake_path / 'version.txt', 'w') as fid:
fid.write('9999.9999')
monkeypatch.setenv('_MNE_FAKE_HOME_DIR', str(tmp_path))
monkeypatch.setenv('MNE_DATASETS_TESTING_PATH', str(tmp_path))
got_path = str(testing.data_path(download=False, verbose='debug'))
assert got_path == str(fake_path)
def test_url_to_local_path():
"""Test URL to local path."""
assert _url_to_local_path('http://google.com/home/why.html', '.') == \
op.join('.', 'home', 'why.html')
| {
"content_hash": "7893e183bb325bcc76ed6dd603f4534c",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 74,
"avg_line_length": 28,
"alnum_prop": 0.635989010989011,
"repo_name": "Teekuningas/mne-python",
"id": "f72fd5ce8dc1a0a66398de009a0ed82924a2c7ce",
"size": "1556",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "mne/utils/tests/test_testing.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Csound Document",
"bytes": "24999"
},
{
"name": "JavaScript",
"bytes": "8008"
},
{
"name": "Jinja",
"bytes": "14962"
},
{
"name": "Makefile",
"bytes": "4612"
},
{
"name": "Python",
"bytes": "10372316"
},
{
"name": "Sass",
"bytes": "257"
},
{
"name": "Shell",
"bytes": "19970"
}
],
"symlink_target": ""
} |
package examplePackage;
import java.io.InputStream;
import javax.servlet.ServletException;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import encrypt.BCrypt;
/**
* Servlet implementation class RegistrationServlet
*/
@WebServlet("/RegistrationServlet")
@MultipartConfig(maxFileSize = 16177215)
public class RegistrationServlet extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
String passHash = null;
try {
UserBean user = new UserBean();
user.setName(request.getParameter("name"));
user.setUserName(request.getParameter("username"));
InputStream inputStream = null; // input stream of the upload file
// obtains the upload file part in this multipart request
Part filePart = request.getPart("photo");
if (filePart != null) {
// prints out some information for debugging
System.out.println(filePart.getName());
System.out.println(filePart.getSize());
System.out.println(filePart.getContentType());
// obtains input stream of the upload file
inputStream = filePart.getInputStream();
user.setImage(inputStream);
}
// check if the password is valid format
if (UserDAO.isValidPass(request.getParameter("pass"))) {
// hash the password (salt+password+salt = hash)
passHash = BCrypt.hashpw(request.getParameter("pass"), BCrypt.gensalt());
System.out.println(passHash);
user.setPassword(passHash);
} else {
response.sendRedirect("invalidSignUp.jsp");
System.out.println("The password format is not valid!");
}
// check if the email is valid format
if (UserDAO.isValidEmail(request.getParameter("email"))) {
user.setEmail(request.getParameter("email"));
} else {
response.sendRedirect("invalidSignUp.jsp");
System.out.println("The email format is not valid!");
}
// check if the passwords are the same
if (request.getParameter("pass").equals(request.getParameter("pass2"))) {
UserDAO.registration(user);
System.out.println("You have successfully registered!");
response.sendRedirect("userSigned.jsp"); // singed-in page
} else {
request.setAttribute("error",
"Servlet " + request.getAttribute(getServletName()) + "has thrown an exception!");
request.getRequestDispatcher("/invalidSignUp.jsp").forward(request, response);
// response.sendRedirect("invalidSignUp.jsp");//invalid sign-up
}
} catch (Throwable theException) {
System.out.println(theException);
System.out.println("Wrong singing up!");
}
}
}
| {
"content_hash": "1776e3843f2279d3526470f0533f4d4e",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 88,
"avg_line_length": 34.81927710843374,
"alnum_prop": 0.7044982698961938,
"repo_name": "deyanm/Viva-Schools",
"id": "2659d963b86cea555d877db14f0c8626b7bcf079",
"size": "2890",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/examplePackage/RegistrationServlet.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7254"
},
{
"name": "Java",
"bytes": "85167"
},
{
"name": "JavaScript",
"bytes": "435"
}
],
"symlink_target": ""
} |
;(function() {
var ngModule = angular.module('eha.online-badge', [
'eha.online-badge.directive',
'eha.online-badge.template'
]);
// Check for and export to commonjs environment
if (typeof module !== 'undefined' && module.exports) {
module.exports = ngModule;
}
})();
| {
"content_hash": "5a0ac05bfb9751c31ad7c186c241e9a2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 56,
"avg_line_length": 22.46153846153846,
"alnum_prop": 0.636986301369863,
"repo_name": "eHealthAfrica/angular-eha.online-badge",
"id": "a9550a5230f096f5f858dc4c04af9f94f2460605",
"size": "292",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/index.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "206"
},
{
"name": "JavaScript",
"bytes": "8038"
},
{
"name": "Shell",
"bytes": "691"
},
{
"name": "VimL",
"bytes": "93"
}
],
"symlink_target": ""
} |
title: Lecture 24
layout: post
---
# Bacteria Forward Motion & Tumbling
As previously discussed, most bacteria use flagella in order to achieve forward motion. Bacteria then tumble in order to change direction. Experiments have shown that bacteria in environments of high concentration of some attractant decrease their tumbling frequency.

[source](http://2012.igem.org/Team:USC/Project1)
It has been shown that after some longer time scale the bacteria's tumbling frequency increases back to its normal rate. This time scale is referred to as the *adaptation time*. Now let's try to explain this phenomenon through a model.
## Chemotaxis Signaling Network
In this model we have inputs and an output.
- Inputs: Attractant, Repellents
- Output: Tumbling frequency
We will assume that tumbling frequency decreases upon attractant-receptor binding, and that adaptation occurs on a long time scale.
Our model will involve receptors and attractants (ligand). Receptors may be in either the active or inactive state, and in either state may be bound to an attractant. The active-unbound and the inactive-bound states are favored. All of these states may also be modified with (de)methylation and this process occurs on the order of minutes.
### Simplest Model
Let's first assume that there is no attractant present -- this eliminates bound receptor states. In this case, transitions from the (in)active state is fast, and transitions from the (de)methylated state is slow.
$$\begin{align*}
x &\equiv \text{Concentration of unmethylated receptors} \\
x_m &\equiv \text{Concentration of methylated receptors}
\end{align*}$$
In order to (de)methylate a receptor an enzyme needs to act on the receptor. There is an enzyme for methylation and a different one for demethylation.
$$\begin{align*}
R &\equiv \text{Concentration of methylation enzyme} \\
\rho &\equiv \text{methylation rate} \\
B &\equiv \text{Concentration of demethylation enzyme} \\
\beta &\equiv \text{demethylation rate} \\
\end{align*}$$
Lets also quantify the fraction of receptors that are active (and are not bound).
$$ \alpha \equiv \text{fraction of receptors that are active} $$
#### Michaelis-Menten Kinetics
Using [Michaelis–Menten kinetics](https://en.wikipedia.org/wiki/Michaelis%E2%80%93Menten_kinetics) we can write the rate equations that our simple model obeys.
$$\begin{align*}
\frac{dx}{dt} &= -\rho R \frac{x}{x+K_R} + \beta B \frac{x_m}{x_m+K_B} \\
\frac{dx_m}{dt} &= -\frac{dx}{dt}
\end{align*}$$
The enzyme $$R$$ *operates at saturation* which implies that
$$ \Rightarrow K_R << x \ \Rightarrow \rho R \frac{x}{x+K_R} \approx \rho R \ .$$
Using this approximation we solve for the the steady-state solutions.
$$
\rho R = \beta B \frac{x_m}{x_m+K_B} \\ \Rightarrow x_m = \frac{\rho R K_B}{\beta B - \rho R}
$$
The total output (or *activity*) $$A_0$$ is the given by the concentration of active receptors.
$$ A_0 = \alpha x_m = \frac{\alpha \rho R K_B}{\beta B - \rho R} $$
After adding a ton of attractant the activity suddenly decreases since the fraction of active, unbound receptors sharply decreases.
$$ \alpha \to \alpha' << 1 $$
$$ \Rightarrow A_1 = \frac{\alpha' \rho R K_B}{\beta B - \rho R} << A_0 $$
**Hypothesis**: the enzyme's demythaltion rate decreases when a lot of attractant is added to the system.
$$ \beta \to \beta' <<\beta $$
This decrease in the rate leads to a build-up of methylated receptors.
$$ \to A_2 = \frac{\alpha'\rho R K_B}{\beta' B-\rho R} $$
#### Exact Adaptation
In the case of exact adaptation this new activity level $$A_2$$ will be equal to the original activity level before a lot of attractant entered the system.
$$ A_2 = A_0 $$
This is hard to achieve in a system of cells because of variability between all of them. For example the concentration of enzymes varies from cell to cell and this will cause the new activity not to get back up to the original value. So we need to modify our simple model in order to try to get to a solution where we can recover the original activity.
### Modified Model
Let's assume that the enzyme $$B$$ only demthylates **active** receptors. With this in mind lets assign a few new variables.
$$\begin{align*}
x_m &\equiv \text{Concentration of active methylated receptors} \\
x_m^* &\equiv \text{Concentration of inactive methylated receptors} \end{align*} \\
\Rightarrow A = x_m^*
$$
$$
\mu , \nu \equiv \text{rates of (de)activation of methylated receptors} \\
\alpha \equiv \frac{\mu}{\mu+\nu}\\
$$
Now the rate equations for a the modified model are the following
$$\begin{align*}
\frac{dx_m}{dt} &= \rho R \frac{x}{x+K_R} + \nu x_m^* - \mu x_m \\
\frac{dx_m^*}{dt} &= - \beta B \frac{x_m}{x_m+K_B} - \nu x_m^* + \mu x_m
\end{align*}$$
Using the same approximation as in the simple model we can solve for the steady-state solutions.
$$\begin{align*}
\rho R = -\nu x_m^* + \mu x_m \\
\beta B \frac{x_m}{x_m+K_B} = -\nu x_m^* + \mu x_m \end{align*}
$$
$$ \Rightarrow x_m^* = \frac{\rho R K_B}{\beta B-\rho R} = A$$
Now we have an expression for the steady-state activity $$A$$. In this modified model $$A$$ is not a function of $$\alpha$$ -- this is a good thing!
For example, in this model if attractant is suddenly added to the system then...
$$
\mu \to \mu' << \mu \\ \alpha \to \alpha' << \alpha \\
A \to A
$$
The activity does not change! The property of exact adaptation is known as *robust*. Robust means that the quantity of interest is independent of parameter changes.
> Written with [StackEdit](https://stackedit.io/).
| {
"content_hash": "42eb8bc88ffe1f183f24835515c0b452",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 352,
"avg_line_length": 42.32089552238806,
"alnum_prop": 0.7143360959266444,
"repo_name": "varennes/varennes.github.io",
"id": "c7d91e84857591687952d9de9c40dd08280ed235",
"size": "5677",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-4-14-lecture24.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "47144"
},
{
"name": "HTML",
"bytes": "5598"
}
],
"symlink_target": ""
} |
package brooklyn.networking.sdn.weave;
import java.net.InetAddress;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import brooklyn.entity.Entity;
import brooklyn.entity.basic.AbstractGroup;
import brooklyn.entity.basic.AbstractSoftwareProcessSshDriver;
import brooklyn.entity.basic.Attributes;
import brooklyn.entity.basic.Entities;
import brooklyn.entity.basic.EntityLocal;
import brooklyn.location.basic.SshMachineLocation;
import brooklyn.networking.sdn.SdnAgent;
import brooklyn.networking.sdn.SdnProvider;
import brooklyn.util.collections.MutableMap;
import brooklyn.util.net.Cidr;
import brooklyn.util.os.Os;
import brooklyn.util.ssh.BashCommands;
import brooklyn.util.task.Tasks;
import com.google.common.collect.Lists;
public class WeaveContainerSshDriver extends AbstractSoftwareProcessSshDriver implements WeaveContainerDriver {
private static final Logger LOG = LoggerFactory.getLogger(WeaveContainer.class);
public WeaveContainerSshDriver(EntityLocal entity, SshMachineLocation machine) {
super(entity, machine);
}
public String getWeaveCommand() {
return Os.mergePathsUnix(getInstallDir(), "weave");
}
@Override
public void preInstall() {
resolver = Entities.newDownloader(this);
}
@Override
public void install() {
List<String> commands = Lists.newLinkedList();
commands.addAll(BashCommands.commandsToDownloadUrlsAs(resolver.getTargets(), getWeaveCommand()));
commands.add("chmod 755 " + getWeaveCommand());
newScript(INSTALLING)
.body.append(commands)
.execute();
}
@Override
public void customize() {
newScript(CUSTOMIZING).execute();
}
@Override
public void launch() {
InetAddress address = getEntity().getAttribute(WeaveContainer.SDN_AGENT_ADDRESS);
Boolean firstMember = getEntity().getAttribute(AbstractGroup.FIRST_MEMBER);
Entity first = getEntity().getAttribute(AbstractGroup.FIRST);
LOG.info("Launching {} Weave service at {}", Boolean.TRUE.equals(firstMember) ? "first" : "next", address.getHostAddress());
newScript(MutableMap.of(USE_PID_FILE, false), LAUNCHING)
.updateTaskAndFailOnNonZeroResultCode()
.body.append(BashCommands.sudo(String.format("%s launch -iprange %s %s", getWeaveCommand(),
entity.config().get(SdnProvider.CONTAINER_NETWORK_CIDR),
Boolean.TRUE.equals(firstMember) ? "" : first.getAttribute(Attributes.SUBNET_ADDRESS))))
.execute();
}
@Override
public boolean isRunning() {
// Spawns a container for duration of command, so take the host lock
getEntity().getAttribute(SdnAgent.DOCKER_HOST).getDynamicLocation().getLock().lock();
try {
return newScript(MutableMap.of(USE_PID_FILE, false), CHECK_RUNNING)
.body.append(BashCommands.sudo(getWeaveCommand() + " status"))
.execute() == 0;
} finally {
getEntity().getAttribute(SdnAgent.DOCKER_HOST).getDynamicLocation().getLock().unlock();
}
}
@Override
public void stop() {
newScript(MutableMap.of(USE_PID_FILE, false), STOPPING)
.body.append(BashCommands.sudo(getWeaveCommand() + " stop"))
.execute();
}
@Override
public void createSubnet(String svirtualNetworkId, String subnetId, Cidr subnetCidr) {
LOG.debug("Nothing to do for Weave subnet creation");
}
@Override
public InetAddress attachNetwork(String containerId, String subnetId) {
Tasks.setBlockingDetails(String.format("Attach %s to %s", containerId, subnetId));
try {
Cidr cidr = getEntity().getAttribute(SdnAgent.SDN_PROVIDER).getSubnetCidr(subnetId);
InetAddress address = getEntity().getAttribute(SdnAgent.SDN_PROVIDER).getNextContainerAddress(subnetId);
((WeaveContainer) getEntity()).getDockerHost().execCommand(BashCommands.sudo(String.format("%s attach %s/%d %s",
getWeaveCommand(), address.getHostAddress(), cidr.getLength(), containerId)));
return address;
} finally {
Tasks.resetBlockingDetails();
}
}
}
| {
"content_hash": "eb89622f0dc382c95c4791994e82595e",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 132,
"avg_line_length": 37.973684210526315,
"alnum_prop": 0.6782166782166782,
"repo_name": "tomzhang/clocker",
"id": "87f28fd4091796bbcd15e05a9f47cbf172b9bafb",
"size": "4391",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docker/src/main/java/brooklyn/networking/sdn/weave/WeaveContainerSshDriver.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2472"
},
{
"name": "HTML",
"bytes": "8362"
},
{
"name": "Java",
"bytes": "527805"
},
{
"name": "JavaScript",
"bytes": "5761"
},
{
"name": "Shell",
"bytes": "10918"
}
],
"symlink_target": ""
} |
/***********************************************************
* Credits:
*
* MSDN Documentation -
* Walkthrough: Creating an IQueryable LINQ Provider
*
* http://msdn.microsoft.com/en-us/library/bb546158.aspx
*
* Matt Warren's Blog -
* LINQ: Building an IQueryable Provider:
*
* http://blogs.msdn.com/mattwar/default.aspx
*
* Adopted and Modified By: Joe Mayo, 8/26/08
* *********************************************************/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading.Tasks;
namespace LinqToTwitter.Provider
{
/// <summary>
/// IQueryable of T part of LINQ to Twitter
/// </summary>
/// <typeparam name="T">Type to operate on</typeparam>
public class TwitterQueryable<T> : IOrderedQueryable<T>
{
/// <summary>
/// init with TwitterContext
/// </summary>
/// <param name="context"></param>
public TwitterQueryable(TwitterContext context)
{
Provider = new TwitterQueryProvider();
Expression = Expression.Constant(this);
// lets provider reach back to TwitterContext,
// where execute implementation resides
((TwitterQueryProvider) Provider).Context = context;
}
/// <summary>
/// modified as internal because LINQ to Twitter is Unusable
/// without TwitterContext, but provider still needs access
/// </summary>
/// <param name="provider">IQueryProvider</param>
/// <param name="expression">Expression Tree</param>
internal TwitterQueryable(
TwitterQueryProvider provider,
Expression expression)
{
if (provider == null)
{
throw new ArgumentNullException("provider");
}
if (expression == null)
{
throw new ArgumentNullException("expression");
}
if (!typeof(IQueryable<T>).GetTypeInfo().IsAssignableFrom(expression.Type.GetTypeInfo()))
{
throw new ArgumentOutOfRangeException("expression");
}
Provider = provider;
Expression = expression;
}
/// <summary>
/// IQueryProvider part of LINQ to Twitter
/// </summary>
public IQueryProvider Provider { get; private set; }
/// <summary>
/// expression tree
/// </summary>
public Expression Expression { get; private set; }
/// <summary>
/// type of T in IQueryable of T
/// </summary>
public Type ElementType
{
get { return typeof(T); }
}
/// <summary>
/// executes when iterating over collection
/// </summary>
/// <returns>query results</returns>
public IEnumerator<T> GetEnumerator()
{
var tsk = Task.Run(() => (((TwitterQueryProvider)Provider).ExecuteAsync<IEnumerable<T>>(Expression)));
return ((IEnumerable<T>)tsk.Result).GetEnumerator();
}
/// <summary>
/// non-generic execution when collection is iterated over
/// </summary>
/// <returns>query results</returns>
IEnumerator IEnumerable.GetEnumerator()
{
return (Provider.Execute<IEnumerable>(Expression)).GetEnumerator();
}
}
}
| {
"content_hash": "8934830688ccbc3eec13fe55a4b3981d",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 114,
"avg_line_length": 31.178571428571427,
"alnum_prop": 0.5575601374570447,
"repo_name": "JoeMayo/LinqToTwitter",
"id": "f86c4ec66f782ba1a79ec2148acb10a6647b9ec8",
"size": "3494",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/LinqToTwitter6/LinqToTwitter/Provider/TwitterQueryable.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "740"
},
{
"name": "C#",
"bytes": "7315873"
},
{
"name": "Pascal",
"bytes": "1216"
},
{
"name": "PowerShell",
"bytes": "2890"
}
],
"symlink_target": ""
} |
from hotspotter.HotSpotterAPI import HotSpotterAPI
from hotspotter.helpers import ensure_path, assert_path, copy_all, copy, img_ext_set, copy_task
from fnmatch import fnmatch
from os import walk
from os.path import join, relpath, splitext
from PIL import Image
input_dir = '/media/Store/data/work/zebra_with_mothers'
output_dir = '/media/Store/data/work/HSDB_zebra_with_mothers'
output_img_dir = '/media/Store/data/work/HSDB_zebra_with_mothers/images'
convert_fmt = 'zebra_with_mothers'
assert_path(input_dir)
ensure_path(output_dir)
ensure_path(output_img_dir)
# Parses the zebra_with_mothers format
# into a hotspotter image directory
# which is logically named
cp_list = []
name_list = []
for root, dirs, files in walk(input_dir):
foal_name = relpath(root, input_dir)
for fname in files:
chip_id, ext = splitext(fname)
if not ext.lower() in img_ext_set:
continue
if chip_id.find('mother') > -1:
chip_id = chip_id.replace('mother ', 'mom-')
mom_name = chip_id.replace('mom-','')
name = mom_name
else:
name = foal_name
dst_fname = 'Nid-' + name + '--Cid-' + chip_id + ext
src = join(root, fname)
dst = join(output_img_dir, dst_fname)
name_list.append(name)
cp_list.append((src, dst))
copy_task(cp_list, test=False, nooverwrite=True, print_tasks=True)
img_list = [tup[1] for tup in cp_list]
sz_list = [Image.open(_img).size for _img in img_list]
roi_list = [(0,0,w,h) for (w,h) in sz_list]
theta_list = [0]*len(roi_list)
print([len(_) for _ in [img_list, sz_list, roi_list, theta_list]])
#hs = HotSpotterAPI(output_dir)
nx_list = hs.add_name_list2(name_list)
gx_list = hs.add_img_list2(img_list)
cx_list = hs.add_chip_list2(nx_list, gx_list, roi_list, theta_list)
hs.save_database()
if convert_fmt == 'zebra_with_mothers':
img_list = create_bare_db_zebra_mother()
| {
"content_hash": "ef8275ab79727c717db928912f0a4a76",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 95,
"avg_line_length": 33.771929824561404,
"alnum_prop": 0.6576623376623376,
"repo_name": "SU-ECE-17-7/hotspotter",
"id": "d34ed507ed258ace4128fb475b5401538db9ae47",
"size": "1925",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "_scripts/convert_2hsdb.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3321"
},
{
"name": "C++",
"bytes": "175"
},
{
"name": "CMake",
"bytes": "870"
},
{
"name": "Inno Setup",
"bytes": "3248"
},
{
"name": "Python",
"bytes": "2044804"
},
{
"name": "Shell",
"bytes": "17534"
}
],
"symlink_target": ""
} |
import DS from 'ember-data';
export default DS.Model.extend({
title: DS.attr('string'),
author: DS.attr('string'),
createdDate: DS.attr('date'),
text: DS.attr('string')
});
| {
"content_hash": "a1ffed8e61ae2695449dfcbb92a4c7a0",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 32,
"avg_line_length": 22.75,
"alnum_prop": 0.6538461538461539,
"repo_name": "S3ak/mo-fam",
"id": "0e48eb780c47b829a7c86356876ef902b91e8040",
"size": "182",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "app/post/model.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "33"
},
{
"name": "HTML",
"bytes": "3915"
},
{
"name": "JavaScript",
"bytes": "11293"
},
{
"name": "Ruby",
"bytes": "1054"
}
],
"symlink_target": ""
} |
/*global define*/
define([
'underscore',
'backbone',
'models/transaction'
], function (_, Backbone, Transaction) {
'use strict';
var TransactionList = Backbone.Collection.extend({
model: Transaction,
url: '/data/transactionData.json'
});
return TransactionList;
});
| {
"content_hash": "cd87905f19ae5bb7c4ba09cd6d242eda",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 54,
"avg_line_length": 16.63157894736842,
"alnum_prop": 0.6139240506329114,
"repo_name": "jonkemp/wizard-mvc",
"id": "aa871404c75bf6c618d0b135f17d3088f0ef0ffa",
"size": "316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/backbone-requirejs/js/collections/transaction-list.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "620"
},
{
"name": "JavaScript",
"bytes": "83177"
}
],
"symlink_target": ""
} |
<!--
/**
* @module 2048
*/
/**
* x-2048 allows users to insert 2048 game into pages.
*
* Example:
*
* <x-2048></x-2048>
*
* @class x-2048
*/
-->
<link rel="import" href="bower_components/polymer/polymer.html">
<polymer-element name="x-2048">
<template>
<link href="style/main.css" rel="stylesheet" type="text/css">
<div class="container">
<div class="heading">
<div class="scores-container">
<div class="score-container">0</div>
<div class="best-container">0</div>
</div>
<a class="restart-button">New Game</a>
</div>
<div class="game-container">
<div class="game-message">
<p></p>
<div class="lower">
<a class="keep-playing-button">Keep going</a>
<a class="retry-button">Try again</a>
</div>
</div>
<div class="grid-container">
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
<div class="grid-row">
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
<div class="grid-cell"></div>
</div>
</div>
<div class="tile-container">
</div>
</div>
<p class="game-copyrights">
Created by <a href="http://gabrielecirulli.com" target="_blank">Gabriele Cirulli.</a> Based on <a href="https://itunes.apple.com/us/app/1024!/id823499224" target="_blank">1024 by Veewo Studio</a> and conceptually similar to <a href="http://asherv.com/threes/" target="_blank">Threes by Asher Vollmer.</a>
</p>
</div>
</template>
<script src="js/bind_polyfill.js"></script>
<script src="js/classlist_polyfill.js"></script>
<script src="js/animframe_polyfill.js"></script>
<script src="js/keyboard_input_manager.js"></script>
<script src="js/html_actuator.js"></script>
<script src="js/grid.js"></script>
<script src="js/tile.js"></script>
<script src="js/local_storage_manager.js"></script>
<script src="js/game_manager.js"></script>
<script>
Polymer('x-2048', {
created: function() {
var _this = this;
window.requestAnimationFrame(function () {
new GameManager(4, KeyboardInputManager, HTMLActuator, LocalStorageManager, _this.shadowRoot);
});
},
});
</script>
</polymer-element> | {
"content_hash": "4b93dbd43e3c72ef94af016f2eb41c26",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 320,
"avg_line_length": 34.86138613861386,
"alnum_prop": 0.4572564612326044,
"repo_name": "nruchlewicz/nruchlewicz.github.io",
"id": "7acdfc1e1dba55b51fdf5b04def53fc4c7c90721",
"size": "3521",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "bower_components/x-2048/x-2048.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "758"
},
{
"name": "HTML",
"bytes": "98175"
},
{
"name": "JavaScript",
"bytes": "1"
},
{
"name": "PHP",
"bytes": "953"
}
],
"symlink_target": ""
} |
package simplebft
import "reflect"
// makeXset returns a request subject that should be proposed as batch
// for new-view. If there is no request to select (null request), it
// will return nil for subject. makeXset always returns a batch for
// the most recent checkpoint.
func (s *SBFT) makeXset(vcs []*ViewChange) (*Subject, *Batch, bool) {
// first select base commit (equivalent to checkpoint/low water mark)
var best *Batch
for _, vc := range vcs {
seq := vc.Checkpoint.DecodeHeader().Seq
if best == nil || seq > best.DecodeHeader().Seq {
best = vc.Checkpoint
}
}
if best == nil {
return nil, nil, false
}
next := best.DecodeHeader().Seq + 1
log.Debugf("replica %d: xset starts at commit %d", s.id, next)
// now determine which request could have executed for best+1
var xset *Subject
// This is according to Castro's TOCS PBFT, Fig. 4
// find some message m in S,
emptycount := 0
nextm:
for _, m := range vcs {
notfound := true
// which has <n,d,v> in its Pset
for _, mtuple := range m.Pset {
log.Debugf("replica %d: trying %v", s.id, mtuple)
if mtuple.Seq.Seq < next {
continue
}
// we found an entry for next
notfound = false
// A1. where 2f+1 messages mp from S
count := 0
nextmp:
for _, mp := range vcs {
// "low watermark" is less than n
if mp.Checkpoint.DecodeHeader().Seq > mtuple.Seq.Seq {
continue
}
// and all <n,d',v'> in its Pset
for _, mptuple := range mp.Pset {
log.Debugf("replica %d: matching %v", s.id, mptuple)
if mptuple.Seq.Seq != mtuple.Seq.Seq {
continue
}
// either v' < v or (v' == v and d' == d)
if mptuple.Seq.View < mtuple.Seq.View ||
(mptuple.Seq.View == mtuple.Seq.View && reflect.DeepEqual(mptuple.Digest, mtuple.Digest)) {
continue
} else {
continue nextmp
}
}
count += 1
}
if count < s.noFaultyQuorum() {
continue
}
log.Debugf("replica %d: found %d replicas for Pset %d/%d", s.id, count, mtuple.Seq.Seq, mtuple.Seq.View)
// A2. f+1 messages mp from S
count = 0
for _, mp := range vcs {
// and all <n,d',v'> in its Qset
for _, mptuple := range mp.Qset {
if mptuple.Seq.Seq != mtuple.Seq.Seq {
continue
}
if mptuple.Seq.View < mtuple.Seq.View {
continue
}
// d' == d
if !reflect.DeepEqual(mptuple.Digest, mtuple.Digest) {
continue
}
count += 1
// there exists one ...
break
}
}
if count < s.oneCorrectQuorum() {
continue
}
log.Debugf("replica %d: found %d replicas for Qset %d", s.id, count, mtuple.Seq.Seq)
log.Debugf("replica %d: selecting %d with %x", s.id, next, mtuple.Digest)
xset = &Subject{
Seq: &SeqView{Seq: next, View: s.view},
Digest: mtuple.Digest,
}
break nextm
}
if notfound {
emptycount += 1
}
}
// B. otherwise select null request
// We actually don't select a null request, but report the most recent batch instead.
if emptycount >= s.noFaultyQuorum() {
log.Debugf("replica %d: no pertinent requests found for %d", s.id, next)
return nil, best, true
}
if xset == nil {
return nil, nil, false
}
return xset, best, true
}
| {
"content_hash": "77b8fc280e27efbdd302b942b54a8b61",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 107,
"avg_line_length": 25.30708661417323,
"alnum_prop": 0.611698817672682,
"repo_name": "christo4ferris/fabric-docs",
"id": "628594a37fd226a277456413e06b25233ed5cc28",
"size": "3789",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "orderer/sbft/simplebft/xset.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "383"
},
{
"name": "Gherkin",
"bytes": "99203"
},
{
"name": "Go",
"bytes": "1977486"
},
{
"name": "HTML",
"bytes": "3077"
},
{
"name": "Java",
"bytes": "79867"
},
{
"name": "Makefile",
"bytes": "14004"
},
{
"name": "Protocol Buffer",
"bytes": "62304"
},
{
"name": "Python",
"bytes": "91354"
},
{
"name": "Ruby",
"bytes": "3259"
},
{
"name": "Shell",
"bytes": "27804"
}
],
"symlink_target": ""
} |
package org.apache.jmeter.gui.util;
import static org.junit.Assert.assertFalse;
import org.apache.jmeter.junit.JMeterTestCase;
import org.apache.jmeter.junit.categories.NeedGuiTests;
import org.junit.Test;
import org.junit.experimental.categories.Category;
@Category(NeedGuiTests.class)
public final class TestMenuFactory extends JMeterTestCase {
private static void check(String s, int i) throws Exception {
assertFalse("The number of " + s + " should not be 0", 0 == i);
}
@Test
public void testMenu() throws Exception {
check("menumap", MenuFactory.menuMap_size());
check("assertions", MenuFactory.assertions_size());
check("configElements", MenuFactory.configElements_size());
check("controllers", MenuFactory.controllers_size());
check("listeners", MenuFactory.listeners_size());
check("nonTestElements", MenuFactory.nonTestElements_size());
check("postProcessors", MenuFactory.postProcessors_size());
check("preProcessors", MenuFactory.preProcessors_size());
check("samplers", MenuFactory.samplers_size());
check("timers", MenuFactory.timers_size());
check("elementstoskip", MenuFactory.elementsToSkip_size());
}
}
| {
"content_hash": "a431c55e3a3d34a076e6b127972f3866",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 34.861111111111114,
"alnum_prop": 0.698804780876494,
"repo_name": "d0k1/jmeter",
"id": "a5dc31a6b42b6f1e5338bc7959a2c2bc427e9904",
"size": "2058",
"binary": false,
"copies": "4",
"ref": "refs/heads/trunk",
"path": "test/src/org/apache/jmeter/gui/util/TestMenuFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "21218"
},
{
"name": "CSS",
"bytes": "36983"
},
{
"name": "HTML",
"bytes": "93491"
},
{
"name": "Java",
"bytes": "7498610"
},
{
"name": "JavaScript",
"bytes": "58096"
},
{
"name": "Shell",
"bytes": "17485"
},
{
"name": "XSLT",
"bytes": "57215"
}
],
"symlink_target": ""
} |
<!-- Global Site Tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-21165003-6"></script>
| {
"content_hash": "0a859f04ee8713ea195820f3e03c57a8",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 87,
"avg_line_length": 71,
"alnum_prop": 0.704225352112676,
"repo_name": "epimorphics/ukhpi",
"id": "859fbe5c3d4a13d7c54a570b63976bc9481461d0",
"size": "142",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "app/views/common/_google-analytics.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Dockerfile",
"bytes": "1252"
},
{
"name": "HTML",
"bytes": "6814"
},
{
"name": "Haml",
"bytes": "70044"
},
{
"name": "JavaScript",
"bytes": "65119"
},
{
"name": "Makefile",
"bytes": "2148"
},
{
"name": "Ruby",
"bytes": "411513"
},
{
"name": "SCSS",
"bytes": "20827"
},
{
"name": "Shell",
"bytes": "2636"
},
{
"name": "Vue",
"bytes": "58277"
}
],
"symlink_target": ""
} |
package com.ghgande.j2mod.modbus.utils;
import com.ghgande.j2mod.modbus.net.AbstractSerialConnection;
import org.apache.commons.exec.CommandLine;
import org.apache.commons.exec.DefaultExecutor;
import org.apache.commons.exec.ExecuteWatchdog;
import org.apache.commons.exec.PumpStreamHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.*;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
/**
* This class is a collection of utility methods used by all test classes
*
* @author Steve O'Hara (4NG)
* @version 2.0 (March 2016)
*/
public class TestUtils {
private static final Logger logger = LoggerFactory.getLogger(TestUtils.class);
private static final int DEFAULT_BUFFER_SIZE = 32 * 1024;
/**
* This method will extract the appropriate Modbus master tool into the
* temp folder so that it can be used later
*
* @return The temporary location of the Modbus master tool.
* @throws Exception If tool cannot be extracted
*/
public static File loadModPollTool() throws Exception {
// Load the resource from the library
String osName = System.getProperty("os.name");
// Work out the correct name
String exeName;
if (osName.matches("(?is)windows.*")) {
osName = "win32";
exeName = "modpoll.exe";
}
else {
osName = "linux";
exeName = "modpoll";
}
// Copy the native modpoll library to a temporary directory in the build workspace to facilitate
// execution on some platforms.
File tmpDir = new File(new File("").getAbsolutePath(), "modpoll-" + System.currentTimeMillis());
tmpDir.mkdirs();
tmpDir.deleteOnExit();
File nativeFile = new File(tmpDir, exeName);
// Copy the library to the temporary folder
InputStream in = null;
String resourceName = String.format("/com/ghgande/j2mod/modbus/native/%s/%s", osName, exeName);
try {
in = AbstractSerialConnection.class.getResourceAsStream(resourceName);
if (in == null) {
throw new Exception(String.format("Cannot find resource [%s]", resourceName));
}
pipeInputToOutputStream(in, nativeFile, false);
nativeFile.deleteOnExit();
// Set the correct privileges
if (!nativeFile.setWritable(true, true)) {
logger.warn("Cannot set modpoll native library to be writable");
}
if (!nativeFile.setReadable(true, false)) {
logger.warn("Cannot set modpoll native library to be readable");
}
if (!nativeFile.setExecutable(true, false)) {
logger.warn("Cannot set modpoll native library to be executable");
}
}
catch (Exception e) {
throw new Exception(String.format("Cannot locate modpoll native library [%s] - %s", exeName, e.getMessage()));
}
finally {
if (in != null) {
try {
in.close();
}
catch (IOException e) {
logger.error("Cannot close stream - {}", e.getMessage());
}
}
}
return nativeFile;
}
/**
* Convenient way of sending data from an input stream to an output file
* in the most efficient way possible
*
* @param in Input stream to read from
* @param fileOut Output file to write to
* @param ignoreErrors True if this method must not throw any socket errors
*
* @throws IOException if an error occurs
*/
@SuppressWarnings("ResultOfMethodCallIgnored")
public static void pipeInputToOutputStream(InputStream in, File fileOut, boolean ignoreErrors) throws IOException {
if (fileOut == null) {
logger.error("The output filename doesn't exist or is invalid");
if (!ignoreErrors) {
throw new IOException("The output filename doesn't exist or is invalid");
}
}
else {
// Create the parentage for the folders if they don't exist
File parent = fileOut.getParentFile();
if (parent != null && !parent.exists()) {
parent.mkdirs();
}
OutputStream fileStream = null;
try {
fileStream = new FileOutputStream(fileOut);
pipeInputToOutputStream(in, fileStream, true, ignoreErrors);
}
catch (IOException e) {
if (fileStream != null) {
try {
fileStream.close();
}
catch (IOException ex) {
logger.error("Cannot close stream - {}", ex.getMessage());
}
}
if (!ignoreErrors) {
throw e;
}
}
}
}
/**
* Convenient way of sending data from an input stream to an output stream
* in the most efficient way possible
* If the bCloseOutput flag is false, then the output stream remains open
* so that further writes can be made to the stream
*
* @param in Input stream to read from
* @param out Output stream to write to
* @param closeOutput True if the output stream should be closed on exit
* @param ignoreErrors True if this method must not throw any socket errors
*
* @throws IOException if an error occurs
*/
public static void pipeInputToOutputStream(InputStream in, OutputStream out, boolean closeOutput, boolean ignoreErrors) throws IOException {
OutputStream bufferedOut = out;
InputStream bufferedIn = in;
if (in != null && out != null) {
try {
// Buffer the streams if they aren't already
if (!bufferedOut.getClass().equals(BufferedOutputStream.class)) {
bufferedOut = new BufferedOutputStream(bufferedOut, DEFAULT_BUFFER_SIZE);
}
if (!bufferedIn.getClass().equals(BufferedInputStream.class)) {
bufferedIn = new BufferedInputStream(bufferedIn, DEFAULT_BUFFER_SIZE);
}
// Push the data
int iTmp;
while ((iTmp = bufferedIn.read()) != -1) {
bufferedOut.write((byte)iTmp);
}
bufferedOut.flush();
out.flush();
}
catch (IOException e) {
if (!ignoreErrors && !(e instanceof java.net.SocketException)) {
logger.error(e.getMessage());
throw e;
}
else {
logger.debug(e.getMessage());
}
}
finally {
bufferedIn.close();
if (closeOutput) {
bufferedOut.close();
}
}
}
}
/**
* Runs a command line task and returns the screen output or throws and
* error if something bad happened
*
* @param command Command to run
*
* @return Screen output
*
* @throws Exception If command cannot be run
*/
public static String execToString(String command) throws Exception {
// Prepare the command line
CommandLine commandline = CommandLine.parse(command);
// Prepare the output stream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);
// Prepare the executor
DefaultExecutor exec = new DefaultExecutor();
exec.setExitValues(null);
exec.setStreamHandler(streamHandler);
exec.setWatchdog(new ExecuteWatchdog(5000));
// Execute the command
try {
exec.execute(commandline);
return (outputStream.toString());
}
catch (Exception e) {
throw new Exception(String.format("%s - %s", outputStream.toString(), e.getMessage()));
}
}
/**
* Returns the last adapter it finds that is not a loopback
*
* @return Adapter to use
*/
public static List<NetworkInterface> getNetworkAdapters() {
List<NetworkInterface> returnValue = new ArrayList<NetworkInterface>();
try {
// Loop round all the adapters
Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
while (networkInterfaces.hasMoreElements()) {
// Get the MAC address if it exists
NetworkInterface network = networkInterfaces.nextElement();
byte[] mac = network.getHardwareAddress();
if (mac != null && mac.length > 0 && network.getInterfaceAddresses() != null) {
returnValue.add(network);
logger.debug("Current MAC address : {} ({})", returnValue, network.getDisplayName());
}
}
}
catch (Exception e) {
logger.error("Cannot determine the local MAC address - {}", e.getMessage());
}
return returnValue;
}
/**
* Returns the first real IP address it finds
*
* @return Real IP address or null if nothing available
*/
public static String getFirstIp4Address() {
// Get all the physical adapters
List<NetworkInterface> adapters = getNetworkAdapters();
if (adapters.size() > 0) {
for (NetworkInterface adapter : adapters) {
// Loop through all the addresses
Enumeration<InetAddress> addresses = adapter.getInetAddresses();
while (addresses.hasMoreElements()) {
InetAddress address = addresses.nextElement();
// Only interested in non-loopback and IPv4 types
if (!address.isLoopbackAddress() && address instanceof Inet4Address) {
return address.getHostAddress();
}
}
}
}
return null;
}
/**
* Returns true if the platform supports the modpoll executable
*
* @return True if modpoll available
*/
public static boolean platformSupportsModPoll() {
return System.getProperty("os.name").matches("(?i)(Windows|Linux).*");
}
}
| {
"content_hash": "2415185141351f4a62956f34e397da1f",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 144,
"avg_line_length": 34.060317460317464,
"alnum_prop": 0.5694845745176624,
"repo_name": "steveohara/j2mod",
"id": "ba5d53202f9b0699d60a0d38a4d083c8a702a0de",
"size": "11344",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "src/test/java/com/ghgande/j2mod/modbus/utils/TestUtils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C++",
"bytes": "41628"
},
{
"name": "Java",
"bytes": "936233"
}
],
"symlink_target": ""
} |
var k = require('../lib/koda.js')
, mongodb = require('mongodb')
, util = require('util')
mongodb.MongoClient.connect('mongodb://localhost/test', function(err, db) {
if (err || !db) {
console.error('failed to connect to db', err, db);
process.exit(1);
}
var koda = k.create(db);
koda.on('error', function(err) {
console.error('coda init failed', err, err.stack);
process.exit(1);
});
//console.log(util.inspect(koda, true, null, true))
koda.onReady(function() {
console.log('koda ready');
koda.enqueue('job_a', { blabla: true }, function(err, data) {
console.log('enqueue job_a callback', err, data);
});
koda.enqueue('job_b', { oops: true }, { expires: 5000 /*milliseconds*/, ignoreResult: true }, function(err, data) {
console.log('enqueue job_b callback', err, data);
});
function print_queue_stats() {
koda.stats(function (err, result) {
console.log(err, result);
setTimeout(print_queue_stats, 5000) ;
})
}
print_queue_stats()
});
});
| {
"content_hash": "430b9186bb6408d1a883902fad3237e7",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 119,
"avg_line_length": 29.27777777777778,
"alnum_prop": 0.5996204933586338,
"repo_name": "vivocha/koda",
"id": "4db6cb3dfea1f02c573f96c8802ab74354a77356",
"size": "1054",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/poster.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "12198"
}
],
"symlink_target": ""
} |
'use strict';
var zrUtil = require('zrender/lib/core/util');
var ChartView = require('../../view/Chart');
var graphic = require('../../util/graphic');
var whiskerBoxCommon = require('../helper/whiskerBoxCommon');
var BoxplotView = ChartView.extend({
type: 'boxplot',
getStyleUpdater: function () {
return updateStyle;
}
});
zrUtil.mixin(BoxplotView, whiskerBoxCommon.viewMixin, true);
// Update common properties
var normalStyleAccessPath = ['itemStyle', 'normal'];
var emphasisStyleAccessPath = ['itemStyle', 'emphasis'];
function updateStyle(itemGroup, data, idx) {
var itemModel = data.getItemModel(idx);
var normalItemStyleModel = itemModel.getModel(normalStyleAccessPath);
var borderColor = data.getItemVisual(idx, 'color');
// Exclude borderColor.
var itemStyle = normalItemStyleModel.getItemStyle(['borderColor']);
var whiskerEl = itemGroup.childAt(itemGroup.whiskerIndex);
whiskerEl.style.set(itemStyle);
whiskerEl.style.stroke = borderColor;
whiskerEl.dirty();
var bodyEl = itemGroup.childAt(itemGroup.bodyIndex);
bodyEl.style.set(itemStyle);
bodyEl.style.stroke = borderColor;
bodyEl.dirty();
var hoverStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
graphic.setHoverStyle(itemGroup, hoverStyle);
}
module.exports = BoxplotView;
| {
"content_hash": "977725b6bfec66d9b799cdd6609b6bea",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 84,
"avg_line_length": 31.48936170212766,
"alnum_prop": 0.6581081081081082,
"repo_name": "wiflsnmo/react_study2",
"id": "c2f64d8083c62f60d1ff17a5b88ae9adb0a6b78b",
"size": "1480",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "node_modules/echarts/lib/chart/boxplot/BoxplotView.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13967"
},
{
"name": "HTML",
"bytes": "3197"
},
{
"name": "JavaScript",
"bytes": "9185"
}
],
"symlink_target": ""
} |
<!-- header -->
<ng-include src="'views/inc_header.html'"></ng-include>
<!-- banner -->
<div id="banner" class="grid-container-fluid margin-top-xs">
<div class="grid-container">
<div class="grid-row">
<div class="grid-xs-12">
<a href="/{{event.slug}}" class="clear-decoration">
<img src="{{S3_ENDPOINT}}/cover/{{event.image}}" class="img block" alt="{{event.name}}">
<div class="shadow-banner absolute position-bottom position-left position-right padding-sm margin-left-sm margin-right-sm">
<h1 class="text-xl text-white align-center clear-margin padding-top-xl">{{event.name}} ♥ {{event.date | date:'dd/MM/yyyy'}}</h1>
</div>
</a>
</div>
</div>
</div>
</div>
<!-- content -->
<div class="grid-container margin-top-lg">
<!-- products -->
<div class="grid-row">
<div class="grid-xs-12">
<div class="bg-white box-shadow padding-top-md padding-right-xl padding-bottom-md padding-left-xl">
<form name="form">
<div class="grid-row margin-bottom-xl">
<div class="grid-xs-12">
<h2 class="text-lg text-default clear-margin">Vaquinha</h2>
</div>
</div>
<div class="grid-row">
<div class="grid-md-3 grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="radio-buttom-check relative inline-block align-center pointer">
<input type="radio" class="hidden" ng-model="donation.amount" value="100.00" required>
<span class="absolute position-top position-left text-xl text-white bg-primary icon-md hidden">✔</span>
<img src="/uploads/presente-cafe.jpg" alt="" class="img">
<span class="text-lg text-default block">R$ 100,00</span>
</label>
</div>
<div class="grid-md-3 grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="radio-buttom-check relative inline-block align-center pointer">
<input type="radio" class="hidden" ng-model="donation.amount" value="150.00" required>
<span class="absolute position-top position-left text-xl text-white bg-primary icon-md hidden">✔</span>
<img src="/uploads/presente-jantar.jpg" alt="" class="img">
<span class="text-lg text-default block">R$ 150,00</span>
</label>
</div>
<div class="grid-md-3 grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="radio-buttom-check relative inline-block align-center pointer">
<input type="radio" class="hidden" ng-model="donation.amount" value="200.00" required>
<span class="absolute position-top position-left text-xl text-white bg-primary icon-md hidden">✔</span>
<img src="/uploads/presente-hospedagem.jpg" alt="" class="img">
<span class="text-lg text-default block">R$ 200,00</span>
</label>
</div>
<div class="grid-md-3 grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="radio-buttom-check relative inline-block align-center pointer">
<input type="radio" class="hidden" ng-model="donation.amount" value="500.00" required>
<span class="absolute position-top position-left text-xl text-white bg-primary icon-md hidden">✔</span>
<img src="/uploads/presente-passagem.jpg" alt="" class="img">
<span class="text-lg text-default block">R$ 500,00</span>
</label>
</div>
</div>
<div ng-show="donation.amount" class="grid-row">
<div class="grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="text-sm text-default">Nome:</label>
<input id="name" class="field text-field text-field-lg" type="text" ng-model="donation.name" required>
</div>
<div class="grid-sm-6 grid-xs-12 margin-bottom-xl">
<label class="text-sm text-default">E-mail:</label>
<input id="name" class="field text-field text-field-lg" type="text" ng-model="donation.email" required>
</div>
</div>
<div class="grid-row margin-bottom-xl">
<div class="grid-md-2 grid-md-offset-10 grid-sm-3 grid-sm-offset-9 grid-xs-12">
<button id="saveDonation" class="btn-lg btn-primary" ng-click="saveDonation(donation)">Pagar</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://stc.sandbox.pagseguro.uol.com.br/pagseguro/api/v2/checkout/pagseguro.lightbox.js"></script>
<!-- footer -->
<ng-include src="'views/inc_footer.html'"></ng-include>
| {
"content_hash": "0e8b437067f5c76d88be296f191d3a22",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 147,
"avg_line_length": 55.627906976744185,
"alnum_prop": 0.5852842809364549,
"repo_name": "mxczpiscioneri/lista-presentes",
"id": "a9f6f9e4e4f0b3c697e63b1128f9594684cbba12",
"size": "4784",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "public/views/publico-vaquinha.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "66924"
},
{
"name": "HTML",
"bytes": "57254"
},
{
"name": "JavaScript",
"bytes": "37306"
}
],
"symlink_target": ""
} |
#include "sky/engine/config.h"
#include "sky/engine/core/dom/Microtask.h"
#include "base/bind.h"
#include "base/trace_event/trace_event.h"
#include "sky/engine/public/platform/WebThread.h"
#include "sky/engine/wtf/OwnPtr.h"
#include "sky/engine/wtf/Vector.h"
namespace blink {
namespace {
class Task : public WebThread::Task {
public:
explicit Task(const base::Closure& closure)
: m_closure(closure)
{
}
virtual void run() override
{
m_closure.Run();
}
private:
base::Closure m_closure;
};
}
// TODO(dart): Integrate this microtask queue with darts.
typedef Vector<OwnPtr<WebThread::Task> > MicrotaskQueue;
static MicrotaskQueue& microtaskQueue()
{
DEFINE_STATIC_LOCAL(OwnPtr<MicrotaskQueue>, queue, (adoptPtr(new MicrotaskQueue())));
return *queue;
}
void Microtask::performCheckpoint()
{
MicrotaskQueue& queue = microtaskQueue();
while(!queue.isEmpty()) {
TRACE_EVENT0("sky", "Microtask::performCheckpoint");
MicrotaskQueue local;
swap(queue, local);
for (const auto& task : local)
task->run();
}
}
void Microtask::enqueueMicrotask(PassOwnPtr<WebThread::Task> callback)
{
microtaskQueue().append(callback);
}
void Microtask::enqueueMicrotask(const base::Closure& callback)
{
enqueueMicrotask(adoptPtr(new Task(callback)));
}
} // namespace blink
| {
"content_hash": "8445ccef73dd9e1ed19dddd97ab3794d",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 89,
"avg_line_length": 21.215384615384615,
"alnum_prop": 0.6809282088469906,
"repo_name": "collinjackson/mojo",
"id": "7be9902076e9a6739dda9803f0a3d06180951054",
"size": "2950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sky/engine/core/dom/Microtask.cpp",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Bison",
"bytes": "31162"
},
{
"name": "C",
"bytes": "1870198"
},
{
"name": "C++",
"bytes": "36473977"
},
{
"name": "CSS",
"bytes": "1897"
},
{
"name": "Dart",
"bytes": "508640"
},
{
"name": "Go",
"bytes": "181090"
},
{
"name": "Groff",
"bytes": "29030"
},
{
"name": "HTML",
"bytes": "6258864"
},
{
"name": "Java",
"bytes": "1187123"
},
{
"name": "JavaScript",
"bytes": "204155"
},
{
"name": "Makefile",
"bytes": "402"
},
{
"name": "Objective-C",
"bytes": "74603"
},
{
"name": "Objective-C++",
"bytes": "370763"
},
{
"name": "Protocol Buffer",
"bytes": "1048"
},
{
"name": "Python",
"bytes": "5515876"
},
{
"name": "Shell",
"bytes": "143302"
},
{
"name": "nesC",
"bytes": "18347"
}
],
"symlink_target": ""
} |
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<!--
<services>
<service id="hope_for_sick_and_poor_frontend.example" class="HopeForSickAndPoor\FrontendBundle\Example">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
</service>
</services>
-->
</container>
| {
"content_hash": "ebae9f5df1e20ce83a1cad685a8bcb4f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 120,
"avg_line_length": 37.875,
"alnum_prop": 0.6485148514851485,
"repo_name": "mccico/hopeForSickAndPoor",
"id": "d32c5764b3963d4e175cd36fef5ce646d3c267f1",
"size": "606",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/HopeForSickAndPoor/FrontendBundle/Resources/config/services.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "227229"
},
{
"name": "JavaScript",
"bytes": "700118"
},
{
"name": "PHP",
"bytes": "66224"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
#if !CORECLR
using System.ComponentModel.Composition;
#endif
using System.Globalization;
using System.Management.Automation.Language;
using Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic;
namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules
{
/// <summary>
/// AvoidLongLines: Checks for lines longer than 120 characters
/// </summary>
#if !CORECLR
[Export(typeof(IScriptRule))]
#endif
public class AvoidLongLines : ConfigurableRule
{
/// <summary>
/// Construct an object of AvoidLongLines type.
/// </summary>
public AvoidLongLines()
{ }
[ConfigurableRuleProperty(defaultValue: 120)]
public int MaximumLineLength { get; set; }
private readonly string[] s_lineSeparators = new[] { "\r\n", "\n" };
/// <summary>
/// Analyzes the given ast to find violations.
/// </summary>
/// <param name="ast">AST to be analyzed. This should be non-null</param>
/// <param name="fileName">Name of file that corresponds to the input AST.</param>
/// <returns>A an enumerable type containing the violations</returns>
public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string fileName)
{
if (ast == null)
{
throw new ArgumentNullException(nameof(ast));
}
var diagnosticRecords = new List<DiagnosticRecord>();
string[] lines = ast.Extent.Text.Split(s_lineSeparators, StringSplitOptions.None);
for (int lineNumber = 0; lineNumber < lines.Length; lineNumber++)
{
string line = lines[lineNumber];
if (line.Length <= MaximumLineLength)
{
continue;
}
int startLine = lineNumber + 1;
int endLine = startLine;
int startColumn = 1;
int endColumn = line.Length;
var violationExtent = new ScriptExtent(
new ScriptPosition(
ast.Extent.File,
startLine,
startColumn,
line
),
new ScriptPosition(
ast.Extent.File,
endLine,
endColumn,
line
));
var record = new DiagnosticRecord(
String.Format(CultureInfo.CurrentCulture,
String.Format(Strings.AvoidLongLinesError, MaximumLineLength)),
violationExtent,
GetName(),
GetDiagnosticSeverity(),
ast.Extent.File,
null
);
diagnosticRecords.Add(record);
}
return diagnosticRecords;
}
/// <summary>
/// Retrieves the common name of this rule.
/// </summary>
public override string GetCommonName()
{
return string.Format(CultureInfo.CurrentCulture, Strings.AvoidLongLinesCommonName);
}
/// <summary>
/// Retrieves the description of this rule.
/// </summary>
public override string GetDescription()
{
return string.Format(CultureInfo.CurrentCulture, Strings.AvoidLongLinesDescription);
}
/// <summary>
/// Retrieves the name of this rule.
/// </summary>
public override string GetName()
{
return string.Format(
CultureInfo.CurrentCulture,
Strings.NameSpaceFormat,
GetSourceName(),
Strings.AvoidLongLinesName);
}
/// <summary>
/// Retrieves the severity of the rule: error, warning or information.
/// </summary>
public override RuleSeverity GetSeverity()
{
return RuleSeverity.Warning;
}
/// <summary>
/// Gets the severity of the returned diagnostic record: error, warning, or information.
/// </summary>
/// <returns></returns>
private DiagnosticSeverity GetDiagnosticSeverity()
{
return DiagnosticSeverity.Warning;
}
/// <summary>
/// Retrieves the name of the module/assembly the rule is from.
/// </summary>
public override string GetSourceName()
{
return string.Format(CultureInfo.CurrentCulture, Strings.SourceName);
}
/// <summary>
/// Retrieves the type of the rule, Builtin, Managed or Module.
/// </summary>
public override SourceType GetSourceType()
{
return SourceType.Builtin;
}
}
}
| {
"content_hash": "b5c0e75a67513755e8f6d7a16941a19b",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 96,
"avg_line_length": 32.57516339869281,
"alnum_prop": 0.5385232744783307,
"repo_name": "PowerShell/PSScriptAnalyzer",
"id": "ad527bb37250ec9a5567dc933ef275131a676c68",
"size": "5081",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Rules/AvoidLongLines.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1590465"
},
{
"name": "Dockerfile",
"bytes": "641"
},
{
"name": "PowerShell",
"bytes": "829702"
}
],
"symlink_target": ""
} |
package de.undercouch.citeproc.bibtex;
import de.undercouch.citeproc.csl.CSLName;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Tests the name parser
* @author Michel Kraemer
*/
public class NameParserTest {
/**
* Tests if a family name can be parsed
*/
@Test
public void familyOnly() {
CSLName[] names = NameParser.parse("Thompson");
assertEquals(1, names.length);
assertEquals("Thompson", names[0].getFamily());
}
/**
* Tests if a simple name can be parsed
*/
@Test
public void simple() {
CSLName[] names = NameParser.parse("Ken Thompson");
assertEquals(1, names.length);
assertEquals("Ken", names[0].getGiven());
assertEquals("Thompson", names[0].getFamily());
}
/**
* Tests if a name with a middle initial can be parsed
*/
@Test
public void middleName() {
CSLName[] names = NameParser.parse("Dennis M. Ritchie");
assertEquals(1, names.length);
assertEquals("Dennis M.", names[0].getGiven());
assertEquals("Ritchie", names[0].getFamily());
}
/**
* Tests if a name with initials can be parsed
*/
@Test
public void initials() {
CSLName[] names = NameParser.parse("S. C. Johnson");
assertEquals(1, names.length);
assertEquals("S. C.", names[0].getGiven());
assertEquals("Johnson", names[0].getFamily());
}
/**
* Tests if a name with a non-dropping particle can be parsed
*/
@Test
public void nonDroppingParticle() {
CSLName[] names = NameParser.parse("Michael van Gerwen");
assertEquals(1, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
}
/**
* Tests if a family name with a non-dropping particle can be parsed
*/
@Test
public void nonDroppingParticleFamilyOnly() {
CSLName[] names = NameParser.parse("van Gerwen");
assertEquals(1, names.length);
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
}
/**
* Tests if a name with a comma can be parsed
*/
@Test
public void comma() {
CSLName[] names = NameParser.parse("Thompson, Ken");
assertEquals(1, names.length);
assertEquals("Ken", names[0].getGiven());
assertEquals("Thompson", names[0].getFamily());
}
/**
* Tests if a name with a suffix can be parsed
*/
@Test
public void commaJunior() {
CSLName[] names = NameParser.parse("Friedman, Jr., George");
assertEquals(1, names.length);
assertEquals("George", names[0].getGiven());
assertEquals("Jr.", names[0].getSuffix());
assertEquals("Friedman", names[0].getFamily());
}
/**
* Tests if a name with a given name and two family names can be
* parsed correctly and if the given name is not parsed as suffix
*/
@Test
public void commaNoJunior() {
CSLName[] names = NameParser.parse("Familya Familyb, Given");
assertEquals(1, names.length);
assertEquals("Given", names[0].getGiven());
assertEquals("Familya Familyb", names[0].getFamily());
}
/**
* Tests if a name with a comma and a middle initial can be parsed
*/
@Test
public void commaInitials() {
CSLName[] names = NameParser.parse("Ritchie, Dennis M.");
assertEquals(1, names.length);
assertEquals("Dennis M.", names[0].getGiven());
assertEquals("Ritchie", names[0].getFamily());
}
/**
* Tests if a name with a comma and a non-dropping particle can be parsed
*/
@Test
public void commaNonDroppingParticle() {
CSLName[] names = NameParser.parse("van Gerwen, Michael");
assertEquals(1, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
}
/**
* Tests if a name with a comma and multiple non-dropping particles can be parsed
*/
@Test
public void commaNonDroppingParticles() {
CSLName[] names = NameParser.parse("Van der Voort, Vincent");
assertEquals(1, names.length);
assertEquals("Vincent", names[0].getGiven());
assertEquals("Van der", names[0].getNonDroppingParticle());
assertEquals("Voort", names[0].getFamily());
}
/**
* Tests if multiple names can be parsed
*/
@Test
public void and() {
CSLName[] names = NameParser.parse("Michael van Gerwen and Vincent van der Voort");
assertEquals(2, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
assertEquals("Vincent", names[1].getGiven());
assertEquals("van der", names[1].getNonDroppingParticle());
assertEquals("Voort", names[1].getFamily());
}
/**
* Tests if multiple names with commas can be parsed
*/
@Test
public void andComma() {
CSLName[] names = NameParser.parse("van Gerwen, Michael and Van der Voort, Vincent");
assertEquals(2, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
assertEquals("Vincent", names[1].getGiven());
assertEquals("Van der", names[1].getNonDroppingParticle());
assertEquals("Voort", names[1].getFamily());
}
/**
* Tests if multiple names with commas can be parsed
*/
@Test
public void andComma2() {
CSLName[] names = NameParser.parse("van Gerwen, Michael and van der Voort, Vincent");
assertEquals(2, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
assertEquals("Vincent", names[1].getGiven());
assertEquals("van der", names[1].getNonDroppingParticle());
assertEquals("Voort", names[1].getFamily());
}
/**
* Tests if multiple names with commas can be parsed
*/
@Test
public void andCommaMix() {
CSLName[] names = NameParser.parse("van Gerwen, Michael and Vincent van der Voort");
assertEquals(2, names.length);
assertEquals("Michael", names[0].getGiven());
assertEquals("van", names[0].getNonDroppingParticle());
assertEquals("Gerwen", names[0].getFamily());
assertEquals("Vincent", names[1].getGiven());
assertEquals("van der", names[1].getNonDroppingParticle());
assertEquals("Voort", names[1].getFamily());
}
/**
* Tests if a name with a suffix can be parsed
*/
@Test
public void junior() {
CSLName[] names = NameParser.parse("George Friedman, Jr.");
assertEquals(1, names.length);
assertEquals("George", names[0].getGiven());
assertEquals("Jr.", names[0].getSuffix());
assertEquals("Friedman", names[0].getFamily());
}
/**
* Tests if a non-parseable name renders a literal string
*/
@Test
public void nonParseable() {
String str = "Jerry Peek and Tim O'Reilly and Mike Loukides and other authors of the Nutshell handbooks";
CSLName[] names = NameParser.parse(str);
assertEquals(1, names.length);
assertEquals(str, names[0].getLiteral());
}
}
| {
"content_hash": "8928369b5922e1d40a5c1a063ae415a7",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 113,
"avg_line_length": 33.59307359307359,
"alnum_prop": 0.6097938144329897,
"repo_name": "michel-kraemer/citeproc-java",
"id": "eb349403afc32455ea6cf67d63bcd418ae24d8f3",
"size": "7760",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "citeproc-java/src/test/java/de/undercouch/citeproc/bibtex/NameParserTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "9980"
},
{
"name": "Dockerfile",
"bytes": "389"
},
{
"name": "Groovy",
"bytes": "8367"
},
{
"name": "Java",
"bytes": "747008"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.