text
stringlengths 2
1.04M
| meta
dict |
---|---|
<?php
namespace PHPExiftool\Driver\Tag\Qualcomm;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class R2TL84RedCtbl24 extends AbstractTag
{
protected $Id = 'r2_tl84_red_ctbl[24]';
protected $Name = 'R2TL84RedCtbl24';
protected $FullName = 'Qualcomm::Main';
protected $GroupName = 'Qualcomm';
protected $g0 = 'MakerNotes';
protected $g1 = 'Qualcomm';
protected $g2 = 'Camera';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'R2 TL84 Red Ctbl 24';
protected $flag_Permanent = true;
}
| {
"content_hash": "c7a0f60e178ef39c60b92af6f55e0e79",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 51,
"avg_line_length": 17.37837837837838,
"alnum_prop": 0.6687402799377916,
"repo_name": "romainneutron/PHPExiftool",
"id": "6e739dafc1092a36e9a501585641c07077ca3390",
"size": "865",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/PHPExiftool/Driver/Tag/Qualcomm/R2TL84RedCtbl24.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "22042446"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<head>
<title>{% if page.title %}{{ page.title }} – {% endif %}{{ site.name }} – {{ site.description }}</title>
{% include meta.html %}
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="{{ site.baseurl }}/style.css" />
<link rel="alternate" type="application/rss+xml" title="{{ site.name }} - {{ site.description }}" href="{{ site.baseurl }}/feed.xml" />
<!-- Created with Jekyll Now - http://github.com/barryclark/jekyll-now -->
</head>
<body>
<div class="wrapper-masthead">
<div class="container">
<header class="masthead clearfix">
<a href="{{ site.baseurl }}/" class="site-avatar"><img src="{{ site.avatar }}" /></a>
<div class="site-info">
<h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name }}</a></h1>
<p class="site-description">{{ site.description }}</p>
</div>
<nav>
<a href="{{ site.baseurl }}/">Blog</a>
<a href="{{ site.baseurl }}/about">About</a>
<a href="{{ site.baseurl }}/projects">Projects</a>
</nav>
</header>
</div>
</div>
<div id="main" role="main" class="container">
{{ content }}
</div>
<div class="wrapper-footer">
<div class="container">
<footer class="footer">
{% include svg-icons.html %}
</footer>
</div>
</div>
{% include analytics.html %}
</body>
</html>
| {
"content_hash": "40a67dcfd3d6712e10354737f954f10f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 139,
"avg_line_length": 30.46153846153846,
"alnum_prop": 0.5208333333333334,
"repo_name": "edwardheming/edwardheming.github.io",
"id": "01c626026a9cc1725d2436c9605b6d69de686357",
"size": "1588",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "_layouts/default.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "62905"
},
{
"name": "HTML",
"bytes": "6311"
}
],
"symlink_target": ""
} |
{% extends "../layout_search.html" %}
{% block page_title %}
Service Green
{% endblock %}
{% block content %}
<main id="content" role="main">
{% include "../../includes/phase_banner_beta.html" %}
<div class="breadcrumbs">
<ol>
<li><a href="../index.html">Home</a></li>
</ol>
</div>
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-xlarge">Psychologist</h1>
<div class="govuk-box-grey">
<p>Psychologists study people's behaviour, motivations, thoughts and feelings, to help them overcome or control their problems.</p>
</div>
<div class="profile">
<div class="sixty">
<span class="salary-icon">
<img alt="Salary, a pound sign" src="/public/images/salary.png">
</span>
<span class="visually-hidden">Salary:</span>
<span class="bold">£31,000 to £98,500</span>
per year
</div>
<div class="forty">
<span class="hours-icon">
<img alt="Hours, a clock face" src="/public/images/hours.png">
</span>
<span class="visually-hidden">Hours:</span>
<span class="bold">35 to 40 hours</span>
per week
</div>
</div>
<nav aria-label="skip to your documents" class="jump-links" role="navigation">
<div class="grid-row">
<div class="column-one-half">
<ol class="list list-number">
<li>
<a href="#how-to-become">How to become a psychologist</a>
</li>
<li>
<a href="#skills-required">Skills</a>
</li>
<li>
<a href="#what-youll-do">What you'll do</a>
</li>
<li>
<a href="#salary">Salary</a>
</li>
</ol>
</div>
<div class="column-one-half">
<ol class="list list-number" start="5">
<li>
<a href="#working-hours-patterns-and-environment">Working hours, patterns and environment</a>
</li>
<li>
<a href="#career-path-and-progression">Career path and progression</a>
</li>
<li>
<a href="#current-opportunities">Current opportunities</a>
</li>
</ol>
</div>
</div>
</nav>
<!--section 1-->
<section id="how-to-become">
<h2 class="heading-large">1. How to become a psychologist</h2>
<p>You can follow 2 routes to become a psychologist. For both routes, you’ll need:</p>
<ul class="list list-bullet">
<li>a degree</li>
<li>background checks by the <a href="https://www.gov.uk/disclosure-barring-service-check/overview">Disclosure and Barring Service (DBS)</a></li>
</ul>
<p>You’ll need to get Graduate Basis for Chartered Membership (GBC) of the British Psychological Society (BPS) to practise as a psychologist.</p>
<p>You can get GBC by taking a <a href="http://www.bps.org.uk/bpslegacy/ac">BPS-accredited</a>:</p>
<ul class="list list-bullet">
<li>degree in psychology</li>
<li>conversion course in psychology if you have a degree in another subject</li>
</ul>
<p>To get on a degree course in psychology, you’ll normally need to have at least 5 GCSEs at grades 9 to 4 (A* to C) and at least 2 A levels. You don’t need an A level in psychology. Some universities may prefer you to have at least 1 A level in a science subject. </p>
<p>Conversion courses usually take 1 year full time or 2 years part time.</p>
<p>You may be able to get <a href="https://www.gov.uk/student-finance/overview">financial help to do a course</a>.</p>
<h3 class="heading-medium">To specialise</h3>
<p>Once you have a psychology degree or complete a conversion course, you can <a href="http://careers.bps.org.uk/">specialise in a particular area of psychology</a> like educational or clinical psychology.</p>
<p>You’ll need:</p>
<ul class="list list-bullet">
<li>a <a href="http://www.bps.org.uk/bpslegacy/ac">British Psychological Society (BPS)-accredited postgraduate degree</a> in your chosen specialism</li>
<li>to register with the Health and Care Professions Council (HCPC) to use the professional title of your specialism, for example educational psychologist</li>
</ul>
</section>
<!--section 2-->
<section id="skills-required">
<h2 class="heading-large">2. Skills</h2>
<p>You'll need:</p>
<ul class="list list-bullet">
<li>science and maths ability</li>
<li>excellent communication and listening skills</li>
<li>empathy and the ability to deal with people in distress</li>
<li>decision-making skills</li>
<li>an accurate, logical and methodical approach</li>
<li>IT skills</li>
</ul>
</section>
<!--section 3-->
<section id="what-youll-do">
<h2 class="heading-large">3. What you'll do</h2>
<p>
You'll specialise in an area of psychology like:
</p>
<ul class="list list-bullet">
<li>education – helping children and young people overcome difficulties and further their educational and psychological development</li>
<li>occupational – helping businesses improve their performance and increase employee job satisfaction</li>
<li>counselling – helping people resolve their problems and make decisions, particularly at stressful times in their lives</li>
<li>neuropsychology – helping patients with brain injuries and diseases to recover or improve their quality of life</li>
<li>forensic or criminal – using psychological theory to help investigate crimes, rehabilitate offenders and support prison staff</li>
<li>clinical – working with people to help them deal with conditions like anxiety, stress, depression and mental illness</li>
<li>sports and exercise – working with individuals, teams and organisations to improve motivation and performance</li>
</ul>
<p>You could be based in a hospital, school, clinic, prison or community mental health team.</p>
</section>
<!--section 4 -->
<section id="salary">
<h2 class="heading-large">4. Salary</h2>
<p>Starter: £31,000 to £41,000</p>
<p>Experienced: £41,000 to £57,000</p>
<p>Highly Experienced: £58,000 to £98,500 (head of service)</p>
<p>Your salary will depend on your area of specialism. The figures included here are based on a clinical psychologist's salary, working in the NHS.</p>
<p>These figures are a guide.</p>
</section>
<!--section 5 -->
<section id="working-hours-patterns-and-environment">
<h2 class="heading-large">
5. Working hours, patterns and environment
</h2>
<p>Your working hours will depend on your specialism.</p>
<p>You'll usually work from an office or consultation room, but you may also visit clients in their homes.</p>
</section>
<!--section 6-->
<section id="career-path-and-progression">
<h2 class="heading-large">
6. Career path and progression
</h2>
<p>You could specialise further within your branch of psychology or take on a research project leading to a PhD qualification.</p>
<p>You could move also into teaching or research as a career.</p>
<h3 class="heading-medium">Related careers</h3>
<p>You may be interested in:</p>
<ul class="list list-bullet">
<li><a href="/job-profiles/clinical-psychologist">Clinical psychologist</a></li>
<li><a href="/job-profiles/psychiatrist">Psychiatrist</a></li>
<li><a href="/job-profiles/forensic-psychologist">Forensic psychologist</a></li>
<li><a href="/job-profiles/sport-and-exercise-psychologist">Sport and exercise psychologist</a></li>
<li><a href="/job-profiles/art-therapist">Art therapist</a></li>
<li><a href="/job-profiles/dramatherapist">Dramatherapist</a></li>
<li><a href="/job-profiles/cognitive-behavioural-therapist">Cognitive behavioural therapist</a></li>
</ul>
</section>
<!--section 7-->
<section id="current-opportunities" style="margin-bottom:30px">
<h2 class="heading-large">7. Current opportunities</h2>
<!-- <p>Find the latest opportunities</p> -->
<div class="grid-row" id="appGeneric">
<div class="column-full">
<h2 class="heading-medium" style="margin-top:0px;">Apprenticeships
<span class="heading-secondary">In England</span>
</h2>
</div>
<div class="column-half">
<div class="opportunity-item">
<h3 class="heading-small"><a href="https://www.findapprenticeship.service.gov.uk/apprenticeship/-123488">Administration & Clerical Worker Apprentice</a></h3>
<ul class="list">
<li><span class="bold-small">Weekly wage:</span> £131.25</li>
<li><span class="bold-small">Weekly hours:</span> 37.50</li>
<li><span class="bold-small">Location:</span> Coventry</li>
</ul>
</div>
</div>
<div class="column-half">
<div class="opportunity-item">
<h3 class="heading-small"><a href="https://www.findapprenticeship.service.gov.uk/apprenticeship/-89326">Apprentice Support Worker</a></h3>
<ul class="list">
<li><span class="bold-small">Weekly wage:</span> £135</li>
<li><span class="bold-small">Weekly hours:</span> 30</li>
<li><span class="bold-small">Location:</span> Liverpool</li>
</ul>
</div>
</div>
</div>
<div class="opportunity-footer">
<a href="https://www.findapprenticeship.service.gov.uk/apprenticeshipsearch">Find apprenticeships near you</a>
</div>
<div class="grid-row" id="courseGeneric">
<div class="column-full">
<h2 class="heading-medium">Training courses
<span class="heading-secondary">In England</span>
</h2>
</div>
<div class="column-half">
<div class="opportunity-item">
<h3 class="heading-small"><a href="https://nationalcareersservice.direct.gov.uk/course-directory/course-details?courseid=54237002">Psychology A Level</a></h3>
<ul class="list">
<li><span class="bold-small">Provider:</span> Salisbury Sixth Form College</li>
<li><span class="bold-small">Start date:</span> 01 September 2017</li>
<li><span class="bold-small">Location:</span> Coventry</li>
</ul>
</div>
</div>
<div class="column-half">
<div class="opportunity-item">
<h3 class="heading-small"><a href="https://nationalcareersservice.direct.gov.uk/course-directory/course-details?courseid=54497881">Psychology A'Level 7182</a></h3>
<ul class="list">
<li><span class="bold-small">Provider:</span> Ernesford Grange Community Academy</li>
<li><span class="bold-small">Start date:</span> 01 July 2019</li>
<li><span class="bold-small">Location:</span> Brentwood</li>
</ul>
</div>
</div>
</div>
<div class="opportunity-footer">
<a href="https://nationalcareersservice.direct.gov.uk/course-directory/home">Find courses near you</a>
</div>
</section>
<p class="grey font-xsmall">Last updated: 23 March 2016</p>
</div>
<div class="column-one-third">
<aside class="PROD_govuk-related-items" role="complementary">
<h2 class="heading-medium" id="related-gov-links">
Useful links</h2>
<ul class="list">
<li>
<a href="https://nationalcareersservice.direct.gov.uk/course-directory/home">Find a course</a>
</li>
<li>
<a href="https://www.gov.uk/apply-apprenticeship">Apprenticeships</a>
</li>
<li>
<a href="https://www.ucas.com/">Thinking about university</a>
</li>
<li>
<a href="https://www.gov.uk/further-education-courses">Help with funding</a>
</li>
<li>
<a href="https://www.gov.uk/volunteering">Become a volunteer</a>
</li>
</ul>
</aside>
</div>
</div>
</main>
<script src="/public/_sprint9/javascripts/jquery-1.11.3.js"></script>
<script src="/public/_sprint9/javascripts/paralegal-dynamic-panels.js"></script>
{% endblock %}
| {
"content_hash": "5fedda83f8479a5d834b0dbfaab5d342",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 275,
"avg_line_length": 50.41901408450704,
"alnum_prop": 0.5316712060898108,
"repo_name": "citizendigitalalpha/careers_beta",
"id": "65261012ef7ec1eb22c410fc1c734104f5af9050",
"size": "14353",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/views/_sprint9/job-profiles/psychologist_v4.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1907280"
},
{
"name": "HTML",
"bytes": "31930145"
},
{
"name": "JavaScript",
"bytes": "3956399"
},
{
"name": "Shell",
"bytes": "1495"
}
],
"symlink_target": ""
} |
/**
* Module dependencies.
*/
var express = require('express')
, fs = require("fs")
, jquery = fs.readFileSync(__dirname + "/vendor/jquery.min.js", "utf-8")
, jsdom = require('jsdom')
, request = require('request')
, url = require('url')
, config = require('../app/config')
, utils = require('../app/utils')(request, jsdom, jquery)
, Spreadsheet = require('edit-google-spreadsheet')
, app = module.exports = express.createServer();
// Configuration
// CORS middleware
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
};
app.configure(function(){
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(allowCrossDomain);
app.use(app.router);
});
app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
app.use(express.errorHandler());
});
// Routes
app.get('/commits', function(req, res) {
var self = this;
self.revisions = [];
self.res = res;
self.currentPage = 1;
/** SCRAPPING CONFIG ! **/
self.baseProjectUrl = req.query.url;
self.xtensionsToLook = ['php', 'js', 'css', 'html', 'phtml'];
self.startDate = new Date(req.query.date);
self.dateFormat = req.query.redmineDateFormat;
self.startDate = new Date(startDate.getFullYear(), startDate.getMonth(), startDate.getDate());
self.project = req.query.project.toLowerCase();
self.cookieJar = request.jar();
self.cookieJar.setCookie(request.cookie('_redmine_session='+req.query.cookie), baseProjectUrl);
utils.parseUrl(self, '/projects/'+self.project+'/repository/revisions?per_page=100', function(jQuery) {
utils.scrapRevisions(self, jQuery, function(revisions) {
self.totalRevisions = revisions.length;
if(revisions.length === 0 && !self.res.headerSent) {
self.res.writeHead(200, { 'Content-Type': 'application/json' });
self.res.write(JSON.stringify([]));
self.res.end();
}
var revisionsTreated = 0;
console.log('There\'s '+ self.totalRevisions +' revisions to scrap!\n');
revisions.forEach(function(revision) {
var diffUrl = revision.url + '/diff?format=diff';
utils.parseUrl(self, diffUrl, function(fileContent) {
revision.files = utils.splitPatches(fileContent, self);
revisionsTreated++;
console.log(revisionsTreated + '/' + self.totalRevisions);
utils.addRevision(self, revision);
}, true);
});
});
});
});
app.post('/comments', function(req, res) {
var done = req.body.done;
var date = req.body.date;
var issues = req.body.issues;
var revision = req.body.revision;
var file = req.body.file;
var status = req.body.status;
var line = req.body.line;
var comment = req.body.comment;
var spreadsheetId = req.body.spreadsheetId;
if(done === undefined ||
date === undefined ||
issues === undefined ||
revision === undefined ||
file === undefined ||
status === undefined ||
line === undefined ||
spreadsheetId === undefined ||
comment === undefined && !res.headerSent) {
res.writeHead(400, { 'Content-Type': 'application/json' });
res.end();
return false;
}
doneValue = done ? 'Done' : '';
date = new Date(date);
date = date.getDate() + '/' + (date.getMonth() +1) + '/' + date.getFullYear();
Spreadsheet.load({
debug: false,
spreadsheetId: spreadsheetId,
worksheetId: '1',
// See https://github.com/extrabacon/google-oauth-jwt#specifying-options
oauth : config.oauth
}, function sheetReady(err, spreadsheet) {
if(err) throw err;
spreadsheet.receive(function(err, rows, info) {
if(err) throw err;
var nextRow = parseInt(info.nextRow);
var newRow = {2: [[
doneValue,
date,
issues,
revision,
file,
status,
line,
comment
]]};
var add = {};
add[nextRow] = newRow;
spreadsheet.add(add);
spreadsheet.send(function(err) {
if(err) throw err;
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end();
});
});
});
});
app.listen(config.express.port, function(){
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);
});
| {
"content_hash": "1e7cd047e243cecc7b6edba37c708d96",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 107,
"avg_line_length": 30.343373493975903,
"alnum_prop": 0.562636489974191,
"repo_name": "ngotchac/dasreviewer-api",
"id": "fb048cce3492c05e213016a6022e137864e93952",
"size": "5037",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/app.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "13944"
}
],
"symlink_target": ""
} |
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
| {
"content_hash": "ee6be183fceae6d7377e9bdc983c2463",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 19.352941176470587,
"alnum_prop": 0.723404255319149,
"repo_name": "wangyuxiangloveyou/-",
"id": "c40f4dfcc239126eaaab53b6e419640378bf6de3",
"size": "496",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "百思不得姐/百思不得姐/ViewController.m",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "16534"
},
{
"name": "Objective-C",
"bytes": "988279"
},
{
"name": "Ruby",
"bytes": "242"
},
{
"name": "Shell",
"bytes": "9486"
}
],
"symlink_target": ""
} |
package draco18s.decay.instability.symbols;
import net.minecraft.block.Block;
import com.xcompwiz.mystcraft.api.internals.BlockDescriptor;
import com.xcompwiz.mystcraft.api.symbol.IAgeController;
import com.xcompwiz.mystcraft.api.symbol.IAgeSymbol;
import draco18s.decay.instability.effects.EffectMethane;
public class SymbolMethane implements IAgeSymbol
{
//boolean unstable = false;
/*@Override
public float getRarity()
{
return 2;
}*/
@Override
public void registerLogic(IAgeController controller, long seed)
{
controller.registerInterface(new EffectMethane());
}
@Override
public int instabilityModifier(int count)
{
return (count > 1) ? 50 : 0;
}
@Override
public String identifier()
{
return "MethanePockets";
}
@Override
public String displayName()
{
return "Bad Air Pockets";
}
@Override
public String[] getDescriptorWords()
{
String[] str = {"Contain", "Energy", "Inhibit", "Life"};
return str;
}
@Override
public float getRarity() {
return 0.4f;//getDescriptorWords
}
}
| {
"content_hash": "1cd78b12b1d5c1a023eb41d5acd25f70",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 67,
"avg_line_length": 21.571428571428573,
"alnum_prop": 0.6307947019867549,
"repo_name": "Draco18s/Decaying-World",
"id": "e582180e379a31adab32a35c979fa8dd23158f38",
"size": "1208",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "draco18s/decay/instability/symbols/SymbolMethane.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "1123381"
}
],
"symlink_target": ""
} |
package org.apache.ivy.osgi.core;
import java.util.Set;
import java.util.TreeSet;
public class ExecutionEnvironmentProfile {
private Set/* <String> */pkgNames = new TreeSet/* <String> */();
private final String name;
public ExecutionEnvironmentProfile(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void addPkgName(String pkgName) {
if (pkgName != null) {
pkgNames.add(pkgName);
}
}
public Set/* <String> */getPkgNames() {
return pkgNames;
}
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((pkgNames == null) ? 0 : pkgNames.hashCode());
return result;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExecutionEnvironmentProfile)) {
return false;
}
ExecutionEnvironmentProfile other = (ExecutionEnvironmentProfile) obj;
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
if (pkgNames == null) {
if (other.pkgNames != null) {
return false;
}
} else if (!pkgNames.equals(other.pkgNames)) {
return false;
}
return true;
}
public String toString() {
return name + ":" + pkgNames;
}
}
| {
"content_hash": "d6162fc7816a1da337d5404844be813d",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 81,
"avg_line_length": 24.228571428571428,
"alnum_prop": 0.5194575471698113,
"repo_name": "pantsbuild/ivy",
"id": "dc55da76454a568ea5834b3a880b5116669f7707",
"size": "2512",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/java/org/apache/ivy/osgi/core/ExecutionEnvironmentProfile.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "11624"
},
{
"name": "Java",
"bytes": "4070711"
},
{
"name": "JavaScript",
"bytes": "7595"
},
{
"name": "XSLT",
"bytes": "82079"
}
],
"symlink_target": ""
} |
<?php
namespace Grav\Plugin\GitSync;
use Defuse\Crypto\Crypto;
use Grav\Common\Config\Config;
use Grav\Common\Grav;
use Grav\Common\Utils;
use SebastianBergmann\Git\RuntimeException;
class Helper
{
/** @var string */
private static $hash = '594ef69d-6c29-45f7-893a-f1b4342687d3';
/** @var string */
const GIT_REGEX = '/(?:git|ssh|https?|git@[-\w.]+):(\/\/)?(.*?)(\.git)(\/?|\#[-\d\w._]+?)$/';
/**
* Checks if the user/ folder is already initialized
*
* @return bool
*/
public static function isGitInitialized()
{
return file_exists(rtrim(USER_DIR, '/') . '/.git');
}
/**
* @param bool $version
* @return bool|string
*/
public static function isGitInstalled($version = false)
{
$bin = Helper::getGitBinary();
exec($bin . ' --version', $output, $returnValue);
$installed = $returnValue === 0;
if ($version && $output) {
$output = explode(' ', array_shift($output));
$versions = array_filter($output, static function($item) {
return version_compare($item, '0.0.1', '>=');
});
$installed = array_shift($versions);
}
return $installed;
}
/**
* @param bool $override
* @return string
*/
public static function getGitBinary($override = false)
{
/** @var Config $grav */
$config = Grav::instance()['config'];
return $override ?: $config->get('plugins.git-sync.git.bin', 'git');
}
/**
* @param string $user
* @param string $password
* @param string $repository
* @return string
*/
public static function prepareRepository($user, $password, $repository)
{
$user = $user ? urlencode($user) . ':' : '';
$password = urlencode($password);
if (Utils::startsWith($repository, 'ssh://')) {
return $repository;
}
return str_replace('://', "://${user}${password}@", $repository);
}
/**
* @param string $user
* @param string $password
* @param string $repository
* @return string[]
*/
public static function testRepository($user, $password, $repository, $branch)
{
$git = new GitSync();
$repository = self::prepareRepository($user, $password, $repository);
try {
return $git->testRepository($repository, $branch);
} catch (RuntimeException $e) {
return [$e->getMessage()];
}
}
/**
* @param string $password
* @return string
* @throws \Defuse\Crypto\Exception\EnvironmentIsBrokenException
*/
public static function encrypt($password)
{
return 'gitsync-' . Crypto::encryptWithPassword($password, self::$hash);
}
/**
* @param string $enc_password
* @return string
*/
public static function decrypt($enc_password)
{
if (strpos($enc_password, 'gitsync-') === 0) {
$enc_password = substr($enc_password, 8);
return Crypto::decryptWithPassword($enc_password, self::$hash);
}
return $enc_password;
}
/**
* @return bool
*/
public static function synchronize()
{
if (!self::isGitInstalled() || !self::isGitInitialized()) {
return true;
}
$git = new GitSync();
if ($git->hasChangesToCommit()) {
$git->commit();
}
// synchronize with remote
$git->sync();
return true;
}
/**
* @param string $str
* @param string $password
* @return string
*/
public static function preventReadablePassword($str, $password)
{
$encoded = urlencode(self::decrypt($password));
return str_replace($encoded, '{password}', $str);
}
}
| {
"content_hash": "c2a31f901b390d6c0d6974b259cb8f55",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 97,
"avg_line_length": 24.367088607594937,
"alnum_prop": 0.5418181818181819,
"repo_name": "trilbymedia/grav-plugin-git-sync",
"id": "9dac08fb67cac017ab682ba590ed1ad3ec41370f",
"size": "3850",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "classes/Helper.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "504"
},
{
"name": "JavaScript",
"bytes": "14859"
},
{
"name": "PHP",
"bytes": "50241"
},
{
"name": "SCSS",
"bytes": "3221"
},
{
"name": "Shell",
"bytes": "570"
},
{
"name": "Twig",
"bytes": "28450"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>waitable_timer_service::destroy</title>
<link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../waitable_timer_service.html" title="waitable_timer_service">
<link rel="prev" href="construct.html" title="waitable_timer_service::construct">
<link rel="next" href="duration.html" title="waitable_timer_service::duration">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
<td align="center"><a href="../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="construct.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../waitable_timer_service.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="duration.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="boost_asio.reference.waitable_timer_service.destroy"></a><a class="link" href="destroy.html" title="waitable_timer_service::destroy">waitable_timer_service::destroy</a>
</h4></div></div></div>
<p>
<a class="indexterm" name="idp170808096"></a>
Destroy a timer implementation.
</p>
<pre class="programlisting"><span class="keyword">void</span> <span class="identifier">destroy</span><span class="special">(</span>
<span class="identifier">implementation_type</span> <span class="special">&</span> <span class="identifier">impl</span><span class="special">);</span>
</pre>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2003-2015 Christopher M.
Kohlhoff<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="construct.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../waitable_timer_service.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="duration.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "3775ac387e0c8afb7cdc431cea2d4d0a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 437,
"avg_line_length": 66.27450980392157,
"alnum_prop": 0.6363905325443787,
"repo_name": "BenKeyFSI/poedit",
"id": "4dd4d51b69a8d338e0a4c0def4b446cfd8c70526",
"size": "3380",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "deps/boost/doc/html/boost_asio/reference/waitable_timer_service/destroy.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "24827"
},
{
"name": "C++",
"bytes": "913779"
},
{
"name": "Inno Setup",
"bytes": "11293"
},
{
"name": "Makefile",
"bytes": "9174"
},
{
"name": "Objective-C",
"bytes": "4693"
},
{
"name": "Objective-C++",
"bytes": "15875"
},
{
"name": "Python",
"bytes": "3040"
},
{
"name": "Ruby",
"bytes": "232"
},
{
"name": "Shell",
"bytes": "10607"
}
],
"symlink_target": ""
} |
require 'test_helper'
class TodosControllerTest < ActionController::TestCase
setup do
@todo = todos(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:todos)
end
test "should get new" do
get :new
assert_response :success
end
test "should create todo" do
assert_difference('Todo.count') do
post :create, todo: { done: @todo.done, due: @todo.due, notes: @todo.notes, title: @todo.title }
end
assert_redirected_to todo_path(assigns(:todo))
end
test "should show todo" do
get :show, id: @todo
assert_response :success
end
test "should get edit" do
get :edit, id: @todo
assert_response :success
end
test "should update todo" do
patch :update, id: @todo, todo: { done: @todo.done, due: @todo.due, notes: @todo.notes, title: @todo.title }
assert_redirected_to todo_path(assigns(:todo))
end
test "should destroy todo" do
assert_difference('Todo.count', -1) do
delete :destroy, id: @todo
end
assert_redirected_to todos_path
end
end
| {
"content_hash": "79fd5e3e98dfd512aaad35919c1f9ff7",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 112,
"avg_line_length": 22.346938775510203,
"alnum_prop": 0.6566210045662101,
"repo_name": "mykia/tts_rails",
"id": "b3a9dc315df8b784b118b65ec3efa58229f475d8",
"size": "1095",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "ToDo_app/test/controllers/todos_controller_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7693"
},
{
"name": "CoffeeScript",
"bytes": "844"
},
{
"name": "HTML",
"bytes": "27469"
},
{
"name": "JavaScript",
"bytes": "2659"
},
{
"name": "Ruby",
"bytes": "92239"
}
],
"symlink_target": ""
} |
/*********************************************************************************************************************/
/* File Name: angsys.hpp */
/* Autor: Ing. Jesus Rocha <[email protected]>, July 2016. */
/* File description: this file declare all functions and clases for dynamic type naming and types conversions. */
/* Also it defines useful macros for the use of this functions and clases. */
/* */
/* Copyright (C) angsys, Jesus Angel Rocha Morales */
/* You may opt to use, copy, modify, merge, publish and/or distribute copies of the Software, and permit persons */
/* to whom the Software is furnished to do so. */
/* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
/* */
/*********************************************************************************************************************/
#ifndef __ANGSYS_HPP__
#error ...
#elif !defined __ANG_VALUE_HPP__
#define __ANG_VALUE_HPP__
namespace ang
{
template<typename T> class value_wrapper;
typedef value_wrapper<bool> boolean;
typedef value_wrapper<int> integer;
typedef value_wrapper<uint> uinteger;
typedef value_wrapper<long64> integer64;
typedef value_wrapper<ulong64> uinteger64;
typedef value_wrapper<float> floating;
typedef value_wrapper<double> floating64;
typedef object_wrapper<boolean> boolean_t;
typedef object_wrapper<integer> integer_t;
typedef object_wrapper<uinteger> uinteger_t;
typedef object_wrapper<integer64> integer64_t;
typedef object_wrapper<uinteger64> uinteger64_t;
typedef object_wrapper<floating> floating_t;
typedef object_wrapper<floating64> floating64_t;
template<typename T> struct value
{
public: /*type definitions*/
typedef T type;
private: /*members*/
type _value;
public: /*constructors*/
value() : _value() {}
value(type val) : _value(val) {}
value(value const& other) : _value(other._value) {}
value(value && other) : _value(ang::move(other._value)) {}
~value() {}
public: /*getters and setters*/
type & get() { return _value; }
type const& get()const { return _value; }
void set(type val) { _value = ang::move(val); }
public: /*operators*/
value& operator = (type val) { set(ang::move(val)); return*this; }
value& operator = (value const& val) { set(val._value); return*this; }
value& operator = (value && val) { set(ang::move(val._value)); return*this; }
operator type& () { return get(); }
operator type ()const { return get(); }
type* operator -> () { return &get(); }
type const* operator -> ()const { return &get(); }
value<type*> operator & () { return value<type*>(&get(), 1); }
value<type const*> operator & ()const { return value<type const*>(&get(), 1); }
};
template<typename T> struct value<const T>
{
public: /*type definitions*/
typedef T type;
private: /*members*/
const type _value;
public: /*constructors*/
value(type val) : _value(val) {}
value(value const& other) : _value(other._value) {}
~value() {}
public: /*getters and setters*/
type const& get()const { return _value; }
public: /*operators*/
operator type ()const { return get(); }
type const* operator -> ()const { return &get(); }
value<type const*> operator & ()const { return &get(); }
};
template<typename T> struct value<T&>
{
public: /*type definitions*/
typedef T type;
private: /*members*/
type& _value;
public: /*constructors*/
value(type& val) : _value(val) {}
value(value& other) : _value(other._value) {}
value(value<T>& other) : _value(other.get()) {}
~value() {}
public: /*getters and setters*/
type & get() { return _value; }
type const& get()const { return _value; }
void set(type val) { _value = ang::move(val); }
public: /*operators*/
value& operator = (type val) { set(ang::move(val)); return*this; }
value& operator = (value const& val) { set(val._value); return*this; }
value& operator = (value<T> val) { set(ang::move(val.get())); }
operator type& () { return get(); }
operator type ()const { return get(); }
type* operator -> () { return &get(); }
type const* operator -> ()const { return &get(); }
value<type*> operator & () { return &get(); }
value<type const*> operator & ()const { return &get(); }
};
template<typename T> struct value<const T&>
{
public: /*type definitions*/
typedef T type;
private: /*members*/
const type& _value;
public: /*constructors*/
value(type const& val) : _value(val) {}
value(value const& other) : _value(other._value) {}
~value() {}
public: /*getters and setters*/
type const& get()const { return _value; }
public: /*operators*/
operator type ()const { return get(); }
type const* operator -> ()const { return &get(); }
value<type const*> operator & ()const { return &get(); }
};
template<typename T> struct value<T*>
{
public: /*type definitions*/
typedef T* type;
private: /*members*/
type _value;
public: /*constructors*/
value() : _value(null) {}
value(type val, uint size) : _value(val) {}
value(ang::nullptr_t) : _value(null) {}
value(value<T>* val, uint size) : _value(&val->get()) {}
value(value const& other) : _value(other._value) {}
value(value && other) : _value(ang::move(other._value)) {}
~value() {}
public: /*getters and setters*/
type & get() { return _value; }
type const& get()const { return _value; }
void set(type val) { _value = ang::move(val); }
type data()const { return _value; }
public: /*operators*/
value& operator = (type val) { set(ang::move(val)); return*this; }
value& operator = (value const& val) { set(val._value); return*this; }
value& operator = (value && val) { set(ang::move(val._value)); return*this; }
operator type& () { return get(); }
operator type ()const { return get(); }
value<T>& operator * () { return *reinterpret_cast<value<T>*>(get()); }
value<T> const& operator * ()const { return *reinterpret_cast<value<T> const*>(get()); }
value<T**> operator & () { return &get(); }
//value<T *const*> operator & ()const { return &get(); }
};
template<typename T> struct value<T const*>
{
public: /*type definitions*/
typedef T const* type;
private: /*members*/
type _value;
public: /*constructors*/
value() : _value(null) {}
value(type val, uint size) : _value(val) {}
value(ang::nullptr_t) : _value(null) {}
value(value<T> const* val, uint size) : _value(&val->get()) {}
value(value const& other) : _value(other._value) {}
value(value && other) : _value(ang::move(other._value)) {}
~value() {}
public: /*getters and setters*/
type & get() { return _value; }
type const& get()const { return _value; }
void set(type val) { _value = ang::move(val); }
type data()const { return _value; }
public: /*operators*/
value& operator = (type val) { set(ang::move(val), 1); return*this; }
value& operator = (value const& val) { set(val._value); return*this; }
value& operator = (value && val) { set(ang::move(val._value)); return*this; }
operator type& () { return get(); }
operator type ()const { return get(); }
value<T const> & operator * () { return *reinterpret_cast<value<T const>*>((void*)get()); }
value<T const> const& operator * ()const { return *reinterpret_cast<value<T const> const*>((void*)get()); }
//value<T const**> operator & () { return &get(); }
//value<T const*const*> operator & ()const { return &get(); }
};
template<typename T> struct value<T**>
{
public: /*type definitions*/
typedef T** type;
private: /*members*/
type _value;
public: /*constructors*/
value() : _value() {}
value(type val) : _value(val) {}
value(ang::nullptr_t) : _value(null) {}
value(value const& other) : _value(other._value) {}
value(value && other) : _value(ang::move(other._value)) {}
~value() {}
public: /*getters and setters*/
type get()const { return _value; }
void set(type val) { _value = ang::move(val); }
public: /*operators*/
value& operator = (type val) { set(ang::move(val)); return*this; }
value& operator = (value const& val) { set(val._value); return*this; }
value& operator = (value && val) { set(ang::move(val._value)); return*this; }
operator type ()const { return get(); }
T*& operator * () { return *get(); }
};
template<typename T1, typename T2> inline bool value_compare_same(T1 const& arg1, T2 const& arg2) { return arg1 == arg2; }
template<typename T1, typename T2> inline bool value_compare_dif(T1 const& arg1, T2 const& arg2) { return arg1 != arg2; }
template<typename T1, typename T2> inline bool value_compare_same_ma(T1 const& arg1, T2 const& arg2) { return arg1 >= arg2; }
template<typename T1, typename T2> inline bool value_compare_same_mi(T1 const& arg1, T2 const& arg2) { return arg1 <= arg2; }
template<typename T1, typename T2> inline bool value_compare_ma(T1 const& arg1, T2 const& arg2) { return arg1 > arg2; }
template<typename T1, typename T2> inline bool value_compare_mi(T1 const& arg1, T2 const& arg2) { return arg1 < arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_add(T1 const& arg1, T2 const& arg2) { return arg1 + arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_sub(T1 const& arg1, T2 const& arg2) { return arg1 - arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_mul(T1 const& arg1, T2 const& arg2) { return arg1 * arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_div(T1 const& arg1, T2 const& arg2) { return arg1 / arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_add(value<T1> const& arg1, T2 const& arg2) { return arg1.get() + arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_sub(value<T1> const& arg1, T2 const& arg2) { return arg1.get() - arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_mul(value<T1> const& arg1, T2 const& arg2) { return arg1.get() * arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_div(value<T1> const& arg1, T2 const& arg2) { return arg1.get() / arg2; }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_add(T1 const& arg1, value<T2> const& arg2) { return arg1 + arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_sub(T1 const& arg1, value<T2> const& arg2) { return arg1 - arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_mul(T1 const& arg1, value<T2> const& arg2) { return arg1 * arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_div(T1 const& arg1, value<T2> const& arg2) { return arg1 / arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_add(value<T1> const& arg1, value<T2> const& arg2) { return arg1.get() + arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_sub(value<T1> const& arg1, value<T2> const& arg2) { return arg1.get() - arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_mul(value<T1> const& arg1, value<T2> const& arg2) { return arg1.get() * arg2.get(); }
template<typename T1, typename T2> inline typename operation_result<T1, T2>::type value_operation_div(value<T1> const& arg1, value<T2> const& arg2) { return arg1.get() / arg2.get(); }
template<typename T1, typename T2> inline bool operator == (value<T1> const& arg1, T2 arg2) { return value_compare_same(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator != (value<T1> const& arg1, T2 arg2) { return value_compare_dif(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator >= (value<T1> const& arg1, T2 arg2) { return value_compare_same_ma(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator <= (value<T1> const& arg1, T2 arg2) { return value_compare_same_mi(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator > (value<T1> const& arg1, T2 arg2) { return value_compare_ma(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator < (value<T1> const& arg1, T2 arg2) { return value_compare_mi(arg1.get(), arg2); }
template<typename T1, typename T2> inline bool operator == (T1 arg1, value<T2> const& arg2) { return value_compare_same(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator != (T1 arg1, value<T2> const& arg2) { return value_compare_dif(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator >= (T1 arg1, value<T2> const& arg2) { return value_compare_same_ma(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator <= (T1 arg1, value<T2> const& arg2) { return value_compare_same_mi(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator > (T1 arg1, value<T2> const& arg2) { return value_compare_ma(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator < (T1 arg1, value<T2> const& arg2) { return value_compare_mi(arg1, arg2.get()); }
template<typename T1, typename T2> inline bool operator == (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_same(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline bool operator != (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_dif(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline bool operator >= (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_same_ma(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline bool operator <= (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_same_mi(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline bool operator > (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_ma(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline bool operator < (value<T1> const& arg1, value<T2> const& arg2) { return value_compare_mi(arg1.get(), arg2.get()); }
template<typename T1, typename T2> inline auto operator + (value<T1> const& arg1, T2 arg2)->value<decltype(T1() + T2())> { return value_operation_add(arg1, arg2); }
template<typename T1, typename T2> inline auto operator - (value<T1> const& arg1, T2 arg2)->value<decltype(T1() - T2())> { return value_operation_sub(arg1, arg2); }
template<typename T1, typename T2> inline auto operator * (value<T1> const& arg1, T2 arg2)->value<decltype(T1() * T2())> { return value_operation_mul(arg1, arg2); }
template<typename T1, typename T2> inline auto operator / (value<T1> const& arg1, T2 arg2)->value<decltype(T1() / T2())> { return value_operation_div(arg1, arg2); }
template<typename T1, typename T2> inline auto operator + (T1 arg1, value<T2> const& arg2)->value<decltype(T1() + T2())> { return value_operation_add(arg1, arg2); }
template<typename T1, typename T2> inline auto operator - (T1 arg1, value<T2> const& arg2)->value<decltype(T1() - T2())> { return value_operation_sub(arg1, arg2); }
template<typename T1, typename T2> inline auto operator * (T1 arg1, value<T2> const& arg2)->value<decltype(T1() * T2())> { return value_operation_mul(arg1, arg2); }
template<typename T1, typename T2> inline auto operator / (T1 arg1, value<T2> const& arg2)->value<decltype(T1() / T2())> { return value_operation_div(arg1, arg2); }
template<typename T1, typename T2> inline auto operator + (value<T1> const& arg1, value<T2> const& arg2)->value<decltype(T1() + T2())> { return value_operation_add(arg1, arg2); }
template<typename T1, typename T2> inline auto operator - (value<T1> const& arg1, value<T2> const& arg2)->value<decltype(T1() - T2())> { return value_operation_sub(arg1, arg2); }
template<typename T1, typename T2> inline auto operator * (value<T1> const& arg1, value<T2> const& arg2)->value<decltype(T1() * T2())> { return value_operation_mul(arg1, arg2); }
template<typename T1, typename T2> inline auto operator / (value<T1> const& arg1, value<T2> const& arg2)->value<decltype(T1() / T2())> { return value_operation_div(arg1, arg2); }
template<typename T>
class value_wrapper
: public object
, public value<T>
{
public:
value_wrapper();
value_wrapper(T const& val);
value_wrapper(value<T> const& other);
value_wrapper(value_wrapper const& other);
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
private:
virtual~value_wrapper();
};
template<typename T>
class object_wrapper<value_wrapper<T>>
{
public:
typedef value_wrapper<T> type;
private:
type* _ptr;
public:
object_wrapper();
object_wrapper(type*);
object_wrapper(value<T> const&);
object_wrapper(object_wrapper &&);
object_wrapper(object_wrapper const&);
object_wrapper(ang::nullptr_t const&);
~object_wrapper();
public:
void clean();
void clean_unsafe();
bool is_empty()const;
type* get(void)const;
void set(type*);
type ** addres_of(void);
public:
object_wrapper& operator = (type*);
object_wrapper& operator = (value<T> const&);
object_wrapper& operator = (object_wrapper &&);
object_wrapper& operator = (object_wrapper const&);
object_wrapper_ptr<type> operator & (void);
T * operator -> (void);
T const* operator -> (void)const;
explicit operator T& (void);
explicit operator T const& (void)const;
inline operator objptr (void)const { return (object*)get(); }
operator T* (void);
operator T const* (void)const;
operator type * (void);
operator type const* (void)const;
friend safe_pointer;
};
template<typename T>
void swap(object_wrapper<T>& a, object_wrapper<T>&b) {
swap<wsize>(*reinterpret_cast<wsize*>(a.addres_of()), *reinterpret_cast<wsize*>(b.addres_of()));
}
template<typename T>
void swap(intf_wrapper<T>& a, intf_wrapper<T>&b) {
swap<wsize>(*reinterpret_cast<wsize*>(a.addres_of()), *reinterpret_cast<wsize*>(b.addres_of()));
}
template<> class LINK value_wrapper<bool> final
: public object
, public value<bool>
{
public:
static value<bool> parse(cstr_t);
static value<bool> parse(cwstr_t);
static string to_string(value<bool>);
static wstring to_wstring(value<bool>);
public:
value_wrapper();
value_wrapper(bool val);
value_wrapper(boolean const& other);
value_wrapper(value<bool> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<int> final
: public object
, public value<int>
{
public:
static value<int> parse(cstr_t, int base = 10);
static value<int> parse(cwstr_t, int base = 10);
static string to_string(value<int>);
static wstring to_wstring(value<int>);
static string to_string(value<int>, text::text_format_t format);
static wstring to_wstring(value<int>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(int val);
value_wrapper(integer const& other);
value_wrapper(value<int> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<uint> final
: public object
, public value<uint>
{
public:
static value<uint> parse(cstr_t, int base = 10);
static value<uint> parse(cwstr_t, int base = 10);
static string to_string(value<uint>);
static wstring to_wstring(value<uint>);
static string to_string(value<uint>, text::text_format_t format);
static wstring to_wstring(value<uint>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(uint val);
value_wrapper(uinteger const& other);
value_wrapper(value<uint> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<long64> final
: public object
, public value<long64>
{
public:
static value<long64> parse(cstr_t, int base = 10);
static value<long64> parse(cwstr_t, int base = 10);
static string to_string(value<long64>);
static wstring to_wstring(value<long64>);
static string to_string(value<long64>, text::text_format_t format);
static wstring to_wstring(value<long64>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(long64 val);
value_wrapper(integer64 const& other);
value_wrapper(value<long64> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<ulong64> final
: public object
, public value<ulong64>
{
public:
static value<ulong64> parse(cstr_t, int base = 10);
static value<ulong64> parse(cwstr_t, int base = 10);
static string to_string(value<ulong64>);
static wstring to_wstring(value<ulong64>);
static string to_string(value<ulong64>, text::text_format_t format);
static wstring to_wstring(value<ulong64>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(ulong64 val);
value_wrapper(uinteger64 const& other);
value_wrapper(value<ulong64> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<float> final
: public object
, public value<float>
{
public:
static value<float> parse(cstr_t);
static value<float> parse(cwstr_t);
static string to_string(value<float>);
static wstring to_wstring(value<float>);
static string to_string(value<float>, text::text_format_t format);
static wstring to_wstring(value<float>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(float val);
value_wrapper(floating const& other);
value_wrapper(value<float> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
template<> class LINK value_wrapper<double> final
: public object
, public value<double>
{
public:
static value<double> parse(cstr_t);
static value<double> parse(cwstr_t);
static string to_string(value<double>);
static wstring to_wstring(value<double>);
static string to_string(value<double>, text::text_format_t format);
static wstring to_wstring(value<double>, text::text_format_t format);
public:
value_wrapper();
value_wrapper(double val);
value_wrapper(floating64 const& other);
value_wrapper(value<double> const& other);
template<typename T>
value_wrapper(value<T> const& other) : value(other.get()) {}
public:
ANG_DECLARE_INTERFACE();
string to_string()const override;
string to_string(text::text_format_t)const;
private:
virtual~value_wrapper();
};
inline integer_t operator "" _i(ulong64 value) { return new integer((int)value); }
inline uinteger_t operator "" _ui(ulong64 value) { return new uinteger((uint)value); }
inline integer64_t operator "" _l(ulong64 value) { return new integer64((long64)value); }
inline integer64_t operator "" _li(ulong64 value) { return new integer64((long64)value); }
inline uinteger64_t operator "" _ul(ulong64 value) { return new uinteger64((ulong64)value); }
inline uinteger64_t operator "" _uli(ulong64 value) { return new uinteger64((ulong64)value); }
inline floating_t operator "" _f(ulong64 value) { return new floating((float)(long64)value); }
inline floating_t operator "" _f(long double value) { return new floating((float)value); }
inline floating64_t operator "" _lf(ulong64 value) { return new floating64((double)(long64)value); }
inline floating64_t operator "" _lf(long double value) { return new floating64((double)value); }
namespace runtime
{
template<class T>
struct runtime_type_builder<value<T>>
{
typedef T type;
static inline type_name_t type_of() {
return runtime_type_builder<type>::type_of();
}
static inline bool is_type_of(type_name_t name) {
return runtime_type_builder<type>::is_type_of(name);
}
template<typename new_t>
static inline auto interface_cast(void* _old) {
return runtime_type_builder<type>::template interface_cast<new_t>(_old);
}
};
}
}
#endif//__ANG_BUFFER_HPP__ | {
"content_hash": "a80bde28cebc693449b69c793b952487",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 184,
"avg_line_length": 40.309859154929576,
"alnum_prop": 0.6608432331702772,
"repo_name": "ChuyX3/angsys",
"id": "96129de071e547c75f9d67d27fc60d0808ccb2b7",
"size": "25758",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "branch/old_angsys/angsys_beta2/include/angsys/ang/value.hpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "388439"
},
{
"name": "C++",
"bytes": "14522973"
},
{
"name": "HLSL",
"bytes": "38588"
},
{
"name": "Makefile",
"bytes": "10143"
},
{
"name": "Objective-C",
"bytes": "1382"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Crystal SDK 2.1 for iOS: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.3 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Crystal SDK 2.1 for iOS <span id="projectnumber">Version 2.1 build 0221</span></div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<h1><CrystalAchievementDelegate> Member List</h1> </div>
</div>
<div class="contents">
This is the complete list of members for <a class="el" href="protocol_crystal_achievement_delegate-p.html"><CrystalAchievementDelegate></a>, including all inherited members.<table>
<tr class="memlist"><td>- </td><td><a class="el" href="protocol_crystal_achievement_delegate-p.html#ad9ebb90cae56da413d9359c237e63e0c">crystalAchievementsUpdated</a></td><td><a class="el" href="protocol_crystal_achievement_delegate-p.html"><CrystalAchievementDelegate></a></td><td></td></tr>
</table></div>
<hr class="footer"/><address class="footer"><small>Generated on Thu May 5 2011 10:07:57 for Crystal SDK 2.1 for iOS by 
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
| {
"content_hash": "da23ded7250bb4fbad2ff2a40212b42e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 304,
"avg_line_length": 46.36538461538461,
"alnum_prop": 0.6603069265864786,
"repo_name": "srr313/PinataSmash-Open",
"id": "84fcc7e3f1e875687fd3a8caff4251efd9642b78",
"size": "2411",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "CrystalSDK_2.1_build-0221_sdk-4.3/Documentation/com.chillingo.ios.crystalsdk.docset/Contents/Resources/Documents/protocol_crystal_achievement_delegate-p-members.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "23440"
},
{
"name": "C#",
"bytes": "140953"
},
{
"name": "C++",
"bytes": "706"
},
{
"name": "CSS",
"bytes": "48777"
},
{
"name": "Objective-C",
"bytes": "1327901"
},
{
"name": "Perl",
"bytes": "6644"
},
{
"name": "Racket",
"bytes": "10388"
},
{
"name": "Shell",
"bytes": "181"
}
],
"symlink_target": ""
} |
(function (jQuery) {
var $ = jQuery;
var animate = jQuery.fn.animate;
jQuery.fn.animate = function(){
//Extract the animation properties from the arguments list, and use jQuery.speed to identify the remaining parameters
var props = arguments[0];
var opts = jQuery.speed(arguments[1], arguments[2], arguments[3]);
//opts.queue = false;
return this.each(function(i, el){
var elem, clone, height, width, changed, options, callback;
//Create a copy of the element, then measure it's height and width if they were "auto"
elem = $(el);
clone = elem.clone().css({height:'auto', width:'auto'}).appendTo(elem.parent());
height = clone.height();
width = clone.width();
clone.remove();
//Temporarily change the height and width property if the original parameters had them listed as "auto"
changed = {};
if (props.height && props.height === 'auto') {
changed.height = props.height = height;
}
if (props.width && props.width === 'auto') {
changed.width = props.width = width;
}
//Wrap the callback in function that ensures the height/width is reset to "auto" after the animation is over
options = $.extend(true, {}, opts);
if (options.complete) {
callback = options.complete;
options.complete = function() {
//Reset the height/width css properties to "auto"
for (var x in changed) {
elem.css(x, 'auto');
}
callback.call(elem);
};
}
//Do the animation
animate.call(elem, props, options);
});
}
}(jQuery)); | {
"content_hash": "eb23d77e29465fc318e58454968e5260",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 119,
"avg_line_length": 31.6875,
"alnum_prop": 0.6495726495726496,
"repo_name": "darcyclarke/jQuery-Animate-Auto-Plugin",
"id": "fbaef0c512e4fc149ee62d810a687d8024d5944b",
"size": "1752",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "animate_auto.jquery.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "1752"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<Tokens version="1.0">
<File path="Classes/AWSS3Condition.html">
<Token>
<TokenIdentifier>//apple_ref/occ/cl/AWSS3Condition</TokenIdentifier>
<Abstract type="html"></Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSS3Condition/setHttpErrorCodeReturnedEquals:</TokenIdentifier>
<Abstract type="html">The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *httpErrorCodeReturnedEquals</Declaration>
<Anchor>//api/name/httpErrorCodeReturnedEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSS3Condition/httpErrorCodeReturnedEquals</TokenIdentifier>
<Abstract type="html">The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *httpErrorCodeReturnedEquals</Declaration>
<Anchor>//api/name/httpErrorCodeReturnedEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instp/AWSS3Condition/httpErrorCodeReturnedEquals</TokenIdentifier>
<Abstract type="html">The HTTP error code when the redirect is applied. In the event of an error, if the error code equals this value, then the specified redirect is applied. Required when parent element Condition is specified and sibling KeyPrefixEquals is not specified. If both are specified, then both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *httpErrorCodeReturnedEquals</Declaration>
<Anchor>//api/name/httpErrorCodeReturnedEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSS3Condition/setKeyPrefixEquals:</TokenIdentifier>
<Abstract type="html">The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *keyPrefixEquals</Declaration>
<Anchor>//api/name/keyPrefixEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instm/AWSS3Condition/keyPrefixEquals</TokenIdentifier>
<Abstract type="html">The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *keyPrefixEquals</Declaration>
<Anchor>//api/name/keyPrefixEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
<Token>
<TokenIdentifier>//apple_ref/occ/instp/AWSS3Condition/keyPrefixEquals</TokenIdentifier>
<Abstract type="html">The object key name prefix when the redirect is applied. For example, to redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. To redirect request for all pages with the prefix docs/, the key prefix will be /docs, which identifies all objects in the docs/ folder. Required when the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals is not specified. If both conditions are specified, both must be true for the redirect to be applied.</Abstract>
<DeclaredIn>AWSS3Model.h</DeclaredIn>
<Declaration>@property (nonatomic, strong) NSString *keyPrefixEquals</Declaration>
<Anchor>//api/name/keyPrefixEquals</Anchor>
<NodeRef refid="1065"/>
</Token>
</File>
</Tokens> | {
"content_hash": "7741301c88cee4c57d089152f46fa065",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 524,
"avg_line_length": 57.477777777777774,
"alnum_prop": 0.7488884593079451,
"repo_name": "davidbutz/ChristmasFamDuels",
"id": "eb8cf1bae7f44e2e8299b5e4c9dee0102cf85666",
"size": "5173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "iOS/frameworks/aws-ios-sdk-2.4.1/documentation/com.amazon.aws.ios.docset/Contents/Resources/Tokens1065.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "211"
},
{
"name": "CSS",
"bytes": "77"
},
{
"name": "HTML",
"bytes": "330"
},
{
"name": "JavaScript",
"bytes": "212297"
},
{
"name": "Objective-C",
"bytes": "3465743"
},
{
"name": "Ruby",
"bytes": "461"
},
{
"name": "Shell",
"bytes": "2569"
},
{
"name": "Swift",
"bytes": "325330"
}
],
"symlink_target": ""
} |
/**
* @file ump_kernel_license.h
* Defines for the macro MODULE_LICENSE.
*/
#ifndef __UMP_KERNEL_LICENSE_H__
#define __UMP_KERNEL_LICENSE_H__
#ifdef __cplusplus
extern "C"
{
#endif
#define UMP_KERNEL_LINUX_LICENSE "GPL"
#define UMP_LICENSE_IS_GPL 1
#ifdef __cplusplus
}
#endif
#endif /* __UMP_KERNEL_LICENSE_H__ */
| {
"content_hash": "4f2c6bc3ace45d613ed16013dfda373e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 42,
"avg_line_length": 14.304347826086957,
"alnum_prop": 0.6595744680851063,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "17b930d2c572e7d2eb0d2ac077791faba78c8196",
"size": "826",
"binary": false,
"copies": "757",
"ref": "refs/heads/master",
"path": "lichee/linux-3.4/modules/mali/DX910-SW-99002-r3p2-01rel1/driver/src/devicedrv/ump/linux/license/gpl/ump_kernel_license.h",
"mode": "33261",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
"""@package src.wi.views.user.user
@author Piotr Wójcik
@date 31.01.2014
"""
from django.contrib import messages
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
from django.views.decorators.csrf import csrf_protect
from wi.commontags.templatetags.templatetags import filesizeformatmb
from wi.forms.user import CMAuthenticationForm, HelpForm, PasswordChangeForm, \
AccountDataEdit
from wi.utils import get_dict_from_list, messages_ajax
from wi.utils.decorators import django_view, user_permission
from wi.utils.exceptions import RestErrorException
from wi.utils.messages_ajax import ajax_request
from wi.utils.messages_codes import get_message
from wi.utils.states import message_levels_reversed
from wi.utils.views import prep_data
@django_view
@user_permission
def change_cm(request, cm_id, success_url='mai_main'):
"""
View changing used CM.
"""
request.session['user'].cm_id = int(cm_id)
request.session.modified = True
messages.success(request, _('Cluster Manager changed.'))
return redirect(request.META['HTTP_REFERER'] or success_url)
@django_view
@ajax_request
@user_permission
def get_messages(request):
"""
Ajax view fetching user messages.
"""
if request.method == 'POST':
response = prep_data('user/message/get_list/', request.session)
for item in response:
item['text'] = get_message(item['code'], item['params'])
item['level'] = message_levels_reversed[item['level']]
return messages_ajax.success(response)
@django_view
@ajax_request
@user_permission
def acc_ajax_get_user_data(request):
"""
Ajax view. Returns user account data.
"""
if request.method == 'GET':
rest_data = prep_data({'user': 'user/user/get_my_data/',
'cms': 'guest/cluster/list_names/'
}, request.session)
user_data = rest_data['user']
users_cm = get_dict_from_list(rest_data['cms'], user_data['default_cluster_id'], key='cluster_id')
if users_cm is None:
raise Exception('User\'s default_cluster_id=%d is not a valid CM id.' % user_data['default_cluster_id'])
user_data['default_cluster_id'] = users_cm['name']
return messages_ajax.success(user_data)
@django_view
@ajax_request
@user_permission
@csrf_protect
def acc_ajax_account_data_edit(request, template_name='generic/form.html', form_class=AccountDataEdit):
"""
Ajax view for user account data editing.
"""
rest_data = prep_data({'cms': 'guest/cluster/list_names/'}, request.session)
if request.method == 'POST':
form = form_class(data=request.POST, rest_data=rest_data)
if form.is_valid():
prep_data({'user': ('user/user/edit/', form.cleaned_data)}, request.session)
request.session['user'].email = form.cleaned_data['email']
request.session['user'].default_cluster_id = form.cleaned_data['default_cluster_id']
request.session.modified = True
return messages_ajax.success(_('Account data edited.'))
else:
form = form_class(data={'email': request.session['user'].email,
'default_cluster_id': request.session['user'].default_cluster_id}, rest_data=rest_data)
return messages_ajax.success(render_to_string(template_name, {'form': form,
'text': '',
'confirmation': _('Save')},
context_instance=RequestContext(request)),
status=1)
@django_view
@ajax_request
@user_permission
def acc_ajax_get_user_quotas(request):
"""
Ajax view for fetching users' quotas.
"""
if request.method == 'GET':
quota = prep_data('user/user/check_quota/', request.session)
quota['memory'] = filesizeformatmb(quota['memory'])
quota['used_memory'] = filesizeformatmb(quota['used_memory'])
quota['storage'] = filesizeformatmb(quota['storage'])
quota['used_storage'] = filesizeformatmb(quota['used_storage'])
return messages_ajax.success(quota)
@django_view
@csrf_protect
@user_permission
def acc_password_change(request, template_name='account/password_change_form.html', password_change_form=PasswordChangeForm):
"""
View for password changing (for logged users).
"""
if request.method == "POST":
form = password_change_form(user=request.session['user'], data=request.POST)
if form.is_valid():
new_password = form.cleaned_data['new_password1']
try:
prep_data(('user/user/set_password/', {'new_password': new_password}), request.session)
except RestErrorException as ex:
messages.error(request, ex.value)
request.session['user'].set_password(new_password)
request.session.modified = True
return redirect('acc_password_change_done')
else:
form = password_change_form(user=request.session['user'])
return render_to_response(template_name, {'form': form}, context_instance=RequestContext(request))
@django_view
@user_permission
def hlp_form(request, form_class=HelpForm, template_name='help/form.html'):
"""
View handling help form.
"""
if request.method == 'POST':
form = form_class(data=request.POST)
if form.is_valid():
topic, issue, email = form.cleaned_data['topic'], form.cleaned_data['issue'], form.cleaned_data['email']
name = str(request.session.get('user', form.cleaned_data['firstlast']))
topic += _(' from user:') + name + ', email: ' + email
dictionary = {'issue': issue,
'topic': topic}
try:
prep_data(('user/user/send_issue/', dictionary), request.session)
except Exception:
return redirect('hlp_issue_error')
return redirect('hlp_issue_sent')
else:
form = form_class()
rest_data = prep_data('guest/user/is_mailer_active/', request.session)
return render_to_response(template_name, dict({'form': form}.items() + rest_data.items()),
context_instance=RequestContext(request))
| {
"content_hash": "e6df216b37579c8ef7411ba725715d62",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 125,
"avg_line_length": 37.07954545454545,
"alnum_prop": 0.6259577076310144,
"repo_name": "cc1-cloud/cc1",
"id": "779ca94f3295938fb0f803a6dd3397114bd47169",
"size": "7225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/wi/views/user/user.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "63829"
},
{
"name": "HTML",
"bytes": "323260"
},
{
"name": "JavaScript",
"bytes": "458924"
},
{
"name": "Python",
"bytes": "1466456"
},
{
"name": "Shell",
"bytes": "14317"
}
],
"symlink_target": ""
} |
var Event, User, async, cozydb, log, momentTz,
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
cozydb = require('cozydb');
momentTz = require('moment-timezone');
async = require('async');
log = require('printit')({
prefix: 'event:model'
});
User = require('./user');
module.exports = Event = cozydb.getModel('Event', {
start: {
type: String
},
end: {
type: String
},
place: {
type: String
},
details: {
type: String
},
description: {
type: String
},
rrule: {
type: String
},
tags: [String],
attendees: {
type: [Object]
},
related: {
type: String,
"default": null
},
timezone: {
type: String
},
alarms: {
type: [Object]
},
created: {
type: String
},
lastModification: {
type: String
}
});
Event.dateFormat = 'YYYY-MM-DD';
Event.ambiguousDTFormat = 'YYYY-MM-DD[T]HH:mm:00.000';
Event.utcDTFormat = 'YYYY-MM-DD[T]HH:mm:00.000[Z]';
Event.alarmTriggRegex = /(\+?|-)PT?(\d+)(W|D|H|M|S)/;
require('cozy-ical').decorateEvent(Event);
Event.byCalendar = function(calendarId, callback) {
return Event.request('byCalendar', {
key: calendarId
}, callback);
};
Event.tags = function(callback) {
return Event.rawRequest("tags", {
group: true
}, function(err, results) {
var out, result, tag, type, _i, _len, _ref;
if (err) {
return callback(err);
}
out = {
calendar: [],
tag: []
};
for (_i = 0, _len = results.length; _i < _len; _i++) {
result = results[_i];
_ref = result.key, type = _ref[0], tag = _ref[1];
out[type].push(tag);
}
return callback(null, out);
});
};
Event.createOrGetIfImport = function(data, callback) {
if (data["import"]) {
return Event.request('byDate', {
key: data.start
}, function(err, events) {
if (err) {
log.error(err);
return Event.create(data, callback);
} else if (events.length === 0) {
return Event.create(data, callback);
} else if (data.description === events[0].description) {
log.warn('Event already exists, it was not created.');
return callback(null, events[0]);
} else {
return Event.create(data, callback);
}
});
} else {
return Event.create(data, callback);
}
};
Event.prototype.isAllDayEvent = function() {
return this.start.length === 10;
};
Event.prototype.formatStart = function(dateFormat) {
var date, formattedDate;
if (this.rrule) {
date = momentTz.tz(this.start, this.timezone);
} else {
date = momentTz(this.start);
}
date.tz(User.timezone);
formattedDate = date.format(dateFormat);
if (!this.isAllDayEvent()) {
formattedDate += " (" + User.timezone + ")";
}
return formattedDate;
};
Event.prototype.getGuest = function(key) {
var currentguest, guests;
guests = this.attendees || [];
currentguest = guests.filter(function(guest) {
return guest.key === key;
})[0];
if (currentguest) {
currentguest.setStatus = (function(_this) {
return function(status, callback) {
currentguest.status = status;
return _this.updateAttributes({
attendees: guests
}, callback);
};
})(this);
}
return currentguest;
};
Event.prototype.getAlarmAttendeesEmail = function() {
return [User.email];
};
Event.prototype.migrateDoctype = function(callback) {
var hasMigrate;
hasMigrate = this.migrateDateTime('start');
if (!hasMigrate) {
return callback();
} else {
this.migrateDateTime('end');
if (this.rrule) {
this.timezone = User.timezone;
} else {
this.timezone = void 0;
}
return this.save(callback);
}
};
Event.prototype.migrateDateTime = function(dateField) {
var d, dateStr, m, timezone;
dateStr = this[dateField];
if (!dateStr) {
return false;
}
if (dateStr.length === 10 || dateStr.charAt(10) === 'T') {
return false;
}
d = dateStr;
if (__indexOf.call(dateStr, "GMT") < 0) {
d = d + " GMT+0000";
}
m = momentTz.tz(d, 'UTC');
if (this.rrule) {
timezone = User.timezone || "Europe/Paris";
this[dateField] = m.tz(timezone).format(Event.ambiguousDTFormat);
} else {
this[dateField] = m.format(Event.utcDTFormat);
}
return true;
};
Event.prototype.patchTag = function(callback) {
if ((this.tags == null) || (this.tags[0] == null)) {
return this.updateAttributes({
tags: ['my-calendar']
}, callback);
} else {
return callback();
}
};
Event.migrateAll = function(callback) {
return Event.all({}, function(err, events) {
if (err != null) {
console.log(err);
return callback();
} else {
return async.eachLimit(events, 10, function(event, done) {
return event.migrateDoctype(function() {
return event.patchTag(done);
});
}, callback);
}
});
};
Event.bulkCalendarRename = function(oldName, newName, callback) {
return Event.request('byCalendar', {
key: oldName
}, function(err, events) {
return async.eachLimit(events, 10, function(event, done) {
var tags;
tags = [].concat(event.tags);
tags[0] = newName;
return event.updateAttributes({
tags: tags
}, done);
}, function(err) {
return callback(err, events);
});
});
};
Event.bulkDelete = function(calendarName, callback) {
return Event.request('byCalendar', {
key: calendarName
}, function(err, events) {
return async.eachLimit(events, 10, function(event, done) {
return event.destroy(done);
}, function(err) {
return callback(err, events);
});
});
};
| {
"content_hash": "f711d08c9d8bc9c32a7f6e00d194f6f2",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 152,
"avg_line_length": 22.995983935742974,
"alnum_prop": 0.5937827453719874,
"repo_name": "aenario/cozy-agenda",
"id": "1c4bdda8ed679e941465668578be74ec6f5af226",
"size": "5761",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "build/server/models/event.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "260035"
},
{
"name": "CoffeeScript",
"bytes": "220760"
},
{
"name": "HTML",
"bytes": "40917"
},
{
"name": "JavaScript",
"bytes": "1628710"
}
],
"symlink_target": ""
} |
package e2e
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
"os/exec"
"path"
"strings"
"sync"
"time"
"k8s.io/kubernetes/pkg/api"
client "k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/util/wait"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
// realVersion turns a version constant s into a version string deployable on
// GKE. See hack/get-build.sh for more information.
func realVersion(s string) (string, error) {
v, _, err := runCmd(path.Join(testContext.RepoRoot, "hack/get-build.sh"), "-v", s)
if err != nil {
return v, err
}
return strings.TrimPrefix(strings.TrimSpace(v), "v"), nil
}
// The following upgrade functions are passed into the framework below and used
// to do the actual upgrades.
var masterUpgrade = func(v string) error {
switch testContext.Provider {
case "gce":
return masterUpgradeGCE(v)
case "gke":
return masterUpgradeGKE(v)
default:
return fmt.Errorf("masterUpgrade() is not implemented for provider %s", testContext.Provider)
}
}
func masterUpgradeGCE(rawV string) error {
v := "v" + rawV
_, _, err := runCmd(path.Join(testContext.RepoRoot, "cluster/gce/upgrade.sh"), "-M", v)
return err
}
func masterUpgradeGKE(v string) error {
Logf("Upgrading master to %q", v)
_, _, err := runCmd("gcloud", "container",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone),
"clusters",
"upgrade",
testContext.CloudConfig.Cluster,
"--master",
fmt.Sprintf("--cluster-version=%s", v),
"--quiet")
return err
}
var nodeUpgrade = func(f *Framework, replicas int, v string) error {
// Perform the upgrade.
var err error
switch testContext.Provider {
case "gce":
err = nodeUpgradeGCE(v)
case "gke":
err = nodeUpgradeGKE(v)
default:
err = fmt.Errorf("nodeUpgrade() is not implemented for provider %s", testContext.Provider)
}
if err != nil {
return err
}
// Wait for it to complete and validate nodes and pods are healthy.
//
// TODO(ihmccreery) We shouldn't have to wait for nodes to be ready in
// GKE; the operation shouldn't return until they all are.
Logf("Waiting up to %v for all nodes to be ready after the upgrade", restartNodeReadyAgainTimeout)
if _, err := checkNodesReady(f.Client, restartNodeReadyAgainTimeout, testContext.CloudConfig.NumNodes); err != nil {
return err
}
Logf("Waiting up to %v for all pods to be running and ready after the upgrade", restartPodReadyAgainTimeout)
return waitForPodsRunningReady(f.Namespace.Name, replicas, restartPodReadyAgainTimeout)
}
func nodeUpgradeGCE(rawV string) error {
// TODO(ihmccreery) This code path should be identical to how a user
// would trigger a node update; right now it's very different.
v := "v" + rawV
Logf("Preparing node upgrade by creating new instance template for %q", v)
stdout, _, err := runCmd(path.Join(testContext.RepoRoot, "cluster/gce/upgrade.sh"), "-P", v)
if err != nil {
return err
}
tmpl := strings.TrimSpace(stdout)
Logf("Performing a node upgrade to %q; waiting at most %v per node", tmpl, restartPerNodeTimeout)
if err := migRollingUpdate(tmpl, restartPerNodeTimeout); err != nil {
return fmt.Errorf("error doing node upgrade via a migRollingUpdate to %s: %v", tmpl, err)
}
return nil
}
func nodeUpgradeGKE(v string) error {
Logf("Upgrading nodes to %q", v)
_, _, err := runCmd("gcloud", "container",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone),
"clusters",
"upgrade",
testContext.CloudConfig.Cluster,
fmt.Sprintf("--cluster-version=%s", v),
"--quiet")
return err
}
var _ = Describe("Upgrade [Feature:Upgrade]", func() {
svcName, replicas := "baz", 2
var rcName, ip, v string
var ingress api.LoadBalancerIngress
BeforeEach(func() {
// The version is determined once at the beginning of the test so that
// the master and nodes won't be skewed if the value changes during the
// test.
By(fmt.Sprintf("Getting real version for %q", testContext.UpgradeTarget))
var err error
v, err = realVersion(testContext.UpgradeTarget)
expectNoError(err)
Logf("Version for %q is %q", testContext.UpgradeTarget, v)
})
f := NewDefaultFramework("cluster-upgrade")
var w *ServiceTestFixture
BeforeEach(func() {
By("Setting up the service, RC, and pods")
w = NewServerTest(f.Client, f.Namespace.Name, svcName)
rc := w.CreateWebserverRC(replicas)
rcName = rc.ObjectMeta.Name
svc := w.BuildServiceSpec()
svc.Spec.Type = api.ServiceTypeLoadBalancer
w.CreateService(svc)
By("Waiting for the service to become reachable")
result, err := waitForLoadBalancerIngress(f.Client, svcName, f.Namespace.Name)
Expect(err).NotTo(HaveOccurred())
ingresses := result.Status.LoadBalancer.Ingress
if len(ingresses) != 1 {
Failf("Was expecting only 1 ingress IP but got %d (%v): %v", len(ingresses), ingresses, result)
}
ingress = ingresses[0]
Logf("Got load balancer ingress point %v", ingress)
ip = ingress.IP
if ip == "" {
ip = ingress.Hostname
}
testLoadBalancerReachable(ingress, 80)
// TODO(mikedanese): Add setup, validate, and teardown for:
// - secrets
// - volumes
// - persistent volumes
})
AfterEach(func() {
w.Cleanup()
})
Describe("master upgrade", func() {
It("should maintain responsive services [Feature:MasterUpgrade]", func() {
By("Validating cluster before master upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
By("Performing a master upgrade")
testUpgrade(ip, v, masterUpgrade)
By("Checking master version")
expectNoError(checkMasterVersion(f.Client, v))
By("Validating cluster after master upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
})
})
Describe("node upgrade", func() {
var tmplBefore, tmplAfter string
BeforeEach(func() {
if providerIs("gce") {
By("Getting the node template before the upgrade")
var err error
tmplBefore, err = migTemplate()
expectNoError(err)
}
})
AfterEach(func() {
if providerIs("gce") {
By("Cleaning up any unused node templates")
var err error
tmplAfter, err = migTemplate()
if err != nil {
Logf("Could not get node template post-upgrade; may have leaked template %s", tmplBefore)
return
}
if tmplBefore == tmplAfter {
// The node upgrade failed so there's no need to delete
// anything.
Logf("Node template %s is still in use; not cleaning up", tmplBefore)
return
}
Logf("Deleting node template %s", tmplBefore)
if _, _, err := retryCmd("gcloud", "compute", "instance-templates",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
"delete",
tmplBefore); err != nil {
Logf("gcloud compute instance-templates delete %s call failed with err: %v", tmplBefore, err)
Logf("May have leaked instance template %q", tmplBefore)
}
}
})
It("should maintain a functioning cluster [Feature:NodeUpgrade]", func() {
By("Validating cluster before node upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
By("Performing a node upgrade")
// Circumnavigate testUpgrade, since services don't necessarily stay up.
Logf("Starting upgrade")
expectNoError(nodeUpgrade(f, replicas, v))
Logf("Upgrade complete")
By("Checking node versions")
expectNoError(checkNodesVersions(f.Client, v))
By("Validating cluster after node upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
})
It("should maintain responsive services [Feature:ExperimentalNodeUpgrade]", func() {
By("Validating cluster before node upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
By("Performing a node upgrade")
testUpgrade(ip, v, func(v string) error {
return nodeUpgrade(f, replicas, v)
})
By("Checking node versions")
expectNoError(checkNodesVersions(f.Client, v))
By("Validating cluster after node upgrade")
expectNoError(validate(f, svcName, rcName, ingress, replicas))
})
})
})
func testUpgrade(ip, v string, upF func(v string) error) {
Logf("Starting async validation")
httpClient := http.Client{Timeout: 2 * time.Second}
done := make(chan struct{}, 1)
// Let's make sure we've finished the heartbeat before shutting things down.
var wg sync.WaitGroup
go wait.Until(func() {
defer GinkgoRecover()
wg.Add(1)
defer wg.Done()
if err := wait.Poll(poll, singleCallTimeout, func() (bool, error) {
r, err := httpClient.Get("http://" + ip)
if err != nil {
Logf("Error reaching %s: %v", ip, err)
return false, nil
}
if r.StatusCode < http.StatusOK || r.StatusCode >= http.StatusNotFound {
Logf("Bad response; status: %d, response: %v", r.StatusCode, r)
return false, nil
}
return true, nil
}); err != nil {
// We log the error here because the test will fail at the very end
// because this validation runs in another goroutine. Without this,
// a failure is very confusing to track down because from the logs
// everything looks fine.
msg := fmt.Sprintf("Failed to contact service during upgrade: %v", err)
Logf(msg)
Failf(msg)
}
}, 200*time.Millisecond, done)
Logf("Starting upgrade")
expectNoError(upF(v))
done <- struct{}{}
Logf("Stopping async validation")
wg.Wait()
Logf("Upgrade complete")
}
func checkMasterVersion(c *client.Client, want string) error {
v, err := c.Discovery().ServerVersion()
if err != nil {
return fmt.Errorf("checkMasterVersion() couldn't get the master version: %v", err)
}
// We do prefix trimming and then matching because:
// want looks like: 0.19.3-815-g50e67d4
// got looks like: v0.19.3-815-g50e67d4034e858-dirty
got := strings.TrimPrefix(v.GitVersion, "v")
if !strings.HasPrefix(got, want) {
return fmt.Errorf("master had kube-apiserver version %s which does not start with %s",
got, want)
}
Logf("Master is at version %s", want)
return nil
}
func checkNodesVersions(c *client.Client, want string) error {
l := ListSchedulableNodesOrDie(c)
for _, n := range l.Items {
// We do prefix trimming and then matching because:
// want looks like: 0.19.3-815-g50e67d4
// kv/kvp look like: v0.19.3-815-g50e67d4034e858-dirty
kv, kpv := strings.TrimPrefix(n.Status.NodeInfo.KubeletVersion, "v"),
strings.TrimPrefix(n.Status.NodeInfo.KubeProxyVersion, "v")
if !strings.HasPrefix(kv, want) {
return fmt.Errorf("node %s had kubelet version %s which does not start with %s",
n.ObjectMeta.Name, kv, want)
}
if !strings.HasPrefix(kpv, want) {
return fmt.Errorf("node %s had kube-proxy version %s which does not start with %s",
n.ObjectMeta.Name, kpv, want)
}
}
return nil
}
// retryCmd runs cmd using args and retries it for up to singleCallTimeout if
// it returns an error. It returns stdout and stderr.
func retryCmd(command string, args ...string) (string, string, error) {
var err error
stdout, stderr := "", ""
wait.Poll(poll, singleCallTimeout, func() (bool, error) {
stdout, stderr, err = runCmd(command, args...)
if err != nil {
Logf("Got %v", err)
return false, nil
}
return true, nil
})
return stdout, stderr, err
}
// runCmd runs cmd using args and returns its stdout and stderr. It also outputs
// cmd's stdout and stderr to their respective OS streams.
//
// TODO(ihmccreery) This function should either be moved into util.go or
// removed; other e2e's use bare exe.Command.
func runCmd(command string, args ...string) (string, string, error) {
Logf("Running %s %v", command, args)
var bout, berr bytes.Buffer
cmd := exec.Command(command, args...)
// We also output to the OS stdout/stderr to aid in debugging in case cmd
// hangs and never returns before the test gets killed.
cmd.Stdout = io.MultiWriter(os.Stdout, &bout)
cmd.Stderr = io.MultiWriter(os.Stderr, &berr)
err := cmd.Run()
stdout, stderr := bout.String(), berr.String()
if err != nil {
return "", "", fmt.Errorf("error running %s %v; got error %v, stdout %q, stderr %q",
command, args, err, stdout, stderr)
}
return stdout, stderr, nil
}
func validate(f *Framework, svcNameWant, rcNameWant string, ingress api.LoadBalancerIngress, podsWant int) error {
Logf("Beginning cluster validation")
// Verify RC.
rcs, err := f.Client.ReplicationControllers(f.Namespace.Name).List(api.ListOptions{})
if err != nil {
return fmt.Errorf("error listing RCs: %v", err)
}
if len(rcs.Items) != 1 {
return fmt.Errorf("wanted 1 RC with name %s, got %d", rcNameWant, len(rcs.Items))
}
if got := rcs.Items[0].Name; got != rcNameWant {
return fmt.Errorf("wanted RC name %q, got %q", rcNameWant, got)
}
// Verify pods.
if err := verifyPods(f.Client, f.Namespace.Name, rcNameWant, false, podsWant); err != nil {
return fmt.Errorf("failed to find %d %q pods: %v", podsWant, rcNameWant, err)
}
// Verify service.
svc, err := f.Client.Services(f.Namespace.Name).Get(svcNameWant)
if err != nil {
return fmt.Errorf("error getting service %s: %v", svcNameWant, err)
}
if svcNameWant != svc.Name {
return fmt.Errorf("wanted service name %q, got %q", svcNameWant, svc.Name)
}
// TODO(mikedanese): Make testLoadBalancerReachable return an error.
testLoadBalancerReachable(ingress, 80)
Logf("Cluster validation succeeded")
return nil
}
// migRollingUpdate starts a MIG rolling update, upgrading the nodes to a new
// instance template named tmpl, and waits up to nt times the number of nodes
// for it to complete.
func migRollingUpdate(tmpl string, nt time.Duration) error {
By(fmt.Sprintf("starting the MIG rolling update to %s", tmpl))
id, err := migRollingUpdateStart(tmpl, nt)
if err != nil {
return fmt.Errorf("couldn't start the MIG rolling update: %v", err)
}
By(fmt.Sprintf("polling the MIG rolling update (%s) until it completes", id))
if err := migRollingUpdatePoll(id, nt); err != nil {
return fmt.Errorf("err waiting until update completed: %v", err)
}
return nil
}
// migTemplate (GCE/GKE-only) returns the name of the MIG template that the
// nodes of the cluster use.
func migTemplate() (string, error) {
var errLast error
var templ string
key := "instanceTemplate"
if wait.Poll(poll, singleCallTimeout, func() (bool, error) {
// TODO(mikedanese): make this hit the compute API directly instead of
// shelling out to gcloud.
// An `instance-groups managed describe` call outputs what we want to stdout.
output, _, err := retryCmd("gcloud", "compute", "instance-groups", "managed",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
"describe",
fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone),
testContext.CloudConfig.NodeInstanceGroup)
if err != nil {
errLast = fmt.Errorf("gcloud compute instance-groups managed describe call failed with err: %v", err)
return false, nil
}
// The 'describe' call probably succeeded; parse the output and try to
// find the line that looks like "instanceTemplate: url/to/<templ>" and
// return <templ>.
if val := parseKVLines(output, key); len(val) > 0 {
url := strings.Split(val, "/")
templ = url[len(url)-1]
Logf("MIG group %s using template: %s", testContext.CloudConfig.NodeInstanceGroup, templ)
return true, nil
}
errLast = fmt.Errorf("couldn't find %s in output to get MIG template. Output: %s", key, output)
return false, nil
}) != nil {
return "", fmt.Errorf("migTemplate() failed with last error: %v", errLast)
}
return templ, nil
}
// migRollingUpdateStart (GCE/GKE-only) starts a MIG rolling update using templ
// as the new template, waiting up to nt per node, and returns the ID of that
// update.
func migRollingUpdateStart(templ string, nt time.Duration) (string, error) {
var errLast error
var id string
prefix, suffix := "Started [", "]."
if err := wait.Poll(poll, singleCallTimeout, func() (bool, error) {
// TODO(mikedanese): make this hit the compute API directly instead of
// shelling out to gcloud.
// NOTE(mikedanese): If you are changing this gcloud command, update
// cluster/gce/upgrade.sh to match this EXACTLY.
// A `rolling-updates start` call outputs what we want to stderr.
_, output, err := retryCmd("gcloud", "alpha", "compute",
"rolling-updates",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone),
"start",
// Required args.
fmt.Sprintf("--group=%s", testContext.CloudConfig.NodeInstanceGroup),
fmt.Sprintf("--template=%s", templ),
// Optional args to fine-tune behavior.
fmt.Sprintf("--instance-startup-timeout=%ds", int(nt.Seconds())),
// NOTE: We can speed up this process by increasing
// --max-num-concurrent-instances.
fmt.Sprintf("--max-num-concurrent-instances=%d", 1),
fmt.Sprintf("--max-num-failed-instances=%d", 0),
fmt.Sprintf("--min-instance-update-time=%ds", 0))
if err != nil {
errLast = fmt.Errorf("rolling-updates call failed with err: %v", err)
return false, nil
}
// The 'start' call probably succeeded; parse the output and try to find
// the line that looks like "Started [url/to/<id>]." and return <id>.
for _, line := range strings.Split(output, "\n") {
// As a sanity check, ensure the line starts with prefix and ends
// with suffix.
if strings.Index(line, prefix) != 0 || strings.Index(line, suffix) != len(line)-len(suffix) {
continue
}
url := strings.Split(strings.TrimSuffix(strings.TrimPrefix(line, prefix), suffix), "/")
id = url[len(url)-1]
Logf("Started MIG rolling update; ID: %s", id)
return true, nil
}
errLast = fmt.Errorf("couldn't find line like '%s ... %s' in output to MIG rolling-update start. Output: %s",
prefix, suffix, output)
return false, nil
}); err != nil {
return "", fmt.Errorf("migRollingUpdateStart() failed with last error: %v", errLast)
}
return id, nil
}
// migRollingUpdatePoll (CKE/GKE-only) polls the progress of the MIG rolling
// update with ID id until it is complete. It returns an error if this takes
// longer than nt times the number of nodes.
func migRollingUpdatePoll(id string, nt time.Duration) error {
// Two keys and a val.
status, progress, done := "status", "statusMessage", "ROLLED_OUT"
start, timeout := time.Now(), nt*time.Duration(testContext.CloudConfig.NumNodes)
var errLast error
Logf("Waiting up to %v for MIG rolling update to complete.", timeout)
if wait.Poll(restartPoll, timeout, func() (bool, error) {
// A `rolling-updates describe` call outputs what we want to stdout.
output, _, err := retryCmd("gcloud", "alpha", "compute",
"rolling-updates",
fmt.Sprintf("--project=%s", testContext.CloudConfig.ProjectID),
fmt.Sprintf("--zone=%s", testContext.CloudConfig.Zone),
"describe",
id)
if err != nil {
errLast = fmt.Errorf("Error calling rolling-updates describe %s: %v", id, err)
Logf("%v", errLast)
return false, nil
}
// The 'describe' call probably succeeded; parse the output and try to
// find the line that looks like "status: <status>" and see whether it's
// done.
Logf("Waiting for MIG rolling update: %s (%v elapsed)",
parseKVLines(output, progress), time.Since(start))
if st := parseKVLines(output, status); st == done {
return true, nil
}
return false, nil
}) != nil {
return fmt.Errorf("timeout waiting %v for MIG rolling update to complete. Last error: %v", timeout, errLast)
}
Logf("MIG rolling update complete after %v", time.Since(start))
return nil
}
func testLoadBalancerReachable(ingress api.LoadBalancerIngress, port int) bool {
loadBalancerLagTimeout := loadBalancerLagTimeoutDefault
if providerIs("aws") {
loadBalancerLagTimeout = loadBalancerLagTimeoutAWS
}
return testLoadBalancerReachableInTime(ingress, port, loadBalancerLagTimeout)
}
func testLoadBalancerReachableInTime(ingress api.LoadBalancerIngress, port int, timeout time.Duration) bool {
ip := ingress.IP
if ip == "" {
ip = ingress.Hostname
}
return testReachableInTime(conditionFuncDecorator(ip, port, testReachableHTTP, "/", "test-webserver"), timeout)
}
func conditionFuncDecorator(ip string, port int, fn func(string, int, string, string) (bool, error), request string, expect string) wait.ConditionFunc {
return func() (bool, error) {
return fn(ip, port, request, expect)
}
}
func testReachableInTime(testFunc wait.ConditionFunc, timeout time.Duration) bool {
By(fmt.Sprintf("Waiting up to %v", timeout))
err := wait.PollImmediate(poll, timeout, testFunc)
if err != nil {
Expect(err).NotTo(HaveOccurred(), "Error waiting")
return false
}
return true
}
func waitForLoadBalancerIngress(c *client.Client, serviceName, namespace string) (*api.Service, error) {
// TODO: once support ticket 21807001 is resolved, reduce this timeout
// back to something reasonable
const timeout = 20 * time.Minute
var service *api.Service
By(fmt.Sprintf("waiting up to %v for service %s in namespace %s to have a LoadBalancer ingress point", timeout, serviceName, namespace))
i := 1
for start := time.Now(); time.Since(start) < timeout; time.Sleep(3 * time.Second) {
service, err := c.Services(namespace).Get(serviceName)
if err != nil {
Logf("Get service failed, ignoring for 5s: %v", err)
continue
}
if len(service.Status.LoadBalancer.Ingress) > 0 {
return service, nil
}
if i%5 == 0 {
Logf("Waiting for service %s in namespace %s to have a LoadBalancer ingress point (%v)", serviceName, namespace, time.Since(start))
}
i++
}
return service, fmt.Errorf("service %s in namespace %s doesn't have a LoadBalancer ingress point after %.2f seconds", serviceName, namespace, timeout.Seconds())
}
| {
"content_hash": "d9f90a5ff7748c1009553af94e2c5765",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 161,
"avg_line_length": 35.36867862969005,
"alnum_prop": 0.6966929569669296,
"repo_name": "jtblin/kubernetes",
"id": "c9a6da68780705df6bfbb3c15ac2a8fcdc3f3dcc",
"size": "22270",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "test/e2e/cluster_upgrade.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1875"
},
{
"name": "Go",
"bytes": "20402117"
},
{
"name": "HTML",
"bytes": "1194407"
},
{
"name": "JavaScript",
"bytes": "556"
},
{
"name": "Makefile",
"bytes": "48177"
},
{
"name": "Nginx",
"bytes": "1013"
},
{
"name": "Python",
"bytes": "79138"
},
{
"name": "SaltStack",
"bytes": "49463"
},
{
"name": "Shell",
"bytes": "1225575"
}
],
"symlink_target": ""
} |
<?php namespace Ups\Entity;
use Ups\AddressValidation;
use Ups\Entity\AddressValidation\AVAddress;
use Ups\Entity\AddressValidation\AddressClassification;
class AddressValidationResponse
{
protected $response;
protected $requestAction;
/**
* AddressValidationResponse constructor.
* @param \SimpleXMLElement $xmlDocument
* @param $requestAction
*/
public function __construct(\SimpleXMLElement $xmlDocument, $requestAction)
{
$this->response = $xmlDocument;
$this->requestAction = $requestAction;
}
/**
* Tells whether or not the NoCandidatesIndicator is present on the XML document.
* This indicator is returned if the address is so badly formed that UPS is
* unable to even offer any suggested alternatives
*
* @throws \BadMethodCallException
* @return bool
*/
public function noCandidates()
{
if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) {
throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.');
}
return isset($this->response->NoCandidatesIndicator);
}
/**
* Tells whether or not the ValidAddressIndicator is present on the XML document.
* This indicator is present if provided address is valid and represents a
* single, unique address in the UPS Address Validation system.
*
* @return bool
*/
public function isValid()
{
if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) {
return $this->response->AddressClassification->Code > 0;
}
return isset($this->response->ValidAddressIndicator);
}
/**
* Tells whether or not the AmbiguousAddressIndicator is present on the XML document.
* This indicator is present when the address provided is not specific enough to
* be unique to one physical location, but provides enough
*
* @throws \BadMethodCallException
* @return bool
*/
public function isAmbiguous()
{
if (AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION == $this->requestAction) {
throw new \BadMethodCallException(__METHOD__ . ' should not be called on Address Classification only requests.');
}
return isset($this->response->AmbiguousAddressIndicator);
}
/**
* @throws \BadMethodCallException
* @return AddressClassification
*/
public function getAddressClassification()
{
if ($this->requestAction < AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) {
throw new \BadMethodCallException('Address Classification was not requested.');
}
return new AddressClassification($this->response->AddressClassification);
}
/**
* @return array
*/
public function getCandidateAddressList()
{
if (!isset($this->response->AddressKeyFormat)) {
return [];
}
$candidates = [];
foreach ($this->response->AddressKeyFormat as $address) {
$candidates[] = new AVAddress($address);
}
return $candidates;
}
/**
* @return AVAddress
*/
public function getValidatedAddress()
{
if ($this->requestAction == AddressValidation::REQUEST_OPTION_ADDRESS_CLASSIFICATION) {
throw new \BadMethodCallException('Only Address Classification was requested. There is no address.');
}
return new AVAddress($this->response->AddressKeyFormat);
}
}
| {
"content_hash": "4ab7e32f5372f3162a620f95e4bc86de",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 125,
"avg_line_length": 33.44444444444444,
"alnum_prop": 0.6580841638981174,
"repo_name": "surprisehighway/craft-upsshippingrates",
"id": "6fa3e96d9b0f7c2c49b536032c6654f7c4f8e3ff",
"size": "3612",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/gabrielbull/ups-api/src/Entity/AddressValidationResponse.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2217"
},
{
"name": "PHP",
"bytes": "24540"
}
],
"symlink_target": ""
} |
require '../lib/zliby'
require 'stringio'
describe 'Zlib::GzipFile#comment' do
before :each do
@io = StringIO.new
end
it 'returns the name' do
Zlib::GzipWriter.wrap @io do |gzio|
gzio.comment = 'name'
gzio.comment.should == 'name'
end
end
it 'raises an error on a closed stream' do
Zlib::GzipWriter.wrap @io do |gzio|
gzio.close
lambda { gzio.comment }.should \
raise_error(Zlib::GzipFile::Error, 'closed gzip stream')
end
end
end
| {
"content_hash": "29d6e5fff5abf57372821dda2ea0a520",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 18.59259259259259,
"alnum_prop": 0.6274900398406374,
"repo_name": "mletterle/zliby",
"id": "7ee2987b4e2083b61ca307d6e760c04b29828331",
"size": "557",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "pkg/Zliby-0.0.5/specs/gzipfile/comment_spec.rb",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "Ruby",
"bytes": "118152"
}
],
"symlink_target": ""
} |
#include <aws/networkmanager/model/AssociateCustomerGatewayRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::NetworkManager::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
AssociateCustomerGatewayRequest::AssociateCustomerGatewayRequest() :
m_customerGatewayArnHasBeenSet(false),
m_globalNetworkIdHasBeenSet(false),
m_deviceIdHasBeenSet(false),
m_linkIdHasBeenSet(false)
{
}
Aws::String AssociateCustomerGatewayRequest::SerializePayload() const
{
JsonValue payload;
if(m_customerGatewayArnHasBeenSet)
{
payload.WithString("CustomerGatewayArn", m_customerGatewayArn);
}
if(m_deviceIdHasBeenSet)
{
payload.WithString("DeviceId", m_deviceId);
}
if(m_linkIdHasBeenSet)
{
payload.WithString("LinkId", m_linkId);
}
return payload.View().WriteReadable();
}
| {
"content_hash": "ef585108d20aee36a5f201db26a496ad",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 69,
"avg_line_length": 18.872340425531913,
"alnum_prop": 0.7508455467869222,
"repo_name": "awslabs/aws-sdk-cpp",
"id": "a1e3cc09dc2d6251767f0f52fdb341127a94dc75",
"size": "1006",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-networkmanager/source/model/AssociateCustomerGatewayRequest.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "7596"
},
{
"name": "C++",
"bytes": "61740540"
},
{
"name": "CMake",
"bytes": "337520"
},
{
"name": "Java",
"bytes": "223122"
},
{
"name": "Python",
"bytes": "47357"
}
],
"symlink_target": ""
} |
function tv_cell_select() {
var win = Ti.UI.createWindow();
// create table view data object
var data = [];
data[0] = Ti.UI.createTableViewRow({hasChild:true,title:'No cell selection',selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE});
data[1] = Ti.UI.createTableViewRow({hasDetail:true,title:'Blue cell selection',selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.BLUE});
data[2] = Ti.UI.createTableViewRow({hasCheck:true,title:'Gray cell selection',selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.GRAY});
data[3] = Ti.UI.createTableViewRow({title:'Default cell selection'});
// create table view
var tableview = Titanium.UI.createTableView({
data:data
});
// create table view event listener
tableview.addEventListener('click', function(e)
{
// event data
var index = e.index;
var section = e.section;
var row = e.row;
var rowdata = e.rowData;
Titanium.UI.createAlertDialog({title:'Table View',message:'row ' + row + ' index ' + index + ' section ' + section + ' row data ' + rowdata}).show();
});
// add table view to the window
win.add(tableview);
return win;
};
module.exports = tv_cell_select;
| {
"content_hash": "42cbca310f74ba5ade88a368b3e8a328",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 152,
"avg_line_length": 35.42424242424242,
"alnum_prop": 0.7159965782720273,
"repo_name": "andi2/KitchenSink",
"id": "19f3cdf6577cb65c2d4cbea7fcee48a896e32cbe",
"size": "1169",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "Resources/ui/handheld/ios/baseui/table_view_cell_selection.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "700035"
}
],
"symlink_target": ""
} |
include $(GOROOT)/src/Make.inc
TARG=tutorial
GOFILES=\
tutorial.go\
spec: gospec clean
gospec:
gospec -v spec
include $(GOROOT)/src/Make.cmd
| {
"content_hash": "dae42eaf6fa32ca128f1837046b83097",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 30,
"avg_line_length": 13.083333333333334,
"alnum_prop": 0.6815286624203821,
"repo_name": "yaoshipu/go-spec",
"id": "8aeb8e47f0bc346d7aaf91fcfbc0e32cae154094",
"size": "384",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "examples/tutorial/Makefile",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Go",
"bytes": "36309"
},
{
"name": "Makefile",
"bytes": "757"
}
],
"symlink_target": ""
} |
package org.drools.phreak;
import java.util.ArrayList;
import java.util.List;
import org.drools.common.InternalFactHandle;
import org.drools.common.InternalWorkingMemory;
import org.drools.common.PropagationContextImpl;
import org.drools.common.LeftTupleSets;
import org.drools.core.util.FastIterator;
import org.drools.reteoo.BetaMemory;
import org.drools.reteoo.BetaNode;
import org.drools.reteoo.LeftTuple;
import org.drools.reteoo.LeftTupleMemory;
import org.drools.reteoo.LeftTupleSink;
import org.drools.reteoo.SegmentMemory;
import static org.junit.Assert.fail;
public class LeftMemory {
private Scenario scenario;
public LeftMemory(Scenario scenario, Object... objects) {
this.scenario = scenario;
scenario.getLeftMemory().addAll( getLeftTuples( objects ) );
}
public List<LeftTuple> getLeftTuples(Object... objects) {
BetaNode node = scenario.getBetaNode();
BetaMemory bm = scenario.getBm();
LeftTupleMemory ltm = bm.getLeftTupleMemory();
InternalWorkingMemory wm = scenario.getWorkingMemory();
if ( objects == null ) {
objects = new Object[0];
}
List<LeftTuple> list = new ArrayList<LeftTuple>();
for ( Object object : objects ) {
InternalFactHandle fh = (InternalFactHandle) wm.insert( object );
LeftTuple expectedLeftTuple = node.createLeftTuple( fh, node, true );
expectedLeftTuple.setPropagationContext( new PropagationContextImpl() );
list.add( expectedLeftTuple );
}
scenario.setTestLeftMemory( true );
return list;
}
public RightMemory right(Object... objects) {
return new RightMemory( scenario, objects );
}
public StagedBuilder preStaged(SegmentMemory sm) {
StagedBuilder stagedBuilder = new StagedBuilder( scenario, sm );
scenario.addPreStagedBuilder( stagedBuilder );
return stagedBuilder;
}
public StagedBuilder postStaged(SegmentMemory sm) {
StagedBuilder stagedBuilder = new StagedBuilder( scenario, sm );
scenario.addPostStagedBuilder( stagedBuilder );
return stagedBuilder;
}
public Scenario run() {
return this.scenario.run();
}
} | {
"content_hash": "dbc4b7b4072bd9998910bbd5e6b1333d",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 84,
"avg_line_length": 32.690140845070424,
"alnum_prop": 0.6734166307626023,
"repo_name": "yurloc/drools",
"id": "e917a1bdd568acdd6cb4b0480a851c6c556d52ef",
"size": "2321",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "drools-compiler/src/test/java/org/drools/phreak/LeftMemory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "20184204"
},
{
"name": "Python",
"bytes": "4529"
},
{
"name": "Ruby",
"bytes": "491"
},
{
"name": "Shell",
"bytes": "1162"
}
],
"symlink_target": ""
} |
package com.azure.security.confidentialledger;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.identity.DefaultAzureCredentialBuilder;
import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClient;
import com.azure.security.confidentialledger.certificate.ConfidentialLedgerCertificateClientBuilder;
public class GetLedgerIdentitySample {
public static void main(String[] args) {
ConfidentialLedgerCertificateClient confidentialLedgerCertificateClient =
new ConfidentialLedgerCertificateClientBuilder()
.credential(new DefaultAzureCredentialBuilder().build())
.certificateEndpoint("identity.accledger.azure.com")
.buildClient();
RequestOptions requestOptions = new RequestOptions();
String ledgerId = "your_ledger_name";
Response<BinaryData> response =
confidentialLedgerCertificateClient.getLedgerIdentityWithResponse(ledgerId, requestOptions);
}
}
| {
"content_hash": "d3b357c1f430d54a651f4000772acd30",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 108,
"avg_line_length": 51.09090909090909,
"alnum_prop": 0.75,
"repo_name": "Azure/azure-sdk-for-java",
"id": "44bc8c2c9aae41a07e2d8489fc42842798c8d282",
"size": "1221",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "sdk/confidentialledger/azure-security-confidentialledger/src/samples/java/com/azure/security/confidentialledger/GetLedgerIdentitySample.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "8762"
},
{
"name": "Bicep",
"bytes": "15055"
},
{
"name": "CSS",
"bytes": "7676"
},
{
"name": "Dockerfile",
"bytes": "2028"
},
{
"name": "Groovy",
"bytes": "3237482"
},
{
"name": "HTML",
"bytes": "42090"
},
{
"name": "Java",
"bytes": "432409546"
},
{
"name": "JavaScript",
"bytes": "36557"
},
{
"name": "Jupyter Notebook",
"bytes": "95868"
},
{
"name": "PowerShell",
"bytes": "737517"
},
{
"name": "Python",
"bytes": "240542"
},
{
"name": "Scala",
"bytes": "1143898"
},
{
"name": "Shell",
"bytes": "18488"
},
{
"name": "XSLT",
"bytes": "755"
}
],
"symlink_target": ""
} |
package org.springframework.test.context.support;
import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.lang.Nullable;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.annotation.DirtiesContext.HierarchyMode;
import org.springframework.test.annotation.DirtiesContext.MethodMode;
import org.springframework.test.context.TestContext;
import org.springframework.test.context.TestContextAnnotationUtils;
import org.springframework.util.Assert;
/**
* Abstract base class for {@code TestExecutionListener} implementations that
* provide support for marking the {@code ApplicationContext} associated with
* a test as <em>dirty</em> for both test classes and test methods annotated
* with the {@link DirtiesContext @DirtiesContext} annotation.
*
* <p>The core functionality for this class was extracted from
* {@link DirtiesContextTestExecutionListener} in Spring Framework 4.2.
*
* @author Sam Brannen
* @author Juergen Hoeller
* @since 4.2
* @see DirtiesContext
*/
public abstract class AbstractDirtiesContextTestExecutionListener extends AbstractTestExecutionListener {
private static final Log logger = LogFactory.getLog(AbstractDirtiesContextTestExecutionListener.class);
@Override
public abstract int getOrder();
/**
* Mark the {@linkplain ApplicationContext application context} of the supplied
* {@linkplain TestContext test context} as
* {@linkplain TestContext#markApplicationContextDirty(DirtiesContext.HierarchyMode) dirty}
* and set {@link DependencyInjectionTestExecutionListener#REINJECT_DEPENDENCIES_ATTRIBUTE
* REINJECT_DEPENDENCIES_ATTRIBUTE} in the test context to {@code true}.
* @param testContext the test context whose application context should
* be marked as dirty
* @param hierarchyMode the context cache clearing mode to be applied if the
* context is part of a hierarchy; may be {@code null}
* @since 3.2.2
*/
protected void dirtyContext(TestContext testContext, @Nullable HierarchyMode hierarchyMode) {
testContext.markApplicationContextDirty(hierarchyMode);
testContext.setAttribute(DependencyInjectionTestExecutionListener.REINJECT_DEPENDENCIES_ATTRIBUTE, Boolean.TRUE);
}
/**
* Perform the actual work for {@link #beforeTestMethod} and {@link #afterTestMethod}
* by dirtying the context if appropriate (i.e., according to the required modes).
* @param testContext the test context whose application context should
* potentially be marked as dirty; never {@code null}
* @param requiredMethodMode the method mode required for a context to
* be marked dirty in the current phase; never {@code null}
* @param requiredClassMode the class mode required for a context to
* be marked dirty in the current phase; never {@code null}
* @throws Exception allows any exception to propagate
* @since 4.2
* @see #dirtyContext
*/
protected void beforeOrAfterTestMethod(TestContext testContext, MethodMode requiredMethodMode,
ClassMode requiredClassMode) throws Exception {
Assert.notNull(testContext, "TestContext must not be null");
Assert.notNull(requiredMethodMode, "requiredMethodMode must not be null");
Assert.notNull(requiredClassMode, "requiredClassMode must not be null");
Class<?> testClass = testContext.getTestClass();
Method testMethod = testContext.getTestMethod();
Assert.notNull(testClass, "The test class of the supplied TestContext must not be null");
Assert.notNull(testMethod, "The test method of the supplied TestContext must not be null");
DirtiesContext methodAnn = AnnotatedElementUtils.findMergedAnnotation(testMethod, DirtiesContext.class);
DirtiesContext classAnn = TestContextAnnotationUtils.findMergedAnnotation(testClass, DirtiesContext.class);
boolean methodAnnotated = (methodAnn != null);
boolean classAnnotated = (classAnn != null);
MethodMode methodMode = (methodAnnotated ? methodAnn.methodMode() : null);
ClassMode classMode = (classAnnotated ? classAnn.classMode() : null);
if (logger.isTraceEnabled()) {
logger.trace("""
%s test method: context %s, class annotated with @DirtiesContext [%s] \
with mode [%s], method annotated with @DirtiesContext [%s] with mode [%s]"""
.formatted(getPhase(requiredMethodMode), testContext, classAnnotated, classMode,
methodAnnotated, methodMode));
}
else if (logger.isDebugEnabled()) {
logger.debug("""
%s test method: class [%s], method [%s], class annotated with @DirtiesContext [%s] \
with mode [%s], method annotated with @DirtiesContext [%s] with mode [%s]"""
.formatted(getPhase(requiredMethodMode), testClass.getSimpleName(),
testMethod.getName(), classAnnotated, classMode, methodAnnotated, methodMode));
}
if ((methodMode == requiredMethodMode) || (classMode == requiredClassMode)) {
HierarchyMode hierarchyMode = (methodAnnotated ? methodAnn.hierarchyMode() : classAnn.hierarchyMode());
dirtyContext(testContext, hierarchyMode);
}
}
/**
* Perform the actual work for {@link #beforeTestClass} and {@link #afterTestClass}
* by dirtying the context if appropriate (i.e., according to the required mode).
* @param testContext the test context whose application context should
* potentially be marked as dirty; never {@code null}
* @param requiredClassMode the class mode required for a context to
* be marked dirty in the current phase; never {@code null}
* @throws Exception allows any exception to propagate
* @since 4.2
* @see #dirtyContext
*/
protected void beforeOrAfterTestClass(TestContext testContext, ClassMode requiredClassMode) throws Exception {
Assert.notNull(testContext, "TestContext must not be null");
Assert.notNull(requiredClassMode, "requiredClassMode must not be null");
Class<?> testClass = testContext.getTestClass();
Assert.notNull(testClass, "The test class of the supplied TestContext must not be null");
DirtiesContext dirtiesContext = TestContextAnnotationUtils.findMergedAnnotation(testClass, DirtiesContext.class);
boolean classAnnotated = (dirtiesContext != null);
ClassMode classMode = (classAnnotated ? dirtiesContext.classMode() : null);
if (logger.isTraceEnabled()) {
logger.trace("%s test class: context %s, class annotated with @DirtiesContext [%s] with mode [%s]"
.formatted(getPhase(requiredClassMode), testContext, classAnnotated, classMode));
}
else if (logger.isDebugEnabled()) {
logger.debug("%s test class: class [%s], class annotated with @DirtiesContext [%s] with mode [%s]"
.formatted(getPhase(requiredClassMode), testClass.getSimpleName(), classAnnotated, classMode));
}
if (classMode == requiredClassMode) {
dirtyContext(testContext, dirtiesContext.hierarchyMode());
}
}
private static String getPhase(ClassMode classMode) {
return (classMode.name().startsWith("BEFORE") ? "Before" : "After");
}
private static String getPhase(MethodMode methodMode) {
return (methodMode.name().startsWith("BEFORE") ? "Before" : "After");
}
}
| {
"content_hash": "c959464a93e4b8f1e7e616f710caac2b",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 115,
"avg_line_length": 46.21656050955414,
"alnum_prop": 0.7666758544652701,
"repo_name": "spring-projects/spring-framework",
"id": "17586a70294a8e690855ca874463119d688c5e0c",
"size": "7877",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "spring-test/src/main/java/org/springframework/test/context/support/AbstractDirtiesContextTestExecutionListener.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AspectJ",
"bytes": "32003"
},
{
"name": "CSS",
"bytes": "1019"
},
{
"name": "Dockerfile",
"bytes": "257"
},
{
"name": "FreeMarker",
"bytes": "30820"
},
{
"name": "Groovy",
"bytes": "6902"
},
{
"name": "HTML",
"bytes": "1203"
},
{
"name": "Java",
"bytes": "43939386"
},
{
"name": "JavaScript",
"bytes": "280"
},
{
"name": "Kotlin",
"bytes": "571613"
},
{
"name": "PLpgSQL",
"bytes": "305"
},
{
"name": "Python",
"bytes": "254"
},
{
"name": "Ruby",
"bytes": "1060"
},
{
"name": "Shell",
"bytes": "5374"
},
{
"name": "Smarty",
"bytes": "700"
},
{
"name": "XSLT",
"bytes": "2945"
}
],
"symlink_target": ""
} |
Rumale project will be rebooted on version 0.24.0.
This version is probably the last release of the series starting with version 0.8.0.
- Refactor some codes and configs.
- Deprecate VPTree class.
# 0.23.1
- Fix all estimators to return inference results in a contiguous narray.
- Fix to use until statement instead of recursive call on apply methods of tree estimators.
- Rename native extension files.
- Introduce clang-format for native extension codes.
# 0.23.0
## Breaking change
- Change automalically selected solver from sgd to lbfgs in
[LinearRegression](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/LinearRegression.html) and
[Ridge](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/Ridge.html).
- When given 'auto' to solver parameter, these estimator select the 'svd' solver if Numo::Linalg is loaded.
Otherwise, they select the 'lbfgs' solver.
# 0.22.5
- Add transformer class for calculating kernel matrix.
- [KernelCalculator](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing/KernelCalculator.html)
- Add classifier class based on Ridge regression.
- [KernelRidgeClassifier](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine/KernelRidgeClassifier.html)
- Add supported kernel functions to [Nystroem](https://yoshoku.github.io/rumale/doc/Rumale/KernelApproximation/Nystroem.html).
- Add parameter for specifying the number of features to [load_libsvm_file](https://yoshoku.github.io/rumale/doc/Rumale/Dataset.html#load_libsvm_file-class_method).
# 0.22.4
- Add classifier and regressor classes for voting ensemble method.
- [VotingClassifier](https://yoshoku.github.io/rumale/doc/Rumale/Ensemble/VotingClassifier.html)
- [VotingRegressor](https://yoshoku.github.io/rumale/doc/Rumale/Ensemble/VotingRegressor.html)
- Refactor some codes.
- Fix some typos on API documentation.
# 0.22.3
- Add regressor class for non-negative least square method.
- [NNLS](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/NNLS.html)
- Add lbfgs solver to [Ridge](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/Ridge.html) and [LinearRegression](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/LinearRegression.html).
- In version 0.23.0, these classes will be changed to attempt to optimize with 'svd' or 'lbfgs' solver if 'auto' is given to
the solver parameter. If you use 'sgd' solver, you need specify it explicitly.
- Add GC guard to native extension codes.
- Update API documentation.
# 0.22.2
- Add classifier and regressor classes for stacking method.
- [StackingClassifier](https://yoshoku.github.io/rumale/doc/Rumale/Ensemble/StackingClassifier.html)
- [StackingRegressor](https://yoshoku.github.io/rumale/doc/Rumale/Ensemble/StackingRegressor.html)
- Refactor some codes with Rubocop.
# 0.22.1
- Add transfomer class for [MLKR](https://yoshoku.github.io/rumale/doc/Rumale/MetricLearning/MLKR.html), that implements Metric Learning for Kernel Regression.
- Refactor NeighbourhoodComponentAnalysis.
- Update API documentation.
# 0.22.0
## Breaking change
- Add lbfgsb.rb gem to runtime dependencies. Rumale uses lbfgsb gem for optimization.
This eliminates the need to require the mopti gem when using [NeighbourhoodComponentAnalysis](https://yoshoku.github.io/rumale/doc/Rumale/MetricLearning/NeighbourhoodComponentAnalysis.html).
- Add lbfgs solver to [LogisticRegression](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/LogisticRegression.html) and make it the default solver.
# 0.21.0
## Breaking change
- Change the default value of max_iter argument on LinearModel estimators to 1000.
# 0.20.3
- Fix to use automatic solver of PCA in NeighbourhoodComponentAnalysis.
- Refactor some codes with Rubocop.
- Update README.
# 0.20.2
- Add cross-validator class for time-series data.
- [TimeSeriesSplit](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/TimeSeriesSplit.html)
# 0.20.1
- Add cross-validator classes that split data according group labels.
- [GroupKFold](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/GroupKFold.html)
- [GroupShuffleSplit](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/GroupShuffleSplit.html)
- Fix fraction treating of the number of samples on shuffle split cross-validator classes.
- [ShuffleSplit](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/ShuffleSplit.html)
- [StratifiedShuffleSplit](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/StratifiedShuffleSplit.html)
- Refactor some codes with Rubocop.
# 0.20.0
## Breaking changes
- Delete deprecated estimators such as PolynomialModel, Optimizer, and BaseLinearModel.
# 0.19.3
- Add preprocessing class for [Binarizer](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing/Binarizer.html)
- Add preprocessing class for [MaxNormalizer](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing/MaxNormalizer.html)
- Refactor some codes with Rubocop.
# 0.19.2
- Fix L2Normalizer to avoid zero divide.
- Add preprocssing class for [L1Normalizer](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing/L1Normalizer.html).
- Add transformer class for [TfidfTransformer](https://yoshoku.github.io/rumale/doc/Rumale/FeatureExtraction/TfidfTransformer.html).
# 0.19.1
- Add cluster analysis class for [mini-batch K-Means](https://yoshoku.github.io/rumale/doc/Rumale/Clustering/MiniBatchKMeans.html).
- Fix some typos.
# 0.19.0
## Breaking changes
- Change mmh3 and mopti gem to non-runtime dependent library.
- The mmh3 gem is used in [FeatureHasher](https://yoshoku.github.io/rumale/doc/Rumale/FeatureExtraction/FeatureHasher.html).
You only need to require mmh3 gem when using FeatureHasher.
```ruby
require 'mmh3'
require 'rumale'
encoder = Rumale::FeatureExtraction::FeatureHasher.new
```
- The mopti gem is used in [NeighbourhoodComponentAnalysis](https://yoshoku.github.io/rumale/doc/Rumale/MetricLearning/NeighbourhoodComponentAnalysis.html).
You only need to require mopti gem when using NeighbourhoodComponentAnalysis.
```ruby
require 'mopti'
require 'rumale'
transformer = Rumale::MetricLearning::NeighbourhoodComponentAnalysis.new
```
- Change the default value of solver parameter on [PCA](https://yoshoku.github.io/rumale/doc/Rumale/Decomposition/PCA.html) to 'auto'.
If Numo::Linalg is loaded, 'evd' is selected for the solver, otherwise 'fpt' is selected.
- Deprecate [PolynomialModel](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel.html), [Optimizer](https://yoshoku.github.io/rumale/doc/Rumale/Optimizer.html), and the estimators contained in them. They will be deleted in version 0.20.0.
- Many machine learning libraries do not contain factorization machine algorithms, they are provided by another compatible library.
In addition, there are no plans to implement estimators in PolynomialModel.
Thus, the author decided to deprecate PolynomialModel.
- Currently, the Optimizer classes are only used by PolynomialModel estimators.
Therefore, they have been deprecated together with PolynomialModel.
# 0.18.7
- Fix to convert target_name to string array in [classification_report method](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure.html#classification_report-class_method).
- Refactor some codes with Rubocop.
# 0.18.6
- Fix some configuration files.
- Update API documentation.
# 0.18.5
- Add functions for calculation of cosine similarity and distance to [Rumale::PairwiseMetric](https://yoshoku.github.io/rumale/doc/Rumale/PairwiseMetric.html).
- Refactor some codes with Rubocop.
# 0.18.4
- Add transformer class for [KernelFDA](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine/KernelFDA.html).
- Refactor [KernelPCA](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine/KernelPCA.html).
- Fix API documentation.
# 0.18.3
- Fix API documentation on [KNeighborsRegressor](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/KNeighborsRegressor.html)
- Refector [rbf_kernel](https://yoshoku.github.io/rumale/doc/Rumale/PairwiseMetric.html#rbf_kernel-class_method) method.
- Delete unneeded marshal dump and load methods. The deletion work is complete.
- [Tree](https://yoshoku.github.io/rumale/doc/Rumale/Tree.html),
[Ensemble](https://yoshoku.github.io/rumale/doc/Rumale/Ensemble.html),
[Optimizer](https://yoshoku.github.io/rumale/doc/Rumale/Optimizer.html),
[OneVsRestClassifier](https://yoshoku.github.io/rumale/doc/Rumale/Multiclass/OneVsRestClassifier.html),
[GridSearchCV](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection/GridSearchCV.html).
# 0.18.2
- Change file composition of naive bayes classifiers.
- Add classifier class for [ComplementNaiveBayes](https://yoshoku.github.io/rumale/doc/Rumale/NaiveBayes/ComplementNB.html).
- Add classifier class for [NegationNaiveBayes](https://yoshoku.github.io/rumale/doc/Rumale/NaiveBayes/NegationNB.html).
- Add [module function](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure.html#confusion_matrix-class_method) for calculating confusion matrix.
- Delete unneeded marshal dump and load methods.
- [Clustering](https://yoshoku.github.io/rumale/doc/Rumale/Clustering.html),
[KernelApproximation](https://yoshoku.github.io/rumale/doc/Rumale/KernelApproximation.html),
[KernelMachine](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine.html),
[NearestNeighbors](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors.html),
[Preprocessing](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing.html).
# 0.18.1
- Add [module function](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure.html#classification_report-class_method) for generating summary of classification performance.
- Delete marshal dump and load methods for documentation.
The marshal methods are written in estimator classes for indicating on API documentation that the learned model can be saved with Marshal.
Even without these methods, Marshal can save the learned model, so they are deleted sequentially.
- [Manifold](https://yoshoku.github.io/rumale/doc/Rumale/Manifold.html),
[NaiveBayes](https://yoshoku.github.io/rumale/doc/Rumale/NaiveBayes.html),
[PolynomialModel](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel.html),
[Decomposition](https://yoshoku.github.io/doc/Rumale/Decomposition.html).
# 0.18.0
- Add transformer class for [FisherDiscriminantAnalysis](https://yoshoku.github.io/rumale/doc/Rumale/MetricLearning/FisherDiscriminantAnalysis.html).
- Add transformer class for [NeighbourhoodComponentAnalysis](https://yoshoku.github.io/rumale/doc/Rumale/MetricLearning/NeighbourhoodComponentAnalysis.html).
- Add [module function](https://yoshoku.github.io/rumale/doc/Rumale/ModelSelection.html#train_test_split-class_method) for hold-out validation.
# 0.17.3
- Add pipeline class for [FeatureUnion](https://yoshoku.github.io/rumale/doc/Rumale/Pipeline/FeatureUnion.html).
- Fix to use mmh3 gem for generating hash value on [FeatureHasher](https://yoshoku.github.io/rumale/doc/Rumale/FeatureExtraction/FeatureHasher.html).
# 0.17.2
- Add transformer class for kernel approximation with [Nystroem](https://yoshoku.github.io/rumale/doc/Rumale/KernelApproximation/Nystroem.html) method.
- Delete array validation on [Pipeline](https://yoshoku.github.io/rumale/doc/Rumale/Pipeline/Pipeline.html) class considering that array of hash is given to HashVectorizer.
# 0.17.1
- Add transformer class for [PolynomialFeatures](https://yoshoku.github.io/rumale/doc/Rumale/Preprocessing/PolynomialFeatures.html)
- Add verbose and tol parameter to [FactorizationMachineClassifier](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel/FactorizationMachineClassifier.html)
and [FactorizationMachineRegressor](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel/FactorizationMachineRegressor.html)
- Fix bug that factor elements of Factorization Machines estimators are not learned caused by initializing factors to zero.
# 0.17.0
## Breaking changes
- Fix all linear model estimators to use the new abstract class ([BaseSGD](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/BaseSGD.html)) introduced in version 0.16.1.
The major differences from the old abstract class are that
the optimizer of LinearModel estimators is fixed to mini-batch SGD with momentum term,
the max_iter parameter indicates the number of epochs instead of the maximum number of iterations,
the fit_bias parameter is true by default, and elastic-net style regularization can be used.
Note that there are additions and changes to hyperparameters.
Existing trained linear models may need to re-train the model and adjust the hyperparameters.
- [LogisticRegression](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/LogisticRegression.html)
- [SVC](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/SVC.html)
- [LinearRegression](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/LinearRegression.html)
- [Rdige](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/Ridge.html)
- [Lasso](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/Lasso.html)
- [SVR](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/SVR.html)
- Change the default value of solver parameter on LinearRegression and Ridge to 'auto'.
If Numo::Linalg is loaded, 'svd' is selected for the solver, otherwise 'sgd' is selected.
- The meaning of the `max_iter` parameter of the factorization machine estimators
has been changed from the maximum number of iterations to the number of epochs.
- [FactorizationMachineClassifier](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel/FactorizationMachineClassifier.html)
- [FactorizationMachineRegressor](https://yoshoku.github.io/rumale/doc/Rumale/PolynomialModel/FactorizationMachineRegressor.html)
# 0.16.1
- Add regressor class for [ElasticNet](https://yoshoku.github.io/rumale/doc/Rumale/LinearModel/ElasticNet.html).
- Add new linear model abstract class.
- In version 0.17.0, all LinearModel estimators will be changed to use this new abstract class.
The major differences from the existing abstract class are that
the optimizer of LinearModel estimators is fixed to mini-batch SGD with momentum term,
the max_iter parameter indicates the number of epochs instead of the maximum number of iterations,
the fit_bias parameter is true by default, and elastic-net style regularization can be used.
# 0.16.0
## Breaking changes
- The meaning of the `max_iter` parameter of the multi-layer perceptron estimators
has been changed from the maximum number of iterations to the number of epochs.
The number of epochs is how many times the whole data is given to the training process.
As a future plan, similar changes will be applied to other estimators used stochastic gradient descent such as SVC and Lasso.
- [MLPClassifier](https://yoshoku.github.io/rumale/doc/Rumale/NeuralNetwork/MLPClassifier.html)
- [MLPRegressor](https://yoshoku.github.io/rumale/doc/Rumale/NeuralNetwork/MLPRegressor.html)
# 0.15.0
- Add feature extractor classes:
- [HashVectorizer](https://yoshoku.github.io/rumale/doc/Rumale/FeatureExtraction/HashVectorizer.html)
- [FeatureHasher](https://yoshoku.github.io/rumale/doc/Rumale/FeatureExtraction/FeatureHasher.html)
# 0.14.5
- Fix to suppress deprecation warning about keyword argument in Ruby 2.7.
# 0.14.4
- Add metric parameter that specifies distance metric to
[KNeighborsClassifier](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/KNeighborsClassifier.html) and
[KNeighborsRegressor](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/KNeighborsRegressor.html).
- Add algorithm parameter that specifies nearest neighbor search algorithm to
[KNeighborsClassifier](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/KNeighborsClassifier.html) and
[KNeighborsRegressor](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/KNeighborsRegressor.html).
- Add nearest neighbor search class with [vantage point tree](https://yoshoku.github.io/rumale/doc/Rumale/NearestNeighbors/VPTree.html).
# 0.14.3
- Fix documents of GradientBoosting, RandomForest, and ExtraTrees.
- Refactor gaussian mixture clustering with Rubocop.
- Refactor specs.
# 0.14.2
- Refactor extension codes of decision tree estimators.
- Refactor specs.
# 0.14.1
- Fix bug where MDS optimization is not performed when tol paremeter is given.
- Refactor specs.
# 0.14.0
- Add classifier and regressor class with multi-layer perceptron.
- [MLPClassifier](https://yoshoku.github.io/rumale/doc/Rumale/NeuralNetwork/MLPClassifier.html)
- [MLPRegressor](https://yoshoku.github.io/rumale/doc/Rumale/NeuralNetwork/MLPRegressor.html)
- Refactor specs.
## Breaking changes
- Change predict method of SVC, LogisticRegression, and FactorizationMachineClassifier classes to return the original label instead of -1 or 1 labels when binary classification problem.
- Fix hyperparameter validation to check if the type of given value is Numeric type.
- Fix array validation for samples, labels, and target values to accept Ruby Array.
```ruby
require 'rumale'
samples = [[-1, 1], [1, 1], [1, -1], [-1, -1]]
labels = [0, 1, 1, 0]
svc = Rumale::LinearModel::SVC.new(reg_param: 1, batch_size: 1, random_seed: 1)
svc.fit(samples, labels)
svc.predict([[-1, 0], [1, 0]])
# => Numo::Int32#shape=[2]
# [0, 1]
```
# 0.13.8
- Add [module function](https://yoshoku.github.io/rumale/doc/Rumale/Dataset.html#make_blobs-class_method) for generating artificial dataset with gaussian blobs.
- Add documents about Rumale::SVM.
- Refactor specs.
# 0.13.7
- Add some evaluator classes for clustering.
- [SilhouetteScore](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure/SilhouetteScore.html)
- [CalinskiHarabaszScore](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure/CalinskiHarabaszScore.html)
- [DaviesBouldinScore](https://yoshoku.github.io/rumale/doc/Rumale/EvaluationMeasure/DaviesBouldinScore.html)
# 0.13.6
- Add transformer class for [FastICA](https://yoshoku.github.io/rumale/doc/Rumale/Decomposition/FastICA.html).
- Fix a typo on README ([#13](https://github.com/yoshoku/rumale/pull/13)).
# 0.13.5
- Add transformer class for [Factor Analysis](https://yoshoku.github.io/rumale/doc/Rumale/Decomposition/FactorAnalysis.html).
- Add covariance_type parameter to [Rumale::Clustering::GaussianMixture](https://yoshoku.github.io/rumale/doc/Rumale/Clustering/GaussianMixture.html).
# 0.13.4
- Add cluster analysis class for [HDBSCAN](https://yoshoku.github.io/rumale/doc/Rumale/Clustering/HDBSCAN.html).
- Add cluster analysis class for [spectral clustering](https://yoshoku.github.io/rumale/doc/Rumale/Clustering/SpectralClustering.html).
- Refactor power iteration clustering.
- Several documentation improvements.
# 0.13.3
- Add transformer class for [Kernel PCA](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine/KernelPCA.html).
- Add regressor class for [Kernel Ridge](https://yoshoku.github.io/rumale/doc/Rumale/KernelMachine/KernelRidge.html).
# 0.13.2
- Add preprocessing class for label binarization.
- Fix to use LabelBinarizer instead of OneHotEncoder.
- Fix bug that OneHotEncoder leaves elements related to values that do not occur in training data.
# 0.13.1
- Add class for Shared Neareset Neighbor clustering.
- Add function for calculation of manhattan distance to Rumale::PairwiseMetric.
- Add metric parameter that specifies distance metric to Rumale::Clustering::DBSCAN.
- Add the solver parameter that specifies the optimization algorithm to Rumale::LinearModel::LinearRegression.
- Add the solver parameter that specifies the optimization algorithm to Rumale::LinearModel::Ridge.
- Fix bug that the ndim of NArray of 1-dimensional principal components is not 1.
# 0.13.0
- Introduce [Numo::Linalg](https://github.com/ruby-numo/numo-linalg) to use linear algebra algorithms on the optimization.
- Add the solver parameter that specifies the optimization algorithm to Rumale::Decomposition::PCA.
```ruby
require 'rumale'
# Loading Numo::Linalg enables features based on linear algebra algorithms.
require 'numo/linalg/autoloader'
decomposer = Rumale::Decomposition::PCA.new(n_components: 2, solver: 'evd')
low_dimensional_samples = decomposer.fit_transform(samples)
```
# 0.12.9
- Add class for K-Medoids clustering.
- Fix extension codes of decision tree regressor for using Numo::NArray.
# 0.12.8
- Fix bug that fails to build and install on Windows again. Fix extconf to add Numo::NArray libraries to $lib.
# 0.12.7
- Fix bug that fails to build and install on Windows. Add search for Numo::NArray static library path to extconf.
# 0.12.6
- Fix extension codes of decision tree classifier and gradient tree regressor for using Numo::NArray.
# 0.12.5
- Fix random number generator initialization on gradient boosting estimators
to obtain the same result with and without parallel option.
# 0.12.4
- Add class for multidimensional scaling.
- Fix parameter description on artificial dataset generation method.
# 0.12.3
- Add class for Power Iteration clustering.
- Add classes for artificial dataset generation.
# 0.12.2
- Add class for cluster analysis with Gaussian Mixture Model.
- Add encoder class for categorical features.
# 0.12.1
- Refactor kernel support vector classifier.
- Refactor random sampling on tree estimators.
# 0.12.0
## Breaking changes
- For reproductivity, Rumale changes to not repeatedly use the same random number generator in the same estimator.
In the training phase, estimators use a copy of the random number generator created in the initialize method.
Even with the same algorithm and the same data, the order of random number generation
may make slight differences in learning results.
By this change, even if the fit method is executed multiple times,
the same learning result can be obtained if the same data is given.
```ruby
svc = Rumale::LinearModel::SVC.new(random_seed: 0)
svc.fit(x, y)
a = svc.weight_vec
svc.fit(x, y)
b = svc.weight_vec
err = ((a - b)**2).mean
# In version 0.11.0 or earlier, false may be output,
# but from this version, true is always output.
puts(err < 1e-4)
```
# 0.11.0
- Introduce [Parallel gem](https://github.com/grosser/parallel) to improve execution speed for one-vs-the-rest and bagging methods.
- Add the n_jobs parameter that specifies the number of jobs for parallel processing in some estimators belong to the Rumale::LinearModel, Rumale::PolynomialModel, and Rumale::Ensemble.
- The n_jobs parameter is valid only when parallel gem is loaded.
```ruby
require 'rumale'
require 'parallel'
svc = Rumale::LinearModel::SVC.new(n_jobs: -1)
```
# 0.10.0
- Add class for t-distributed Stochastic Neighborhood Embedding.
- Fix bug of zero division on min-max scaling class.
# 0.9.2
- Add class for Gradient tree boosting classifier.
- Add class for Gradient tree boosting regressor.
- Add class for discretizing feature values.
- Refactor extra-trees estimators.
- Refactor decision tree base class.
- Fix some typos on document ([#6](https://github.com/yoshoku/rumale/pull/6)).
# 0.9.1
- Add class for Extra-Trees classifier.
- Add class for Extra-Trees regressor.
- Refactor extension modules of decision tree estimators for improving performance.
# 0.9.0
## Breaking changes
- Decide to introduce Ruby extensions for improving performance.
- Fix to find split point on decision tree estimators using extension modules.
# 0.8.4
- Remove unused parameter on Nadam.
- Fix condition to stop growing tree about decision tree.
# 0.8.3
- Add optimizer class for AdaGrad.
- Add evaluator class for ROC AUC.
- Add class for scaling with maximum absolute value.
# 0.8.2
- Add class for Adam optimizer.
- Add data splitter classes for random permutation cross validation.
- Add accessor method for number of splits to K-fold splitter classes.
- Add execution result of example script on README ([#3](https://github.com/yoshoku/rumale/pull/3)).
# 0.8.1
- Add some evaluator classes.
- MeanSquaredLogError
- MedianAbsoluteError
- ExplainedVarianceScore
- AdjustedRandScore
- MutualInformation
- Refactor normalized mutual infomation evaluator.
- Fix typo on document ([#2](https://github.com/yoshoku/rumale/pull/2)).
# 0.8.0
## Breaking changes
- Rename SVMKit to Rumale.
- Rename SGDLienareEstimator class to BaseLienarModel class.
- Add data type option to load_libsvm_file method. By default, the method represents the feature with Numo::DFloat.
## Refactoring
- Refactor factorization machine estimators.
- Refactor decision tree estimators.
# 0.7.3
- Add class for grid search performing hyperparameter optimization.
- Add argument validations to Pipeline.
# 0.7.2
- Add class for Pipeline that constructs chain of transformers and estimators.
- Fix some typos on document ([#1](https://github.com/yoshoku/SVMKit/pull/1)).
# 0.7.1
- Fix to use CSV class in parsing libsvm format file.
- Refactor ensemble estimators.
# 0.7.0
- Add class for AdaBoost classifier.
- Add class for AdaBoost regressor.
# 0.6.3
- Fix bug on setting random seed and max_features parameter of Random Forest estimators.
# 0.6.2
- Refactor decision tree classes for improving performance.
# 0.6.1
- Add abstract class for linear estimator with stochastic gradient descent.
- Refactor linear estimators to use linear esitmator abstract class.
- Refactor decision tree classes to avoid unneeded type conversion.
# 0.6.0
- Add class for Principal Component Analysis.
- Add class for Non-negative Matrix Factorization.
# 0.5.2
- Add class for DBSCAN clustering.
# 0.5.1
- Fix bug on class probability calculation of DecisionTreeClassifier.
# 0.5.0
- Add class for K-Means clustering.
- Add class for evaluating purity.
- Add class for evaluating normalized mutual information.
# 0.4.1
- Add class for linear regressor.
- Add class for SGD optimizer.
- Add class for RMSProp optimizer.
- Add class for YellowFin optimizer.
- Fix to be able to select optimizer on estimators of LineaModel and PolynomialModel.
# 0.4.0
## Breaking changes
SVMKit introduces optimizer algorithm that calculates learning rates adaptively
on each iteration of stochastic gradient descent (SGD).
While Pegasos SGD runs fast, it sometimes fails to optimize complicated models
like Factorization Machine.
To solve this problem, in version 0.3.3, SVMKit introduced optimization with RMSProp on
FactorizationMachineRegressor, Ridge and Lasso.
This attempt realized stable optimization of those estimators.
Following the success of the attempt, author decided to use modern optimizer algorithms
with all SGD optimizations in SVMKit.
Through some preliminary experiments, author implemented Nadam as the default optimizer.
SVMKit plans to add other optimizer algorithms sequentially, so that users can select them.
- Fix to use Nadam for optimization on SVC, SVR, LogisticRegression, Ridge, Lasso, and Factorization Machine estimators.
- Combine reg_param_weight and reg_param_bias parameters on Factorization Machine estimators into the unified parameter named reg_param_linear.
- Remove init_std paramter on Factorization Machine estimators.
- Remove learning_rate, decay, and momentum parameters on Ridge, Lasso, and FactorizationMachineRegressor.
- Remove normalize parameter on SVC, SVR, and LogisticRegression.
# 0.3.3
- Add class for Ridge regressor.
- Add class for Lasso regressor.
- Fix bug on gradient calculation of FactorizationMachineRegressor.
- Fix some documents.
# 0.3.2
- Add class for Factorization Machine regressor.
- Add class for Decision Tree regressor.
- Add class for Random Forest regressor.
- Fix to support loading and dumping libsvm file with multi-target variables.
- Fix to require DecisionTreeClassifier on RandomForestClassifier.
- Fix some mistakes on document.
# 0.3.1
- Fix bug on decision function calculation of FactorizationMachineClassifier.
- Fix bug on weight updating process of KernelSVC.
# 0.3.0
- Add class for Support Vector Regression.
- Add class for K-Nearest Neighbor Regression.
- Add class for evaluating coefficient of determination.
- Add class for evaluating mean squared error.
- Add class for evaluating mean absolute error.
- Fix to use min method instead of sort and first methods.
- Fix cross validation class to be able to use for regression problem.
- Fix some typos on document.
- Rename spec filename for Factorization Machine classifier.
# 0.2.9
- Add predict_proba method to SVC and KernelSVC.
- Add class for evaluating logarithmic loss.
- Add classes for Label- and One-Hot- encoding.
- Add some validator.
- Fix bug on training data score calculation of cross validation.
- Fix fit method of SVC for performance.
- Fix criterion calculation on Decision Tree for performance.
- Fix data structure of Decision Tree for performance.
# 0.2.8
- Fix bug on gradient calculation of Logistic Regression.
- Fix to change accessor of params of estimators to read only.
- Add parameter validation.
# 0.2.7
- Fix to support multiclass classifiction into LinearSVC, LogisticRegression, KernelSVC, and FactorizationMachineClassifier
# 0.2.6
- Add class for Decision Tree classifier.
- Add class for Random Forest classifier.
- Fix to use frozen string literal.
- Refactor marshal dump method on some classes.
- Introduce Coveralls to confirm test coverage.
# 0.2.5
- Add classes for Naive Bayes classifier.
- Fix decision function method on Logistic Regression class.
- Fix method visibility on RBF kernel approximation class.
# 0.2.4
- Add class for Factorization Machine classifier.
- Add classes for evaluation measures.
- Fix the method for prediction of class probability in Logistic Regression.
# 0.2.3
- Add class for cross validation.
- Add specs for base modules.
- Fix validation of the number of splits when a negative label is given.
# 0.2.2
- Add data splitter classes for K-fold cross validation.
# 0.2.1
- Add class for K-nearest neighbors classifier.
# 0.2.0
- Migrated the linear algebra library to Numo::NArray.
- Add module for loading and saving libsvm format file.
# 0.1.3
- Add class for Kernel Support Vector Machine with Pegasos algorithm.
- Add module for calculating pairwise kernel fuctions and euclidean distances.
# 0.1.2
- Add the function learning a model with bias term to the PegasosSVC and LogisticRegression classes.
- Rewrite the document with yard notation.
# 0.1.1
- Add class for Logistic Regression with SGD optimization.
- Fix some mistakes on the document.
# 0.1.0
- Add basic classes.
- Add an utility module.
- Add class for RBF kernel approximation.
- Add class for Support Vector Machine with Pegasos alogrithm.
- Add class that performs mutlclass classification with one-vs.-rest strategy.
- Add classes for preprocessing such as min-max scaling, standardization, and L2 normalization.
| {
"content_hash": "f6dc3c315c57accc4b778184a110972f",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 247,
"avg_line_length": 48.15179968701096,
"alnum_prop": 0.7841008807566057,
"repo_name": "yoshoku/SVMKit",
"id": "beb943d85520adcdd2ed7dd8bb1d15ad7aa6641a",
"size": "30778",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Perl",
"bytes": "219"
},
{
"name": "Ruby",
"bytes": "414070"
},
{
"name": "Shell",
"bytes": "131"
}
],
"symlink_target": ""
} |
package Armadillo.Analytics.Stat.Distributions;
import Armadillo.Analytics.Stat.Random.IRng;
public abstract class AUnivContDist extends AUnivDist
{
public AUnivContDist(IRng rng)
{
super(rng);
}
public double[] NextDoubleArr(int n)
{
double[] x = new double[n];
for (int i = 0; i < n; i++)
{
x[i] = NextDouble();
}
return x;
}
// public Vector NextDoubleVector(int n)
// {
// double[] dblRandomArr = NextDoubleArr(n);
// return new Vector(dblRandomArr);
// }
public double Cdf(
double dblLowLimit,
double dblHighLimit)
{
return Cdf(dblHighLimit) - Cdf(dblLowLimit);
}
/// <summary>
/// Probability density function
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public abstract double Pdf(double dblX);
/// <summary>
/// Returns a random number from the distribution.
/// </summary>
/// <returns></returns>
public abstract double NextDouble();
/// <summary>
/// Cumulative distribution function
/// </summary>
/// <param name="dblX"></param>
/// <returns></returns>
public abstract double Cdf(double dblX);
/// <summary>
/// Inverse Cdf
/// </summary>
/// <param name="dblProbability"></param>
/// <returns></returns>
public abstract double CdfInv(double dblProbability);
} | {
"content_hash": "0d41149186cf3c854e2df0a52617c0ef",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 57,
"avg_line_length": 23.80952380952381,
"alnum_prop": 0.556,
"repo_name": "camachohoracio/Armadillo.Core",
"id": "47c86723992ada3d9193be44d9f35ed3541573c8",
"size": "1500",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Analytics/src/main/java/Armadillo/Analytics/Stat/Distributions/AUnivContDist.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "3273913"
}
],
"symlink_target": ""
} |
// .NAME vtkRect - templated base type for storage of 2D rectangles.
//
// .SECTION Description
// This class is a templated data type for storing and manipulating rectangles.
// The memory layout is a contiguous array of the specified type, such that a
// float[4] can be cast to a vtkRectf and manipulated. Also a float[12] could
// be cast and used as a vtkRectf[3].
#ifndef __vtkRect_h
#define __vtkRect_h
#include "vtkVector.h"
template<typename T>
class vtkRect : public vtkVector<T, 4>
{
public:
vtkRect()
{
}
vtkRect(const T& x, const T& y, const T& width, const T& height)
{
this->Data[0] = x;
this->Data[1] = y;
this->Data[2] = width;
this->Data[3] = height;
}
explicit vtkRect(const T* init) : vtkVector<T, 4>(init) { }
// Description:
// Set the x, y components of the rectangle, and the width/height.
void Set(const T& x, const T& y, const T& width, const T& height)
{
this->Data[0] = x;
this->Data[1] = y;
this->Data[2] = width;
this->Data[3] = height;
}
// Description:
// Set the x component of the rectangle bottom corner, i.e. element 0.
void SetX(const T& x) { this->Data[0] = x; }
// Description:
// Get the x component of the rectangle bottom corner, i.e. element 0.
const T& GetX() const { return this->Data[0]; }
const T& X() const { return this->Data[0]; }
// Description:
// Set the y component of the rectangle bottom corner, i.e. element 1.
void SetY(const T& y) { this->Data[1] = y; }
// Description:
// Get the y component of the rectangle bottom corner, i.e. element 1.
const T& GetY() const { return this->Data[1]; }
const T& Y() const { return this->Data[1]; }
// Description:
// Set the width of the rectanle, i.e. element 2.
void SetWidth(const T& width) { this->Data[2] = width; }
// Description:
// Get the width of the rectangle, i.e. element 2.
const T& GetWidth() const { return this->Data[2]; }
const T& Width() const { return this->Data[2]; }
// Description:
// Set the height of the rectangle, i.e. element 3.
void SetHeight(const T& height) { this->Data[3] = height; }
// Description:
// Get the height of the rectangle, i.e. element 3.
const T& GetHeight() const { return this->Data[3]; }
const T& Height() const { return this->Data[3]; }
};
class vtkRecti : public vtkRect<int>
{
public:
vtkRecti() {}
vtkRecti(int x, int y, int width, int height)
: vtkRect<int>(x, y, width, height) {}
explicit vtkRecti(const int *init) : vtkRect<int>(init) {}
};
class vtkRectf : public vtkRect<float>
{
public:
vtkRectf() {}
vtkRectf(float x, float y, float width, float height)
: vtkRect<float>(x, y, width, height) {}
explicit vtkRectf(const float *init) : vtkRect<float>(init) {}
};
class vtkRectd : public vtkRect<double>
{
public:
vtkRectd() {}
vtkRectd(double x, double y, double width, double height)
: vtkRect<double>(x, y, width, height) {}
explicit vtkRectd(const double *init) : vtkRect<double>(init) {}
};
#endif // __vtkRect_h
// VTK-HeaderTest-Exclude: vtkRect.h
| {
"content_hash": "7730f2ad5db0fcb3f6a4cb1a8f1debcd",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 79,
"avg_line_length": 27.927272727272726,
"alnum_prop": 0.64453125,
"repo_name": "aashish24/VTK-old",
"id": "405ecbc65b831737ec43d4751de2c76dfa2c6c3d",
"size": "3651",
"binary": false,
"copies": "2",
"ref": "refs/heads/cvshead",
"path": "Common/DataModel/vtkRect.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "37780"
},
{
"name": "C",
"bytes": "29104777"
},
{
"name": "C++",
"bytes": "44530249"
},
{
"name": "Java",
"bytes": "89326"
},
{
"name": "Objective-C",
"bytes": "907576"
},
{
"name": "Perl",
"bytes": "175758"
},
{
"name": "Prolog",
"bytes": "340"
},
{
"name": "Python",
"bytes": "923074"
},
{
"name": "Shell",
"bytes": "3723"
},
{
"name": "Tcl",
"bytes": "1875947"
}
],
"symlink_target": ""
} |
// Copyright (C) 2005 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.caja.parser.js;
import com.google.caja.lexer.FilePosition;
import com.google.caja.reporting.RenderContext;
import java.util.List;
/**
*
* @author [email protected]
*/
public final class ThrowStmt extends AbstractStatement {
private static final long serialVersionUID = 6894047499156075804L;
/** @param value unused. This ctor is provided for reflection. */
@ReflectiveCtor
public ThrowStmt(
FilePosition pos, Void value, List<? extends Expression> children) {
this(pos, children.get(0));
}
public ThrowStmt(FilePosition pos, Expression exception) {
super(pos, Expression.class);
createMutation().appendChild(exception).execute();
}
@Override
protected void childrenChanged() {
super.childrenChanged();
if (1 != children().size()) { throw new IllegalStateException(); }
}
@Override
public Object getValue() { return null; }
public Expression getException() { return children().get(0); }
@Override
public List<? extends Expression> children() {
return childrenAs(Expression.class);
}
public void render(RenderContext rc) {
rc.getOut().mark(getFilePosition());
rc.getOut().consume("throw");
getException().render(rc);
}
public boolean hasHangingConditional() { return false; }
}
| {
"content_hash": "c084ade55cd09c2515f59e404996532b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 75,
"avg_line_length": 29.936507936507937,
"alnum_prop": 0.7184517497348887,
"repo_name": "wishabi/caja-1",
"id": "3ce8b43bc239834a820ac457a2f01974069d8b35",
"size": "1886",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/com/google/caja/parser/js/ThrowStmt.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ActionScript",
"bytes": "17339"
},
{
"name": "CSS",
"bytes": "30715"
},
{
"name": "HTML",
"bytes": "1083151"
},
{
"name": "Java",
"bytes": "2537833"
},
{
"name": "JavaScript",
"bytes": "2076561"
},
{
"name": "Perl",
"bytes": "5572"
},
{
"name": "Python",
"bytes": "23812"
},
{
"name": "Shell",
"bytes": "2820"
}
],
"symlink_target": ""
} |
u.prototype.trigger = function (events) {
var data = this.slice(arguments).slice(1);
return this.eacharg(events, function (node, event) {
var ev;
// Allow the event to bubble up and to be cancelable (as default)
var opts = { bubbles: true, cancelable: true, detail: data };
try {
// Accept different types of event names or an event itself
ev = new window.CustomEvent(event, opts);
} catch (e) {
ev = document.createEvent('CustomEvent');
ev.initCustomEvent(event, true, true, data);
}
node.dispatchEvent(ev);
});
};
| {
"content_hash": "856512a72d2ae0878044e9a914ea7d43",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 69,
"avg_line_length": 28.9,
"alnum_prop": 0.6401384083044983,
"repo_name": "umbrellajs/umbrella",
"id": "c4dd5c2e8602de500b7486df42d7f3f77136980c",
"size": "621",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/plugins/trigger/trigger.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14143"
},
{
"name": "HTML",
"bytes": "127341"
},
{
"name": "JavaScript",
"bytes": "226871"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
<bill>
<updateDate>2017-01-27T09:53:09Z</updateDate>
<latestAction>
<actionDate>2017-01-09</actionDate>
<text>Read twice and referred to the Committee on Finance.</text>
<links />
</latestAction>
<title>Emergency Citrus Disease Response Act</title>
<billNumber>71</billNumber>
<notes />
<subjects>
<billSubjects>
<legislativeSubjects>
<item>
<name>Business investment and capital</name>
</item>
<item>
<name>Forests, forestry, trees</name>
</item>
<item>
<name>Fruit and vegetables</name>
</item>
<item>
<name>Horticulture and plants</name>
</item>
<item>
<name>Income tax deductions</name>
</item>
</legislativeSubjects>
<policyArea>
<name>Taxation</name>
</policyArea>
</billSubjects>
</subjects>
<originChamber>Senate</originChamber>
<sponsors>
<item>
<identifiers>
<lisID>859</lisID>
<bioguideId>N000032</bioguideId>
<gpoId>8236</gpoId>
</identifiers>
<middleName>WILLIAM</middleName>
<lastName>NELSON</lastName>
<firstName>CLARENCE</firstName>
<byRequestType />
<fullName>Sen. Nelson, Bill [D-FL]</fullName>
<party>D</party>
<state>FL</state>
<bioguideId>N000032</bioguideId>
</item>
</sponsors>
<congress>115</congress>
<policyArea>
<name>Taxation</name>
</policyArea>
<introducedDate>2017-01-09</introducedDate>
<summaries>
<billSummaries>
<item>
<lastSummaryUpdateDate>2017-01-24T19:54:03Z</lastSummaryUpdateDate>
<updateDate>2017-01-09T05:00:00Z</updateDate>
<actionDate>2017-01-09</actionDate>
<versionCode>00</versionCode>
<actionDesc>Introduced in Senate</actionDesc>
<text><![CDATA[<p><strong>Emergency Citrus Disease Response Act </strong></p> <p>This bill amends the Internal Revenue Code to allow a full deduction in the current taxable year of the cost of replanting lost or damaged citrus plants. The taxpayer must own an equity interest of at least 50% in such replanted plants and may deduct costs paid or incurred through the date that is ten years after the enactment of this bill. </p>]]></text>
<name>Introduced in Senate</name>
</item>
</billSummaries>
</summaries>
<cboCostEstimates />
<billType>S</billType>
<relatedBills>
<item>
<latestTitle>Emergency Citrus Disease Response Act of 2017</latestTitle>
<relationshipDetails>
<item>
<type>Related bill</type>
<identifiedBy>CRS</identifiedBy>
</item>
</relationshipDetails>
<number>112</number>
<type>HR</type>
<congress>115</congress>
<latestAction>
<actionDate>2017-01-03</actionDate>
<text>Referred to the House Committee on Ways and Means.</text>
</latestAction>
</item>
</relatedBills>
<cosponsors>
<item>
<lastName>Rubio</lastName>
<isOriginalCosponsor>True</isOriginalCosponsor>
<middleName />
<fullName>Sen. Rubio, Marco [R-FL]</fullName>
<firstName>Marco</firstName>
<bioguideId>R000595</bioguideId>
<party>R</party>
<sponsorshipWithdrawnDate />
<state>FL</state>
<identifiers>
<lisID>2084</lisID>
<bioguideId>R000595</bioguideId>
<gpoId>8242</gpoId>
</identifiers>
<sponsorshipDate>2017-01-09</sponsorshipDate>
</item>
<item>
<lastName>Cornyn</lastName>
<isOriginalCosponsor>False</isOriginalCosponsor>
<middleName />
<fullName>Sen. Cornyn, John [R-TX]</fullName>
<firstName>John</firstName>
<bioguideId>C001056</bioguideId>
<party>R</party>
<sponsorshipWithdrawnDate />
<state>TX</state>
<identifiers>
<lisID>1692</lisID>
<gpoId>8295</gpoId>
<bioguideId>C001056</bioguideId>
</identifiers>
<sponsorshipDate>2017-01-17</sponsorshipDate>
</item>
</cosponsors>
<actions>
<item>
<actionDate>2017-01-09</actionDate>
<committee>
<name>Finance Committee</name>
<systemCode>ssfi00</systemCode>
</committee>
<links />
<sourceSystem>
<name>Senate</name>
<code>0</code>
</sourceSystem>
<text>Read twice and referred to the Committee on Finance.</text>
<type>IntroReferral</type>
</item>
<item>
<sourceSystem>
<name>Library of Congress</name>
<code>9</code>
</sourceSystem>
<text>Introduced in Senate</text>
<committee />
<actionCode>10000</actionCode>
<actionDate>2017-01-09</actionDate>
<type>IntroReferral</type>
<links />
</item>
<actionTypeCounts>
<referredToCommittee>1</referredToCommittee>
<introducedInSenate>1</introducedInSenate>
</actionTypeCounts>
<actionByCounts>
<senate>2</senate>
</actionByCounts>
</actions>
<createDate>2017-01-10T05:15:46Z</createDate>
<laws />
<amendments />
<recordedVotes />
<committees>
<billCommittees>
<item>
<subcommittees />
<type>Standing</type>
<name>Finance Committee</name>
<systemCode>ssfi00</systemCode>
<chamber>Senate</chamber>
<activities>
<item>
<name>Referred to</name>
<date>2017-01-09T23:57:52Z</date>
</item>
</activities>
</item>
</billCommittees>
</committees>
<committeeReports />
<calendarNumbers />
<titles>
<item>
<parentTitleType />
<titleType>Short Titles as Introduced</titleType>
<chamberCode />
<chamberName />
<title>Emergency Citrus Disease Response Act</title>
</item>
<item>
<parentTitleType />
<titleType>Official Title as Introduced</titleType>
<chamberCode />
<chamberName />
<title>A bill to amend the Internal Revenue Code of 1986 to temporarily allow expensing of certain costs of replanting citrus plants lost by reason of casualty.</title>
</item>
<item>
<parentTitleType />
<titleType>Display Title</titleType>
<chamberCode />
<chamberName />
<title>Emergency Citrus Disease Response Act</title>
</item>
</titles>
</bill>
<dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>text/xml</dc:format>
<dc:language>EN</dc:language>
<dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
<dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
<dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
</dublinCore>
</billStatus>
| {
"content_hash": "a3b9eba1464448edd1ca5ddfda6968d0",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 676,
"avg_line_length": 36.0958904109589,
"alnum_prop": 0.6079696394686906,
"repo_name": "abigpotostew/easypolitics",
"id": "9c6851440406c8a51bdd0715a34586da5865b308",
"size": "7905",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "rest/src/test/resources/data/115/bills/s/s71/fdsys_billstatus.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "17953"
},
{
"name": "HTML",
"bytes": "11607"
},
{
"name": "JavaScript",
"bytes": "405"
},
{
"name": "Kotlin",
"bytes": "424534"
},
{
"name": "Shell",
"bytes": "4612"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>User agent detail - Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="../circle.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Test suite</th></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /><small>vendor/zsxsoft/php-useragent/tests/UserAgentList.php</small></td><td>Internet Explorer 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-cc0b14fd-de64-41b9-a57c-c778ee172802">Detail</a>
<!-- Modal Structure -->
<div id="modal-cc0b14fd-de64-41b9-a57c-c778ee172802" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[0] => img/16/browser/msie7.png
[1] => img/16/os/win-4.png
[2] => Internet Explorer
[3] => 8.0
[4] => Internet Explorer 8.0
[5] => Windows
[6] => 7
[7] => Windows 7
[8] =>
[9] => os
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapFull<br /><small>6014</small><br /></td><td>IE 8.0</td><td>Trident 4.0</td><td>Win7 6.1</td><td style="border-left: 1px solid #555"></td><td></td><td>Desktop</td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.022</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-47a9cd06-e213-4882-bc34-db6aed664223">Detail</a>
<!-- Modal Structure -->
<div id="modal-47a9cd06-e213-4882-bc34-db6aed664223" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapFull result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/4\.0 \(compatible; msie 8\.0.*; .*windows nt 6\.1.*$/
[browser_name_pattern] => mozilla/4.0 (compatible; msie 8.0*; *windows nt 6.1*
[parent] => IE 8.0
[comment] => IE 8.0
[browser] => IE
[browser_type] => Browser
[browser_bits] => 32
[browser_maker] => Microsoft Corporation
[browser_modus] => unknown
[version] => 8.0
[majorver] => 8
[minorver] => 0
[platform] => Win7
[platform_version] => 6.1
[platform_description] => Windows 7
[platform_bits] => 32
[platform_maker] => Microsoft Corporation
[alpha] =>
[beta] =>
[win16] =>
[win32] => 1
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] => 1
[javascript] => 1
[vbscript] => 1
[javaapplets] => 1
[activexcontrols] => 1
[ismobiledevice] =>
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[isfake] =>
[isanonymized] =>
[ismodified] => 1
[cssversion] => 2
[aolversion] => 0
[device_name] => Windows Desktop
[device_maker] => Various
[device_type] => Desktop
[device_pointing_method] => mouse
[device_code_name] => Windows Desktop
[device_brand_name] => unknown
[renderingengine_name] => Trident
[renderingengine_version] => 4.0
[renderingengine_description] => For Internet Explorer since version 4.0 and embedded WebBrowser controls (such as Internet Explorer shells, Maxthon and some media players).
[renderingengine_maker] => Microsoft Corporation
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapLite<br /><small>6014</small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Win7 </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Desktop</td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.012</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-42bb56ba-b834-47c5-bea0-c0270e9ab371">Detail</a>
<!-- Modal Structure -->
<div id="modal-42bb56ba-b834-47c5-bea0-c0270e9ab371" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapLite result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/4\.0 \(compatible; msie 8\.0.*; .*windows nt 6\.1.*$/
[browser_name_pattern] => mozilla/4.0 (compatible; msie 8.0*; *windows nt 6.1*
[parent] => IE 8.0
[comment] => IE 8.0
[browser] => IE
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => unknown
[browser_modus] => unknown
[version] => 8.0
[majorver] => 0
[minorver] => 0
[platform] => Win7
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] =>
[istablet] =>
[issyndicationreader] => false
[crawler] => false
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Desktop
[device_pointing_method] => unknown
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>BrowscapPhp<br /><small>6014</small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Win7 </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Desktop</td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.013</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68">Detail</a>
<!-- Modal Structure -->
<div id="modal-ad0041a2-b0f4-43f6-a70d-cad1443caa68" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^mozilla\/4\.0 \(compatible; msie 8\.0.*; .*windows nt 6\.1.*$/
[browser_name_pattern] => mozilla/4.0 (compatible; msie 8.0*; *windows nt 6.1*
[parent] => IE 8.0
[comment] => IE 8.0
[browser] => IE
[browser_type] => unknown
[browser_bits] => 0
[browser_maker] => Microsoft Corporation
[browser_modus] => unknown
[version] => 8.0
[majorver] => 8
[minorver] => 0
[platform] => Win7
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] => false
[beta] => false
[win16] => false
[win32] => false
[win64] => false
[frames] => false
[iframes] => false
[tables] => false
[cookies] => false
[backgroundsounds] => false
[javascript] => false
[vbscript] => false
[javaapplets] => false
[activexcontrols] => false
[ismobiledevice] =>
[istablet] =>
[issyndicationreader] => false
[crawler] =>
[isfake] => false
[isanonymized] => false
[ismodified] => false
[cssversion] => 0
[aolversion] => 0
[device_name] => unknown
[device_maker] => unknown
[device_type] => Desktop
[device_pointing_method] => mouse
[device_code_name] => unknown
[device_brand_name] => unknown
[renderingengine_name] => unknown
[renderingengine_version] => unknown
[renderingengine_description] => unknown
[renderingengine_maker] => unknown
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.1</small><br /></td><td>MSIE 8.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050">Detail</a>
<!-- Modal Structure -->
<div id="modal-15fbc1f0-2615-4d42-b5d9-a30dd647b050" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] => Windows
[browser] => MSIE
[version] => 8.0
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>JenssegersAgent<br /><small>v2.3.3</small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Windows 6.1</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.005</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51">Detail</a>
<!-- Modal Structure -->
<div id="modal-b85a2b91-6a55-4436-a82c-1ea0d46e2e51" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>JenssegersAgent result detail</h4>
<p><pre><code class="php">Array
(
[browserName] => IE
[browserVersion] => 8.0
[osName] => Windows
[osVersion] => 6.1
[deviceModel] =>
[isMobile] =>
[isRobot] =>
[botName] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Windows 6.1</td><td style="border-left: 1px solid #555"></td><td></td><td>desktop-browser</td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.23101</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b">Detail</a>
<!-- Modal Structure -->
<div id="modal-8c2a7a4e-3fbf-4df2-8d61-5e730422f67b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 0
[is_mobile] =>
[type] => desktop-browser
[mobile_brand] =>
[mobile_model] =>
[version] => 8.0
[is_android] =>
[browser_name] => IE
[operating_system_family] => Windows
[operating_system_version] => 6.1
[is_ios] =>
[producer] => Microsoft Corporation.
[operating_system] => Windows 7
[mobile_screen_width] => 0
[mobile_browser] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.6.1</small><br /></td><td>Internet Explorer 8.0</td><td>Trident </td><td>Windows 7</td><td style="border-left: 1px solid #555"></td><td></td><td>desktop</td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.006</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-4a941d34-a8d3-4914-9724-346f60ad7046">Detail</a>
<!-- Modal Structure -->
<div id="modal-4a941d34-a8d3-4914-9724-346f60ad7046" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => Internet Explorer
[short_name] => IE
[version] => 8.0
[engine] => Trident
)
[operatingSystem] => Array
(
[name] => Windows
[short_name] => WIN
[version] => 7
[platform] =>
)
[device] => Array
(
[brand] =>
[brandName] =>
[model] =>
[device] => 0
[deviceName] => desktop
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] =>
[isTablet] =>
[isTV] =>
[isDesktop] => 1
[isMobile] =>
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.1</small><br /></td><td>Internet Explorer 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7</td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-ec1cd248-02b0-457e-8a9d-35bb99af008c">Detail</a>
<!-- Modal Structure -->
<div id="modal-ec1cd248-02b0-457e-8a9d-35bb99af008c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>SinergiBrowserDetector result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Sinergi\BrowserDetector\Browser Object
(
[userAgent:Sinergi\BrowserDetector\Browser:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
)
[name:Sinergi\BrowserDetector\Browser:private] => Internet Explorer
[version:Sinergi\BrowserDetector\Browser:private] => 8.0
[isRobot:Sinergi\BrowserDetector\Browser:private] =>
[isChromeFrame:Sinergi\BrowserDetector\Browser:private] =>
[isFacebookWebView:Sinergi\BrowserDetector\Browser:private] =>
[isCompatibilityMode:Sinergi\BrowserDetector\Browser:private] =>
)
[operatingSystem] => Sinergi\BrowserDetector\Os Object
(
[name:Sinergi\BrowserDetector\Os:private] => Windows
[version:Sinergi\BrowserDetector\Os:private] => 7
[isMobile:Sinergi\BrowserDetector\Os:private] =>
[userAgent:Sinergi\BrowserDetector\Os:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
)
)
[device] => Sinergi\BrowserDetector\Device Object
(
[name:Sinergi\BrowserDetector\Device:private] => unknown
[userAgent:Sinergi\BrowserDetector\Device:private] => Sinergi\BrowserDetector\UserAgent Object
(
[userAgentString:Sinergi\BrowserDetector\UserAgent:private] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
)
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UAParser<br /><small>v3.4.5</small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7 </td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.005</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-3160e405-8a8f-46dd-8f47-5115f06462d2">Detail</a>
<!-- Modal Structure -->
<div id="modal-3160e405-8a8f-46dd-8f47-5115f06462d2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 8
[minor] => 0
[patch] =>
[family] => IE
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Windows 7
)
[device] => UAParser\Result\Device Object
(
[brand] =>
[model] =>
[family] => Other
)
[originalUserAgent] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentApiCom<br /><small></small><br /></td><td>Internet Explorer 8.0</td><td> </td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>Desktop</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.15101</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6">Detail</a>
<!-- Modal Structure -->
<div id="modal-afeb05fb-26b9-4509-b8ac-0c604a9e97d6" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[platform_name] => Windows 7
[platform_version] => Windows NT 6.1
[platform_type] => Desktop
[browser_name] => Internet Explorer
[browser_version] => 8.0
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small><br /></td><td>Internet Explorer 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7 </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.089</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee">Detail</a>
<!-- Modal Structure -->
<div id="modal-08a9ddfb-838f-48d7-9ede-1d132306b2ee" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => Internet Explorer
[agent_version] => 8.0
[os_type] => Windows
[os_name] => Windows 7
[os_versionName] =>
[os_versionNumber] =>
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small><br /></td><td>Internet Explorer 8.0</td><td>Trident </td><td>Windows Windows NT 6.1</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.24601</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c">Detail</a>
<!-- Modal Structure -->
<div id="modal-5fc1ff22-a74d-481b-9ad1-fcfde73ded9c" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] => Windows
[simple_sub_description_string] =>
[simple_browser_string] => Internet Explorer 8 on Windows 7
[browser_version] => 8
[extra_info] => stdClass Object
(
[20] => Array
(
[0] => Possibly running on Windows Server 2008 R2
)
)
[operating_platform] =>
[extra_info_table] => Array
(
)
[layout_engine_name] => Trident
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
[0] => stdClass Object
(
[code] => microsoft-dotnet
[name] => Microsoft .Net
[versions] => Array
(
[0] => stdClass Object
(
[simple] => 2.0
[full] => 2.0.50727
)
[1] => stdClass Object
(
[simple] => 3.0
[full] => 3.0.04506.648
)
[2] => stdClass Object
(
[simple] => 3.5
[full] => 3.5.21022
)
)
)
)
[browser_name_code] => internet-explorer
[operating_system_version] => 7
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
)
[operating_platform_vendor_name] =>
[operating_system] => Windows 7
[operating_system_version_full] => Windows NT 6.1
[operating_platform_code] =>
[browser_name] => Internet Explorer
[operating_system_name_code] => windows
[user_agent] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
[browser_version_full] => 8.0
[browser] => Internet Explorer 8
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>v2.0.18</small><br /></td><td>Internet Explorer 8.0</td><td>Trident </td><td>Windows 7</td><td style="border-left: 1px solid #555"></td><td></td><td>desktop</td><td></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.002</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-083a336f-5d73-4505-84f3-c5fc9bb78652">Detail</a>
<!-- Modal Structure -->
<div id="modal-083a336f-5d73-4505-84f3-c5fc9bb78652" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => Internet Explorer
[version] => 8.0
[type] => browser
)
[engine] => Array
(
[name] => Trident
)
[os] => Array
(
[name] => Windows
[version] => Array
(
[value] => 6.1
[alias] => 7
)
)
[device] => Array
(
[type] => desktop
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small><br /></td><td>Internet Explorer 8.0</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>pc</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9">Detail</a>
<!-- Modal Structure -->
<div id="modal-f00e7198-0e22-49fe-bad0-dbb3a9cde9b9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Woothee result detail</h4>
<p><pre><code class="php">Array
(
[name] => Internet Explorer
[vendor] => Microsoft
[version] => 8.0
[category] => pc
[os] => Windows 7
[os_version] => NT 6.1
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Wurfl<br /><small>1.7.1.0</small><br /></td><td>IE 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7</td><td style="border-left: 1px solid #555"></td><td></td><td>Desktop</td><td></td><td></td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.021</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50">Detail</a>
<!-- Modal Structure -->
<div id="modal-a2bedf8c-4a95-42a7-96c5-aaf233b2ac50" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => true
[is_largescreen] => true
[is_mobile] => false
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => false
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] => Windows
[advertised_device_os_version] => 7
[advertised_browser] => IE
[advertised_browser_version] => 8.0
[complete_device_name] => Microsoft Internet Explorer
[device_name] => Microsoft Internet Explorer
[form_factor] => Desktop
[is_phone] => false
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Microsoft
[model_name] => Internet Explorer
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => false
[device_claims_web_support] => true
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] =>
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] => Desktop
[mobile_browser] => MSIE
[mobile_browser_version] => 8.0
[device_os_version] =>
[pointing_method] => mouse
[release_date] => 2007_january
[marketing_name] =>
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => false
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => false
[softkey_support] => false
[table_support] => false
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => false
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => false
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => false
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => none
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => true
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => true
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => true
[xhtml_select_as_radiobutton] => true
[xhtml_select_as_popup] => true
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => false
[xhtml_supports_css_cell_table_coloring] => false
[xhtml_format_as_css_property] => false
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => false
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => none
[xhtmlmp_preferred_mime_type] => text/html
[xhtml_table_support] => false
[xhtml_send_sms_string] => none
[xhtml_send_mms_string] => none
[xhtml_file_upload] => supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => full
[xhtml_avoid_accesskeys] => true
[xhtml_can_embed_video] => play_and_stop
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => false
[wml_1_2] => false
[wml_1_3] => false
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => false
[html_wi_imode_html_1] => false
[html_wi_imode_html_2] => false
[html_wi_imode_html_3] => false
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 800
[resolution_height] => 600
[columns] => 120
[max_image_width] => 800
[max_image_height] => 600
[rows] => 200
[physical_screen_width] => 400
[physical_screen_height] => 400
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => false
[bmp] => true
[epoc_bmp] => false
[gif_animated] => true
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 3200
[wifi] => true
[sdio] => false
[vpn] => false
[has_cellular_radio] => false
[max_deck_size] => 100000
[max_url_length_in_requests] => 128
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => false
[inline_support] => false
[oma_support] => false
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => false
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => false
[streaming_3gpp] => false
[streaming_mp4] => false
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => -1
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => -1
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => none
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[wap_push_support] => false
[connectionless_service_indication] => false
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => true
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => false
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => false
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => true
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => true
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => true
[progressive_download] => true
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => html4
[viewport_supported] => false
[viewport_width] => width_equals_max_image_width
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => none
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => true
[jqm_grade] => A
[is_sencha_touch_ok] => true
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Zsxsoft<br /><small>1.3</small><br /></td><td>Internet Explorer 8.0</td><td><i class="material-icons">close</i></td><td>Windows 7</td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.001</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-5d43e024-b46c-44f6-8914-529b05569bc2">Detail</a>
<!-- Modal Structure -->
<div id="modal-5d43e024-b46c-44f6-8914-529b05569bc2" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Zsxsoft result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[link] => http://www.microsoft.com/windows/products/winfamily/ie/default.mspx
[title] => Internet Explorer 8.0
[name] => Internet Explorer
[version] => 8.0
[code] => msie7
[image] => img/16/browser/msie7.png
)
[os] => Array
(
[link] => http://www.microsoft.com/windows/
[name] => Windows
[version] => 7
[code] => win-4
[x64] =>
[title] => Windows 7
[type] => os
[dir] => os
[image] => img/16/os/win-4.png
)
[device] => Array
(
[link] =>
[title] =>
[model] =>
[brand] =>
[code] => null
[dir] => device
[type] => device
[image] => img/16/device/null.png
)
[platform] => Array
(
[link] => http://www.microsoft.com/windows/
[name] => Windows
[version] => 7
[code] => win-4
[x64] =>
[title] => Windows 7
[type] => os
[dir] => os
[image] => img/16/os/win-4.png
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-05-10 07:56:20</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.2.0/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {
"content_hash": "4a1b52404ba25bf98168c9b16779d0c0",
"timestamp": "",
"source": "github",
"line_count": 1410,
"max_line_length": 972,
"avg_line_length": 40.13758865248227,
"alnum_prop": 0.5349153620525144,
"repo_name": "ThaDafinser/UserAgentParserComparison",
"id": "25878adb61bbcca2ecb271f21167e1ca5f3f1e2f",
"size": "56595",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "v5/user-agent-detail/47/9f/479f035f-390e-4062-ab9a-bd9c4961b8eb.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2060859160"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "67cab4745bf995e5e77455ba184007a9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 18,
"avg_line_length": 8.384615384615385,
"alnum_prop": 0.6788990825688074,
"repo_name": "mdoering/backbone",
"id": "a5e558f388adbd168d9dbd8801658a7a6ddc7f96",
"size": "149",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Parmeliaceae/Parmelia/Parmelia ohionis/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import Map from '../src/ol/Map.js';
import View from '../src/ol/View.js';
import {Image as ImageLayer, Tile as TileLayer} from '../src/ol/layer.js';
import Projection from '../src/ol/proj/Projection.js';
import ImageWMS from '../src/ol/source/ImageWMS.js';
import TileWMS from '../src/ol/source/TileWMS.js';
const layers = [
new TileLayer({
source: new TileWMS({
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">Pixelmap 1:1000000 / geo.admin.ch</a>',
crossOrigin: 'anonymous',
params: {
'LAYERS': 'ch.swisstopo.pixelkarte-farbe-pk1000.noscale',
'FORMAT': 'image/jpeg'
},
url: 'https://wms.geo.admin.ch/'
})
}),
new ImageLayer({
source: new ImageWMS({
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
'en/home.html">National parks / geo.admin.ch</a>',
crossOrigin: 'anonymous',
params: {'LAYERS': 'ch.bafu.schutzgebiete-paerke_nationaler_bedeutung'},
serverType: 'mapserver',
url: 'https://wms.geo.admin.ch/'
})
})
];
// A minimal projection object is configured with only the SRS code and the map
// units. No client-side coordinate transforms are possible with such a
// projection object. Requesting tiles only needs the code together with a
// tile grid of Cartesian coordinates; it does not matter how those
// coordinates relate to latitude or longitude.
const projection = new Projection({
code: 'EPSG:21781',
units: 'm'
});
const map = new Map({
layers: layers,
target: 'map',
view: new View({
center: [660000, 190000],
projection: projection,
zoom: 9
})
});
| {
"content_hash": "ae7528aa1fe71f583b2fa091dd3eb066",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 32.26923076923077,
"alnum_prop": 0.6501787842669845,
"repo_name": "fredj/ol3",
"id": "ca1d270fff086fdb8c6ac98e4034562ffc0fe124",
"size": "1680",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "examples/wms-no-proj.js",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1927"
},
{
"name": "CSS",
"bytes": "24927"
},
{
"name": "JavaScript",
"bytes": "2663627"
},
{
"name": "Python",
"bytes": "126728"
},
{
"name": "Scheme",
"bytes": "1882"
},
{
"name": "Shell",
"bytes": "56"
}
],
"symlink_target": ""
} |
<?php
namespace Codeception\Module;
// here you can define custom functions for WebGuy
class WebHelper extends \Codeception\Module
{
/**
* user is not a logged admin
*
* mock Auth::check() to return false;
*/
public function amGuest()
{
\Illuminate\Support\Facades\Auth::shouldReceive('check')
->once()
->andReturn(false);
}
/**
* user is a logged admin
*
* mock Auth::check() to return true;
*/
public function amAdmin()
{
// enable filter to check if admin
\Route::enableFilters();
// auth user
$this->getModule('Laravel4')->amHttpAuthenticated('testguy', 'pass');
}
public function amAdminWithMock()
{
$this->amAdmin();
\Illuminate\Support\Facades\Auth::shouldReceive('check')
->once()
->andReturn(true);
}
/**
* be on the page that display a specified post
*
* @param Post $post
*/
public function amOnPostPage($post)
{
$this->getModule('Laravel4')->amOnPage('/'.$post->slug);
}
/**
* be on the page that display list of post with a specified tag
*
* @param Tag $tag
*/
public function amOnTagPage($tag)
{
$this->getModule('Laravel4')->amOnPage('/tag/'.$tag->title);
}
public function prepareEmptyCache()
{
// assert using a file cache
$this->assertEquals('Illuminate\Cache\FileStore', get_class(\Cache::getStore()), 'You must config testing cache to be "file"');
// create dir if not exists
file_exists($this->cacheDir()) || mkdir($this->cacheDir());
// flush cache dir
\BlogCacheManager::flush();
}
/**
* content is retrived from cache
*/
public function contentIsFromCache()
{
$this->getModule('Laravel4')->see('<!-- retrieved from cache -->');
}
/**
* Content is not retrieved from cache
*/
public function contentIsNotFromCache()
{
$this->getModule('Laravel4')->dontSee('<!-- retrieved from cache -->');
}
private function cacheDir()
{
return \Config::get('cache.path');
}
}
| {
"content_hash": "6520fc26e618374a621baa0063d7d0cc",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 135,
"avg_line_length": 24.57608695652174,
"alnum_prop": 0.5528527200353825,
"repo_name": "SebSept/onemorelaravelblog",
"id": "16d56d4bc25693b4bddeeb40bfd14e1aae81244b",
"size": "2261",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/tests/_helpers/WebHelper.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "491"
},
{
"name": "CSS",
"bytes": "2316"
},
{
"name": "JavaScript",
"bytes": "19645"
},
{
"name": "PHP",
"bytes": "153510"
},
{
"name": "PLpgSQL",
"bytes": "38404"
}
],
"symlink_target": ""
} |
#include <aws/ssm/model/CreatePatchBaselineRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::SSM::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreatePatchBaselineRequest::CreatePatchBaselineRequest() :
m_nameHasBeenSet(false),
m_globalFiltersHasBeenSet(false),
m_approvalRulesHasBeenSet(false),
m_approvedPatchesHasBeenSet(false),
m_rejectedPatchesHasBeenSet(false),
m_descriptionHasBeenSet(false),
m_clientToken(Aws::Utils::UUID::RandomUUID()),
m_clientTokenHasBeenSet(true)
{
}
Aws::String CreatePatchBaselineRequest::SerializePayload() const
{
JsonValue payload;
if(m_nameHasBeenSet)
{
payload.WithString("Name", m_name);
}
if(m_globalFiltersHasBeenSet)
{
payload.WithObject("GlobalFilters", m_globalFilters.Jsonize());
}
if(m_approvalRulesHasBeenSet)
{
payload.WithObject("ApprovalRules", m_approvalRules.Jsonize());
}
if(m_approvedPatchesHasBeenSet)
{
Array<JsonValue> approvedPatchesJsonList(m_approvedPatches.size());
for(unsigned approvedPatchesIndex = 0; approvedPatchesIndex < approvedPatchesJsonList.GetLength(); ++approvedPatchesIndex)
{
approvedPatchesJsonList[approvedPatchesIndex].AsString(m_approvedPatches[approvedPatchesIndex]);
}
payload.WithArray("ApprovedPatches", std::move(approvedPatchesJsonList));
}
if(m_rejectedPatchesHasBeenSet)
{
Array<JsonValue> rejectedPatchesJsonList(m_rejectedPatches.size());
for(unsigned rejectedPatchesIndex = 0; rejectedPatchesIndex < rejectedPatchesJsonList.GetLength(); ++rejectedPatchesIndex)
{
rejectedPatchesJsonList[rejectedPatchesIndex].AsString(m_rejectedPatches[rejectedPatchesIndex]);
}
payload.WithArray("RejectedPatches", std::move(rejectedPatchesJsonList));
}
if(m_descriptionHasBeenSet)
{
payload.WithString("Description", m_description);
}
if(m_clientTokenHasBeenSet)
{
payload.WithString("ClientToken", m_clientToken);
}
return payload.WriteReadable();
}
Aws::Http::HeaderValueCollection CreatePatchBaselineRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonSSM.CreatePatchBaseline"));
return headers;
}
| {
"content_hash": "f5f62be91109782a653bcf061bead4b6",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 125,
"avg_line_length": 24.903225806451612,
"alnum_prop": 0.7560449050086355,
"repo_name": "svagionitis/aws-sdk-cpp",
"id": "39aa172eb095a6c36ee5641f4ab7606520211a07",
"size": "2889",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "aws-cpp-sdk-ssm/source/model/CreatePatchBaselineRequest.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2313"
},
{
"name": "C++",
"bytes": "104799778"
},
{
"name": "CMake",
"bytes": "455533"
},
{
"name": "HTML",
"bytes": "4471"
},
{
"name": "Java",
"bytes": "243075"
},
{
"name": "Python",
"bytes": "72896"
},
{
"name": "Shell",
"bytes": "2803"
}
],
"symlink_target": ""
} |
#Overview
This directory contains Test Objects for all built-in keystone fields. A Field Test Object defines the entire test behavior of a keystone field.
# Object Structure
The structure of a field Test Object is similar to a NightwatchJS Page Object. Please see existing Field Test Object for implementation examples.
It is important that the Field Test Object adheres to the following format as the test framework may make use of this structure during test processing.
NOTE: when calling commands in the Field Test Object, the test framework will first make sure the command is configured. If not configured,
it will log an quick message for the field and move on.
NOTE: fields should be selected on the context of their parent form. Thus, the config.formSelector is matched along with the field selector.
module.exports = function FieldTestObject (config) {
/*
This is a convenience function that returns fully qualified css field elements selectors.
*/
var selectElem = function (elem) {
return config.formSelector + ' ' + self.selector + ' ' + self.elements[elem];
};
/*
We use self to keep a reference to the test object closure since function blocks may need to reference
closure properties.
*/
var self = {
selector: '<THE-CSS-SELECTOR-FOR-THE-FIELD>',
elements: {
<WHAT-EVER-CSS-ELEMENTS-FOR-THE-FIELD>
},
/*
A Field Test Object can implement any of the following commands. Commands that are not implemented will not
be called and thus cannot be tested.
*/
commands: {
clickFieldUI: function (browser, elem) {
/*
THIS FUNCTION CLICKS THE SPECIFIED ELEM IN THE FIELD
*/
},
assertFieldUIVisible: function (browser, options) {
/*
THIS FUNCTION ASSERTS THAT THE UI FOR THIS FIELD IS VISIBLE AS IN THE USER CAN SEE IT
*/
},
assertFieldUINotVisible: function (browser, options) {
/*
THIS FUNCTION ASSERTS THAT THE UI FOR THIS FIELD IS NOT VISIBLE AS IN THE USER CANNOT SEE IT
*/
},
assertFieldDOMPresent: function (browser, options) {
/*
THIS FUNCTION ASSERTS THAT THE ELEMENTS FOR THIS FIELD ARE PRESENT IN THE DOM
*/
},
assertFieldDOMNotPresent: function (browser, options) {
/*
THIS FUNCTION ASSERTS THAT THE ELEMENTS FOR THIS FIELD ARE NOT PRESENT IN THE DOM
*/
},
fillFieldInputs: function (browser, input, options) {
/*
THIS FUNCTION FILLS THE FIELD FORM WITH THE SPECIFIED INPUT
*/
},
assertFieldInputs: function (browser, input, options) {
/*
THIS FUNCTION ASSERTS THAT THE FIELD FORM IS FILLED WITH THE SPECIFIED INPUT
*/
}
}
};
}
| {
"content_hash": "b696dd6fc80693e070a72e20d4112cf3",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 151,
"avg_line_length": 44.73684210526316,
"alnum_prop": 0.5535294117647059,
"repo_name": "keystonejs/keystone-nightwatch-e2e",
"id": "28141ca8fd747c08fb03016764d2b70c6c853493",
"size": "3400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/src/fieldTestObjects/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "259529"
},
{
"name": "Shell",
"bytes": "824"
}
],
"symlink_target": ""
} |
' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Imports System.Collections.Immutable
Imports System.Composition
Imports System.Globalization
Imports System.Threading
Imports Microsoft.CodeAnalysis.Completion
Imports Microsoft.CodeAnalysis.Completion.Providers
Imports Microsoft.CodeAnalysis.Host.Mef
Imports Microsoft.CodeAnalysis.Options
Imports Microsoft.CodeAnalysis.Text
Imports Microsoft.CodeAnalysis.VisualBasic.Completion.Providers
Imports Microsoft.CodeAnalysis.VisualBasic.Completion.SuggestionMode
Imports Microsoft.CodeAnalysis.Host
Namespace Microsoft.CodeAnalysis.VisualBasic.Completion
<ExportLanguageServiceFactory(GetType(CompletionService), LanguageNames.VisualBasic), [Shared]>
Friend Class VisualBasicCompletionServiceFactory
Implements ILanguageServiceFactory
Public Function CreateLanguageService(languageServices As HostLanguageServices) As ILanguageService Implements ILanguageServiceFactory.CreateLanguageService
Return New VisualBasicCompletionService(languageServices.WorkspaceServices.Workspace)
End Function
End Class
Partial Friend Class VisualBasicCompletionService
Inherits CommonCompletionService
Private ReadOnly _completionProviders As ImmutableArray(Of CompletionProvider) = ImmutableArray.Create(Of CompletionProvider)(
New KeywordCompletionProvider(),
New SymbolCompletionProvider(),
New ObjectInitializerCompletionProvider(),
New ObjectCreationCompletionProvider(),
New EnumCompletionProvider(),
New NamedParameterCompletionProvider(),
New VisualBasicSuggestionModeCompletionProvider(),
New ImplementsClauseCompletionProvider(),
New HandlesClauseCompletionProvider(),
New PartialTypeCompletionProvider(),
New CrefCompletionProvider(),
New CompletionListTagCompletionProvider(),
New OverrideCompletionProvider(),
New XmlDocCommentCompletionProvider()
)
Private ReadOnly _workspace As Workspace
Public Sub New(workspace As Workspace,
Optional exclusiveProviders As ImmutableArray(Of CompletionProvider) ? = Nothing)
MyBase.New(workspace, exclusiveProviders)
_workspace = workspace
End Sub
Public Overrides ReadOnly Property Language As String
Get
Return LanguageNames.VisualBasic
End Get
End Property
Private Shared s_defaultCompletionRules As CompletionRules =
CompletionRules.Create(
dismissIfEmpty:=True,
dismissIfLastCharacterDeleted:=True,
defaultCommitCharacters:=CompletionRules.Default.DefaultCommitCharacters,
defaultEnterKeyRule:=EnterKeyRule.Always)
Public Overrides Function GetRules() As CompletionRules
Return s_defaultCompletionRules
End Function
Protected Overrides Function GetBuiltInProviders() As ImmutableArray(Of CompletionProvider)
Return _completionProviders
End Function
Protected Overrides Function GetProviders(roles As ImmutableHashSet(Of String), trigger As CompletionTrigger) As ImmutableArray(Of CompletionProvider)
Dim _providers = MyBase.GetProviders(roles)
If trigger.Kind = CompletionTriggerKind.Snippets Then
_providers = _providers.Where(Function(p) p.IsSnippetProvider).ToImmutableArray()
Else
_providers = _providers.Where(Function(p) Not p.IsSnippetProvider).ToImmutableArray()
End If
Return _providers
End Function
Protected Overrides Function GetBetterItem(item As CompletionItem, existingItem As CompletionItem) As CompletionItem
' If one Is a keyword, And the other Is some other item that inserts the same text as the keyword,
' keep the keyword (VB only)
If IsKeywordItem(existingItem) Then
Return existingItem
End If
Return MyBase.GetBetterItem(item, existingItem)
End Function
Protected Overrides Function ItemsMatch(item As CompletionItem, existingItem As CompletionItem) As Boolean
If Not MyBase.ItemsMatch(item, existingItem) Then
Return False
End If
' DevDiv 957450 Normally, we want to show items with the same display text And
' different glyphs. That way, the we won't hide user - defined symbols that happen
' to match a keyword (Like Select). However, we want to avoid showing the keyword
' for an intrinsic right next to the item for the corresponding symbol.
' Therefore, if a keyword claims to represent an "intrinsic" item, we'll ignore
' the glyph when matching.
Dim keywordCompletionItem = If(IsKeywordItem(existingItem), existingItem, If(IsKeywordItem(item), item, Nothing))
If keywordCompletionItem IsNot Nothing AndAlso keywordCompletionItem.Tags.Contains(CompletionTags.Intrinsic) Then
Dim otherItem = If(keywordCompletionItem Is item, existingItem, item)
Dim changeText = GetChangeText(otherItem)
If changeText = keywordCompletionItem.DisplayText Then
Return True
Else
Return False
End If
End If
Return item.Tags = existingItem.Tags OrElse Enumerable.SequenceEqual(item.Tags, existingItem.Tags)
End Function
Private Function GetChangeText(item As CompletionItem) As String
Dim provider = TryCast(GetProvider(item), CommonCompletionProvider)
If provider IsNot Nothing Then
' TODO: Document Is Not available in this code path.. what about providers that need to reconstruct information before producing text?
Dim result = provider.GetTextChangeAsync(Nothing, item, Nothing, CancellationToken.None).Result
If result IsNot Nothing Then
Return result.Value.NewText
End If
End If
Return item.DisplayText
End Function
Public Overrides Function GetDefaultItemSpan(text As SourceText, caretPosition As Integer) As TextSpan
Return CompletionUtilities.GetCompletionItemSpan(text, caretPosition)
End Function
Public Overrides Function ShouldTriggerCompletion(text As SourceText, position As Integer, trigger As CompletionTrigger, Optional roles As ImmutableHashSet(Of String) = Nothing, Optional options As OptionSet = Nothing) As Boolean
options = If(options, _workspace.Options)
If Not options.GetOption(CompletionOptions.TriggerOnTyping, Me.Language) Then
Return False
End If
If trigger.Kind = CompletionTriggerKind.Deletion AndAlso (Char.IsLetterOrDigit(trigger.Character) OrElse trigger.Character = "."c) Then
Return True
Else
Return MyBase.ShouldTriggerCompletion(text, position, trigger, roles, options)
End If
End Function
End Class
End Namespace
| {
"content_hash": "bcac0be83e51ddb95d4567a16bd61be5",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 237,
"avg_line_length": 48.103896103896105,
"alnum_prop": 0.6942494600431965,
"repo_name": "rgani/roslyn",
"id": "54620ed7486fedb11cf14c4e38ebb505d47a6447",
"size": "7408",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/Features/VisualBasic/Portable/Completion/VisualBasicCompletionService.vb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "17756"
},
{
"name": "C#",
"bytes": "73658248"
},
{
"name": "C++",
"bytes": "6311"
},
{
"name": "F#",
"bytes": "421"
},
{
"name": "Groovy",
"bytes": "6576"
},
{
"name": "PowerShell",
"bytes": "29080"
},
{
"name": "Shell",
"bytes": "9396"
},
{
"name": "Visual Basic",
"bytes": "59417712"
}
],
"symlink_target": ""
} |
layout: page
title: "About"
header-img: "img/transit.jpg"
group: "navigation"
order: 2
---
<p>What: Music reviews, mostly from the worlds of hip-hop and R&B, with an emphasis on quality artists and projects that are underrepresented or underappreciated.</p>
<p>Who: Just a passionate music fan, not an artist in any sense.</p>
<p>Where: Here on your computer or smartphone, brought to you by my resident coding nerd.</p>
<p>When: Several times a week (call it 3 or so), but without a schedule.</p>
<p>Why: See <a href="http://theplpt.com/grandScheme">The Grand Scheme</a> for more.</p>
<p>Contact Us: Hit the little mail button</p>
| {
"content_hash": "0a9b5ec2944922ed0594aa3039545ae1",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 170,
"avg_line_length": 38.294117647058826,
"alnum_prop": 0.7250384024577573,
"repo_name": "thepulpit/thepulpit.github.io",
"id": "f615a92dbf3754964a923ecacf241173e8c603f3",
"size": "655",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "about.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "26184"
},
{
"name": "HTML",
"bytes": "20774"
},
{
"name": "JavaScript",
"bytes": "54567"
},
{
"name": "PHP",
"bytes": "1234"
},
{
"name": "Ruby",
"bytes": "5704"
}
],
"symlink_target": ""
} |
"""
Django settings for elf project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'pdj&pd=xh^e3o#g6#=8o1bk=6jbj^6683q^-xl)c5)0v610p+z'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
TEMPLATE_DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# master
'master',
# apps
'todo',
'event',
'hours10k',
'mood',
'dream',
'diary',
)
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'elf.urls'
WSGI_APPLICATION = 'elf.wsgi.application'
# Database
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
# Internationalization
# https://docs.djangoproject.com/en/1.7/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.7/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static', 'static')
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static', 'media')
# Template DIR
TEMPLATE_DIRS = (
os.path.join(os.path.dirname(BASE_DIR), 'static', 'templates'),
)
if DEBUG:
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static', 'media')
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static', 'static')
TEMPLATE_ROOT = os.path.join(os.path.dirname(BASE_DIR), 'static', 'templates')
STATICFILES_DIRS = (
os.path.join(os.path.dirname(BASE_DIR), 'static'),
)
| {
"content_hash": "e30896971a8b213804fefc4120628064",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 82,
"avg_line_length": 24.605263157894736,
"alnum_prop": 0.6898395721925134,
"repo_name": "KellyChan/python-examples",
"id": "5cf98149275ef38328bbf5342a0a6a5acadd1d0f",
"size": "2805",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "python/django/elf/elf/src/elf/settings.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "86277"
},
{
"name": "HTML",
"bytes": "320182"
},
{
"name": "JavaScript",
"bytes": "154998"
},
{
"name": "Jupyter Notebook",
"bytes": "30660"
},
{
"name": "Python",
"bytes": "238130"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.directory.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateSettings" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UpdateSettingsRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* The identifier of the directory for which to update settings.
* </p>
*/
private String directoryId;
/**
* <p>
* The list of <a>Setting</a> objects.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<Setting> settings;
/**
* <p>
* The identifier of the directory for which to update settings.
* </p>
*
* @param directoryId
* The identifier of the directory for which to update settings.
*/
public void setDirectoryId(String directoryId) {
this.directoryId = directoryId;
}
/**
* <p>
* The identifier of the directory for which to update settings.
* </p>
*
* @return The identifier of the directory for which to update settings.
*/
public String getDirectoryId() {
return this.directoryId;
}
/**
* <p>
* The identifier of the directory for which to update settings.
* </p>
*
* @param directoryId
* The identifier of the directory for which to update settings.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateSettingsRequest withDirectoryId(String directoryId) {
setDirectoryId(directoryId);
return this;
}
/**
* <p>
* The list of <a>Setting</a> objects.
* </p>
*
* @return The list of <a>Setting</a> objects.
*/
public java.util.List<Setting> getSettings() {
if (settings == null) {
settings = new com.amazonaws.internal.SdkInternalList<Setting>();
}
return settings;
}
/**
* <p>
* The list of <a>Setting</a> objects.
* </p>
*
* @param settings
* The list of <a>Setting</a> objects.
*/
public void setSettings(java.util.Collection<Setting> settings) {
if (settings == null) {
this.settings = null;
return;
}
this.settings = new com.amazonaws.internal.SdkInternalList<Setting>(settings);
}
/**
* <p>
* The list of <a>Setting</a> objects.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setSettings(java.util.Collection)} or {@link #withSettings(java.util.Collection)} if you want to override
* the existing values.
* </p>
*
* @param settings
* The list of <a>Setting</a> objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateSettingsRequest withSettings(Setting... settings) {
if (this.settings == null) {
setSettings(new com.amazonaws.internal.SdkInternalList<Setting>(settings.length));
}
for (Setting ele : settings) {
this.settings.add(ele);
}
return this;
}
/**
* <p>
* The list of <a>Setting</a> objects.
* </p>
*
* @param settings
* The list of <a>Setting</a> objects.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UpdateSettingsRequest withSettings(java.util.Collection<Setting> settings) {
setSettings(settings);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getDirectoryId() != null)
sb.append("DirectoryId: ").append(getDirectoryId()).append(",");
if (getSettings() != null)
sb.append("Settings: ").append(getSettings());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateSettingsRequest == false)
return false;
UpdateSettingsRequest other = (UpdateSettingsRequest) obj;
if (other.getDirectoryId() == null ^ this.getDirectoryId() == null)
return false;
if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == false)
return false;
if (other.getSettings() == null ^ this.getSettings() == null)
return false;
if (other.getSettings() != null && other.getSettings().equals(this.getSettings()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode());
hashCode = prime * hashCode + ((getSettings() == null) ? 0 : getSettings().hashCode());
return hashCode;
}
@Override
public UpdateSettingsRequest clone() {
return (UpdateSettingsRequest) super.clone();
}
}
| {
"content_hash": "018c9aa143f0506f598cd1a8106cf374",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 120,
"avg_line_length": 29.00502512562814,
"alnum_prop": 0.5918225918225918,
"repo_name": "aws/aws-sdk-java",
"id": "80483b2b3b886863a3652ca387bf31df159fbf9d",
"size": "6352",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-directory/src/main/java/com/amazonaws/services/directory/model/UpdateSettingsRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
import 'whatwg-fetch';
const URL_GITHUB = '/api/github';
const URL_TWITTER = '/api/twitter';
const URL_FACEBOOK = '/api/facebook';
/**
* Private.
* GET API call to get user profile details.
* @param {string} url - API URL
* @param {object} credentials - User authentication to connect to API
*/
const fetchUser = async (url, credentials) => {
const response = await fetch(url, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-credentials': JSON.stringify(credentials)
}
});
const body = await response.json();
if (response.status !== 200) throw Error(body.message);
return body;
};
/**
* Private.
* POST API call to update user profile.
* @param {string} url - API URL
* @param {object} fields - Profile fields to update
* @param {object} credentials - User authentication to connect to API
*/
const updateUserProfile = async (url, fields, credentials) => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
fields,
credentials
})
});
const body = await response.json();
if (response.status !== 200) throw Error(body.message);
return body;
};
/**
* Public.
* Gets Twitter user profile details.
* @param {string} handle - Twitter handle
* @param {object} credentials - User authentication to connect to Twitter API
*/
const fetchTwitterUser = (handle, credentials) =>
fetchUser(`${URL_TWITTER}?handle=${handle}`, credentials);
/**
* Public.
* Updates Twitter user profile.
* @param {object} fields - Profile fields to update
* @param {object} credentials - User authentication to connect to Twitter API
*/
const updateTwitterUserProfile = (fields, credentials) =>
updateUserProfile(URL_TWITTER, fields, credentials);
/**
* Public.
* Gets GitHub user profile details.
* @param {object} credentials - User authentication to connect to GitHub API
*/
const fetchGithubUser = credentials => fetchUser(URL_GITHUB, credentials);
/**
* Public.
* Updates GitHub user profile.
* @param {object} fields - Profile fields to update
* @param {object} credentials - User authentication to connect to GitHub API
*/
const updateGithubUserProfile = (fields, credentials) =>
updateUserProfile(URL_GITHUB, fields, credentials);
/**
* Public.
* Gets Facebook user profile details.
* @param {object} credentials - User authentication to connect to Facebook API
*/
const fetchFacebookUser = credentials => fetchUser(URL_FACEBOOK, credentials);
/**
* Public.
* Updates Facebook user profile.
* @param {object} fields - Profile fields to update
* @param {object} credentials - User authentication to connect to GitHub API
*/
const updateFacebookUserProfile = (fields, credentials) =>
updateUserProfile(URL_FACEBOOK, fields, credentials);
const API = {
fetchTwitterUser,
updateTwitterUserProfile,
fetchGithubUser,
updateGithubUserProfile,
fetchFacebookUser,
updateFacebookUserProfile
};
export default API;
| {
"content_hash": "934db49daaf3a54a6eec433e7c3c7c0c",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 27.75229357798165,
"alnum_prop": 0.7001652892561984,
"repo_name": "esausilva/profile-updater",
"id": "9a86b6867604e55009081e9dc422a5b19a66bf55",
"size": "3025",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/src/api/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2731"
},
{
"name": "HTML",
"bytes": "475"
},
{
"name": "JavaScript",
"bytes": "49267"
},
{
"name": "Shell",
"bytes": "217"
}
],
"symlink_target": ""
} |
namespace Umbraco.Cms.Core.Models.Editors;
/// <summary>
/// Represents an uploaded file for a property.
/// </summary>
public class ContentPropertyFile
{
/// <summary>
/// Gets or sets the property alias.
/// </summary>
public string? PropertyAlias { get; set; }
/// <summary>
/// When dealing with content variants, this is the culture for the variant
/// </summary>
public string? Culture { get; set; }
/// <summary>
/// When dealing with content variants, this is the segment for the variant
/// </summary>
public string? Segment { get; set; }
/// <summary>
/// An array of metadata that is parsed out from the file info posted to the server which is set on the client.
/// </summary>
/// <remarks>
/// This can be used for property types like Nested Content that need to have special unique identifiers for each file
/// since there might be multiple files
/// per property.
/// </remarks>
public string[]? Metadata { get; set; }
/// <summary>
/// Gets or sets the name of the file.
/// </summary>
public string? FileName { get; set; }
/// <summary>
/// Gets or sets the temporary path where the file has been uploaded.
/// </summary>
public string TempFilePath { get; set; } = string.Empty;
}
| {
"content_hash": "9ca73de077a6f11e3ecfa64f0c8c9093",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 126,
"avg_line_length": 32.404761904761905,
"alnum_prop": 0.6113152094048494,
"repo_name": "umbraco/Umbraco-CMS",
"id": "9bb098697c90653ce86e70530cf4e5d06b7d1637",
"size": "1361",
"binary": false,
"copies": "5",
"ref": "refs/heads/v11/contrib",
"path": "src/Umbraco.Core/Models/Editors/ContentPropertyFile.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "15983652"
},
{
"name": "CSS",
"bytes": "20625"
},
{
"name": "Dockerfile",
"bytes": "1204"
},
{
"name": "HTML",
"bytes": "1384255"
},
{
"name": "JavaScript",
"bytes": "4766393"
},
{
"name": "Less",
"bytes": "734364"
},
{
"name": "Smalltalk",
"bytes": "1"
},
{
"name": "TypeScript",
"bytes": "241078"
}
],
"symlink_target": ""
} |
<html>
<head>
<title>User agent detail - PantechP9050/JJUS05312010 NetFront/3.5 OMC/1.5.3 Profile/MIDP-2.1 Configuration/CLDC-1.1 RMC/2.06.5 P11/01.02.02</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="section">
<h1 class="header center orange-text">User agent detail</h1>
<div class="row center">
<h5 class="header light">
PantechP9050/JJUS05312010 NetFront/3.5 OMC/1.5.3 Profile/MIDP-2.1 Configuration/CLDC-1.1 RMC/2.06.5 P11/01.02.02
</h5>
</div>
</div>
<div class="section">
<table class="striped"><tr><th></th><th colspan="3">General</th><th colspan="5">Device</th><th colspan="3">Bot</th><th colspan="2"></th></tr><tr><th>Provider</th><th>Browser</th><th>Engine</th><th>OS</th><th>Brand</th><th>Model</th><th>Type</th><th>Is mobile</th><th>Is touch</th><th>Is bot</th><th>Name</th><th>Type</th><th>Parse time</th><th>Actions</th></tr><tr><th colspan="14" class="green lighten-3">Source result (test suite)</th></tr><tr><td>ua-parser/uap-core<br /><small>vendor/thadafinser/uap-core/tests/test_device.yaml</small></td><td> </td><td> </td><td> </td><td style="border-left: 1px solid #555">Pantech</td><td>P9050</td><td></td><td></td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td></td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-test">Detail</a>
<!-- Modal Structure -->
<div id="modal-test" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Testsuite result detail</h4>
<p><pre><code class="php">Array
(
[user_agent_string] => PantechP9050/JJUS05312010 NetFront/3.5 OMC/1.5.3 Profile/MIDP-2.1 Configuration/CLDC-1.1 RMC/2.06.5 P11/01.02.02
[family] => Pantech P9050
[brand] => Pantech
[model] => P9050
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><th colspan="14" class="green lighten-3">Providers</th></tr><tr><td>BrowscapPhp<br /><small>6012</small></td><td>NetFront 3.5</td><td>NetFront </td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td>Mobile Device</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.08</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-215ac98d-ccf8-4615-916e-5a819d6a59c9">Detail</a>
<!-- Modal Structure -->
<div id="modal-215ac98d-ccf8-4615-916e-5a819d6a59c9" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>BrowscapPhp result detail</h4>
<p><pre><code class="php">stdClass Object
(
[browser_name_regex] => /^.*netfront\/3\.5.*$/
[browser_name_pattern] => *netfront/3.5*
[parent] => NetFront 3.5
[comment] => Access NetFront 3.5
[browser] => NetFront
[browser_type] => Browser
[browser_bits] => 0
[browser_maker] => Access
[browser_modus] => unknown
[version] => 3.5
[majorver] => 3
[minorver] => 5
[platform] => unknown
[platform_version] => unknown
[platform_description] => unknown
[platform_bits] => 0
[platform_maker] => unknown
[alpha] =>
[beta] =>
[win16] =>
[win32] =>
[win64] =>
[frames] => 1
[iframes] => 1
[tables] => 1
[cookies] => 1
[backgroundsounds] =>
[javascript] => 1
[vbscript] =>
[javaapplets] =>
[activexcontrols] =>
[ismobiledevice] => 1
[istablet] =>
[issyndicationreader] =>
[crawler] =>
[cssversion] => 2
[aolversion] => 0
[device_name] => general Mobile Device
[device_maker] => unknown
[device_type] => Mobile Device
[device_pointing_method] => unknown
[device_code_name] => general Mobile Device
[device_brand_name] => unknown
[renderingengine_name] => NetFront
[renderingengine_version] => unknown
[renderingengine_description] => For Access NetFront.
[renderingengine_maker] => Access
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>DonatjUAParser<br /><small>v0.5.0</small></td><td>PantechP9050 JJUS05312010</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661">Detail</a>
<!-- Modal Structure -->
<div id="modal-f1436016-fdf1-4aea-b4be-1d7c99ab0661" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>DonatjUAParser result detail</h4>
<p><pre><code class="php">Array
(
[platform] =>
[browser] => PantechP9050
[version] => JJUS05312010
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>NeutrinoApiCom<br /><small></small></td><td>NetFront 3.5</td><td><i class="material-icons">close</i></td><td>JVM </td><td style="border-left: 1px solid #555">Access</td><td>NetFront Ver. 3.5</td><td>mobile-browser</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.188</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc">Detail</a>
<!-- Modal Structure -->
<div id="modal-9b0fa449-ec1b-40c8-8b1c-9486eb3b9cbc" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>NeutrinoApiCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[mobile_screen_height] => 100
[is_mobile] => 1
[type] => mobile-browser
[mobile_brand] => Access
[mobile_model] => NetFront Ver. 3.5
[version] => 3.5
[is_android] =>
[browser_name] => NetFront
[operating_system_family] => JVM
[operating_system_version] =>
[is_ios] =>
[producer] => ACCESS CO.,LTD
[operating_system] => JVM (Platform Micro Edition)
[mobile_screen_width] => 176
[mobile_browser] => Access Netfront
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>PiwikDeviceDetector<br /><small>3.5.2</small></td><td>NetFront 3.5</td><td>NetFront </td><td> </td><td style="border-left: 1px solid #555">Pantech</td><td>P9050</td><td>smartphone</td><td>yes</td><td></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.006</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-21638055-738d-46ba-a1b1-f5114bc26475">Detail</a>
<!-- Modal Structure -->
<div id="modal-21638055-738d-46ba-a1b1-f5114bc26475" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>PiwikDeviceDetector result detail</h4>
<p><pre><code class="php">Array
(
[client] => Array
(
[type] => browser
[name] => NetFront
[short_name] => NF
[version] => 3.5
[engine] => NetFront
)
[operatingSystem] => Array
(
)
[device] => Array
(
[brand] => PT
[brandName] => Pantech
[model] => P9050
[device] => 1
[deviceName] => smartphone
)
[bot] =>
[extra] => Array
(
[isBot] =>
[isBrowser] => 1
[isFeedReader] =>
[isMobileApp] =>
[isPIM] =>
[isLibrary] =>
[isMediaPlayer] =>
[isCamera] =>
[isCarBrowser] =>
[isConsole] =>
[isFeaturePhone] =>
[isPhablet] =>
[isPortableMediaPlayer] =>
[isSmartDisplay] =>
[isSmartphone] => 1
[isTablet] =>
[isTV] =>
[isDesktop] =>
[isMobile] => 1
[isTouchEnabled] =>
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>SinergiBrowserDetector<br /><small>6.0.0</small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>UAParser<br /><small>v3.4.5</small></td><td>NetFront 3.5</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Pantech</td><td>P9050</td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b">Detail</a>
<!-- Modal Structure -->
<div id="modal-346c1a98-5fd3-454f-b6c8-350f2f505d8b" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UAParser result detail</h4>
<p><pre><code class="php">UAParser\Result\Client Object
(
[ua] => UAParser\Result\UserAgent Object
(
[major] => 3
[minor] => 5
[patch] =>
[family] => NetFront
)
[os] => UAParser\Result\OperatingSystem Object
(
[major] =>
[minor] =>
[patch] =>
[patchMinor] =>
[family] => Other
)
[device] => UAParser\Result\Device Object
(
[brand] => Pantech
[model] => P9050
[family] => Pantech P9050
)
[originalUserAgent] => PantechP9050/JJUS05312010 NetFront/3.5 OMC/1.5.3 Profile/MIDP-2.1 Configuration/CLDC-1.1 RMC/2.06.5 P11/01.02.02
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>UserAgentStringCom<br /><small></small></td><td>NetFront 3.5</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td></td><td>0.1</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4">Detail</a>
<!-- Modal Structure -->
<div id="modal-9cdd8b45-a2eb-406b-bd27-7e48af38ffd4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>UserAgentStringCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[agent_type] => Browser
[agent_name] => NetFront
[agent_version] => 3.5
[os_type] => unknown
[os_name] => unknown
[os_versionName] =>
[os_versionNumber] =>
[os_producer] =>
[os_producerURL] =>
[linux_distibution] => Null
[agent_language] =>
[agent_languageTag] =>
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhatIsMyBrowserCom<br /><small></small></td><td>NetFront </td><td> </td><td> </td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.408</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-9795f66f-7271-430e-973a-a5c0e14dc35a">Detail</a>
<!-- Modal Structure -->
<div id="modal-9795f66f-7271-430e-973a-a5c0e14dc35a" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhatIsMyBrowserCom result detail</h4>
<p><pre><code class="php">stdClass Object
(
[operating_system_name] =>
[simple_sub_description_string] =>
[simple_browser_string] => NetFront 3.5
[browser_version] => 3.5
[extra_info] => Array
(
)
[operating_platform] =>
[extra_info_table] => Array
(
)
[layout_engine_name] =>
[detected_addons] => Array
(
)
[operating_system_flavour_code] =>
[hardware_architecture] =>
[operating_system_flavour] =>
[operating_system_frameworks] => Array
(
)
[browser_name_code] => netfront
[operating_system_version] =>
[simple_operating_platform_string] =>
[is_abusive] =>
[layout_engine_version] =>
[browser_capabilities] => Array
(
[0] => MIDP v2.1
[1] => CLDC v1.1
)
[operating_platform_vendor_name] =>
[operating_system] =>
[operating_system_version_full] =>
[operating_platform_code] =>
[browser_name] => NetFront
[operating_system_name_code] =>
[user_agent] => PantechP9050/JJUS05312010 NetFront/3.5 OMC/1.5.3 Profile/MIDP-2.1 Configuration/CLDC-1.1 RMC/2.06.5 P11/01.02.02
[browser_version_full] =>
[browser] => NetFront 3.5
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>WhichBrowser<br /><small>2.0.10</small></td><td>NetFront 3.5</td><td> </td><td> </td><td style="border-left: 1px solid #555">Pantech</td><td>Laser</td><td>mobile:feature</td><td>yes</td><td><i class="material-icons">close</i></td><td style="border-left: 1px solid #555"></td><td></td><td><i class="material-icons">close</i></td><td>0.004</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4">Detail</a>
<!-- Modal Structure -->
<div id="modal-342c8d32-4765-40a8-8a5c-af3a38d19ae4" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>WhichBrowser result detail</h4>
<p><pre><code class="php">Array
(
[browser] => Array
(
[name] => NetFront
[version] => 3.5
[type] => browser
)
[device] => Array
(
[type] => mobile
[subtype] => feature
[manufacturer] => Pantech
[model] => Laser
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr><tr><td>Woothee<br /><small>v1.2.0</small></td>
<td colspan="12" class="center-align red lighten-1">
<strong>No result found</strong>
</td>
</tr><tr><td>Wurfl<br /><small>1.6.4</small></td><td>NetFront 3.5</td><td><i class="material-icons">close</i></td><td> </td><td style="border-left: 1px solid #555">Pantech</td><td>P9050</td><td>Feature Phone</td><td>yes</td><td>yes</td><td style="border-left: 1px solid #555"></td><td><i class="material-icons">close</i></td><td><i class="material-icons">close</i></td><td>0.036</td><td>
<!-- Modal Trigger -->
<a class="modal-trigger btn waves-effect waves-light" href="#modal-1a1aee36-7ce7-4111-a391-8e2c501f1532">Detail</a>
<!-- Modal Structure -->
<div id="modal-1a1aee36-7ce7-4111-a391-8e2c501f1532" class="modal modal-fixed-footer">
<div class="modal-content">
<h4>Wurfl result detail</h4>
<p><pre><code class="php">Array
(
[virtual] => Array
(
[is_android] => false
[is_ios] => false
[is_windows_phone] => false
[is_app] => false
[is_full_desktop] => false
[is_largescreen] => true
[is_mobile] => true
[is_robot] => false
[is_smartphone] => false
[is_touchscreen] => true
[is_wml_preferred] => false
[is_xhtmlmp_preferred] => false
[is_html_preferred] => true
[advertised_device_os] =>
[advertised_device_os_version] =>
[advertised_browser] => NetFront
[advertised_browser_version] => 3.5
[complete_device_name] => Pantech P9050 (Laser)
[form_factor] => Feature Phone
[is_phone] => true
[is_app_webview] => false
)
[all] => Array
(
[brand_name] => Pantech
[model_name] => P9050
[unique] => true
[ununiqueness_handler] =>
[is_wireless_device] => true
[device_claims_web_support] => false
[has_qwerty_keyboard] => true
[can_skip_aligned_link_row] => true
[uaprof] => http://www.pantech.com/Uaprof/umts/PU-P9050.xml
[uaprof2] =>
[uaprof3] =>
[nokia_series] => 0
[nokia_edition] => 0
[device_os] =>
[mobile_browser] => Access Netfront
[mobile_browser_version] => 3.5
[device_os_version] =>
[pointing_method] => touchscreen
[release_date] => 2010_october
[marketing_name] => Laser
[model_extra_info] =>
[nokia_feature_pack] => 0
[can_assign_phone_number] => true
[is_tablet] => false
[manufacturer_name] =>
[is_bot] => false
[is_google_glass] => false
[proportional_font] => false
[built_in_back_button_support] => false
[card_title_support] => true
[softkey_support] => false
[table_support] => true
[numbered_menus] => false
[menu_with_select_element_recommended] => false
[menu_with_list_of_links_recommended] => true
[icons_on_menu_items_support] => false
[break_list_of_links_with_br_element_recommended] => true
[access_key_support] => false
[wrap_mode_support] => false
[times_square_mode_support] => false
[deck_prefetch_support] => false
[elective_forms_recommended] => true
[wizards_recommended] => false
[image_as_link_support] => false
[insert_br_element_after_widget_recommended] => false
[wml_can_display_images_and_text_on_same_line] => false
[wml_displays_image_in_center] => false
[opwv_wml_extensions_support] => false
[wml_make_phone_call_string] => wtai://wp/mc;
[chtml_display_accesskey] => false
[emoji] => false
[chtml_can_display_images_and_text_on_same_line] => false
[chtml_displays_image_in_center] => false
[imode_region] => none
[chtml_make_phone_call_string] => tel:
[chtml_table_support] => false
[xhtml_honors_bgcolor] => true
[xhtml_supports_forms_in_table] => true
[xhtml_support_wml2_namespace] => false
[xhtml_autoexpand_select] => false
[xhtml_select_as_dropdown] => false
[xhtml_select_as_radiobutton] => false
[xhtml_select_as_popup] => false
[xhtml_display_accesskey] => false
[xhtml_supports_invisible_text] => false
[xhtml_supports_inline_input] => false
[xhtml_supports_monospace_font] => false
[xhtml_supports_table_for_layout] => true
[xhtml_supports_css_cell_table_coloring] => true
[xhtml_format_as_css_property] => true
[xhtml_format_as_attribute] => false
[xhtml_nowrap_mode] => false
[xhtml_marquee_as_css_property] => true
[xhtml_readable_background_color1] => #FFFFFF
[xhtml_readable_background_color2] => #FFFFFF
[xhtml_allows_disabled_form_elements] => false
[xhtml_document_title_support] => true
[xhtml_preferred_charset] => utf8
[opwv_xhtml_extensions_support] => false
[xhtml_make_phone_call_string] => tel:
[xhtmlmp_preferred_mime_type] => application/xhtml+xml
[xhtml_table_support] => true
[xhtml_send_sms_string] => sms:
[xhtml_send_mms_string] => none
[xhtml_file_upload] => supported
[cookie_support] => true
[accept_third_party_cookie] => true
[xhtml_supports_iframe] => none
[xhtml_avoid_accesskeys] => false
[xhtml_can_embed_video] => none
[ajax_support_javascript] => true
[ajax_manipulate_css] => true
[ajax_support_getelementbyid] => true
[ajax_support_inner_html] => true
[ajax_xhr_type] => standard
[ajax_manipulate_dom] => true
[ajax_support_events] => true
[ajax_support_event_listener] => true
[ajax_preferred_geoloc_api] => none
[xhtml_support_level] => 4
[preferred_markup] => html_web_4_0
[wml_1_1] => true
[wml_1_2] => true
[wml_1_3] => true
[html_wi_w3_xhtmlbasic] => true
[html_wi_oma_xhtmlmp_1_0] => true
[html_wi_imode_html_1] => true
[html_wi_imode_html_2] => true
[html_wi_imode_html_3] => true
[html_wi_imode_html_4] => false
[html_wi_imode_html_5] => false
[html_wi_imode_htmlx_1] => false
[html_wi_imode_htmlx_1_1] => false
[html_wi_imode_compact_generic] => false
[html_web_3_2] => true
[html_web_4_0] => true
[voicexml] => false
[multipart_support] => false
[total_cache_disable_support] => false
[time_to_live_support] => false
[resolution_width] => 480
[resolution_height] => 800
[columns] => 11
[max_image_width] => 120
[max_image_height] => 92
[rows] => 6
[physical_screen_width] => 41
[physical_screen_height] => 68
[dual_orientation] => false
[density_class] => 1.0
[wbmp] => true
[bmp] => false
[epoc_bmp] => false
[gif_animated] => true
[jpg] => true
[png] => true
[tiff] => false
[transparent_png_alpha] => false
[transparent_png_index] => false
[svgt_1_1] => false
[svgt_1_1_plus] => false
[greyscale] => false
[gif] => true
[colors] => 65536
[webp_lossy_support] => false
[webp_lossless_support] => false
[post_method_support] => true
[basic_authentication_support] => true
[empty_option_value_support] => true
[emptyok] => false
[nokia_voice_call] => false
[wta_voice_call] => false
[wta_phonebook] => false
[wta_misc] => false
[wta_pdc] => false
[https_support] => true
[phone_id_provided] => false
[max_data_rate] => 9
[wifi] => false
[sdio] => false
[vpn] => false
[has_cellular_radio] => true
[max_deck_size] => 200000
[max_url_length_in_requests] => 256
[max_url_length_homepage] => 0
[max_url_length_bookmark] => 0
[max_url_length_cached_page] => 0
[max_no_of_connection_settings] => 0
[max_no_of_bookmarks] => 0
[max_length_of_username] => 0
[max_length_of_password] => 0
[max_object_size] => 0
[downloadfun_support] => false
[directdownload_support] => true
[inline_support] => false
[oma_support] => false
[ringtone] => false
[ringtone_3gpp] => false
[ringtone_midi_monophonic] => false
[ringtone_midi_polyphonic] => false
[ringtone_imelody] => false
[ringtone_digiplug] => false
[ringtone_compactmidi] => false
[ringtone_mmf] => false
[ringtone_rmf] => false
[ringtone_xmf] => false
[ringtone_amr] => false
[ringtone_awb] => false
[ringtone_aac] => false
[ringtone_wav] => false
[ringtone_mp3] => false
[ringtone_spmidi] => false
[ringtone_qcelp] => false
[ringtone_voices] => 1
[ringtone_df_size_limit] => 0
[ringtone_directdownload_size_limit] => 0
[ringtone_inline_size_limit] => 0
[ringtone_oma_size_limit] => 0
[wallpaper] => false
[wallpaper_max_width] => 0
[wallpaper_max_height] => 0
[wallpaper_preferred_width] => 0
[wallpaper_preferred_height] => 0
[wallpaper_resize] => none
[wallpaper_wbmp] => false
[wallpaper_bmp] => false
[wallpaper_gif] => false
[wallpaper_jpg] => false
[wallpaper_png] => false
[wallpaper_tiff] => false
[wallpaper_greyscale] => false
[wallpaper_colors] => 2
[wallpaper_df_size_limit] => 0
[wallpaper_directdownload_size_limit] => 0
[wallpaper_inline_size_limit] => 0
[wallpaper_oma_size_limit] => 0
[screensaver] => false
[screensaver_max_width] => 0
[screensaver_max_height] => 0
[screensaver_preferred_width] => 0
[screensaver_preferred_height] => 0
[screensaver_resize] => none
[screensaver_wbmp] => false
[screensaver_bmp] => false
[screensaver_gif] => false
[screensaver_jpg] => false
[screensaver_png] => false
[screensaver_greyscale] => false
[screensaver_colors] => 2
[screensaver_df_size_limit] => 0
[screensaver_directdownload_size_limit] => 0
[screensaver_inline_size_limit] => 0
[screensaver_oma_size_limit] => 0
[picture] => false
[picture_max_width] => 0
[picture_max_height] => 0
[picture_preferred_width] => 0
[picture_preferred_height] => 0
[picture_resize] => none
[picture_wbmp] => false
[picture_bmp] => false
[picture_gif] => false
[picture_jpg] => false
[picture_png] => false
[picture_greyscale] => false
[picture_colors] => 2
[picture_df_size_limit] => 0
[picture_directdownload_size_limit] => 0
[picture_inline_size_limit] => 0
[picture_oma_size_limit] => 0
[video] => true
[oma_v_1_0_forwardlock] => false
[oma_v_1_0_combined_delivery] => false
[oma_v_1_0_separate_delivery] => false
[streaming_video] => true
[streaming_3gpp] => true
[streaming_mp4] => true
[streaming_mov] => false
[streaming_video_size_limit] => 0
[streaming_real_media] => none
[streaming_flv] => false
[streaming_3g2] => false
[streaming_vcodec_h263_0] => 10
[streaming_vcodec_h263_3] => -1
[streaming_vcodec_mpeg4_sp] => 0
[streaming_vcodec_mpeg4_asp] => -1
[streaming_vcodec_h264_bp] => -1
[streaming_acodec_amr] => nb
[streaming_acodec_aac] => none
[streaming_wmv] => none
[streaming_preferred_protocol] => rtsp
[streaming_preferred_http_protocol] => none
[wap_push_support] => true
[connectionless_service_indication] => true
[connectionless_service_load] => false
[connectionless_cache_operation] => false
[connectionoriented_unconfirmed_service_indication] => false
[connectionoriented_unconfirmed_service_load] => false
[connectionoriented_unconfirmed_cache_operation] => false
[connectionoriented_confirmed_service_indication] => false
[connectionoriented_confirmed_service_load] => false
[connectionoriented_confirmed_cache_operation] => false
[utf8_support] => false
[ascii_support] => false
[iso8859_support] => false
[expiration_date] => false
[j2me_cldc_1_0] => false
[j2me_cldc_1_1] => false
[j2me_midp_1_0] => false
[j2me_midp_2_0] => false
[doja_1_0] => false
[doja_1_5] => false
[doja_2_0] => false
[doja_2_1] => false
[doja_2_2] => false
[doja_3_0] => false
[doja_3_5] => false
[doja_4_0] => false
[j2me_jtwi] => false
[j2me_mmapi_1_0] => false
[j2me_mmapi_1_1] => false
[j2me_wmapi_1_0] => false
[j2me_wmapi_1_1] => false
[j2me_wmapi_2_0] => false
[j2me_btapi] => false
[j2me_3dapi] => false
[j2me_locapi] => false
[j2me_nokia_ui] => false
[j2me_motorola_lwt] => false
[j2me_siemens_color_game] => false
[j2me_siemens_extension] => false
[j2me_heap_size] => 0
[j2me_max_jar_size] => 0
[j2me_storage_size] => 0
[j2me_max_record_store_size] => 0
[j2me_screen_width] => 0
[j2me_screen_height] => 0
[j2me_canvas_width] => 0
[j2me_canvas_height] => 0
[j2me_bits_per_pixel] => 0
[j2me_audio_capture_enabled] => false
[j2me_video_capture_enabled] => false
[j2me_photo_capture_enabled] => false
[j2me_capture_image_formats] => none
[j2me_http] => false
[j2me_https] => false
[j2me_socket] => false
[j2me_udp] => false
[j2me_serial] => false
[j2me_gif] => false
[j2me_gif89a] => false
[j2me_jpg] => false
[j2me_png] => false
[j2me_bmp] => false
[j2me_bmp3] => false
[j2me_wbmp] => false
[j2me_midi] => false
[j2me_wav] => false
[j2me_amr] => false
[j2me_mp3] => false
[j2me_mp4] => false
[j2me_imelody] => false
[j2me_rmf] => false
[j2me_au] => false
[j2me_aac] => false
[j2me_realaudio] => false
[j2me_xmf] => false
[j2me_wma] => false
[j2me_3gpp] => false
[j2me_h263] => false
[j2me_svgt] => false
[j2me_mpeg4] => false
[j2me_realvideo] => false
[j2me_real8] => false
[j2me_realmedia] => false
[j2me_left_softkey_code] => 0
[j2me_right_softkey_code] => 0
[j2me_middle_softkey_code] => 0
[j2me_select_key_code] => 0
[j2me_return_key_code] => 0
[j2me_clear_key_code] => 0
[j2me_datefield_no_accepts_null_date] => false
[j2me_datefield_broken] => false
[receiver] => false
[sender] => false
[mms_max_size] => 0
[mms_max_height] => 0
[mms_max_width] => 0
[built_in_recorder] => false
[built_in_camera] => false
[mms_jpeg_baseline] => false
[mms_jpeg_progressive] => false
[mms_gif_static] => false
[mms_gif_animated] => false
[mms_png] => false
[mms_bmp] => false
[mms_wbmp] => false
[mms_amr] => false
[mms_wav] => false
[mms_midi_monophonic] => false
[mms_midi_polyphonic] => false
[mms_midi_polyphonic_voices] => 0
[mms_spmidi] => false
[mms_mmf] => false
[mms_mp3] => false
[mms_evrc] => false
[mms_qcelp] => false
[mms_ota_bitmap] => false
[mms_nokia_wallpaper] => false
[mms_nokia_operatorlogo] => false
[mms_nokia_3dscreensaver] => false
[mms_nokia_ringingtone] => false
[mms_rmf] => false
[mms_xmf] => false
[mms_symbian_install] => false
[mms_jar] => false
[mms_jad] => false
[mms_vcard] => false
[mms_vcalendar] => false
[mms_wml] => false
[mms_wbxml] => false
[mms_wmlc] => false
[mms_video] => false
[mms_mp4] => false
[mms_3gpp] => false
[mms_3gpp2] => false
[mms_max_frame_rate] => 0
[nokiaring] => false
[picturemessage] => false
[operatorlogo] => false
[largeoperatorlogo] => false
[callericon] => false
[nokiavcard] => false
[nokiavcal] => false
[sckl_ringtone] => false
[sckl_operatorlogo] => false
[sckl_groupgraphic] => false
[sckl_vcard] => false
[sckl_vcalendar] => false
[text_imelody] => false
[ems] => false
[ems_variablesizedpictures] => false
[ems_imelody] => false
[ems_odi] => false
[ems_upi] => false
[ems_version] => 0
[siemens_ota] => false
[siemens_logo_width] => 101
[siemens_logo_height] => 29
[siemens_screensaver_width] => 101
[siemens_screensaver_height] => 50
[gprtf] => false
[sagem_v1] => false
[sagem_v2] => false
[panasonic] => false
[sms_enabled] => true
[wav] => false
[mmf] => false
[smf] => false
[mld] => false
[midi_monophonic] => false
[midi_polyphonic] => false
[sp_midi] => false
[rmf] => false
[xmf] => false
[compactmidi] => false
[digiplug] => false
[nokia_ringtone] => false
[imelody] => false
[au] => false
[amr] => false
[awb] => false
[aac] => false
[mp3] => false
[voices] => 1
[qcelp] => false
[evrc] => false
[flash_lite_version] =>
[fl_wallpaper] => false
[fl_screensaver] => false
[fl_standalone] => false
[fl_browser] => false
[fl_sub_lcd] => false
[full_flash_support] => false
[css_supports_width_as_percentage] => true
[css_border_image] => none
[css_rounded_corners] => none
[css_gradient] => none
[css_spriting] => false
[css_gradient_linear] => none
[is_transcoder] => false
[transcoder_ua_header] => user-agent
[rss_support] => false
[pdf_support] => false
[progressive_download] => false
[playback_vcodec_h263_0] => -1
[playback_vcodec_h263_3] => -1
[playback_vcodec_mpeg4_sp] => -1
[playback_vcodec_mpeg4_asp] => -1
[playback_vcodec_h264_bp] => -1
[playback_real_media] => none
[playback_3gpp] => false
[playback_3g2] => false
[playback_mp4] => false
[playback_mov] => false
[playback_acodec_amr] => none
[playback_acodec_aac] => none
[playback_df_size_limit] => 0
[playback_directdownload_size_limit] => 0
[playback_inline_size_limit] => 0
[playback_oma_size_limit] => 0
[playback_acodec_qcelp] => false
[playback_wmv] => none
[hinted_progressive_download] => false
[html_preferred_dtd] => xhtml_mp1
[viewport_supported] => false
[viewport_width] =>
[viewport_userscalable] =>
[viewport_initial_scale] =>
[viewport_maximum_scale] =>
[viewport_minimum_scale] =>
[mobileoptimized] => false
[handheldfriendly] => false
[canvas_support] => full
[image_inlining] => true
[is_smarttv] => false
[is_console] => false
[nfc_support] => false
[ux_full_desktop] => false
[jqm_grade] => none
[is_sencha_touch_ok] => false
[controlcap_is_smartphone] => default
[controlcap_is_ios] => default
[controlcap_is_android] => default
[controlcap_is_robot] => default
[controlcap_is_app] => default
[controlcap_advertised_device_os] => default
[controlcap_advertised_device_os_version] => default
[controlcap_advertised_browser] => default
[controlcap_advertised_browser_version] => default
[controlcap_is_windows_phone] => default
[controlcap_is_full_desktop] => default
[controlcap_is_largescreen] => default
[controlcap_is_mobile] => default
[controlcap_is_touchscreen] => default
[controlcap_is_wml_preferred] => default
[controlcap_is_xhtmlmp_preferred] => default
[controlcap_is_html_preferred] => default
[controlcap_form_factor] => default
[controlcap_complete_device_name] => default
)
)
</code></pre></p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat ">close</a>
</div>
</div>
</td></tr></table>
</div>
<div class="section">
<h1 class="header center orange-text">About this comparison</h1>
<div class="row center">
<h5 class="header light">
The primary goal of this project is simple<br />
I wanted to know which user agent parser is the most accurate in each part - device detection, bot detection and so on...<br />
<br />
The secondary goal is to provide a source for all user agent parsers to improve their detection based on this results.<br />
<br />
You can also improve this further, by suggesting ideas at <a href="https://github.com/ThaDafinser/UserAgentParserComparison">ThaDafinser/UserAgentParserComparison</a><br />
<br />
The comparison is based on the abstraction by <a href="https://github.com/ThaDafinser/UserAgentParser">ThaDafinser/UserAgentParser</a>
</h5>
</div>
</div>
<div class="card">
<div class="card-content">
Comparison created <i>2016-02-13 13:36:55</i> | by
<a href="https://github.com/ThaDafinser">ThaDafinser</a>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/list.js/1.1.1/list.min.js"></script>
<script>
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
$('.modal-trigger').leanModal();
});
</script>
</body>
</html> | {
"content_hash": "3ec12a6772136d85f482c96f529bdb5a",
"timestamp": "",
"source": "github",
"line_count": 1038,
"max_line_length": 747,
"avg_line_length": 40.117533718689785,
"alnum_prop": 0.5261274674607368,
"repo_name": "ThaDafinser/UserAgentParserComparison",
"id": "f2b309457f364b76206a6cf6eff3c8ebbcb51fd6",
"size": "41643",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "v4/user-agent-detail/a5/6b/a56b2efe-bbd1-4a99-a54f-520dadd21b61.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2060859160"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2014, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>device-types</artifactId>
<version>4.0.45-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>raspberrypi-plugin</artifactId>
<packaging>pom</packaging>
<name>WSO2 Carbon - Arduino Plugin</name>
<url>http://wso2.org</url>
<modules>
<module>org.wso2.carbon.device.mgt.iot.raspberrypi.ui</module>
<module>org.wso2.carbon.device.mgt.iot.raspberrypi.api</module>
<module>org.wso2.carbon.device.mgt.iot.raspberrypi.analytics</module>
</modules>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.2</version>
<executions>
<execution>
<id>generate-scr-scrdescriptor</id>
<goals>
<goal>scr</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
| {
"content_hash": "8ebae15a388cc27df740fce21c8c40f4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 204,
"avg_line_length": 37.6,
"alnum_prop": 0.598404255319149,
"repo_name": "DimalChandrasiri/carbon-device-mgt-plugins",
"id": "0de6af8d770dee4b2afce075a3865879be42098e",
"size": "2256",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "components/device-types/raspberrypi-plugin/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Arduino",
"bytes": "14451"
},
{
"name": "Batchfile",
"bytes": "912"
},
{
"name": "C",
"bytes": "2475"
},
{
"name": "CSS",
"bytes": "977941"
},
{
"name": "HTML",
"bytes": "732077"
},
{
"name": "Java",
"bytes": "2954804"
},
{
"name": "JavaScript",
"bytes": "13542531"
},
{
"name": "PLSQL",
"bytes": "3627"
},
{
"name": "Python",
"bytes": "36810"
},
{
"name": "Shell",
"bytes": "16631"
}
],
"symlink_target": ""
} |
package com.alibaba.rocketmq.remoting.common;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import com.alibaba.rocketmq.remoting.exception.RemotingConnectException;
import com.alibaba.rocketmq.remoting.exception.RemotingSendRequestException;
import com.alibaba.rocketmq.remoting.exception.RemotingTimeoutException;
import com.alibaba.rocketmq.remoting.protocol.RemotingCommand;
import io.netty.channel.Channel;
/**
* 通信层一些辅助方法
*
* @author shijia.wxr<[email protected]>
* @since 2013-7-13
*/
public class RemotingHelper {
public static final String RemotingLogName = "RocketmqRemoting";
public static String exceptionSimpleDesc(final Throwable e) {
StringBuffer sb = new StringBuffer();
if (e != null) {
sb.append(e.toString());
StackTraceElement[] stackTrace = e.getStackTrace();
if (stackTrace != null && stackTrace.length > 0) {
StackTraceElement elment = stackTrace[0];
sb.append(", ");
sb.append(elment.toString());
}
}
return sb.toString();
}
/**
* IP:PORT
*/
public static SocketAddress string2SocketAddress(final String addr) {
String[] s = addr.split(":");
InetSocketAddress isa = new InetSocketAddress(s[0], Integer.valueOf(s[1]));
return isa;
}
/**
* 短连接调用 TODO
*/
public static RemotingCommand invokeSync(final String addr, final RemotingCommand request,
final long timeoutMillis) throws InterruptedException, RemotingConnectException,
RemotingSendRequestException, RemotingTimeoutException {
long beginTime = System.currentTimeMillis();
SocketAddress socketAddress = RemotingUtil.string2SocketAddress(addr);
SocketChannel socketChannel = RemotingUtil.connect(socketAddress);
if (socketChannel != null) {
boolean sendRequestOK = false;
try {
// 使用阻塞模式
socketChannel.configureBlocking(true);
/*
* FIXME The read methods in SocketChannel (and DatagramChannel)
* do notsupport timeouts
* http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4614802
*/
socketChannel.socket().setSoTimeout((int) timeoutMillis);
// 发送数据
ByteBuffer byteBufferRequest = request.encode();
while (byteBufferRequest.hasRemaining()) {
int length = socketChannel.write(byteBufferRequest);
if (length > 0) {
if (byteBufferRequest.hasRemaining()) {
if ((System.currentTimeMillis() - beginTime) > timeoutMillis) {
// 发送请求超时
throw new RemotingSendRequestException(addr);
}
}
}
else {
throw new RemotingSendRequestException(addr);
}
// 比较土
Thread.sleep(1);
}
sendRequestOK = true;
// 接收应答 SIZE
ByteBuffer byteBufferSize = ByteBuffer.allocate(4);
while (byteBufferSize.hasRemaining()) {
int length = socketChannel.read(byteBufferSize);
if (length > 0) {
if (byteBufferSize.hasRemaining()) {
if ((System.currentTimeMillis() - beginTime) > timeoutMillis) {
// 接收应答超时
throw new RemotingTimeoutException(addr, timeoutMillis);
}
}
}
else {
throw new RemotingTimeoutException(addr, timeoutMillis);
}
// 比较土
Thread.sleep(1);
}
// 接收应答 BODY
int size = byteBufferSize.getInt(0);
ByteBuffer byteBufferBody = ByteBuffer.allocate(size);
while (byteBufferBody.hasRemaining()) {
int length = socketChannel.read(byteBufferBody);
if (length > 0) {
if (byteBufferBody.hasRemaining()) {
if ((System.currentTimeMillis() - beginTime) > timeoutMillis) {
// 接收应答超时
throw new RemotingTimeoutException(addr, timeoutMillis);
}
}
}
else {
throw new RemotingTimeoutException(addr, timeoutMillis);
}
// 比较土
Thread.sleep(1);
}
// 对应答数据解码
byteBufferBody.flip();
return RemotingCommand.decode(byteBufferBody);
}
catch (IOException e) {
e.printStackTrace();
if (sendRequestOK) {
throw new RemotingTimeoutException(addr, timeoutMillis);
}
else {
throw new RemotingSendRequestException(addr);
}
}
finally {
try {
socketChannel.close();
}
catch (IOException e) {
e.printStackTrace();
}
}
}
else {
throw new RemotingConnectException(addr);
}
}
/**
* 获取channel连接的远程ip
*
* @param channel
* @return
*/
public static String parseChannelRemoteAddr(final Channel channel) {
if (null == channel) {
return "";
}
final SocketAddress remote = channel.remoteAddress();
final String addr = remote != null ? remote.toString() : "";
if (addr.length() > 0) {
int index = addr.lastIndexOf("/");
if (index >= 0) {
return addr.substring(index + 1);
}
return addr;
}
return "";
}
public static String parseChannelRemoteName(final Channel channel) {
if (null == channel) {
return "";
}
final InetSocketAddress remote = (InetSocketAddress) channel.remoteAddress();
if (remote != null) {
return remote.getAddress().getHostName();
}
return "";
}
public static String parseSocketAddressAddr(SocketAddress socketAddress) {
if (socketAddress != null) {
final String addr = socketAddress.toString();
if (addr.length() > 0) {
return addr.substring(1);
}
}
return "";
}
public static String parseSocketAddressName(SocketAddress socketAddress) {
final InetSocketAddress addrs = (InetSocketAddress) socketAddress;
if (addrs != null) {
return addrs.getAddress().getHostName();
}
return "";
}
}
| {
"content_hash": "14dbedcfc6f4058373bbdefdcb47ee36",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 94,
"avg_line_length": 32.44933920704846,
"alnum_prop": 0.5093673635623134,
"repo_name": "liujia128/RocketMQ-Master-analyze",
"id": "870b5846b72dce2abb1f31972c68608c6f3e151d",
"size": "8134",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "rocketmq-remoting/src/main/java/com/alibaba/rocketmq/remoting/common/RemotingHelper.java",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "127"
},
{
"name": "Java",
"bytes": "2817222"
},
{
"name": "Shell",
"bytes": "19702"
}
],
"symlink_target": ""
} |
from tapiriik.services.ratelimiting import RateLimit, RateLimitExceededException
from tapiriik.services.api import ServiceException, UserExceptionType, UserException
class ServiceAuthenticationType:
OAuth = "oauth"
UsernamePassword = "direct"
class InvalidServiceOperationException(Exception):
pass
class ServiceBase:
# Short ID used everywhere in logging and DB storage
ID = None
# Alias ID in case somebody (not naming names) typoed a service name and needs to keep the old ID functional
IDAliases = None
# Full display name given to users
DisplayName = None
# 2-3 letter abbreviated name
DisplayAbbreviation = None
# One of ServiceAuthenticationType
AuthenticationType = None
# Enables extended auth ("Save these details") functionality
RequiresExtendedAuthorizationDetails = False
# URL to direct user to when starting authentication
UserAuthorizationURL = None
# Don't attempt to IFrame the OAuth login
AuthenticationNoFrame = False
# List of ActivityTypes
SupportedActivities = None
# Used only in tests
SupportsHR = SupportsCalories = SupportsCadence = SupportsTemp = SupportsPower = False
# Does it?
ReceivesActivities = True # Any at all?
ReceivesStationaryActivities = True # Manually-entered?
ReceivesNonGPSActivitiesWithOtherSensorData = True # Trainer-ish?
SuppliesActivities = True
# Services with this flag unset will receive an explicit date range for activity listing,
# rather than the exhaustive flag alone. They are also processed after all other services.
# An account must have at least one service that supports exhaustive listing.
SupportsExhaustiveListing = True
SupportsActivityDeletion = False
# Causes synchronizations to be skipped until...
# - One is triggered (via IDs returned by ExternalIDsForPartialSyncTrigger or PollPartialSyncTrigger)
# - One is necessitated (non-partial sync, possibility of uploading new activities, etc)
PartialSyncRequiresTrigger = False
PartialSyncTriggerRequiresSubscription = False
PartialSyncTriggerStatusCode = 204
# Timedelta for polling to happen at (or None for no polling)
PartialSyncTriggerPollInterval = None
# How many times to call the polling method per interval (this is for the multiple_index kwarg)
PartialSyncTriggerPollMultiple = 1
# How many times should we try each operation on an activity before giving up?
# (only ever tries once per sync run - so ~1 hour interval on average)
UploadRetryCount = 5
DownloadRetryCount = 5
# Global rate limiting options
# For when there's a limit on the API key itself
GlobalRateLimits = []
@property
def PartialSyncTriggerRequiresPolling(self):
return self.PartialSyncRequiresTrigger and self.PartialSyncTriggerPollInterval
# Adds the Setup button to the service configuration pane, and not much else
Configurable = False
# Defaults for per-service configuration
ConfigurationDefaults = {}
# For the diagnostics dashboard
UserProfileURL = UserActivityURL = None
def RequiresConfiguration(self, serviceRecord): # Should convert this into a real property
return False # True means no sync until user configures
def WebInit(self):
pass
# Return an URL pointing directly to the specified activity on the remote site
def UserUploadedActivityURL(self, uploadId):
raise NotImplementedError
def GenerateUserAuthorizationURL(self, session, level=None):
raise NotImplementedError
def Authorize(self, email, password, store=False):
raise NotImplementedError
def RevokeAuthorization(self, serviceRecord):
raise NotImplementedError
def DownloadActivityList(self, serviceRecord, exhaustive_start_date=None):
raise NotImplementedError
def DownloadActivity(self, serviceRecord, activity):
raise NotImplementedError
# Should return an uploadId for storage and potential use in DeleteActivity
def UploadActivity(self, serviceRecord, activity):
raise NotImplementedError
def DeleteActivity(self, serviceRecord, uploadId):
raise NotImplementedError
def DeleteCachedData(self, serviceRecord):
raise NotImplementedError
def SubscribeToPartialSyncTrigger(self, serviceRecord):
if self.PartialSyncRequiresTrigger:
raise NotImplementedError
else:
raise InvalidServiceOperationException
def UnsubscribeFromPartialSyncTrigger(self, serviceRecord):
if self.PartialSyncRequiresTrigger:
raise NotImplementedError
else:
raise InvalidServiceOperationException
def ShouldForcePartialSyncTrigger(self, serviceRecord):
if self.PartialSyncRequiresTrigger:
return False
else:
raise InvalidServiceOperationException
def PollPartialSyncTrigger(self, multiple_index):
if self.PartialSyncRequiresTrigger and self.PartialSyncTriggerPollInterval:
raise NotImplementedError
else:
raise InvalidServiceOperationException
def ExternalIDsForPartialSyncTrigger(self, req):
raise NotImplementedError
def PartialSyncTriggerGET(self, req):
from django.http import HttpResponse
return HttpResponse(status=204)
def ConfigurationUpdating(self, serviceRecord, newConfig, oldConfig):
pass
def _globalRateLimit(self):
try:
RateLimit.Limit(self.ID)
except RateLimitExceededException:
raise ServiceException("Global rate limit reached", user_exception=UserException(UserExceptionType.RateLimited))
| {
"content_hash": "eb5fbc22575873c22c0f8760dfef6f81",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 124,
"avg_line_length": 36.100628930817614,
"alnum_prop": 0.7369337979094077,
"repo_name": "cgourlay/tapiriik",
"id": "513a6f53e38a97b3f7e488528b3abdebea9dbc97",
"size": "5740",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tapiriik/services/service_base.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "23790"
},
{
"name": "HTML",
"bytes": "66893"
},
{
"name": "JavaScript",
"bytes": "48529"
},
{
"name": "Python",
"bytes": "605994"
},
{
"name": "Shell",
"bytes": "1120"
}
],
"symlink_target": ""
} |
package com.netflix.spectator.servo;
import com.netflix.spectator.api.ManualClock;
import com.netflix.spectator.api.Measurement;
import com.netflix.spectator.api.Registry;
import com.netflix.spectator.api.Statistic;
import com.netflix.spectator.api.Timer;
import com.netflix.spectator.api.Utils;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.math.BigInteger;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
@RunWith(JUnit4.class)
public class ServoTimerTest {
private final ManualClock clock = new ManualClock();
private Timer newTimer(String name) {
final Registry r = new ServoRegistry(clock);
return r.timer(r.createId(name));
}
@Before
public void before() {
clock.setWallTime(0L);
clock.setMonotonicTime(0L);
}
@Test
public void testInit() {
Timer t = newTimer("foo");
Assert.assertEquals(t.count(), 0L);
Assert.assertEquals(t.totalTime(), 0L);
}
@Test
public void testRecord() {
Timer t = newTimer("foo");
t.record(42, TimeUnit.MILLISECONDS);
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 42000000L);
}
@Test
public void testRecordNegative() {
Timer t = newTimer("foo");
t.record(-42, TimeUnit.MILLISECONDS);
Assert.assertEquals(t.count(), 0L);
Assert.assertEquals(t.totalTime(), 0L);
}
@Test
public void testRecordZero() {
Timer t = newTimer("foo");
t.record(0, TimeUnit.MILLISECONDS);
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 0L);
}
@Test
public void testRecordCallable() throws Exception {
Timer t = newTimer("foo");
clock.setMonotonicTime(100L);
int v = t.record(new Callable<Integer>() {
public Integer call() throws Exception {
clock.setMonotonicTime(500L);
return 42;
}
});
Assert.assertEquals(v, 42);
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 400L);
}
@Test
public void testRecordCallableException() throws Exception {
Timer t = newTimer("foo");
clock.setMonotonicTime(100L);
boolean seen = false;
try {
t.record(new Callable<Integer>() {
public Integer call() throws Exception {
clock.setMonotonicTime(500L);
throw new RuntimeException("foo");
}
});
} catch (Exception e) {
seen = true;
}
Assert.assertTrue(seen);
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 400L);
}
@Test
public void testRecordRunnable() throws Exception {
Timer t = newTimer("foo");
clock.setMonotonicTime(100L);
t.record(new Runnable() {
public void run() {
clock.setMonotonicTime(500L);
}
});
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 400L);
}
@Test
public void testRecordRunnableException() throws Exception {
Timer t = newTimer("foo");
clock.setMonotonicTime(100L);
boolean seen = false;
try {
t.record(new Runnable() {
public void run() {
clock.setMonotonicTime(500L);
throw new RuntimeException("foo");
}
});
} catch (Exception e) {
seen = true;
}
Assert.assertTrue(seen);
Assert.assertEquals(t.count(), 1L);
Assert.assertEquals(t.totalTime(), 400L);
}
@Test
public void testMeasure() {
Timer t = newTimer("foo");
t.record(42, TimeUnit.MILLISECONDS);
clock.setWallTime(61000L);
for (Measurement m : t.measure()) {
Assert.assertEquals(m.timestamp(), 61000L);
final double count = Utils.first(t.measure(), Statistic.count).value();
final double totalTime = Utils.first(t.measure(), Statistic.totalTime).value();
Assert.assertEquals(count, 1.0 / 60.0, 0.1e-12);
Assert.assertEquals(totalTime, 42e-3 / 60.0, 0.1e-12);
}
}
@Test
public void totalOfSquaresOverflow() {
final long seconds = 10;
final long nanos = TimeUnit.SECONDS.toNanos(seconds);
final BigInteger s = new BigInteger("" + nanos);
final BigInteger s2 = s.multiply(s);
Timer t = newTimer("foo");
t.record(seconds, TimeUnit.SECONDS);
clock.setWallTime(61000L);
final double v = Utils.first(t.measure(), Statistic.totalOfSquares).value();
final double factor = 1e9 * 1e9;
final BigInteger perSec = s2.divide(BigInteger.valueOf(60));
Assert.assertEquals(perSec.doubleValue() / factor, v, 1e-12);
}
@Test
public void totalOfSquaresManySmallValues() {
Timer t = newTimer("foo");
BigInteger sumOfSq = new BigInteger("0");
for (int i = 0; i < 100000; ++i) {
final long nanos = i;
final BigInteger s = new BigInteger("" + nanos);
final BigInteger s2 = s.multiply(s);
sumOfSq = sumOfSq.add(s2);
t.record(i, TimeUnit.NANOSECONDS);
}
clock.setWallTime(61000L);
final double v = Utils.first(t.measure(), Statistic.totalOfSquares).value();
final double factor = 1e9 * 1e9;
sumOfSq = sumOfSq.divide(BigInteger.valueOf(60));
Assert.assertEquals(sumOfSq.doubleValue() / factor, v, 1e-12);
}
@Test
public void totalOfSquaresManyBigValues() {
Timer t = newTimer("foo");
BigInteger sumOfSq = new BigInteger("0");
for (int i = 0; i < 100000; ++i) {
final long nanos = TimeUnit.SECONDS.toNanos(i);
final BigInteger s = new BigInteger("" + nanos);
final BigInteger s2 = s.multiply(s);
sumOfSq = sumOfSq.add(s2);
t.record(i, TimeUnit.SECONDS);
}
clock.setWallTime(61000L);
final double v = Utils.first(t.measure(), Statistic.totalOfSquares).value();
// Expected :3.3332833335E14
// Actual :3.3332833334999825E14
final double factor = 1e9 * 1e9;
sumOfSq = sumOfSq.divide(BigInteger.valueOf(60));
Assert.assertEquals(sumOfSq.doubleValue() / factor, v, 2.0);
}
@Test
public void expiration() {
// Not expired on init
clock.setWallTime(0L);
Timer t = newTimer("foo");
Assert.assertTrue(!t.hasExpired());
// Expires with inactivity
clock.setWallTime(TimeUnit.MINUTES.toMillis(16));
Assert.assertTrue(t.hasExpired());
// Activity brings it back
t.record(42, TimeUnit.SECONDS);
Assert.assertTrue(!t.hasExpired());
}
}
| {
"content_hash": "e67a3a1269398a78be02f648cb20088c",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 85,
"avg_line_length": 28.275555555555556,
"alnum_prop": 0.6549827098396731,
"repo_name": "cfieber/spectator",
"id": "96a9f381a4c126e50cc7c7bc72847b564c188f00",
"size": "6959",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spectator-reg-servo/src/test/java/com/netflix/spectator/servo/ServoTimerTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "534025"
},
{
"name": "Shell",
"bytes": "3769"
}
],
"symlink_target": ""
} |
// Copyright (c) 2011-2016 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_QT_GUICONSTANTS_H
#define BITCOIN_QT_GUICONSTANTS_H
/* Milliseconds between model updates */
static const int MODEL_UPDATE_DELAY = 250;
/* AskPassphraseDialog -- Maximum passphrase length */
static const int MAX_PASSPHRASE_SIZE = 1024;
/* BitcoinGUI -- Size of icons in status bar */
static const int STATUSBAR_ICONSIZE = 16;
static const bool DEFAULT_SPLASHSCREEN = true;
/* Invalid field background style */
#define STYLE_INVALID "background:#FF8080"
/* Transaction list -- unconfirmed transaction */
#define COLOR_UNCONFIRMED QColor(128, 128, 128)
/* Transaction list -- negative amount */
#define COLOR_NEGATIVE QColor(255, 0, 0)
/* Transaction list -- bare address (without label) */
#define COLOR_BAREADDRESS QColor(140, 140, 140)
/* Transaction list -- TX status decoration - open until date */
#define COLOR_TX_STATUS_OPENUNTILDATE QColor(64, 64, 255)
/* Transaction list -- TX status decoration - offline */
#define COLOR_TX_STATUS_OFFLINE QColor(192, 192, 192)
/* Transaction list -- TX status decoration - danger, tx needs attention */
#define COLOR_TX_STATUS_DANGER QColor(200, 100, 100)
/* Transaction list -- TX status decoration - default color */
#define COLOR_BLACK QColor(0, 0, 0)
/* Tooltips longer than this (in characters) are converted into rich text,
so that they can be word-wrapped.
*/
static const int TOOLTIP_WRAP_THRESHOLD = 80;
/* Maximum allowed URI length */
static const int MAX_URI_LENGTH = 255;
/* QRCodeDialog -- size of exported QR Code image */
#define QR_IMAGE_SIZE 300
/* Number of frames in spinner animation */
#define SPINNER_FRAMES 36
#define QAPP_ORG_NAME "Mincoin"
#define QAPP_ORG_DOMAIN "mincoin.us"
#define QAPP_APP_NAME_DEFAULT "Mincoin-Qt"
#define QAPP_APP_NAME_TESTNET "Mincoin-Qt-testnet"
#endif // BITCOIN_QT_GUICONSTANTS_H
| {
"content_hash": "09aebfb13bee472412f91975e608bf77",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 75,
"avg_line_length": 35.785714285714285,
"alnum_prop": 0.7440119760479041,
"repo_name": "xieta/mincoin",
"id": "2dfc0c26edeacc77c0138ea09bc009f09e52bfbb",
"size": "2004",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/qt/guiconstants.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "28456"
},
{
"name": "C",
"bytes": "687986"
},
{
"name": "C++",
"bytes": "4972454"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "HTML",
"bytes": "50622"
},
{
"name": "Java",
"bytes": "30290"
},
{
"name": "M4",
"bytes": "186864"
},
{
"name": "Makefile",
"bytes": "110045"
},
{
"name": "Objective-C",
"bytes": "5461"
},
{
"name": "Objective-C++",
"bytes": "7240"
},
{
"name": "Python",
"bytes": "1138984"
},
{
"name": "QMake",
"bytes": "756"
},
{
"name": "Shell",
"bytes": "48732"
}
],
"symlink_target": ""
} |
PONY_EXTERN_C_BEGIN
typedef void (*trace_object_fn)(pony_ctx_t* ctx, void* p, pony_trace_fn f);
typedef void (*trace_actor_fn)(pony_ctx_t* ctx, pony_actor_t* actor);
typedef struct scheduler_t scheduler_t;
typedef struct pony_ctx_t
{
scheduler_t* scheduler;
pony_actor_t* current;
trace_object_fn trace_object;
trace_actor_fn trace_actor;
gcstack_t* stack;
actormap_t acquire;
bool finalising;
#ifdef USE_TELEMETRY
size_t tsc;
size_t count_gc_passes;
size_t count_alloc;
size_t count_alloc_size;
size_t count_alloc_actors;
size_t count_msg_app;
size_t count_msg_block;
size_t count_msg_unblock;
size_t count_msg_acquire;
size_t count_msg_release;
size_t count_msg_conf;
size_t count_msg_ack;
size_t time_in_gc;
size_t time_in_send_scan;
size_t time_in_recv_scan;
#endif
} pony_ctx_t;
struct scheduler_t
{
// These are rarely changed.
pony_thread_id_t tid;
uint32_t cpu;
uint32_t node;
bool terminate;
bool asio_stopped;
// These are changed primarily by the owning scheduler thread.
__pony_spec_align__(struct scheduler_t* last_victim, 64);
pony_ctx_t ctx;
uint32_t block_count;
uint32_t ack_token;
uint32_t ack_count;
// These are accessed by other scheduler threads. The mpmcq_t is aligned.
mpmcq_t q;
messageq_t mq;
};
pony_ctx_t* scheduler_init(uint32_t threads, bool noyield);
bool scheduler_start(bool library);
void scheduler_stop();
void scheduler_add(pony_ctx_t* ctx, pony_actor_t* actor);
uint32_t scheduler_cores();
void scheduler_terminate();
PONY_EXTERN_C_END
#endif
| {
"content_hash": "ed1604105b262d33185a287dfb12e393",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 20.441558441558442,
"alnum_prop": 0.7033036848792884,
"repo_name": "jonas-l/ponyc",
"id": "bbd0ba18dba0545759913901d7dff0d83ea74a26",
"size": "1734",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/libponyrt/sched/scheduler.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "1164036"
},
{
"name": "C++",
"bytes": "1505638"
},
{
"name": "GAP",
"bytes": "6542"
},
{
"name": "Lua",
"bytes": "6343"
},
{
"name": "Makefile",
"bytes": "16951"
},
{
"name": "Pony",
"bytes": "425249"
},
{
"name": "Shell",
"bytes": "1045"
}
],
"symlink_target": ""
} |
(function() {
var Slack, autoMark, autoReconnect, slack, token;
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({port: process.env.PORT || 5000});
// Grab add-ons
var osu = require('./osu.js');
var quotes = require('./quotes.js');
var scoreKeeper = require('./scoreKeeper.js');
var yolo = require('./yolo.js');
Slack = require('..');
token = process.env.SLACKBOT_TOKEN;
autoReconnect = true;
autoMark = true;
slack = new Slack(token, autoReconnect, autoMark);
// Set up persistence
slack.persist = require('./persist.js');
slack.persist.readPersistFile(function(persistData) {
slack.data = persistData;
console.log(slack.data);
});
osu(slack);
quotes(slack);
scoreKeeper(slack);
yolo(slack);
slack.on('open', function() {
var channel, channels, group, groups, id, messages, unreads;
channels = [];
groups = [];
unreads = slack.getUnreadCount();
channels = (function() {
var ref, results;
ref = slack.channels;
results = [];
for (id in ref) {
channel = ref[id];
if (channel.is_member) {
results.push("#" + channel.name);
}
}
return results;
})();
groups = (function() {
var ref, results;
ref = slack.groups;
results = [];
for (id in ref) {
group = ref[id];
if (group.is_open && !group.is_archived) {
results.push(group.name);
}
}
return results;
})();
console.log("Process is running on port: " + process.env.PORT);
console.log("Welcome to Slack. You are @" + slack.self.name + " of " + slack.team.name);
console.log('You are in: ' + channels.join(', '));
console.log('As well as: ' + groups.join(', '));
messages = unreads === 1 ? 'message' : 'messages';
return console.log("You have " + unreads + " unread " + messages);
});
slack.on('error', function(error) {
return console.error("Error: " + error);
});
slack.login();
}).call(this);
| {
"content_hash": "37cfac3ade2f3e8fe66ee048b4b42b5f",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 92,
"avg_line_length": 26.363636363636363,
"alnum_prop": 0.5802955665024631,
"repo_name": "cpww/dale",
"id": "9ca7bcd66e0ba32dfaeab8b09c713e1b1d1d9aa9",
"size": "2065",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "dale/main.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "28460"
},
{
"name": "JavaScript",
"bytes": "51280"
}
],
"symlink_target": ""
} |
package com.facebook.buck.android;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import com.android.ddmlib.IDevice;
import com.facebook.buck.android.device.TargetDeviceOptions;
import com.facebook.buck.android.exopackage.AndroidDevice;
import com.facebook.buck.android.exopackage.RealAndroidDevice;
import com.facebook.buck.android.toolchain.AndroidPlatformTarget;
import com.facebook.buck.core.build.execution.context.ExecutionContext;
import com.facebook.buck.core.config.FakeBuckConfig;
import com.facebook.buck.core.toolchain.impl.ToolchainProviderBuilder;
import com.facebook.buck.event.BuckEventBusForTests;
import com.facebook.buck.step.AdbOptions;
import com.facebook.buck.step.TestExecutionContext;
import com.facebook.buck.testutil.MoreAsserts;
import com.facebook.buck.testutil.TestConsole;
import com.facebook.buck.util.environment.Platform;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import java.io.File;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference;
import org.junit.Before;
import org.junit.Test;
public class AdbHelperTest {
private TestConsole testConsole;
private ExecutionContext testContext;
private AdbHelper basicAdbHelper;
@Before
public void setUp() {
testContext = TestExecutionContext.newInstance();
testConsole = (TestConsole) testContext.getConsole();
basicAdbHelper = createAdbHelper(createAdbOptions(), new TargetDeviceOptions());
}
private TestDevice createRealDevice(String serial, IDevice.DeviceState state) {
TestDevice device = TestDevice.createRealDevice(serial);
device.setState(state);
return device;
}
private TestDevice createEmulator(String serial, IDevice.DeviceState state) {
TestDevice device = TestDevice.createEmulator(serial);
device.setState(state);
return device;
}
private AdbHelper createAdbHelper(
AdbOptions adbOptions, TargetDeviceOptions targetDeviceOptions) {
return createAdbHelper(testContext, adbOptions, targetDeviceOptions);
}
private AdbHelper createAdbHelper(
ExecutionContext executionContext,
AdbOptions adbOptions,
TargetDeviceOptions targetDeviceOptions) {
return new AdbHelper(
adbOptions,
targetDeviceOptions,
new ToolchainProviderBuilder()
.withToolchain(
AndroidPlatformTarget.DEFAULT_NAME, TestAndroidPlatformTargetFactory.create())
.build(),
() -> executionContext,
true,
ImmutableList.of());
}
/** Verify that null is returned when no devices are present. */
@Test
public void testDeviceFilterNoDevices() {
IDevice[] devices = new IDevice[] {};
assertNull(basicAdbHelper.filterDevices(devices));
}
/** Verify that non-online devices will not appear in result list. */
@Test
public void testDeviceFilterOnlineOnly() {
IDevice[] devices =
new IDevice[] {
createEmulator("1", IDevice.DeviceState.OFFLINE),
createEmulator("2", IDevice.DeviceState.BOOTLOADER),
createEmulator("3", IDevice.DeviceState.RECOVERY),
createRealDevice("4", IDevice.DeviceState.OFFLINE),
createRealDevice("5", IDevice.DeviceState.BOOTLOADER),
createRealDevice("6", IDevice.DeviceState.RECOVERY),
};
assertNull(basicAdbHelper.filterDevices(devices));
}
@Test
public void testEmulatorAddsGenymotionDevices() {
AdbHelper adbHelper =
createAdbHelper(createAdbOptions(), new TargetDeviceOptions(true, false, Optional.empty()));
IDevice[] devices =
new IDevice[] {
TestDevice.createRealDevice("foobarblahblah"),
TestDevice.createRealDevice("192.168.57.101:5555")
};
List<IDevice> filtered = adbHelper.filterDevices(devices);
assertNotNull(filtered);
assertEquals(1, filtered.size());
assertEquals("192.168.57.101:5555", filtered.get(0).getSerialNumber());
}
@Test
public void testGenymotionIsntARealDevice() {
AdbHelper adbHelper =
createAdbHelper(createAdbOptions(), new TargetDeviceOptions(false, true, Optional.empty()));
IDevice[] devices =
new IDevice[] {
TestDevice.createRealDevice("foobar"), TestDevice.createRealDevice("192.168.57.101:5555")
};
List<IDevice> filtered = adbHelper.filterDevices(devices);
assertNotNull(filtered);
assertEquals(1, filtered.size());
assertEquals("foobar", filtered.get(0).getSerialNumber());
}
/**
* Verify that multi-install is not enabled and multiple devices pass the filter null is returned.
* Also verify that if multiple devices are passing the filter and multi-install mode is enabled
* they all appear in resulting list.
*/
@Test
public void testDeviceFilterMultipleDevices() {
IDevice[] devices =
new IDevice[] {
createEmulator("1", IDevice.DeviceState.ONLINE),
createEmulator("2", IDevice.DeviceState.ONLINE),
createRealDevice("4", IDevice.DeviceState.ONLINE),
createRealDevice("5", IDevice.DeviceState.ONLINE)
};
List<IDevice> filteredDevicesNoMultiInstall = basicAdbHelper.filterDevices(devices);
assertNotNull(filteredDevicesNoMultiInstall);
assertEquals(devices.length, filteredDevicesNoMultiInstall.size());
AdbHelper myAdbHelper = createAdbHelper(createAdbOptions(true), new TargetDeviceOptions());
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(devices.length, filteredDevices.size());
}
/** Verify that when emulator-only mode is enabled only emulators appear in result. */
@Test
public void testDeviceFilterEmulator() {
AdbHelper myAdbHelper =
createAdbHelper(createAdbOptions(), new TargetDeviceOptions(true, false, Optional.empty()));
IDevice[] devices =
new IDevice[] {
createEmulator("1", IDevice.DeviceState.ONLINE),
createRealDevice("2", IDevice.DeviceState.ONLINE),
};
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(devices[0], filteredDevices.get(0));
}
/** Verify that when real-device-only mode is enabled only real devices appear in result. */
@Test
public void testDeviceFilterRealDevices() {
AdbHelper myAdbHelper =
createAdbHelper(createAdbOptions(), new TargetDeviceOptions(false, true, Optional.empty()));
IDevice[] devices =
new IDevice[] {
createRealDevice("1", IDevice.DeviceState.ONLINE),
createEmulator("2", IDevice.DeviceState.ONLINE)
};
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(devices[0], filteredDevices.get(0));
}
/** Verify that filtering by serial number works. */
@Test
public void testDeviceFilterBySerial() {
IDevice[] devices =
new IDevice[] {
createRealDevice("1", IDevice.DeviceState.ONLINE),
createEmulator("2", IDevice.DeviceState.ONLINE),
createRealDevice("3", IDevice.DeviceState.ONLINE),
createEmulator("4", IDevice.DeviceState.ONLINE)
};
for (int i = 0; i < devices.length; i++) {
AdbHelper myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(false, false, Optional.of(devices[i].getSerialNumber())));
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(devices[i], filteredDevices.get(0));
}
}
/** Verify that filtering by environment variable works. */
@Test
public void whenSerialNumberSetInEnvironmentThenCorrectDeviceFound() {
IDevice[] devices =
new IDevice[] {
createRealDevice("1", IDevice.DeviceState.ONLINE),
createEmulator("2", IDevice.DeviceState.ONLINE),
createRealDevice("3", IDevice.DeviceState.ONLINE),
createEmulator("4", IDevice.DeviceState.ONLINE)
};
for (int i = 0; i < devices.length; i++) {
AdbHelper myAdbHelper =
createAdbHelper(
TestExecutionContext.newBuilder()
.setEnvironment(
ImmutableMap.of(AdbHelper.SERIAL_NUMBER_ENV, devices[i].getSerialNumber()))
.build(),
createAdbOptions(),
new TargetDeviceOptions());
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(devices[i], filteredDevices.get(0));
}
}
/** Verify that if no devices match filters null is returned. */
@Test
public void testDeviceFilterNoMatchingDevices() {
IDevice[] devices =
new IDevice[] {
createRealDevice("1", IDevice.DeviceState.ONLINE),
createEmulator("2", IDevice.DeviceState.ONLINE),
createRealDevice("3", IDevice.DeviceState.ONLINE),
createEmulator("4", IDevice.DeviceState.ONLINE)
};
AdbHelper myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(false, false, Optional.of("invalid-serial")));
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNull(filteredDevices);
}
/** Verify that different combinations of arguments work correctly. */
@Test
public void testDeviceFilterCombos() {
TestDevice realDevice1 = createRealDevice("1", IDevice.DeviceState.ONLINE);
TestDevice realDevice2 = createRealDevice("2", IDevice.DeviceState.ONLINE);
TestDevice emulator1 = createEmulator("3", IDevice.DeviceState.ONLINE);
TestDevice emulator2 = createEmulator("4", IDevice.DeviceState.ONLINE);
IDevice[] devices = new IDevice[] {realDevice1, emulator1, realDevice2, emulator2};
AdbHelper myAdbHelper;
// Filter by serial in "real device" mode with serial number for real device.
myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(false, true, Optional.of(realDevice1.getSerialNumber())));
List<IDevice> filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(realDevice1, filteredDevices.get(0));
// Filter by serial in "real device" mode with serial number for emulator.
myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(false, true, Optional.of(emulator1.getSerialNumber())));
filteredDevices = myAdbHelper.filterDevices(devices);
assertNull(filteredDevices);
// Filter by serial in "emulator" mode with serial number for real device.
myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(true, false, Optional.of(realDevice1.getSerialNumber())));
filteredDevices = myAdbHelper.filterDevices(devices);
assertNull(filteredDevices);
// Filter by serial in "real device" mode with serial number for emulator.
myAdbHelper =
createAdbHelper(
createAdbOptions(),
new TargetDeviceOptions(true, false, Optional.of(emulator1.getSerialNumber())));
filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(1, filteredDevices.size());
assertSame(emulator1, filteredDevices.get(0));
// Filter in both "real device" mode and "emulator mode".
myAdbHelper =
createAdbHelper(
createAdbOptions(true), new TargetDeviceOptions(true, true, Optional.empty()));
filteredDevices = myAdbHelper.filterDevices(devices);
assertNotNull(filteredDevices);
assertEquals(devices.length, filteredDevices.size());
for (IDevice device : devices) {
assertTrue(filteredDevices.contains(device));
}
}
@Test
public void testQuietDeviceInstall() throws InterruptedException {
BuckEventBusForTests.CapturingConsoleEventListener listener =
new BuckEventBusForTests.CapturingConsoleEventListener();
testContext.getBuckEventBus().register(listener);
File apk = new File("/some/file.apk");
AtomicReference<String> apkPath = new AtomicReference<>();
TestDevice device =
new TestDevice() {
@Override
public void installPackage(String s, boolean b, String... strings) {
apkPath.set(s);
}
};
device.setSerialNumber("serial#1");
device.setName("testDevice");
List<IDevice> deviceList = Lists.newArrayList((IDevice) device);
AdbHelper adbHelper = createAdbHelper(deviceList);
adbHelper.adbCall("install apk", (d) -> d.installApkOnDevice(apk, false, true, false), true);
assertEquals(apk.getAbsolutePath(), apkPath.get());
assertTrue(listener.getLogMessages().isEmpty());
}
@Test
public void testNonQuietShowsOutput() throws InterruptedException {
BuckEventBusForTests.CapturingConsoleEventListener listener =
new BuckEventBusForTests.CapturingConsoleEventListener();
testContext.getBuckEventBus().register(listener);
File apk = new File("/some/file.apk");
AtomicReference<String> apkPath = new AtomicReference<>();
TestDevice device =
new TestDevice() {
@Override
public void installPackage(String s, boolean b, String... strings) {
apkPath.set(s);
}
};
device.setSerialNumber("serial#1");
device.setName("testDevice");
List<IDevice> deviceList = Lists.newArrayList((IDevice) device);
AdbHelper adbHelper = createAdbHelper(deviceList);
adbHelper.adbCall("install apk", (d) -> d.installApkOnDevice(apk, false, false, false), false);
assertEquals(apk.getAbsolutePath(), apkPath.get());
MoreAsserts.assertListEquals(
listener.getLogMessages(),
ImmutableList.of(
"Installing apk on serial#1.", "Successfully ran install apk on 1 device(s)"));
}
private AdbHelper createAdbHelper(List<IDevice> deviceList) {
return new AdbHelper(
createAdbOptions(),
new TargetDeviceOptions(),
new ToolchainProviderBuilder()
.withToolchain(
AndroidPlatformTarget.DEFAULT_NAME, TestAndroidPlatformTargetFactory.create())
.build(),
() -> testContext,
true,
ImmutableList.of()) {
@Override
public ImmutableList<AndroidDevice> getDevices(boolean quiet) {
return deviceList.stream()
.map(
id ->
(AndroidDevice)
new RealAndroidDevice(testContext.getBuckEventBus(), id, testConsole))
.collect(ImmutableList.toImmutableList());
}
};
}
private static AdbOptions createAdbOptions() {
return createAdbOptions(false);
}
private static AdbOptions createAdbOptions(boolean multiInstallMode) {
return new AdbOptions(
0,
multiInstallMode,
new AndroidBuckConfig(FakeBuckConfig.builder().build(), Platform.detect()).getAdbTimeout());
}
}
| {
"content_hash": "9090433d098fdd3ef0711cc363dd83ba",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 100,
"avg_line_length": 37.09285714285714,
"alnum_prop": 0.6967071057192374,
"repo_name": "zpao/buck",
"id": "cd5b60b4782bcd5efe2f02ce18f106535fd57db5",
"size": "16195",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "test/com/facebook/buck/android/AdbHelperTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1796"
},
{
"name": "C",
"bytes": "250514"
},
{
"name": "CSS",
"bytes": "56119"
},
{
"name": "Dockerfile",
"bytes": "2094"
},
{
"name": "HTML",
"bytes": "11770"
},
{
"name": "Java",
"bytes": "33190146"
},
{
"name": "JavaScript",
"bytes": "931240"
},
{
"name": "Kotlin",
"bytes": "310039"
},
{
"name": "Lex",
"bytes": "14469"
},
{
"name": "Makefile",
"bytes": "1704"
},
{
"name": "PowerShell",
"bytes": "2154"
},
{
"name": "Python",
"bytes": "2153057"
},
{
"name": "Shell",
"bytes": "43626"
},
{
"name": "Smalltalk",
"bytes": "194"
},
{
"name": "Thrift",
"bytes": "18638"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
{% include 'head.html' %}
<body>
{% include 'topbar.html' %}
<main>
{% block main %}{% endblock %}
</main>
<div class="modal fade" id="konamiModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">You did it.</h4>
</div>
<div class="modal-body"></div>
</div>
</div>
</div>
{% include 'js.html' %}
</body>
</html>
| {
"content_hash": "34f72ec537161a05c082a4a47d9292e9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 130,
"avg_line_length": 26.727272727272727,
"alnum_prop": 0.576530612244898,
"repo_name": "PrincessTeruko/TsunArt",
"id": "8fdc5f848495a8200441d3c64ed8d45543381ba6",
"size": "588",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tsunart/templates/generic.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "23615"
},
{
"name": "HTML",
"bytes": "34809"
},
{
"name": "JavaScript",
"bytes": "47538"
},
{
"name": "Python",
"bytes": "114688"
},
{
"name": "Shell",
"bytes": "1392"
}
],
"symlink_target": ""
} |
import warnings
from pathlib import Path
import matplotlib.pyplot as plt
import pytest
import pandas as pd
from plotnine import (ggplot, aes, geom_text, geom_point, facet_wrap,
ggsave, theme_xkcd)
from plotnine.data import mtcars
from plotnine.exceptions import PlotnineError, PlotnineWarning
p = (ggplot(mtcars, aes(x='wt', y='mpg', label='name'))
+ geom_text())
def sequential_filenames():
"""
Generate filenames for the tests
"""
for i in range(100):
yield Path(f'filename-{i}.png')
filename_gen = sequential_filenames()
def assert_exist_and_clean(filename, msg=None):
if not msg:
msg = f"File {filename} does not exist"
assert filename.exists(), msg
filename.unlink()
class TestArguments:
def test_default_filename(self):
p.save(verbose=False)
fn = p._save_filename('pdf')
assert_exist_and_clean(fn, "default filename")
def test_save_method(self):
fn = next(filename_gen)
with pytest.warns(PlotnineWarning) as record:
p.save(fn)
assert_exist_and_clean(fn, "save method")
res = ('saving' in str(item.message).lower()
for item in record)
assert any(res)
res = ('filename' in str(item.message).lower()
for item in record)
assert any(res)
# verbose
fn = next(filename_gen)
with warnings.catch_warnings(record=True) as record:
p.save(fn, verbose=False)
assert_exist_and_clean(fn, "save method")
assert not record, "Issued an unexpected warning"
def test_filename_plot_path(self):
fn = next(filename_gen)
p.save(fn, path='.', verbose=False)
assert_exist_and_clean(fn, "fn, plot and path")
def test_format_png(self):
p.save(format='png', verbose=False)
fn = p._save_filename('png')
assert_exist_and_clean(fn, "format png")
def test_dpi(self):
fn = next(filename_gen)
p.save(fn, dpi=100, verbose=False)
assert_exist_and_clean(fn, "dpi = 100")
def test_ggsave(self):
ggsave(p, verbose=False)
fn = p._save_filename('pdf')
assert_exist_and_clean(fn, "default filename")
def test_save_big(self):
fn = next(filename_gen)
# supplying the ggplot object will work without
# printing it first! 26 is the current limit, just go
# over it to not use too much memory
p.save(fn, width=26, height=26, limitsize=False, verbose=False)
assert_exist_and_clean(fn, "big height and width")
def test_dpi_theme_xkcd(self):
fn1 = next(filename_gen)
fn2 = next(filename_gen)
df = pd.DataFrame({
'x': range(4),
'y': range(4),
'b': list('aabb')
})
p = (
ggplot(df)
+ geom_point(aes('x', 'y'))
+ facet_wrap('b')
+ theme_xkcd()
)
p.save(fn1, verbose=False)
assert_exist_and_clean(fn1, "Saving with theme_xkcd and dpi (1)")
p.save(fn2, dpi=72, verbose=False)
assert_exist_and_clean(fn2, "Saving with theme_xkcd and dpi (2)")
class TestExceptions:
def test_unknown_format(self):
with pytest.raises(Exception):
p.save(format='unknown', verbose=False)
def test_width_only(self):
with pytest.raises(PlotnineError):
p.save(width=11)
def test_height_only(self):
with pytest.raises(PlotnineError):
p.save(height=8)
def test_large_width(self):
with pytest.raises(PlotnineError):
p.save(width=300, height=8)
def test_large_height(self):
with pytest.raises(PlotnineError):
p.save(widhth=11, height=300)
def test_bad_units(self):
with pytest.raises(Exception):
p.save(width=1, heigth=1, units='xxx')
# This should be the last function in the file since it can catch
# "leakages" due to the tests in this test module.
def test_ggsave_closes_plot():
assert plt.get_fignums() == [], "There are unsaved test plots"
fn = next(filename_gen)
p.save(fn, verbose=False)
assert_exist_and_clean(fn, "exist")
assert plt.get_fignums() == [], "ggplot.save did not close the plot"
| {
"content_hash": "cdb40221692fa83bd756a91ce494a3d7",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 73,
"avg_line_length": 29.34013605442177,
"alnum_prop": 0.5981915140273592,
"repo_name": "has2k1/plotnine",
"id": "e733ecea3442bb7fee0c699175556aa7d3bbba6e",
"size": "4313",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "tests/test_ggsave.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Makefile",
"bytes": "1729"
},
{
"name": "Python",
"bytes": "991031"
},
{
"name": "Shell",
"bytes": "2997"
}
],
"symlink_target": ""
} |
package com.gemstone.gemfire.internal.admin.remote;
import com.gemstone.gemfire.distributed.internal.*;
import com.gemstone.gemfire.internal.i18n.LocalizedStrings;
//import com.gemstone.gemfire.*;
//import com.gemstone.gemfire.internal.*;
//import com.gemstone.gemfire.internal.admin.*;
import java.io.*;
//import java.util.*;
/**
* A message that is sent to a particular distribution manager to
* reset its current health status.
* @since 3.5
*/
public final class ResetHealthStatusRequest extends AdminRequest {
// instance variables
private int id;
/**
* Returns a <code>ResetHealthStatusRequest</code> to be sent to the specified recipient.
*/
public static ResetHealthStatusRequest create(int id) {
ResetHealthStatusRequest m = new ResetHealthStatusRequest();
m.id = id;
return m;
}
public ResetHealthStatusRequest() {
friendlyName = LocalizedStrings.ResetHealthStatusRequest_RESET_HEALTH_STATUS.toLocalizedString();
}
/**
* Must return a proper response to this request.
*/
@Override
protected AdminResponse createResponse(DistributionManager dm) {
return ResetHealthStatusResponse.create(dm, this.getSender(), this.id);
}
public int getDSFID() {
return RESET_HEALTH_STATUS_REQUEST;
}
@Override
public void toData(DataOutput out) throws IOException {
super.toData(out);
out.writeInt(this.id);
}
@Override
public void fromData(DataInput in)
throws IOException, ClassNotFoundException {
super.fromData(in);
this.id = in.readInt();
}
@Override
public String toString() {
return "ResetHealthStatusRequest from " + this.getRecipient() + " id=" + this.id;
}
}
| {
"content_hash": "58234aedea4e9bb82c3424b1361c33f0",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 101,
"avg_line_length": 26.06153846153846,
"alnum_prop": 0.7172373081463991,
"repo_name": "papicella/snappy-store",
"id": "b48e772e12431f5f3a525335f6da2f4a9d0e1c4d",
"size": "2359",
"binary": false,
"copies": "3",
"ref": "refs/heads/snappy/master",
"path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/admin/remote/ResetHealthStatusRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "AGS Script",
"bytes": "90653"
},
{
"name": "Assembly",
"bytes": "962433"
},
{
"name": "Batchfile",
"bytes": "30248"
},
{
"name": "C",
"bytes": "311620"
},
{
"name": "C#",
"bytes": "1352292"
},
{
"name": "C++",
"bytes": "2029050"
},
{
"name": "CSS",
"bytes": "81939"
},
{
"name": "Gnuplot",
"bytes": "3125"
},
{
"name": "HTML",
"bytes": "8610280"
},
{
"name": "Java",
"bytes": "119311633"
},
{
"name": "JavaScript",
"bytes": "36789"
},
{
"name": "Makefile",
"bytes": "18443"
},
{
"name": "Mathematica",
"bytes": "92588"
},
{
"name": "Objective-C",
"bytes": "1069"
},
{
"name": "PHP",
"bytes": "581417"
},
{
"name": "PLSQL",
"bytes": "86549"
},
{
"name": "PLpgSQL",
"bytes": "33847"
},
{
"name": "Pascal",
"bytes": "808"
},
{
"name": "Perl",
"bytes": "196843"
},
{
"name": "Python",
"bytes": "12796"
},
{
"name": "Ruby",
"bytes": "1380"
},
{
"name": "SQLPL",
"bytes": "219147"
},
{
"name": "Shell",
"bytes": "547363"
},
{
"name": "SourcePawn",
"bytes": "29958"
},
{
"name": "Thrift",
"bytes": "31125"
},
{
"name": "XSLT",
"bytes": "77109"
}
],
"symlink_target": ""
} |
/**
* \file
* \brief Threads.
*/
/*
* Copyright (c) 2007, 2008, 2009, 2010, 2011, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef LIBBARRELFISH_THREADS_H
#define LIBBARRELFISH_THREADS_H
#include <barrelfish/caddr.h> // for struct capref.
#include <barrelfish/thread_sync.h>
#include <barrelfish_kpi/registers_arch.h>
#include <barrelfish_kpi/dispatcher_handle.h>
#include <errors/errno.h>
#include <sys/cdefs.h>
__BEGIN_DECLS
typedef int (*thread_func_t)(void *);
/// Default size of a thread's stack
#define THREADS_DEFAULT_STACK_BYTES (64 * 1024)
struct thread *thread_create(thread_func_t start_func, void *data);
struct thread *thread_create_varstack(thread_func_t start_func, void *arg,
size_t stacksize);
void thread_yield(void);
void thread_yield_dispatcher(struct capref endpoint);
void thread_exit(void);
struct thread *thread_self(void);
errval_t thread_join(struct thread *thread, int *retval);
errval_t thread_detach(struct thread *thread);
void thread_pause(struct thread *thread);
void thread_pause_and_capture_state(struct thread *thread,
arch_registers_state_t **ret_regs,
arch_registers_fpu_state_t **ret_fpuregs);
void thread_resume(struct thread *thread);
void thread_mutex_init(struct thread_mutex *mutex);
void thread_mutex_lock(struct thread_mutex *mutex);
bool thread_mutex_trylock(struct thread_mutex *mutex);
void thread_mutex_lock_nested(struct thread_mutex *mutex);
void thread_mutex_unlock(struct thread_mutex *mutex);
struct thread *thread_mutex_unlock_disabled(dispatcher_handle_t handle,
struct thread_mutex *mutex);
void thread_cond_init(struct thread_cond *cond);
void thread_cond_signal(struct thread_cond *cond);
void thread_cond_broadcast(struct thread_cond *cond);
void thread_cond_wait(struct thread_cond *cond, struct thread_mutex *mutex);
void thread_sem_init(struct thread_sem *sem, unsigned int value);
void thread_sem_wait(struct thread_sem *sem);
bool thread_sem_trywait(struct thread_sem *sem);
void thread_sem_post(struct thread_sem *sem);
void thread_set_tls(void *);
void *thread_get_tls(void);
__END_DECLS
#endif
| {
"content_hash": "dc82d800d3511e5a65625cce66d273f9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 34.66197183098591,
"alnum_prop": 0.7058106460788297,
"repo_name": "daleooo/barrelfish",
"id": "2050cd8afd99c2dbfdbd4eadbede1e44ac0a45ea",
"size": "2461",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "include/barrelfish/threads.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "1131283"
},
{
"name": "Awk",
"bytes": "8608"
},
{
"name": "C",
"bytes": "110151643"
},
{
"name": "C++",
"bytes": "2000568"
},
{
"name": "Clojure",
"bytes": "7003"
},
{
"name": "Emacs Lisp",
"bytes": "1639"
},
{
"name": "Gnuplot",
"bytes": "3830"
},
{
"name": "Haskell",
"bytes": "898395"
},
{
"name": "Objective-C",
"bytes": "117094"
},
{
"name": "Perl",
"bytes": "2717951"
},
{
"name": "Prolog",
"bytes": "2743673"
},
{
"name": "Python",
"bytes": "5352"
},
{
"name": "Scheme",
"bytes": "4249"
},
{
"name": "Scilab",
"bytes": "5315"
},
{
"name": "Shell",
"bytes": "298866"
},
{
"name": "Tcl",
"bytes": "18591"
},
{
"name": "TeX",
"bytes": "786785"
},
{
"name": "eC",
"bytes": "5079"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.gr4yscale.havit.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
| {
"content_hash": "ef328dcd460b0dc0dd7a198ee8c2140c",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 74,
"avg_line_length": 43.6875,
"alnum_prop": 0.7267525035765379,
"repo_name": "gr4yscale/havit",
"id": "ee547d115bf31a18531fca906258dac19bc0fae1",
"size": "699",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "android/Havit/app/src/main/res/layout/activity_main.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "6911"
},
{
"name": "Java",
"bytes": "6698"
},
{
"name": "JavaScript",
"bytes": "131667"
},
{
"name": "Objective-C",
"bytes": "236235"
},
{
"name": "Shell",
"bytes": "50"
}
],
"symlink_target": ""
} |
using UnityEngine;
using VR = UnityEngine.VR;
using System.Collections;
/// <summary>
/// This is a simple behavior that can be attached to a parent of the CameraRig in order
/// to provide movement via the gamepad. This is useful when testing an application in
/// the Unity editor without the HMD.
/// To use it, create a game object in your scene and drag your CameraRig to be a child
/// of the game object. Then, add the OVRDebugHeadController behavior to the game object.
/// Alternatively, this behavior can be placed directly on the OVRCameraRig object, but
/// that is not guaranteed to work if OVRCameraRig functionality changes in the future.
/// In the parent case, the object with OVRDebugHeadController can be thougt of as a
/// platform that your camera is attached to. When the platform moves or rotates, the
/// camera moves or rotates, but the camera can still move independently while "on" the
/// platform.
/// In general, this behavior should be disabled when not debugging.
/// </summary>
public class OVRDebugHeadController : MonoBehaviour
{
[SerializeField]
public bool AllowPitchLook = false;
[SerializeField]
public bool AllowYawLook = true;
[SerializeField]
public bool InvertPitch = false;
[SerializeField]
public float GamePad_PitchDegreesPerSec = 90.0f;
[SerializeField]
public float GamePad_YawDegreesPerSec = 90.0f;
[SerializeField]
public bool AllowMovement = false;
[SerializeField]
public float ForwardSpeed = 2.0f;
[SerializeField]
public float StrafeSpeed = 2.0f;
protected OVRCameraRig CameraRig = null;
void Awake()
{
// locate the camera rig so we can use it to get the current camera transform each frame
OVRCameraRig[] CameraRigs = gameObject.GetComponentsInChildren<OVRCameraRig>();
if( CameraRigs.Length == 0 )
Debug.LogWarning("OVRCamParent: No OVRCameraRig attached.");
else if (CameraRigs.Length > 1)
Debug.LogWarning("OVRCamParent: More then 1 OVRCameraRig attached.");
else
CameraRig = CameraRigs[0];
}
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if ( AllowMovement )
{
float gamePad_FwdAxis = OVRInput.Get(OVRInput.RawAxis2D.LThumbstick).y;
float gamePad_StrafeAxis = OVRInput.Get(OVRInput.RawAxis2D.LThumbstick).x;
Vector3 fwdMove = ( CameraRig.centerEyeAnchor.rotation * Vector3.forward ) * gamePad_FwdAxis * Time.deltaTime * ForwardSpeed;
Vector3 strafeMove = ( CameraRig.centerEyeAnchor.rotation * Vector3.right ) * gamePad_StrafeAxis * Time.deltaTime * StrafeSpeed;
transform.position += fwdMove + strafeMove;
}
if ( !UnityEngine.XR.XRDevice.isPresent && ( AllowYawLook || AllowPitchLook ) )
{
Quaternion r = transform.rotation;
if ( AllowYawLook )
{
float gamePadYaw = OVRInput.Get(OVRInput.RawAxis2D.RThumbstick).x;
float yawAmount = gamePadYaw * Time.deltaTime * GamePad_YawDegreesPerSec;
Quaternion yawRot = Quaternion.AngleAxis( yawAmount, Vector3.up );
r = yawRot * r;
}
if ( AllowPitchLook )
{
float gamePadPitch = OVRInput.Get(OVRInput.RawAxis2D.RThumbstick).y;
if ( Mathf.Abs( gamePadPitch ) > 0.0001f )
{
if ( InvertPitch )
{
gamePadPitch *= -1.0f;
}
float pitchAmount = gamePadPitch * Time.deltaTime * GamePad_PitchDegreesPerSec;
Quaternion pitchRot = Quaternion.AngleAxis( pitchAmount, Vector3.left );
r = r * pitchRot;
}
}
transform.rotation = r;
}
}
}
| {
"content_hash": "16f72842673baa4b4aaa5cc44b87c899",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 131,
"avg_line_length": 34.049019607843135,
"alnum_prop": 0.7238698531528938,
"repo_name": "SchizoCat3D/Ampersand",
"id": "4b6f3f4d3e6aefdd1387b668febd635ec8dcf4b0",
"size": "4413",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/VR_Utilities/OVR/Scripts/OVRDebugHeadController.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "3250362"
},
{
"name": "HLSL",
"bytes": "209630"
},
{
"name": "ShaderLab",
"bytes": "133937"
}
],
"symlink_target": ""
} |
<?php namespace Leochan\Charge\Models;
use Model;
/**
* DriversView Model
*/
class DriversView extends Model
{
protected $connection = 'yamadadbs';
/**
* @var string The database table used by the model.
*/
public $table = 'view_charge_drivers';
/**
* @var array Guarded fields
*/
protected $guarded = ['*'];
/**
* @var array Fillable fields
*/
protected $fillable = [];
/**
* @var array Relations
*/
public $hasOne = [];
public $hasMany = [];
public $belongsTo = [];
public $belongsToMany = [];
public $morphTo = [];
public $morphOne = [];
public $morphMany = [];
public $attachOne = [];
public $attachMany = [];
}
| {
"content_hash": "59bcf75118119f0107963d293836b857",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 56,
"avg_line_length": 19.236842105263158,
"alnum_prop": 0.5512995896032832,
"repo_name": "wintersunsunsun/yamada",
"id": "c9416e15b1c7f03bc4fb0dc2086122455ca62f11",
"size": "731",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/leochan/charge/models/DriversView.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "74305"
},
{
"name": "HTML",
"bytes": "215216"
},
{
"name": "JavaScript",
"bytes": "160018"
},
{
"name": "PHP",
"bytes": "1043128"
},
{
"name": "Smarty",
"bytes": "8578"
}
],
"symlink_target": ""
} |
import json
from base64 import b64encode
from beanstalk_dispatch import ARGS
from beanstalk_dispatch import FUNCTION
from beanstalk_dispatch import KWARGS
from beanstalk_dispatch.common import create_request_body
from django.core.urlresolvers import reverse
from django.test import Client
from django.test import TestCase
from django.test import override_settings
# Don't log logger errors.
import logging
logging.disable(logging.CRITICAL)
CALL_COUNTER = 0
def counter_incrementer(first_arg, second_arg=None):
global CALL_COUNTER
CALL_COUNTER += first_arg
if second_arg:
CALL_COUNTER += second_arg
DISPATCH_SETTINGS = {
'BEANSTALK_DISPATCH_TABLE': {
'the_counter': (
'beanstalk_dispatch.tests.test_dispatcher',
'counter_incrementer')}}
class DispatcherTestCase(TestCase):
""" Test the server-side function dispatcher.
In these tests, we base64-encode every message we send to the server
because this is what boto does.
"""
def setUp(self):
global CALL_COUNTER
CALL_COUNTER = 0
self.client = Client()
self.url = reverse('beanstalk_dispatcher')
@override_settings(**DISPATCH_SETTINGS)
def test_no_get(self):
response = self.client.get(self.url)
self.assertEquals(response.status_code, 405)
@override_settings(BEANSTALK_DISPATCH_TABLE=None)
def test_no_dispatch(self):
response = self.client.post(
self.url, b64encode(
create_request_body('some_func').encode('ascii')),
content_type='application/json')
self.assertEquals(response.status_code, 400)
self.assertEquals(json.loads(response.content.decode()),
{'message': 'No beanstalk dispatch table configured',
'error': 400})
@override_settings(**DISPATCH_SETTINGS)
def test_missing_function(self):
response = self.client.post(
self.url,
b64encode(create_request_body('nonexistent_func').encode('ascii')),
content_type='application/json')
self.assertEquals(response.status_code, 400)
self.assertEquals(
json.loads(response.content.decode()),
{'message': 'Requested function not found: nonexistent_func',
'error': 400})
@override_settings(**DISPATCH_SETTINGS)
def test_malformed_request(self):
keys = {FUNCTION, ARGS, KWARGS}
for missing_key in keys:
request_body = {key: 'test' for key in
keys - {missing_key}}
response = self.client.post(
self.url,
b64encode(json.dumps(request_body).encode('ascii')),
content_type='application/json')
self.assertEquals(response.status_code, 400)
self.assertEquals(json.loads(response.content.decode()), {
'message': 'Please provide a {} argument'.format(missing_key),
'error': 400})
@override_settings(**DISPATCH_SETTINGS)
def test_both_args_kwargs(self):
body = b64encode(
create_request_body('the_counter', 1, second_arg=5)
.encode('ascii'))
response = self.client.post(self.url,
body,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertEquals(json.loads(response.content.decode()),
{})
self.assertEquals(CALL_COUNTER, 6)
@override_settings(**DISPATCH_SETTINGS)
def test_just_args(self):
body = b64encode(create_request_body('the_counter', 2).encode('ascii'))
response = self.client.post(self.url,
body,
content_type='application/json')
self.assertEquals(response.status_code, 200)
self.assertEquals(json.loads(response.content.decode()),
{})
self.assertEquals(CALL_COUNTER, 2)
| {
"content_hash": "2ebeaa97dd3ed2f5a9bf284b51be2d56",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 35.771929824561404,
"alnum_prop": 0.6074055909759686,
"repo_name": "Sonblind/orchestra",
"id": "500189f9f428e8025f869619dc7830904facbb57",
"size": "4078",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "beanstalk_dispatch/tests/test_dispatcher.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "76414"
},
{
"name": "HTML",
"bytes": "57292"
},
{
"name": "JavaScript",
"bytes": "234470"
},
{
"name": "Makefile",
"bytes": "826"
},
{
"name": "Python",
"bytes": "310246"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>containers: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.0 / containers - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
containers
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-12 10:52:21 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-12 10:52:21 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.0 Formal proof management system
dune 3.0.3 Fast, portable, and opinionated build system
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler
ocamlfind 1.9.1 A library manager for OCaml
ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/containers"
license: "Proprietary"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Containers"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:data structures" "keyword:type classes" "category:Computer Science/Data Types and Data Structures" ]
authors: [ "Stéphane Lescuyer <>" ]
bug-reports: "https://github.com/coq-contribs/containers/issues"
dev-repo: "git+https://github.com/coq-contribs/containers.git"
synopsis: "Containers: a typeclass-based library of finite sets/maps"
description:
"This is a reimplementation of the FSets/FMaps library from the standard library, using typeclasses. See tests files for usage. A new vernacular command is provided by Generate.v and the plugin to automatically generate ordered types for user-defined inductive types."
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/containers/archive/v8.5.0.tar.gz"
checksum: "md5=40b794fa49d1ad0710690650e1d18f8c"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-containers.8.5.0 coq.8.14.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.0).
The following dependencies couldn't be met:
- coq-containers -> coq < 8.6~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-containers.8.5.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "e553b970b56bbc8324deb52ef037c3f1",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 280,
"avg_line_length": 44.137724550898206,
"alnum_prop": 0.5518925518925519,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "b3a07ad3ffebf066803ea4540612ed202cc19251",
"size": "7397",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.14.0/containers/8.5.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
const td = require('testdouble');
const runCompilation = td.replace('../../lib/run-compilation');
const { string: formatter } = require('stylelint').formatters;
const LintDirtyModulesPlugin = require('../../lib/lint-dirty-modules-plugin');
const { defaultFilesGlob: glob } = require('../../lib/constants');
const configFilePath = getPath('./.stylelintrc');
describe('lint-dirty-modules-plugin', () => {
let LintDirtyModulesPluginCloned;
let compilerMock;
let optionsMock;
beforeEach(() => {
LintDirtyModulesPluginCloned = function constructor() {
// eslint-disable-next-line prefer-rest-params
LintDirtyModulesPlugin.apply(this, arguments);
};
LintDirtyModulesPluginCloned.prototype = Object.create(
LintDirtyModulesPlugin.prototype
);
LintDirtyModulesPluginCloned.prototype.constructor = LintDirtyModulesPlugin;
compilerMock = {
callback: null,
plugin: function plugin(event, callback) {
this.callback = callback;
},
};
optionsMock = {
configFile: configFilePath,
lintDirtyModulesOnly: true,
formatter,
files: [glob],
};
});
it('lint is called on "emit"', () => {
const lintStub = td.function();
const doneStub = td.function();
LintDirtyModulesPluginCloned.prototype.lint = lintStub;
const compilationMock = {
fileTimestamps: {
'/updated.scss': 5,
},
};
const plugin = new LintDirtyModulesPluginCloned(compilerMock, optionsMock);
compilerMock.callback(compilationMock, doneStub);
expect(plugin.isFirstRun).to.eql(true);
td.verify(lintStub(compilationMock, doneStub));
});
context('#lint()', () => {
let getChangedFilesStub;
let doneStub;
let compilationMock;
const fileTimestamps = {
'/test/changed.scss': 5,
'/test/newly-created.scss': 5,
};
let pluginMock;
beforeEach(() => {
getChangedFilesStub = td.function();
doneStub = td.function();
compilationMock = {
fileTimestamps: {},
};
td.when(getChangedFilesStub({}, glob)).thenReturn([]);
td
.when(getChangedFilesStub(fileTimestamps, glob))
.thenReturn(Object.keys(fileTimestamps));
pluginMock = {
getChangedFiles: getChangedFilesStub,
compiler: compilerMock,
options: optionsMock,
isFirstRun: true,
};
});
it('skips compilation on first run', () => {
expect(pluginMock.isFirstRun).to.eql(true);
LintDirtyModulesPluginCloned.prototype.lint.call(
pluginMock,
compilationMock,
doneStub
);
td.verify(doneStub());
expect(pluginMock.isFirstRun).to.eql(false);
td.verify(getChangedFilesStub(), { times: 0, ignoreExtraArgs: true });
td.verify(runCompilation(), { times: 0, ignoreExtraArgs: true });
});
it('runCompilation is not called if files are not changed', () => {
pluginMock.isFirstRun = false;
LintDirtyModulesPluginCloned.prototype.lint.call(
pluginMock,
compilationMock,
doneStub
);
td.verify(doneStub());
td.verify(runCompilation(), { times: 0, ignoreExtraArgs: true });
});
it('runCompilation is called if styles are changed', () => {
pluginMock.isFirstRun = false;
compilationMock = {
fileTimestamps,
};
LintDirtyModulesPluginCloned.prototype.lint.call(
pluginMock,
compilationMock,
doneStub
);
optionsMock.files = Object.keys(fileTimestamps);
td.verify(runCompilation(optionsMock, compilerMock, doneStub));
});
});
context('#getChangedFiles()', () => {
let pluginMock;
before(() => {
pluginMock = {
compiler: compilerMock,
options: optionsMock,
isFirstRun: true,
startTime: 10,
prevTimestamps: {
'/test/changed.scss': 5,
'/test/removed.scss': 5,
'/test/changed.js': 5,
},
};
});
it('returns changed style files', () => {
const fileTimestamps = {
'/test/changed.scss': 20,
'/test/changed.js': 20,
'/test/newly-created.scss': 15,
};
const changedFiles = LintDirtyModulesPluginCloned.prototype.getChangedFiles.call(
pluginMock,
fileTimestamps,
glob
);
expect(changedFiles).to.eql([
'/test/changed.scss',
'/test/newly-created.scss',
]);
});
});
});
| {
"content_hash": "53bd2abbd64fee5a023e3dd6b3bd7c27",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 87,
"avg_line_length": 27.181818181818183,
"alnum_prop": 0.6142697881828316,
"repo_name": "vieron/stylelint-webpack-plugin",
"id": "95a74f15b206ca51ced29d140fa78d6f3b4a02c7",
"size": "4526",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/lib/lint-dirty-modules-plugin.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "9562"
}
],
"symlink_target": ""
} |
import { mocked } from "jest-mock";
import { EventType, MatrixClient, MatrixEvent, Room } from "matrix-js-sdk/src/matrix";
import Modal from "../../../src/Modal";
import {
startNewVoiceBroadcastRecording,
VoiceBroadcastInfoEventType,
VoiceBroadcastInfoState,
VoiceBroadcastRecordingsStore,
VoiceBroadcastRecording,
} from "../../../src/voice-broadcast";
import { mkEvent, stubClient } from "../../test-utils";
import { mkVoiceBroadcastInfoStateEvent } from "./test-utils";
jest.mock("../../../src/voice-broadcast/models/VoiceBroadcastRecording", () => ({
VoiceBroadcastRecording: jest.fn(),
}));
jest.mock("../../../src/Modal");
describe("startNewVoiceBroadcastRecording", () => {
const roomId = "!room:example.com";
const otherUserId = "@other:example.com";
let client: MatrixClient;
let recordingsStore: VoiceBroadcastRecordingsStore;
let room: Room;
let infoEvent: MatrixEvent;
let otherEvent: MatrixEvent;
let result: VoiceBroadcastRecording | null;
beforeEach(() => {
client = stubClient();
room = new Room(roomId, client, client.getUserId());
jest.spyOn(room.currentState, "maySendStateEvent");
mocked(client.getRoom).mockImplementation((getRoomId: string) => {
if (getRoomId === roomId) {
return room;
}
});
mocked(client.sendStateEvent).mockImplementation((
sendRoomId: string,
eventType: string,
_content: any,
_stateKey: string,
) => {
if (sendRoomId === roomId && eventType === VoiceBroadcastInfoEventType) {
return Promise.resolve({ event_id: infoEvent.getId() });
}
});
recordingsStore = {
setCurrent: jest.fn(),
getCurrent: jest.fn(),
} as unknown as VoiceBroadcastRecordingsStore;
infoEvent = mkVoiceBroadcastInfoStateEvent(
roomId,
VoiceBroadcastInfoState.Started,
client.getUserId(),
client.getDeviceId(),
);
otherEvent = mkEvent({
event: true,
type: EventType.RoomMember,
content: {},
user: client.getUserId(),
room: roomId,
skey: "",
});
mocked(VoiceBroadcastRecording).mockImplementation((
infoEvent: MatrixEvent,
client: MatrixClient,
): any => {
return {
infoEvent,
client,
start: jest.fn(),
} as unknown as VoiceBroadcastRecording;
});
});
afterEach(() => {
jest.clearAllMocks();
});
describe("when the current user is allowed to send voice broadcast info state events", () => {
beforeEach(() => {
mocked(room.currentState.maySendStateEvent).mockReturnValue(true);
});
describe("when there currently is no other broadcast", () => {
it("should create a new Voice Broadcast", async () => {
mocked(client.sendStateEvent).mockImplementation(async (
_roomId: string,
_eventType: string,
_content: any,
_stateKey = "",
) => {
setTimeout(() => {
// emit state events after resolving the promise
room.currentState.setStateEvents([otherEvent]);
room.currentState.setStateEvents([infoEvent]);
}, 0);
return { event_id: infoEvent.getId() };
});
const recording = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
expect(client.sendStateEvent).toHaveBeenCalledWith(
roomId,
VoiceBroadcastInfoEventType,
{
chunk_length: 120,
device_id: client.getDeviceId(),
state: VoiceBroadcastInfoState.Started,
},
client.getUserId(),
);
expect(recording.infoEvent).toBe(infoEvent);
expect(recording.start).toHaveBeenCalled();
});
});
describe("when there is already a current voice broadcast", () => {
beforeEach(async () => {
mocked(recordingsStore.getCurrent).mockReturnValue(
new VoiceBroadcastRecording(infoEvent, client),
);
result = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
});
it("should not start a voice broadcast", () => {
expect(result).toBeNull();
});
it("should show an info dialog", () => {
expect(Modal.createDialog).toMatchSnapshot();
});
});
describe("when there already is a live broadcast of the current user in the room", () => {
beforeEach(async () => {
room.currentState.setStateEvents([
mkVoiceBroadcastInfoStateEvent(
roomId,
VoiceBroadcastInfoState.Resumed,
client.getUserId(),
client.getDeviceId(),
),
]);
result = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
});
it("should not start a voice broadcast", () => {
expect(result).toBeNull();
});
it("should show an info dialog", () => {
expect(Modal.createDialog).toMatchSnapshot();
});
});
describe("when there already is a live broadcast of another user", () => {
beforeEach(async () => {
room.currentState.setStateEvents([
mkVoiceBroadcastInfoStateEvent(
roomId,
VoiceBroadcastInfoState.Resumed,
otherUserId,
"ASD123",
),
]);
result = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
});
it("should not start a voice broadcast", () => {
expect(result).toBeNull();
});
it("should show an info dialog", () => {
expect(Modal.createDialog).toMatchSnapshot();
});
});
});
describe("when the current user is not allowed to send voice broadcast info state events", () => {
beforeEach(async () => {
mocked(room.currentState.maySendStateEvent).mockReturnValue(false);
result = await startNewVoiceBroadcastRecording(room, client, recordingsStore);
});
it("should not start a voice broadcast", () => {
expect(result).toBeNull();
});
it("should show an info dialog", () => {
expect(Modal.createDialog).toMatchSnapshot();
});
});
});
| {
"content_hash": "e483dc83015681638a564bef6150fe5e",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 103,
"avg_line_length": 34.9126213592233,
"alnum_prop": 0.5209955506117909,
"repo_name": "matrix-org/matrix-react-sdk",
"id": "1873a4b513364a3b02fda597e6146902e1931589",
"size": "7770",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/voice-broadcast/utils/startNewVoiceBroadcastRecording-test.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "984691"
},
{
"name": "Dockerfile",
"bytes": "1550"
},
{
"name": "HTML",
"bytes": "1043"
},
{
"name": "JavaScript",
"bytes": "33429"
},
{
"name": "Perl",
"bytes": "10945"
},
{
"name": "Python",
"bytes": "5019"
},
{
"name": "Shell",
"bytes": "5451"
},
{
"name": "TypeScript",
"bytes": "9543345"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>continuations: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.1 / continuations - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
continuations
<small>
8.9.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-06-12 09:12:12 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-06-12 09:12:12 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.2.0 Fast, portable, and opinionated build system
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/continuations"
license: "Unknown"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Continuations"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: exceptions"
"keyword: monads"
"keyword: continuations"
"keyword: cps"
"category: Computer Science/Semantics and Compilation/Semantics"
"category: Miscellaneous/Extracted Programs/Combinatorics"
]
authors: [
"Jean-François Monin"
]
bug-reports: "https://github.com/coq-contribs/continuations/issues"
dev-repo: "git+https://github.com/coq-contribs/continuations.git"
synopsis: "A toolkit to reason with programs raising exceptions"
description: """
We show a way of developing correct functionnal programs
raising exceptions. This is made possible using a Continuation
Passing Style translation, see the contribution "exceptions" from
P. Casteran at Bordeaux. Things are made easier and more modular using
some general definitions."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/continuations/archive/v8.9.0.tar.gz"
checksum: "md5=09c9cc6422b3a07d418fe468138a3489"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-continuations.8.9.0 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-continuations -> coq < 8.10~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-continuations.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "7a6ae0cb736f8ce29f58e7915f99f2e6",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 159,
"avg_line_length": 41.28089887640449,
"alnum_prop": 0.5590636908002178,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "96052b95b2b908e7878f07c5708a4faf0b6f3288",
"size": "7374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.14.1/continuations/8.9.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
<?php
namespace Sabre\VObject;
class TimeZoneUtil {
public static $map = array(
// from http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html
// snapshot taken on 2012/01/16
// windows
'AUS Central Standard Time'=>'Australia/Darwin',
'AUS Eastern Standard Time'=>'Australia/Sydney',
'Afghanistan Standard Time'=>'Asia/Kabul',
'Alaskan Standard Time'=>'America/Anchorage',
'Arab Standard Time'=>'Asia/Riyadh',
'Arabian Standard Time'=>'Asia/Dubai',
'Arabic Standard Time'=>'Asia/Baghdad',
'Argentina Standard Time'=>'America/Buenos_Aires',
'Armenian Standard Time'=>'Asia/Yerevan',
'Atlantic Standard Time'=>'America/Halifax',
'Azerbaijan Standard Time'=>'Asia/Baku',
'Azores Standard Time'=>'Atlantic/Azores',
'Bangladesh Standard Time'=>'Asia/Dhaka',
'Canada Central Standard Time'=>'America/Regina',
'Cape Verde Standard Time'=>'Atlantic/Cape_Verde',
'Caucasus Standard Time'=>'Asia/Yerevan',
'Cen. Australia Standard Time'=>'Australia/Adelaide',
'Central America Standard Time'=>'America/Guatemala',
'Central Asia Standard Time'=>'Asia/Almaty',
'Central Brazilian Standard Time'=>'America/Cuiaba',
'Central Europe Standard Time'=>'Europe/Budapest',
'Central European Standard Time'=>'Europe/Warsaw',
'Central Pacific Standard Time'=>'Pacific/Guadalcanal',
'Central Standard Time'=>'America/Chicago',
'Central Standard Time (Mexico)'=>'America/Mexico_City',
'China Standard Time'=>'Asia/Shanghai',
'Dateline Standard Time'=>'Etc/GMT+12',
'E. Africa Standard Time'=>'Africa/Nairobi',
'E. Australia Standard Time'=>'Australia/Brisbane',
'E. Europe Standard Time'=>'Europe/Minsk',
'E. South America Standard Time'=>'America/Sao_Paulo',
'Eastern Standard Time'=>'America/New_York',
'Egypt Standard Time'=>'Africa/Cairo',
'Ekaterinburg Standard Time'=>'Asia/Yekaterinburg',
'FLE Standard Time'=>'Europe/Kiev',
'Fiji Standard Time'=>'Pacific/Fiji',
'GMT Standard Time'=>'Europe/London',
'GTB Standard Time'=>'Europe/Istanbul',
'Georgian Standard Time'=>'Asia/Tbilisi',
'Greenland Standard Time'=>'America/Godthab',
'Greenwich Standard Time'=>'Atlantic/Reykjavik',
'Hawaiian Standard Time'=>'Pacific/Honolulu',
'India Standard Time'=>'Asia/Calcutta',
'Iran Standard Time'=>'Asia/Tehran',
'Israel Standard Time'=>'Asia/Jerusalem',
'Jordan Standard Time'=>'Asia/Amman',
'Kamchatka Standard Time'=>'Asia/Kamchatka',
'Korea Standard Time'=>'Asia/Seoul',
'Magadan Standard Time'=>'Asia/Magadan',
'Mauritius Standard Time'=>'Indian/Mauritius',
'Mexico Standard Time'=>'America/Mexico_City',
'Mexico Standard Time 2'=>'America/Chihuahua',
'Mid-Atlantic Standard Time'=>'Etc/GMT-2',
'Middle East Standard Time'=>'Asia/Beirut',
'Montevideo Standard Time'=>'America/Montevideo',
'Morocco Standard Time'=>'Africa/Casablanca',
'Mountain Standard Time'=>'America/Denver',
'Mountain Standard Time (Mexico)'=>'America/Chihuahua',
'Myanmar Standard Time'=>'Asia/Rangoon',
'N. Central Asia Standard Time'=>'Asia/Novosibirsk',
'Namibia Standard Time'=>'Africa/Windhoek',
'Nepal Standard Time'=>'Asia/Katmandu',
'New Zealand Standard Time'=>'Pacific/Auckland',
'Newfoundland Standard Time'=>'America/St_Johns',
'North Asia East Standard Time'=>'Asia/Irkutsk',
'North Asia Standard Time'=>'Asia/Krasnoyarsk',
'Pacific SA Standard Time'=>'America/Santiago',
'Pacific Standard Time'=>'America/Los_Angeles',
'Pacific Standard Time (Mexico)'=>'America/Santa_Isabel',
'Pakistan Standard Time'=>'Asia/Karachi',
'Paraguay Standard Time'=>'America/Asuncion',
'Romance Standard Time'=>'Europe/Paris',
'Russian Standard Time'=>'Europe/Moscow',
'SA Eastern Standard Time'=>'America/Cayenne',
'SA Pacific Standard Time'=>'America/Bogota',
'SA Western Standard Time'=>'America/La_Paz',
'SE Asia Standard Time'=>'Asia/Bangkok',
'Samoa Standard Time'=>'Pacific/Apia',
'Singapore Standard Time'=>'Asia/Singapore',
'South Africa Standard Time'=>'Africa/Johannesburg',
'Sri Lanka Standard Time'=>'Asia/Colombo',
'Syria Standard Time'=>'Asia/Damascus',
'Taipei Standard Time'=>'Asia/Taipei',
'Tasmania Standard Time'=>'Australia/Hobart',
'Tokyo Standard Time'=>'Asia/Tokyo',
'Tonga Standard Time'=>'Pacific/Tongatapu',
'US Eastern Standard Time'=>'America/Indianapolis',
'US Mountain Standard Time'=>'America/Phoenix',
'UTC+12'=>'Etc/GMT-12',
'UTC-02'=>'Etc/GMT+2',
'UTC-11'=>'Etc/GMT+11',
'Ulaanbaatar Standard Time'=>'Asia/Ulaanbaatar',
'Venezuela Standard Time'=>'America/Caracas',
'Vladivostok Standard Time'=>'Asia/Vladivostok',
'W. Australia Standard Time'=>'Australia/Perth',
'W. Central Africa Standard Time'=>'Africa/Lagos',
'W. Europe Standard Time'=>'Europe/Berlin',
'West Asia Standard Time'=>'Asia/Tashkent',
'West Pacific Standard Time'=>'Pacific/Port_Moresby',
'Yakutsk Standard Time'=>'Asia/Yakutsk',
// Microsoft exchange timezones
// Source:
// http://msdn.microsoft.com/en-us/library/ms988620%28v=exchg.65%29.aspx
//
// Correct timezones deduced with help from:
// http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
'Universal Coordinated Time' => 'UTC',
'Casablanca, Monrovia' => 'Africa/Casablanca',
'Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London' => 'Europe/Lisbon',
'Greenwich Mean Time; Dublin, Edinburgh, London' => 'Europe/London',
'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna' => 'Europe/Berlin',
'Belgrade, Pozsony, Budapest, Ljubljana, Prague' => 'Europe/Prague',
'Brussels, Copenhagen, Madrid, Paris' => 'Europe/Paris',
'Paris, Madrid, Brussels, Copenhagen' => 'Europe/Paris',
'Prague, Central Europe' => 'Europe/Prague',
'Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb' => 'Europe/Sarajevo',
'West Central Africa' => 'Africa/Luanda', // This was a best guess
'Athens, Istanbul, Minsk' => 'Europe/Athens',
'Bucharest' => 'Europe/Bucharest',
'Cairo' => 'Africa/Cairo',
'Harare, Pretoria' => 'Africa/Harare',
'Helsinki, Riga, Tallinn' => 'Europe/Helsinki',
'Israel, Jerusalem Standard Time' => 'Asia/Jerusalem',
'Baghdad' => 'Asia/Baghdad',
'Arab, Kuwait, Riyadh' => 'Asia/Kuwait',
'Moscow, St. Petersburg, Volgograd' => 'Europe/Moscow',
'East Africa, Nairobi' => 'Africa/Nairobi',
'Tehran' => 'Asia/Tehran',
'Abu Dhabi, Muscat' => 'Asia/Muscat', // Best guess
'Baku, Tbilisi, Yerevan' => 'Asia/Baku',
'Kabul' => 'Asia/Kabul',
'Ekaterinburg' => 'Asia/Yekaterinburg',
'Islamabad, Karachi, Tashkent' => 'Asia/Karachi',
'Kolkata, Chennai, Mumbai, New Delhi, India Standard Time' => 'Asia/Calcutta',
'Kathmandu, Nepal' => 'Asia/Kathmandu',
'Almaty, Novosibirsk, North Central Asia' => 'Asia/Almaty',
'Astana, Dhaka' => 'Asia/Dhaka',
'Sri Jayawardenepura, Sri Lanka' => 'Asia/Colombo',
'Rangoon' => 'Asia/Rangoon',
'Bangkok, Hanoi, Jakarta' => 'Asia/Bangkok',
'Krasnoyarsk' => 'Asia/Krasnoyarsk',
'Beijing, Chongqing, Hong Kong SAR, Urumqi' => 'Asia/Shanghai',
'Irkutsk, Ulaan Bataar' => 'Asia/Irkutsk',
'Kuala Lumpur, Singapore' => 'Asia/Singapore',
'Perth, Western Australia' => 'Australia/Perth',
'Taipei' => 'Asia/Taipei',
'Osaka, Sapporo, Tokyo' => 'Asia/Tokyo',
'Seoul, Korea Standard time' => 'Asia/Seoul',
'Yakutsk' => 'Asia/Yakutsk',
'Adelaide, Central Australia' => 'Australia/Adelaide',
'Darwin' => 'Australia/Darwin',
'Brisbane, East Australia' => 'Australia/Brisbane',
'Canberra, Melbourne, Sydney, Hobart (year 2000 only)' => 'Australia/Sydney',
'Guam, Port Moresby' => 'Pacific/Guam',
'Hobart, Tasmania' => 'Australia/Hobart',
'Vladivostok' => 'Asia/Vladivostok',
'Magadan, Solomon Is., New Caledonia' => 'Asia/Magadan',
'Auckland, Wellington' => 'Pacific/Auckland',
'Fiji Islands, Kamchatka, Marshall Is.' => 'Pacific/Fiji',
'Nuku\'alofa, Tonga' => 'Pacific/Tongatapu',
'Azores' => 'Atlantic/Azores',
'Cape Verde Is.' => 'Atlantic/Cape_Verde',
'Mid-Atlantic' => 'America/Noronha',
'Brasilia' => 'America/Sao_Paulo', // Best guess
'Buenos Aires' => 'America/Argentina/Buenos_Aires',
'Greenland' => 'America/Godthab',
'Newfoundland' => 'America/St_Johns',
'Atlantic Time (Canada)' => 'America/Halifax',
'Caracas, La Paz' => 'America/Caracas',
'Santiago' => 'America/Santiago',
'Bogota, Lima, Quito' => 'America/Bogota',
'Eastern Time (US & Canada)' => 'America/New_York',
'Indiana (East)' => 'America/Indiana/Indianapolis',
'Central America' => 'America/Guatemala',
'Central Time (US & Canada)' => 'America/Chicago',
'Mexico City, Tegucigalpa' => 'America/Mexico_City',
'Saskatchewan' => 'America/Edmonton',
'Arizona' => 'America/Phoenix',
'Mountain Time (US & Canada)' => 'America/Denver', // Best guess
'Pacific Time (US & Canada); Tijuana' => 'America/Los_Angeles', // Best guess
'Alaska' => 'America/Anchorage',
'Hawaii' => 'Pacific/Honolulu',
'Midway Island, Samoa' => 'Pacific/Midway',
'Eniwetok, Kwajalein, Dateline Time' => 'Pacific/Kwajalein',
// The following list are timezone names that could be generated by
// Lotus / Domino
'Dateline' => 'Etc/GMT-12',
'Samoa' => 'Pacific/Apia',
'Hawaiian' => 'Pacific/Honolulu',
'Alaskan' => 'America/Anchorage',
'Pacific' => 'America/Los_Angeles',
'Pacific Standard Time' => 'America/Los_Angeles',
'Mexico Standard Time 2' => 'America/Chihuahua',
'Mountain' => 'America/Denver',
'Mountain Standard Time' => 'America/Chihuahua',
'US Mountain' => 'America/Phoenix',
'Canada Central' => 'America/Edmonton',
'Central America' => 'America/Guatemala',
'Central' => 'America/Chicago',
'Central Standard Time' => 'America/Mexico_City',
'Mexico' => 'America/Mexico_City',
'Eastern' => 'America/New_York',
'SA Pacific' => 'America/Bogota',
'US Eastern' => 'America/Indiana/Indianapolis',
'Venezuela' => 'America/Caracas',
'Atlantic' => 'America/Halifax',
'Central Brazilian' => 'America/Manaus',
'Pacific SA' => 'America/Santiago',
'SA Western' => 'America/La_Paz',
'Newfoundland' => 'America/St_Johns',
'Argentina' => 'America/Argentina/Buenos_Aires',
'E. South America' => 'America/Belem',
'Greenland' => 'America/Godthab',
'Montevideo' => 'America/Montevideo',
'SA Eastern' => 'America/Belem',
'Mid-Atlantic' => 'Etc/GMT-2',
'Azores' => 'Atlantic/Azores',
'Cape Verde' => 'Atlantic/Cape_Verde',
'Greenwich' => 'Atlantic/Reykjavik', // No I'm serious.. Greenwich is not GMT.
'Morocco' => 'Africa/Casablanca',
'Central Europe' => 'Europe/Prague',
'Central European' => 'Europe/Sarajevo',
'Romance' => 'Europe/Paris',
'W. Central Africa' => 'Africa/Lagos', // Best guess
'W. Europe' => 'Europe/Amsterdam',
'E. Europe' => 'Europe/Minsk',
'Egypt' => 'Africa/Cairo',
'FLE' => 'Europe/Helsinki',
'GTB' => 'Europe/Athens',
'Israel' => 'Asia/Jerusalem',
'Jordan' => 'Asia/Amman',
'Middle East' => 'Asia/Beirut',
'Namibia' => 'Africa/Windhoek',
'South Africa' => 'Africa/Harare',
'Arab' => 'Asia/Kuwait',
'Arabic' => 'Asia/Baghdad',
'E. Africa' => 'Africa/Nairobi',
'Georgian' => 'Asia/Tbilisi',
'Russian' => 'Europe/Moscow',
'Iran' => 'Asia/Tehran',
'Arabian' => 'Asia/Muscat',
'Armenian' => 'Asia/Yerevan',
'Azerbijan' => 'Asia/Baku',
'Caucasus' => 'Asia/Yerevan',
'Mauritius' => 'Indian/Mauritius',
'Afghanistan' => 'Asia/Kabul',
'Ekaterinburg' => 'Asia/Yekaterinburg',
'Pakistan' => 'Asia/Karachi',
'West Asia' => 'Asia/Tashkent',
'India' => 'Asia/Calcutta',
'Sri Lanka' => 'Asia/Colombo',
'Nepal' => 'Asia/Kathmandu',
'Central Asia' => 'Asia/Dhaka',
'N. Central Asia' => 'Asia/Almaty',
'Myanmar' => 'Asia/Rangoon',
'North Asia' => 'Asia/Krasnoyarsk',
'SE Asia' => 'Asia/Bangkok',
'China' => 'Asia/Shanghai',
'North Asia East' => 'Asia/Irkutsk',
'Singapore' => 'Asia/Singapore',
'Taipei' => 'Asia/Taipei',
'W. Australia' => 'Australia/Perth',
'Korea' => 'Asia/Seoul',
'Tokyo' => 'Asia/Tokyo',
'Yakutsk' => 'Asia/Yakutsk',
'AUS Central' => 'Australia/Darwin',
'Cen. Australia' => 'Australia/Adelaide',
'AUS Eastern' => 'Australia/Sydney',
'E. Australia' => 'Australia/Brisbane',
'Tasmania' => 'Australia/Hobart',
'Vladivostok' => 'Asia/Vladivostok',
'West Pacific' => 'Pacific/Guam',
'Central Pacific' => 'Asia/Magadan',
'Fiji' => 'Pacific/Fiji',
'New Zealand' => 'Pacific/Auckland',
'Tonga' => 'Pacific/Tongatapu',
);
/**
* List of microsoft exchange timezone ids.
*
* Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx
*/
public static $microsoftExchangeMap = array(
0 => 'UTC',
31 => 'Africa/Casablanca',
// Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo.
// I'm not even kidding.. We handle this special case in the
// getTimeZone method.
2 => 'Europe/Lisbon',
1 => 'Europe/London',
4 => 'Europe/Berlin',
6 => 'Europe/Prague',
3 => 'Europe/Paris',
69 => 'Africa/Luanda', // This was a best guess
7 => 'Europe/Athens',
5 => 'Europe/Bucharest',
49 => 'Africa/Cairo',
50 => 'Africa/Harare',
59 => 'Europe/Helsinki',
27 => 'Asia/Jerusalem',
26 => 'Asia/Baghdad',
74 => 'Asia/Kuwait',
51 => 'Europe/Moscow',
56 => 'Africa/Nairobi',
25 => 'Asia/Tehran',
24 => 'Asia/Muscat', // Best guess
54 => 'Asia/Baku',
48 => 'Asia/Kabul',
58 => 'Asia/Yekaterinburg',
47 => 'Asia/Karachi',
23 => 'Asia/Calcutta',
62 => 'Asia/Kathmandu',
46 => 'Asia/Almaty',
71 => 'Asia/Dhaka',
66 => 'Asia/Colombo',
61 => 'Asia/Rangoon',
22 => 'Asia/Bangkok',
64 => 'Asia/Krasnoyarsk',
45 => 'Asia/Shanghai',
63 => 'Asia/Irkutsk',
21 => 'Asia/Singapore',
73 => 'Australia/Perth',
75 => 'Asia/Taipei',
20 => 'Asia/Tokyo',
72 => 'Asia/Seoul',
70 => 'Asia/Yakutsk',
19 => 'Australia/Adelaide',
44 => 'Australia/Darwin',
18 => 'Australia/Brisbane',
76 => 'Australia/Sydney',
43 => 'Pacific/Guam',
42 => 'Australia/Hobart',
68 => 'Asia/Vladivostok',
41 => 'Asia/Magadan',
17 => 'Pacific/Auckland',
40 => 'Pacific/Fiji',
67 => 'Pacific/Tongatapu',
29 => 'Atlantic/Azores',
53 => 'Atlantic/Cape_Verde',
30 => 'America/Noronha',
8 => 'America/Sao_Paulo', // Best guess
32 => 'America/Argentina/Buenos_Aires',
60 => 'America/Godthab',
28 => 'America/St_Johns',
9 => 'America/Halifax',
33 => 'America/Caracas',
65 => 'America/Santiago',
35 => 'America/Bogota',
10 => 'America/New_York',
34 => 'America/Indiana/Indianapolis',
55 => 'America/Guatemala',
11 => 'America/Chicago',
37 => 'America/Mexico_City',
36 => 'America/Edmonton',
38 => 'America/Phoenix',
12 => 'America/Denver', // Best guess
13 => 'America/Los_Angeles', // Best guess
14 => 'America/Anchorage',
15 => 'Pacific/Honolulu',
16 => 'Pacific/Midway',
39 => 'Pacific/Kwajalein',
);
/**
* This method will try to find out the correct timezone for an iCalendar
* date-time value.
*
* You must pass the contents of the TZID parameter, as well as the full
* calendar.
*
* If the lookup fails, this method will return the default PHP timezone
* (as configured using date_default_timezone_set, or the date.timezone ini
* setting).
*
* Alternatively, if $failIfUncertain is set to true, it will throw an
* exception if we cannot accurately determine the timezone.
*
* @param string $tzid
* @param Sabre\VObject\Component $vcalendar
* @return DateTimeZone
*/
static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) {
// First we will just see if the tzid is a support timezone identifier.
try {
return new \DateTimeZone($tzid);
} catch (\Exception $e) {
}
// Next, we check if the tzid is somewhere in our tzid map.
if (isset(self::$map[$tzid])) {
return new \DateTimeZone(self::$map[$tzid]);
}
// Maybe the author was hyper-lazy and just included an offset. We
// support it, but we aren't happy about it.
if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) {
return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2],0,2),'0'));
}
if ($vcalendar) {
// If that didn't work, we will scan VTIMEZONE objects
foreach($vcalendar->select('VTIMEZONE') as $vtimezone) {
if ((string)$vtimezone->TZID === $tzid) {
// Some clients add 'X-LIC-LOCATION' with the olson name.
if (isset($vtimezone->{'X-LIC-LOCATION'})) {
$lic = (string)$vtimezone->{'X-LIC-LOCATION'};
// Libical generators may specify strings like
// "SystemV/EST5EDT". For those we must remove the
// SystemV part.
if (substr($lic,0,8)==='SystemV/') {
$lic = substr($lic,8);
}
try {
return new \DateTimeZone($lic);
} catch (\Exception $e) {
}
}
// Microsoft may add a magic number, which we also have an
// answer for.
if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) {
$cdoId = (int)$vtimezone->{'X-MICROSOFT-CDO-TZID'}->value;
// 2 can mean both Europe/Lisbon and Europe/Sarajevo.
if ($cdoId===2 && strpos((string)$vtimezone->TZID, 'Sarajevo')!==false) {
return new \DateTimeZone('Europe/Sarajevo');
}
if (isset(self::$microsoftExchangeMap[$cdoId])) {
return new \DateTimeZone(self::$microsoftExchangeMap[$cdoId]);
}
}
}
}
}
if ($failIfUncertain) {
throw new \InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: ' . $tzid);
}
// If we got all the way here, we default to UTC.
return new \DateTimeZone(date_default_timezone_get());
}
}
| {
"content_hash": "677c703bd3b3b785c2116cce88f7465c",
"timestamp": "",
"source": "github",
"line_count": 473,
"max_line_length": 123,
"avg_line_length": 45.53699788583509,
"alnum_prop": 0.5310831514926413,
"repo_name": "Tlapi/Noodle",
"id": "8613e864b7d5a4c2224d3a2e3872edd832d3b828",
"size": "21944",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "public/ajaxplorer/core/classes/sabredav/vendor/sabre/vobject/lib/Sabre/VObject/TimeZoneUtil.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "JavaScript",
"bytes": "1981261"
},
{
"name": "PHP",
"bytes": "5086651"
},
{
"name": "Perl",
"bytes": "3966"
}
],
"symlink_target": ""
} |
@interface CKXPathQuery : NSObject
+ (id)queryFromString:(NSString*)queryString;
- (id)initFromString:(NSString*)queryString;
@property (nonatomic, readonly) NSString* queryString;
@end
| {
"content_hash": "4584bd6d3f2464af9f9e9e209f239395",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 54,
"avg_line_length": 23.625,
"alnum_prop": 0.7777777777777778,
"repo_name": "konistehrad/CKDocument",
"id": "caa7f3fb732fda03ad92ad69876af4c2571df5b0",
"size": "1451",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CKDocument/CKXPathQuery.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Objective-C",
"bytes": "25636"
}
],
"symlink_target": ""
} |
package org.apache.beam.sdk.io.kinesis;
import com.google.common.testing.EqualsTester;
import java.util.NoSuchElementException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Tests {@link CustomOptional}. */
@RunWith(JUnit4.class)
public class CustomOptionalTest {
@Test(expected = NoSuchElementException.class)
public void absentThrowsNoSuchElementExceptionOnGet() {
CustomOptional.absent().get();
}
@Test
public void testEqualsAndHashCode() {
new EqualsTester()
.addEqualityGroup(CustomOptional.absent(), CustomOptional.absent())
.addEqualityGroup(CustomOptional.of(3), CustomOptional.of(3))
.addEqualityGroup(CustomOptional.of(11))
.addEqualityGroup(CustomOptional.of("3"))
.testEquals();
}
}
| {
"content_hash": "332cc1fd871e8dfe922f9daf31852d2e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 28.821428571428573,
"alnum_prop": 0.7360594795539034,
"repo_name": "chamikaramj/beam",
"id": "00e6b933402528cb4e9e91c3063adbf928c6bc27",
"size": "1612",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "sdks/java/io/kinesis/src/test/java/org/apache/beam/sdk/io/kinesis/CustomOptionalTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "1598"
},
{
"name": "C",
"bytes": "3869"
},
{
"name": "CSS",
"bytes": "4957"
},
{
"name": "Cython",
"bytes": "70760"
},
{
"name": "Dart",
"bytes": "830529"
},
{
"name": "Dockerfile",
"bytes": "57816"
},
{
"name": "FreeMarker",
"bytes": "7933"
},
{
"name": "Go",
"bytes": "5458390"
},
{
"name": "Groovy",
"bytes": "927386"
},
{
"name": "HCL",
"bytes": "101921"
},
{
"name": "HTML",
"bytes": "182340"
},
{
"name": "Java",
"bytes": "40998145"
},
{
"name": "JavaScript",
"bytes": "119576"
},
{
"name": "Jupyter Notebook",
"bytes": "55818"
},
{
"name": "Kotlin",
"bytes": "215680"
},
{
"name": "Lua",
"bytes": "3620"
},
{
"name": "Python",
"bytes": "10659416"
},
{
"name": "SCSS",
"bytes": "318364"
},
{
"name": "Sass",
"bytes": "25936"
},
{
"name": "Scala",
"bytes": "1429"
},
{
"name": "Shell",
"bytes": "365119"
},
{
"name": "Smarty",
"bytes": "2618"
},
{
"name": "Thrift",
"bytes": "3260"
},
{
"name": "TypeScript",
"bytes": "1990433"
}
],
"symlink_target": ""
} |
import { noop, promiseNoop } from '../other'
describe('noop', () => {
test('Does nothing', () => {
expect(noop()).toBe(undefined)
})
})
describe('promiseNoop', () => {
test('Does nothing', () => {
expect(promiseNoop()).resolves.toBe(undefined)
})
})
| {
"content_hash": "9c9f294e5ea0cfac789f8997e6ef734e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 50,
"avg_line_length": 20.615384615384617,
"alnum_prop": 0.5671641791044776,
"repo_name": "helpscout/blue",
"id": "5287b1b8f15d784e93ada95d7cf80eb39803137c",
"size": "268",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "src/utilities/__tests__/other.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "47340"
},
{
"name": "JavaScript",
"bytes": "1531763"
},
{
"name": "Shell",
"bytes": "215"
},
{
"name": "TypeScript",
"bytes": "87805"
}
],
"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>
<parent>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>../dropwizard-parent</relativePath>
</parent>
<artifactId>dropwizard-views-mustache</artifactId>
<name>Dropwizard Mustache Views</name>
<dependencies>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jersey</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-logging</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-views</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</dependency>
<dependency>
<groupId>com.github.spullara.mustache.java</groupId>
<artifactId>compiler</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>jersey-test-framework-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-inmemory</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "c1775711dcb928eda5670e55e91afc82",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 204,
"avg_line_length": 37.51282051282051,
"alnum_prop": 0.5974025974025974,
"repo_name": "micsta/dropwizard",
"id": "3c4035e46297a18b9bd758206f33e731ce551c52",
"size": "2926",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "dropwizard-views-mustache/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "FreeMarker",
"bytes": "992"
},
{
"name": "HTML",
"bytes": "111"
},
{
"name": "Java",
"bytes": "2704084"
},
{
"name": "Mustache",
"bytes": "569"
},
{
"name": "Shell",
"bytes": "6214"
}
],
"symlink_target": ""
} |
require File.expand_path('../boot', __FILE__)
require 'rails/all'
Bundler.require(*Rails.groups)
require "params2session"
module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
end
end
| {
"content_hash": "2e46fe9e41c7ec936169f43dcce2d4c1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 99,
"avg_line_length": 38.608695652173914,
"alnum_prop": 0.7105855855855856,
"repo_name": "denispeplin/params2session",
"id": "0d16bfb40f740727a7959993360b81673709287b",
"size": "888",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/dummy/config/application.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "683"
},
{
"name": "JavaScript",
"bytes": "599"
},
{
"name": "Ruby",
"bytes": "17995"
}
],
"symlink_target": ""
} |
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="an uplifting and encouraging blog by Dallas Pepper">
<meta name="keywords" content="an uplifting and encouraging blog by Dallas Pepper">
<meta name="author" content="Dallas Pepper">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Little Encouragement</title>
<link rel="icon" href="../../../favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="../../../framework/css/foundation.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.min.css">
<link href='http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="../../../css/style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<script src="../../../framework/js/vendor/modernizr.js"></script>
<script src="../../../js/data.js"></script>
</head>
<body>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.5";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="row">
<div class="large-12 columns">
<div class="nav-bar right">
<ul class="button-group">
<li><a href="../../../index.html" class="button">Home</a>
</li>
<li><a href="../../../archive.html" class="button">Archive</a>
</li>
<!-- <li><a href="#" class="button">Link 3</a>
</li>
<li><a href="#" class="button">Link 4</a>
</li> -->
</ul>
</div>
<h1><a href="../../../index.html">A Little Encouragement</a></br><small>an Uplifting blog</small></h1>
<hr/>
</div>
</div>
<div class="row">
<div class="large-9 columns" role="content">
<div class="fb-like" data-href="http://www.alittleencouragement.com/post/2016/3/Blog.2016-3-27.html" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<article>
<h3><a href="#">Easter</a></h3>
<h6>Written by <a href="#">Dallas Pepper</a> on March 27th, 2016.</h6>
<p>
Where could I even begin to talk about the resurrection of Jesus Christ. It changed everything forever.
<br>
<blockquote>
"Death In His Grave" by John Mark McMillan
<br><br>
Though the earth cried<br>
Out for blood<br>
Satisfied her hunger was<br>
Billows calmed on raging seas<br>
For the souls of men she craved<br>
Sun and moon from balcony<br>
Turned their head in disbelief<br>
Their precious love would taste<br>
The sting<br>
Disfigured and disdained<br>
<br>
So three days in darkness slept<br>
The morning sun<br>
Of righteousness<br>
But rose to shame<br>
The throws of death<br>
And overturn his rule<br>
Now daughters<br>
And the sons of men<br>
Would pay not their dues again<br>
The debt of blood<br>
They owed was rent<br>
When the day rolled anew<br>
<br>
On Friday a thief<br>
On Sunday a king<br>
Laid down in grief<br>
But woke with the keys<br>
Of hell on that day<br>
The first born of the slain<br>
The man Jesus Christ laid<br>
Death in his grave<br>
<br>
He has cheated hell<br>
And seated us above the fall<br>
In desperate places he paid our<br>
Wages one time once and for all<br>
</blockquote>
</p>
<h6>Verses:</h6>
<p>
Therefore we also, since we are surrounded by so great a cloud of witnesses, let us lay aside every weight, and the sin which so easily ensnares us, and let us run with endurance the race that is set before us, 2 looking unto Jesus, the author and finisher of our faith, who for the joy that was set before Him endured the cross, despising the shame, and has sat down at the right hand of the throne of God.<br>
3 For consider Him who endured such hostility from sinners against Himself, lest you become weary and discouraged in your souls. - Hebrews 12:1-3<br>
<br>
Now on the first day of the week Mary Magdalene went to the tomb early, while it was still dark, and saw that the stone had been taken away from the tomb. 2 Then she ran and came to Simon Peter, and to the other disciple, whom Jesus loved, and said to them, “They have taken away the Lord out of the tomb, and we do not know where they have laid Him.”
<br>
3 Peter therefore went out, and the other disciple, and were going to the tomb. 4 So they both ran together, and the other disciple outran Peter and came to the tomb first. 5 And he, stooping down and looking in, saw the linen cloths lying there; yet he did not go in. 6 Then Simon Peter came, following him, and went into the tomb; and he saw the linen cloths lying there, 7 and the handkerchief that had been around His head, not lying with the linen cloths, but folded together in a place by itself. 8 Then the other disciple, who came to the tomb first, went in also; and he saw and believed. 9 For as yet they did not know the Scripture, that He must rise again from the dead. 10 Then the disciples went away again to their own homes.
<br>
11 But Mary stood outside by the tomb weeping, and as she wept she stooped down and looked into the tomb. 12 And she saw two angels in white sitting, one at the head and the other at the feet, where the body of Jesus had lain. 13 Then they said to her, “Woman, why are you weeping?”
<br>
She said to them, “Because they have taken away my Lord, and I do not know where they have laid Him.”
<br>
14 Now when she had said this, she turned around and saw Jesus standing there, and did not know that it was Jesus. 15 Jesus said to her, “Woman, why are you weeping? Whom are you seeking?”
<br>
She, supposing Him to be the gardener, said to Him, “Sir, if You have carried Him away, tell me where You have laid Him, and I will take Him away.”
<br>
16 Jesus said to her, “Mary!”
<br>
She turned and said to Him, “Rabboni!” (which is to say, Teacher). - John 20:1-16
</p>
<h6>Songs:</h6>
<p>
<a href = "https://www.youtube.com/watch?v=jSTKbmNY1WA&list=RD_HGRyxAfhZU&index=7" target = "_blank">Death In His Grave<a/>
<br>
<a href = "https://www.youtube.com/watch?v=QPz4puhikLM" target = "_blank">Death Was Arrested<a/>
<br>
<a href = "https://www.youtube.com/watch?v=wJ__W9VH9Lo" target = "_blank">Forever<a/>
<br>
<a href = "https://www.youtube.com/watch?v=uTWxm5ZsDWQ" target = "_blank">Happy Day<a/>
<br>
<a href = "https://www.youtube.com/watch?v=Om3mm2dv--k" target = "_blank">Alive<a/>
<br>
<a href = "https://www.youtube.com/watch?v=SuRNZg6uatg" target = "_blank">For The Cross<a/>
<br>
<a href = "https://www.youtube.com/watch?v=EMHyGh0RgCA" target = "_blank">Arise My Love<a/>
</p>
</article>
<div class="fb-comments" data-href="http://www.alittleencouragement.com/post/2016/3/Blog.2016-3-27.html" data-numposts="5"></div>
</div>
<aside class="large-3 columns">
<!-- <h5>Categories</h5>
<ul class="side-nav">
<li><a href="#">News</a>
</li>
<li><a href="#">Code</a>
</li>
<li><a href="#">Design</a>
</li>
<li><a href="#">Fun</a>
</li>
<li><a href="#">Weasels</a>
</li>
</ul> -->
<div class="panel">
<h5>About</h5>
<p>This started as a series of emails to a small group of my sweet sisters and quickly grew. I heard a pastor once say that he was preaching to himself. We were just listening in to what God had been working personally in him. That is what this blog is. It is a window into what God has been working in me. I pray this will help encourage other believers as they run their own race. </p>
<!-- <a href="#">Read More →</a> -->
</div>
<div>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Ad1 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-1283906839417699"
data-ad-slot="4447356969"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
</aside>
</div>
<footer class="row">
<div class="large-12 columns">
<hr/>
<div class="row">
<div class="large-6 columns">
<p>2015-
<script>
document.write(new Date().getFullYear())
</script> © A Little Encouragement <br>
</p>
</div>
<div class="large-4 columns">
Contact me: <a href="mailto:[email protected]">[email protected]</a>
<!-- <ul class="inline-list right">
<li><a href="#">Link 1</a>
</li>
<li><a href="#">Link 2</a>
</li>
<li><a href="#">Link 3</a>
</li>
<li><a href="#">Link 4</a>
</li>
</ul> -->
</div>
</div>
</div>
</footer>
<script src="../../../framework/js/vendor/jquery.js"></script>
<script src="../../../framework/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>
| {
"content_hash": "7b92c0c76b7e42cc4c12740919309a5d",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 739,
"avg_line_length": 46.1712962962963,
"alnum_prop": 0.6117517296701093,
"repo_name": "a-little-encouragement/blog",
"id": "6c61d9ddc25eafd615e71546c5b4220a62c8595e",
"size": "10001",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "post/2016/3/Blog.2016-3-27.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "856"
},
{
"name": "HTML",
"bytes": "839113"
},
{
"name": "JavaScript",
"bytes": "94"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>SQLite Documentation</title>
<style type="text/css">
body {
margin: auto;
font-family: Verdana, sans-serif;
padding: 8px 1%;
}
a { color: #044a64 }
a:visited { color: #734559 }
.logo { position:absolute; margin:3px; }
.tagline {
float:right;
text-align:right;
font-style:italic;
width:300px;
margin:12px;
margin-top:58px;
}
.menubar {
clear: both;
border-radius: 8px;
background: #044a64;
padding: 0px;
margin: 0px;
cell-spacing: 0px;
}
.toolbar {
text-align: center;
line-height: 1.6em;
margin: 0;
padding: 0px 8px;
}
.toolbar a { color: white; text-decoration: none; padding: 6px 12px; }
.toolbar a:visited { color: white; }
.toolbar a:hover { color: #044a64; background: white; }
.content { margin: 5%; }
.content dt { font-weight:bold; }
.content dd { margin-bottom: 25px; margin-left:20%; }
.content ul { padding:0px; padding-left: 15px; margin:0px; }
/* Things for "fancyformat" documents start here. */
.fancy img+p {font-style:italic}
.fancy .codeblock i { color: darkblue; }
.fancy h1,.fancy h2,.fancy h3,.fancy h4 {font-weight:normal;color:#044a64}
.fancy h2 { margin-left: 10px }
.fancy h3 { margin-left: 20px }
.fancy h4 { margin-left: 30px }
.fancy th {white-space:nowrap;text-align:left;border-bottom:solid 1px #444}
.fancy th, .fancy td {padding: 0.2em 1ex; vertical-align:top}
.fancy #toc a { color: darkblue ; text-decoration: none }
.fancy .todo { color: #AA3333 ; font-style : italic }
.fancy .todo:before { content: 'TODO:' }
.fancy p.todo { border: solid #AA3333 1px; padding: 1ex }
.fancy img { display:block; }
.fancy :link:hover, .fancy :visited:hover { background: wheat }
.fancy p,.fancy ul,.fancy ol,.fancy dl { margin: 1em 5ex }
.fancy li p { margin: 1em 0 }
/* End of "fancyformat" specific rules. */
.yyterm {
background: #fff;
border: 1px solid #000;
border-radius: 11px;
padding-left: 4px;
padding-right: 4px;
}
</style>
</head>
<body>
<div><!-- container div to satisfy validator -->
<a href="index.html">
<img class="logo" src="images/sqlite370_banner.gif" alt="SQLite Logo"
border="0"></a>
<div><!-- IE hack to prevent disappearing logo--></div>
<div class="tagline">Small. Fast. Reliable.<br>Choose any three.</div>
<table width=100% class="menubar"><tr>
<td width=100%>
<div class="toolbar">
<a href="about.html">About</a>
<a href="docs.html">Documentation</a>
<a href="download.html">Download</a>
<a href="copyright.html">License</a>
<a href="support.html">Support</a>
<a href="http://www.hwaci.com/sw/sqlite/prosupport.html">Purchase</a>
</div>
<script>
gMsg = "Search SQLite Docs..."
function entersearch() {
var q = document.getElementById("q");
if( q.value == gMsg ) { q.value = "" }
q.style.color = "black"
q.style.fontStyle = "normal"
}
function leavesearch() {
var q = document.getElementById("q");
if( q.value == "" ) {
q.value = gMsg
q.style.color = "#044a64"
q.style.fontStyle = "italic"
}
}
function hideorshow(btn,obj){
var x = document.getElementById(obj);
var b = document.getElementById(btn);
if( x.style.display!='none' ){
x.style.display = 'none';
b.innerHTML='show';
}else{
x.style.display = '';
b.innerHTML='hide';
}
return false;
}
</script>
<td>
<div style="padding:0 1em 0px 0;white-space:nowrap">
<form name=f method="GET" action="https://www.sqlite.org/search">
<input id=q name=q type=text
onfocus="entersearch()" onblur="leavesearch()" style="width:24ex;padding:1px 1ex; border:solid white 1px; font-size:0.9em ; font-style:italic;color:#044a64;" value="Search SQLite Docs...">
<input type=submit value="Go" style="border:solid white 1px;background-color:#044a64;color:white;font-size:0.9em;padding:0 1ex">
</form>
</div>
</table>
<div class=startsearch></div>
<h1 align="center">Categorical Index Of SQLite Documents</h1>
<table width="100%" cellpadding="5">
<tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>Overview Documents</b><tr><td valign="top" align="right"><a href="about.html">About SQLite</a></td><td width="10"></td><td valign="top" align="left">
A high-level overview of what SQLite is and why you might be
interested in using it.
</td></tr><tr><td valign="top" align="right"><a href="whentouse.html">Appropriate Uses For SQLite</a></td><td width="10"></td><td valign="top" align="left">
This document describes situations where SQLite is an appropriate
database engine to use versus situations where a client/server
database engine might be a better choice.
</td></tr><tr><td valign="top" align="right"><a href="different.html">Distinctive Features</a></td><td width="10"></td><td valign="top" align="left">
This document enumerates and describes some of the features of
SQLite that make it different from other SQL database engines.
</td></tr><tr><td valign="top" align="right"><a href="testing.html">How SQLite Is Tested</a></td><td width="10"></td><td valign="top" align="left">
The reliability and robustness of SQLite is achieved in large part
by thorough and careful testing. This document identifies the
many tests that occur before every release of SQLite.
</td></tr><tr><td valign="top" align="right"><a href="copyright.html">Copyright</a></td><td width="10"></td><td valign="top" align="left">
SQLite is in the public domain. This document describes what that means
and the implications for contributors.
</td></tr><tr><td valign="top" align="right"><a href="faq.html">Frequently Asked Questions</a></td><td width="10"></td><td valign="top" align="left">
The title of the document says all...
</td></tr><tr><td valign="top" align="right"><a href="books.html">Books About SQLite</a></td><td width="10"></td><td valign="top" align="left">
A list of independently written books about SQLite.
</td></tr><tr><td valign="top" align="right"><a href="doclist.html">Alphabetical Listing Of Documents</a></td><td width="10"></td><td valign="top" align="left">
A list of all titled pages on this website, sorted by title.
</td></tr><tr><td valign="top" align="right"><a href="keyword_index.html">Website Keyword Index</a></td><td width="10"></td><td valign="top" align="left">
A cross-reference from keywords to various pages within this website.
</td></tr><tr><td valign="top" align="right"><a href="sitemap.html#pindex">Permuted Title Index</a></td><td width="10"></td><td valign="top" align="left">
Also known as a "keyword in context" or "KWIC" index or as a concordance,
this document is a listing of all other documents sorted by keyword.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>SQLite Programming Interfaces</b><br />
Documentation describing the APIs used to program SQLite, and the SQL
dialect that it interprets.
<tr><td valign="top" align="right"><a href="quickstart.html">SQLite In 5 Minutes Or Less</a></td><td width="10"></td><td valign="top" align="left">
A very quick introduction to programming with SQLite.
</td></tr><tr><td valign="top" align="right"><a href="cintro.html">Introduction to the C/C++ API </a></td><td width="10"></td><td valign="top" align="left">
This document introduces the C/C++ API. Users should read this document
before the C/C++ API Reference Guide linked below.
</td></tr><tr><td valign="top" align="right"><a href="howtocompile.html">How To Compile SQLite</a></td><td width="10"></td><td valign="top" align="left">
Instructions and hints for compiling SQLite C code and integrating
that code with your own application.
</td></tr><tr><td valign="top" align="right"><a href="c3ref/intro.html">C/C++ API Reference</a></td><td width="10"></td><td valign="top" align="left">
This document describes each API function separately.
</td></tr><tr><td valign="top" align="right"><a href="rescode.html">Result Codes</a></td><td width="10"></td><td valign="top" align="left">
A description of the meanings of the numeric result codes
returned by various C/C++ interfaces.
</td></tr><tr><td valign="top" align="right"><a href="tclsqlite.html">Tcl API</a></td><td width="10"></td><td valign="top" align="left">
A description of the TCL interface bindings for SQLite.
</td></tr><tr><td valign="top" align="right"><a href="lang.html">SQL Syntax</a></td><td width="10"></td><td valign="top" align="left">
This document describes the SQL language that is understood by
SQLite.
</td></tr><tr><td valign="top" align="right"><a href="pragma.html">Pragma commands</a></td><td width="10"></td><td valign="top" align="left">
This document describes SQLite performance tuning options and other
special purpose database commands.
</td></tr><tr><td valign="top" align="right"><a href="lang_corefunc.html">Core SQL Functions</a></td><td width="10"></td><td valign="top" align="left">
General-purpose built-in scalar SQL functions.
</td></tr><tr><td valign="top" align="right"><a href="lang_aggfunc.html">Aggregate SQL Functions</a></td><td width="10"></td><td valign="top" align="left">
General-purpose built-in aggregate SQL functions.
</td></tr><tr><td valign="top" align="right"><a href="lang_datefunc.html">Date and Time SQL Functions</a></td><td width="10"></td><td valign="top" align="left">
SQL functions for manipulating dates and times.
</td></tr><tr><td valign="top" align="right"><a href="json1.html">JSON SQL Functions</a></td><td width="10"></td><td valign="top" align="left">
SQL functions for creating, parsing, and querying JSON content.
</td></tr><tr><td valign="top" align="right"><a href="datatype3.html">DataTypes</a></td><td width="10"></td><td valign="top" align="left">
SQLite version 3 introduces the concept of manifest typing, where the
type of a value is associated with the value itself, not the column that
it is stored in.
This page describes data typing for SQLite version 3 in further detail.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>SQLite Features and Extensions</b><br />
Pages describing specific features or extension modules of SQLite.
<tr><td valign="top" align="right"><a href="shortnames.html">8+3 Filenames</a></td><td width="10"></td><td valign="top" align="left">
How to make SQLite work on filesystems that only support
8+3 filenames.
</td></tr><tr><td valign="top" align="right"><a href="autoinc.html">Autoincrement</a></td><td width="10"></td><td valign="top" align="left">
A description of the AUTOINCREMENT keyword in SQLite, what it does,
why it is sometimes useful, and why it should be avoided if not
strictly necessary.
</td></tr><tr><td valign="top" align="right"><a href="backup.html">Backup API</a></td><td width="10"></td><td valign="top" align="left">
The <a href="c3ref/backup_finish.html#sqlite3backupinit">online-backup interface</a> can be used to
copy content from a disk file into an in-memory database or vice
versa and it can make a hot backup of a live database. This application
note gives examples of how.
</td></tr><tr><td valign="top" align="right"><a href="cli.html">Command-Line Shell</a></td><td width="10"></td><td valign="top" align="left">
Notes on using the "sqlite3.exe" command-line interface that
can be used to create, modify, and query arbitrary SQLite
database files.
</td></tr><tr><td valign="top" align="right"><a href="errlog.html">Error and Warning Log</a></td><td width="10"></td><td valign="top" align="left">
SQLite supports an "error and warning log" design to capture information
about suspicious and/or error events during operation. Embedded applications
are encouraged to enable the error and warning log to help with debugging
application problems that arise in the field. This document explains how
to do that.
</td></tr><tr><td valign="top" align="right"><a href="foreignkeys.html">Foreign Key Support</a></td><td width="10"></td><td valign="top" align="left">
This document describes the support for foreign key constraints introduced
in version 3.6.19.
</td></tr><tr><td valign="top" align="right"><a href="fts3.html">Full Text Search</a></td><td width="10"></td><td valign="top" align="left">
A description of the SQLite Full Text Search (FTS3) extension.
</td></tr><tr><td valign="top" align="right"><a href="expridx.html">Indexes On Expressions</a></td><td width="10"></td><td valign="top" align="left">
Notes on how to create indexes on expressions instead of just
individual columns.
</td></tr><tr><td valign="top" align="right"><a href="intern-v-extern-blob.html">Internal versus External Blob Storage</a></td><td width="10"></td><td valign="top" align="left">
Should you store large BLOBs directly in the database, or store them
in files and just record the filename in the database? This document
seeks to shed light on that question.
</td></tr><tr><td valign="top" align="right"><a href="limits.html">Limits In SQLite</a></td><td width="10"></td><td valign="top" align="left">
This document describes limitations of SQLite (the maximum length of a
string or blob, the maximum size of a database, the maximum number of
tables in a database, etc.) and how these limits can be altered at
compile-time and run-time.
</td></tr><tr><td valign="top" align="right"><a href="mmap.html">Memory-Mapped I/O</a></td><td width="10"></td><td valign="top" align="left">
SQLite supports memory-mapped I/O. Learn how to enable memory-mapped
I/O and about the various advantages and disadvantages to using
memory-mapped I/O in this document.
</td></tr><tr><td valign="top" align="right"><a href="threadsafe.html">Multi-threaded Programs and SQLite</a></td><td width="10"></td><td valign="top" align="left">
SQLite is safe to use in multi-threaded programs. This document
provides the details and hints on how to maximize performance.
</td></tr><tr><td valign="top" align="right"><a href="nulls.html">Null Handling</a></td><td width="10"></td><td valign="top" align="left">
Different SQL database engines handle NULLs in different ways. The
SQL standards are ambiguous. This (circa 2003) document describes
how SQLite handles NULLs in comparison with other SQL database engines.
</td></tr><tr><td valign="top" align="right"><a href="partialindex.html">Partial Indexes</a></td><td width="10"></td><td valign="top" align="left">
A partial index is an index that only covers a subset of the rows in
a table. Learn how to use partial indexes in SQLite from this document.
</td></tr><tr><td valign="top" align="right"><a href="rtree.html">R-Trees</a></td><td width="10"></td><td valign="top" align="left">
A description of the SQLite R-Tree extension. An R-Tree is a specialized
data structure that supports fast multi-dimensional range queries often
used in geospatial systems.
</td></tr><tr><td valign="top" align="right"><a href="loadext.html">Run-Time Loadable Extensions</a></td><td width="10"></td><td valign="top" align="left">
A general overview on how run-time loadable extensions work, how they
are compiled, and how developers can create their own run-time loadable
extensions for SQLite.
</td></tr><tr><td valign="top" align="right"><a href="sharedcache.html">Shared Cache Mode</a></td><td width="10"></td><td valign="top" align="left">
Version 3.3.0 and later supports the ability for two or more
database connections to share the same page and schema cache.
This feature is useful for certain specialized applications.
</td></tr><tr><td valign="top" align="right"><a href="unlock_notify.html">Unlock Notify</a></td><td width="10"></td><td valign="top" align="left">
The "unlock notify" feature can be used in conjunction with
<a href="sharedcache.html">shared cache mode</a> to more efficiently manage resource conflict (database
table locks).
</td></tr><tr><td valign="top" align="right"><a href="uri.html">URI Filenames</a></td><td width="10"></td><td valign="top" align="left">
The names of database files can be specified using either an ordinary
filename or a URI. Using URI filenames provides additional capabilities,
as this document describes.
</td></tr><tr><td valign="top" align="right"><a href="withoutrowid.html">WITHOUT ROWID Tables</a></td><td width="10"></td><td valign="top" align="left">
The WITHOUT ROWID optimization is a option that can sometimes result
in smaller and faster databases.
</td></tr><tr><td valign="top" align="right"><a href="wal.html">Write-Ahead Log (WAL) Mode</a></td><td width="10"></td><td valign="top" align="left">
Transaction control using a write-ahead log offers more concurrency and
is often faster than the default rollback transactions. This document
explains how to use WAL mode for improved performance.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>Advocacy</b><br />
Documents that strive to encourage the use of SQLite.
<tr><td valign="top" align="right"><a href="appfileformat.html">SQLite As An Application File Format</a></td><td width="10"></td><td valign="top" align="left">
This article advocates using SQLite as an application file format
in place of XML or JSON or a "pile-of-file".
</td></tr><tr><td valign="top" align="right"><a href="famous.html">Well Known Users</a></td><td width="10"></td><td valign="top" align="left">
This page lists a small subset of the many thousands of devices
and application programs that make use of SQLite.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>SQLite Technical/Design Documentation</b><br />
These documents are oriented toward describing the internal
implementation details and operation of SQLite.
<tr><td valign="top" align="right"><a href="howtocorrupt.html">How Database Corruption Can Occur</a></td><td width="10"></td><td valign="top" align="left">
SQLite is highly resistant to database corruption. But application,
OS, and hardware bugs can still result in corrupt database files.
This article describes many of the ways that SQLite database files
can go corrupt.
</td></tr><tr><td valign="top" align="right"><a href="tempfiles.html">Temporary Files Used By SQLite</a></td><td width="10"></td><td valign="top" align="left">
SQLite can potentially use many different temporary files when
processing certain SQL statements. This document describes the
many kinds of temporary files that SQLite uses and offers suggestions
for avoiding them on systems where creating a temporary file is an
expensive operation.
</td></tr><tr><td valign="top" align="right"><a href="inmemorydb.html">In-Memory Databases</a></td><td width="10"></td><td valign="top" align="left">
SQLite normally stores content in a disk file. However, it can also
be used as an in-memory database engine. This document explains how.
</td></tr><tr><td valign="top" align="right"><a href="atomiccommit.html">How SQLite Implements Atomic Commit</a></td><td width="10"></td><td valign="top" align="left">
A description of the logic within SQLite that implements
transactions with atomic commit, even in the face of power
failures.
</td></tr><tr><td valign="top" align="right"><a href="malloc.html">Dynamic Memory Allocation in SQLite</a></td><td width="10"></td><td valign="top" align="left">
SQLite has a sophisticated memory allocation subsystem that can be
configured and customized to meet memory usage requirements of the
application and that is robust against out-of-memory conditions and
leak-free. This document provides the details.
</td></tr><tr><td valign="top" align="right"><a href="custombuild.html">Customizing And Porting SQLite</a></td><td width="10"></td><td valign="top" align="left">
This document explains how to customize the build of SQLite and
how to port SQLite to new platforms.
</td></tr><tr><td valign="top" align="right"><a href="lockingv3.html">Locking And Concurrency<br>In SQLite Version 3</a></td><td width="10"></td><td valign="top" align="left">
A description of how the new locking code in version 3 increases
concurrency and decreases the problem of writer starvation.
</td></tr><tr><td valign="top" align="right"><a href="isolation.html">Isolation In SQLite</a></td><td width="10"></td><td valign="top" align="left">
When we say that SQLite transactions are "serializable" what exactly
does that mean? How and when are changes made visible within the
same database connection and to other database connections?
</td></tr><tr><td valign="top" align="right"><a href="optoverview.html">Overview Of The Optimizer</a></td><td width="10"></td><td valign="top" align="left">
A quick overview of the various query optimizations that are
attempted by the SQLite code generator.
</td></tr><tr><td valign="top" align="right"><a href="queryplanner-ng.html">The Next-Generation Query Planner</a></td><td width="10"></td><td valign="top" align="left">
Additional information about the SQLite query planner, and in particular
the redesign of the query planner that occurred for version 3.8.0.
</td></tr><tr><td valign="top" align="right"><a href="arch.html">Architecture</a></td><td width="10"></td><td valign="top" align="left">
An architectural overview of the SQLite library, useful for those who want
to hack the code.
</td></tr><tr><td valign="top" align="right"><a href="opcode.html">VDBE Opcodes</a></td><td width="10"></td><td valign="top" align="left">
This document is an automatically generated description of the various
opcodes that the VDBE understands. Programmers can use this document as
a reference to better understand the output of EXPLAIN listings from
SQLite.
</td></tr><tr><td valign="top" align="right"><a href="vfs.html">Virtual Filesystem</a></td><td width="10"></td><td valign="top" align="left">
The "VFS" object is the interface between the SQLite core and the
underlying operating system. Learn more about how the VFS object
works and how to create new VFS objects from this article.
</td></tr><tr><td valign="top" align="right"><a href="vtab.html">Virtual Tables</a></td><td width="10"></td><td valign="top" align="left">
This article describes the virtual table mechanism and API in SQLite and how
it can be used to add new capabilities to the core SQLite library.
</td></tr><tr><td valign="top" align="right"><a href="fileformat2.html">SQLite File Format</a></td><td width="10"></td><td valign="top" align="left">
A description of the format used for SQLite database and journal files, and
other details required to create software to read and write SQLite
databases without using SQLite.
</td></tr><tr><td valign="top" align="right"><a href="compile.html">Compilation Options</a></td><td width="10"></td><td valign="top" align="left">
This document describes the compile time options that may be set to
modify the default behavior of the library or omit optional features
in order to reduce binary size.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>Upgrading SQLite, Backwards Compatibility</b><tr><td valign="top" align="right"><a href="35to36.html">Moving From SQLite 3.5 to 3.6</a></td><td width="10"></td><td valign="top" align="left">
A document describing the differences between SQLite version 3.5.9
and 3.6.0.
</td></tr><tr><td valign="top" align="right"><a href="34to35.html">Moving From SQLite 3.4 to 3.5</a></td><td width="10"></td><td valign="top" align="left">
A document describing the differences between SQLite version 3.4.2
and 3.5.0.
</td></tr><tr><td valign="top" align="right"><a href="changes.html">Release History</a></td><td width="10"></td><td valign="top" align="left">
A chronology of SQLite releases going back to version 1.0.0
</td></tr><tr><td valign="top" align="right"><a href="formatchng.html">Backwards Compatibility</a></td><td width="10"></td><td valign="top" align="left">
This document details all of the incompatible changes to the SQLite
file format that have occurred since version 1.0.0.
</td></tr><tr><td valign="top" align="right"><a href="privatebranch.html">Private Branches</a></td><td width="10"></td><td valign="top" align="left">
This document suggests procedures for maintaining a private branch
or fork of SQLite and keeping that branch or fork in sync with the
public SQLite source tree.
</td></tr><tr><td colspan=3 style="padding: 3ex 0 2ex 0"><b>Obsolete Documents</b><br />
The following documents are no longer current and are retained
for historical reference only.
These documents generally pertain to out-of-date, obsolete, and/or
deprecated features and extensions.
<tr><td valign="top" align="right"><a href="asyncvfs.html">Asynchronous IO Mode</a></td><td width="10"></td><td valign="top" align="left">
This page describes the asynchronous IO extension developed alongside
SQLite. Using asynchronous IO can cause SQLite to appear more responsive
by delegating database writes to a background thread. <i>NB: This
extension is deprecated. <a href="wal.html">WAL mode</a> is recommended as a replacement.</i>
</td></tr><tr><td valign="top" align="right"><a href="c_interface.html">Version 2 C/C++ API</a></td><td width="10"></td><td valign="top" align="left">
A description of the C/C++ interface bindings for SQLite through version
2.8
</td></tr><tr><td valign="top" align="right"><a href="datatypes.html">Version 2 DataTypes </a></td><td width="10"></td><td valign="top" align="left">
A description of how SQLite version 2 handles SQL datatypes.
Short summary: Everything is a string.
</td></tr><tr><td valign="top" align="right"><a href="vdbe.html">VDBE Tutorial</a></td><td width="10"></td><td valign="top" align="left">
The VDBE is the subsystem within SQLite that does the actual work of
executing SQL statements. This page describes the principles of operation
for the VDBE in SQLite version 2.7. This is essential reading for anyone
who want to modify the SQLite sources.
</td></tr><tr><td valign="top" align="right"><a href="version3.html">SQLite Version 3</a></td><td width="10"></td><td valign="top" align="left">
A summary of the changes between SQLite version 2.8 and SQLite version 3.0.
</td></tr><tr><td valign="top" align="right"><a href="capi3.html">Version 3 C/C++ API</a></td><td width="10"></td><td valign="top" align="left">
A summary of the API related changes between SQLite version 2.8 and
SQLite version 3.0.
</td></tr><tr><td valign="top" align="right"><a href="speed.html">Speed Comparison</a></td><td width="10"></td><td valign="top" align="left">
The speed of version 2.7.6 of SQLite is compared against PostgreSQL and
MySQL.
</td></tr>
</table>
| {
"content_hash": "524e52e390c44fedac92d57e3a82ee0e",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 275,
"avg_line_length": 67.21271393643032,
"alnum_prop": 0.70516551473263,
"repo_name": "andrasigneczi/TravelOptimizer",
"id": "33f849035fd3db1dd789cad0d60552b9aea21350",
"size": "27490",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "doc/sqlite-doc-3120000/docs.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3443874"
},
{
"name": "C++",
"bytes": "33624518"
},
{
"name": "CSS",
"bytes": "1225"
},
{
"name": "HTML",
"bytes": "13117"
},
{
"name": "IDL",
"bytes": "1110940"
},
{
"name": "Java",
"bytes": "562163"
},
{
"name": "JavaScript",
"bytes": "1480"
},
{
"name": "Makefile",
"bytes": "360"
},
{
"name": "Objective-C",
"bytes": "3166"
},
{
"name": "Python",
"bytes": "322743"
},
{
"name": "Shell",
"bytes": "2539"
}
],
"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>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="http://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.3.0</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.8 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Mutex.html">Mutex</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">sf::Mutex Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classsf_1_1Mutex.html">sf::Mutex</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classsf_1_1Mutex.html#a1a16956a6bbea764480c1b80f2e45763">lock</a>()</td><td class="entry"><a class="el" href="classsf_1_1Mutex.html">sf::Mutex</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classsf_1_1Mutex.html#a9bd52a48320fd7b6db8a78037aad276e">Mutex</a>()</td><td class="entry"><a class="el" href="classsf_1_1Mutex.html">sf::Mutex</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classsf_1_1NonCopyable.html#a2110add170580fdb946f887719da6860">NonCopyable</a>()</td><td class="entry"><a class="el" href="classsf_1_1NonCopyable.html">sf::NonCopyable</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">private</span></td></tr>
<tr><td class="entry"><a class="el" href="classsf_1_1Mutex.html#ade71268ffc5e80756652058b01c23c33">unlock</a>()</td><td class="entry"><a class="el" href="classsf_1_1Mutex.html">sf::Mutex</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classsf_1_1Mutex.html#a9f76a67b7b6d3918131a692179b4e3f2">~Mutex</a>()</td><td class="entry"><a class="el" href="classsf_1_1Mutex.html">sf::Mutex</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="http://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright © Laurent Gomila ::
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> ::
</div>
</div>
</body>
</html>
| {
"content_hash": "89ccb0e1de94f19d9a1d7f76dc5cedea",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 330,
"avg_line_length": 61.53846153846154,
"alnum_prop": 0.62025,
"repo_name": "NhojEntuna/Blank-Engine---Official-Engine-Repository",
"id": "320089e8479f317f79fb8d362b44bcd1c6612c44",
"size": "4000",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "BlankEngine - Source Files/SFML-2.3/doc/html/classsf_1_1Mutex-members.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "404"
},
{
"name": "C++",
"bytes": "652931"
},
{
"name": "CMake",
"bytes": "17563"
},
{
"name": "CSS",
"bytes": "25894"
},
{
"name": "GLSL",
"bytes": "3928"
},
{
"name": "HTML",
"bytes": "6408850"
},
{
"name": "JavaScript",
"bytes": "3422"
}
],
"symlink_target": ""
} |
package org.apache.hadoop.fs.azure;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.EnumSet;
import java.util.HashMap;
import org.apache.hadoop.classification.InterfaceAudience;
import com.microsoft.azure.storage.AccessCondition;
import com.microsoft.azure.storage.CloudStorageAccount;
import com.microsoft.azure.storage.OperationContext;
import com.microsoft.azure.storage.RetryPolicyFactory;
import com.microsoft.azure.storage.StorageCredentials;
import com.microsoft.azure.storage.StorageException;
import com.microsoft.azure.storage.blob.BlobListingDetails;
import com.microsoft.azure.storage.blob.BlobProperties;
import com.microsoft.azure.storage.blob.BlockEntry;
import com.microsoft.azure.storage.blob.BlockListingFilter;
import com.microsoft.azure.storage.blob.BlobRequestOptions;
import com.microsoft.azure.storage.blob.CloudBlob;
import com.microsoft.azure.storage.blob.CopyState;
import com.microsoft.azure.storage.blob.ListBlobItem;
import com.microsoft.azure.storage.blob.PageRange;
/**
* This is a very thin layer over the methods exposed by the Windows Azure
* Storage SDK that we need for WASB implementation. This base class has a real
* implementation that just simply redirects to the SDK, and a memory-backed one
* that's used for unit tests.
*
* IMPORTANT: all the methods here must remain very simple redirects since code
* written here can't be properly unit tested.
*/
@InterfaceAudience.Private
abstract class StorageInterface {
/**
* Sets the timeout to use when making requests to the storage service.
* <p>
* The server timeout interval begins at the time that the complete request
* has been received by the service, and the server begins processing the
* response. If the timeout interval elapses before the response is returned
* to the client, the operation times out. The timeout interval resets with
* each retry, if the request is retried.
*
* The default timeout interval for a request made via the service client is
* 90 seconds. You can change this value on the service client by setting this
* property, so that all subsequent requests made via the service client will
* use the new timeout interval. You can also change this value for an
* individual request, by setting the
* {@link RequestOptions#timeoutIntervalInMs} property.
*
* If you are downloading a large blob, you should increase the value of the
* timeout beyond the default value.
*
* @param timeoutInMs
* The timeout, in milliseconds, to use when making requests to the
* storage service.
*/
public abstract void setTimeoutInMs(int timeoutInMs);
/**
* Sets the RetryPolicyFactory object to use when making service requests.
*
* @param retryPolicyFactory
* the RetryPolicyFactory object to use when making service requests.
*/
public abstract void setRetryPolicyFactory(
final RetryPolicyFactory retryPolicyFactory);
/**
* Creates a new Blob service client.
*
*/
public abstract void createBlobClient(CloudStorageAccount account);
/**
* Creates an instance of the <code>CloudBlobClient</code> class using the
* specified Blob service endpoint.
*
* @param baseUri
* A <code>java.net.URI</code> object that represents the Blob
* service endpoint used to create the client.
*/
public abstract void createBlobClient(URI baseUri);
/**
* Creates an instance of the <code>CloudBlobClient</code> class using the
* specified Blob service endpoint and account credentials.
*
* @param baseUri
* A <code>java.net.URI</code> object that represents the Blob
* service endpoint used to create the client.
* @param credentials
* A {@link StorageCredentials} object that represents the account
* credentials.
*/
public abstract void createBlobClient(URI baseUri,
StorageCredentials credentials);
/**
* Returns the credentials for the Blob service, as configured for the storage
* account.
*
* @return A {@link StorageCredentials} object that represents the credentials
* for this storage account.
*/
public abstract StorageCredentials getCredentials();
/**
* Returns a reference to a {@link CloudBlobContainerWrapper} object that
* represents the cloud blob container for the specified address.
*
* @param name
* A <code>String</code> that represents the name of the container.
* @return A {@link CloudBlobContainerWrapper} object that represents a
* reference to the cloud blob container.
*
* @throws URISyntaxException
* If the resource URI is invalid.
* @throws StorageException
* If a storage service error occurred.
*/
public abstract CloudBlobContainerWrapper getContainerReference(String name)
throws URISyntaxException, StorageException;
/**
* A thin wrapper over the {@link CloudBlobDirectory} class that simply
* redirects calls to the real object except in unit tests.
*/
@InterfaceAudience.Private
public abstract static class CloudBlobDirectoryWrapper implements
ListBlobItem {
/**
* Returns the URI for this directory.
*
* @return A <code>java.net.URI</code> object that represents the URI for
* this directory.
*/
public abstract URI getUri();
/**
* Returns an enumerable collection of blob items whose names begin with the
* specified prefix, using the specified flat or hierarchical option,
* listing details options, request options, and operation context.
*
* @param prefix
* A <code>String</code> that represents the prefix of the blob
* name.
* @param useFlatBlobListing
* <code>true</code> to indicate that the returned list will be
* flat; <code>false</code> to indicate that the returned list will
* be hierarchical.
* @param listingDetails
* A <code>java.util.EnumSet</code> object that contains
* {@link BlobListingDetails} values that indicate whether
* snapshots, metadata, and/or uncommitted blocks are returned.
* Committed blocks are always returned.
* @param options
* A {@link BlobRequestOptions} object that specifies any
* additional options for the request. Specifying <code>null</code>
* will use the default request options from the associated service
* client ( {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @return An enumerable collection of {@link ListBlobItem} objects that
* represent the block items whose names begin with the specified
* prefix in this directory.
*
* @throws StorageException
* If a storage service error occurred.
* @throws URISyntaxException
* If the resource URI is invalid.
*/
public abstract Iterable<ListBlobItem> listBlobs(String prefix,
boolean useFlatBlobListing, EnumSet<BlobListingDetails> listingDetails,
BlobRequestOptions options, OperationContext opContext)
throws URISyntaxException, StorageException;
}
/**
* A thin wrapper over the {@link CloudBlobContainer} class that simply
* redirects calls to the real object except in unit tests.
*/
@InterfaceAudience.Private
public abstract static class CloudBlobContainerWrapper {
/**
* Returns the name of the container.
*
* @return A <code>String</code> that represents the name of the container.
*/
public abstract String getName();
/**
* Returns a value that indicates whether the container exists, using the
* specified operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @return <code>true</code> if the container exists, otherwise
* <code>false</code>.
*
* @throws StorageException
* If a storage service error occurred.
*/
public abstract boolean exists(OperationContext opContext)
throws StorageException;
/**
* Returns the metadata for the container.
*
* @return A <code>java.util.HashMap</code> object that represents the
* metadata for the container.
*/
public abstract HashMap<String, String> getMetadata();
/**
* Sets the metadata for the container.
*
* @param metadata
* A <code>java.util.HashMap</code> object that represents the
* metadata being assigned to the container.
*/
public abstract void setMetadata(HashMap<String, String> metadata);
/**
* Downloads the container's attributes, which consist of metadata and
* properties, using the specified operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
public abstract void downloadAttributes(OperationContext opContext)
throws StorageException;
/**
* Uploads the container's metadata using the specified operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
public abstract void uploadMetadata(OperationContext opContext)
throws StorageException;
/**
* Creates the container using the specified operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
public abstract void create(OperationContext opContext)
throws StorageException;
/**
* Returns a wrapper for a CloudBlobDirectory.
*
* @param relativePath
* A <code>String</code> that represents the name of the directory,
* relative to the container
*
* @throws StorageException
* If a storage service error occurred.
*
* @throws URISyntaxException
* If URI syntax exception occurred.
*/
public abstract CloudBlobDirectoryWrapper getDirectoryReference(
String relativePath) throws URISyntaxException, StorageException;
/**
* Returns a wrapper for a CloudBlockBlob.
*
* @param relativePath
* A <code>String</code> that represents the name of the blob,
* relative to the container
*
* @throws StorageException
* If a storage service error occurred.
*
* @throws URISyntaxException
* If URI syntax exception occurred.
*/
public abstract CloudBlobWrapper getBlockBlobReference(
String relativePath) throws URISyntaxException, StorageException;
/**
* Returns a wrapper for a CloudPageBlob.
*
* @param relativePath
* A <code>String</code> that represents the name of the blob, relative to the container
*
* @throws StorageException
* If a storage service error occurred.
*
* @throws URISyntaxException
* If URI syntax exception occurred.
*/
public abstract CloudBlobWrapper getPageBlobReference(String relativePath)
throws URISyntaxException, StorageException;
}
/**
* A thin wrapper over the {@link CloudBlob} class that simply redirects calls
* to the real object except in unit tests.
*/
@InterfaceAudience.Private
public interface CloudBlobWrapper extends ListBlobItem {
/**
* Returns the URI for this blob.
*
* @return A <code>java.net.URI</code> object that represents the URI for
* the blob.
*/
URI getUri();
/**
* Returns the metadata for the blob.
*
* @return A <code>java.util.HashMap</code> object that represents the
* metadata for the blob.
*/
HashMap<String, String> getMetadata();
/**
* Sets the metadata for the blob.
*
* @param metadata
* A <code>java.util.HashMap</code> object that contains the
* metadata being assigned to the blob.
*/
void setMetadata(HashMap<String, String> metadata);
/**
* Copies an existing blob's contents, properties, and metadata to this instance of the <code>CloudBlob</code>
* class, using the specified operation context.
*
* @param sourceBlob
* A <code>CloudBlob</code> object that represents the source blob to copy.
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws StorageException
* If a storage service error occurred.
* @throws URISyntaxException
*
*/
public abstract void startCopyFromBlob(CloudBlobWrapper sourceBlob,
BlobRequestOptions options, OperationContext opContext)
throws StorageException, URISyntaxException;
/**
* Returns the blob's copy state.
*
* @return A {@link CopyState} object that represents the copy state of the
* blob.
*/
CopyState getCopyState();
/**
* Downloads a range of bytes from the blob to the given byte buffer, using the specified request options and
* operation context.
*
* @param offset
* The byte offset to use as the starting point for the source.
* @param length
* The number of bytes to read.
* @param buffer
* The byte buffer, as an array of bytes, to which the blob bytes are downloaded.
* @param bufferOffset
* The byte offset to use as the starting point for the target.
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
void downloadRange(final long offset, final long length,
final OutputStream outStream, final BlobRequestOptions options,
final OperationContext opContext)
throws StorageException, IOException;
/**
* Deletes the blob using the specified operation context.
* <p>
* A blob that has snapshots cannot be deleted unless the snapshots are also
* deleted. If a blob has snapshots, use the
* {@link DeleteSnapshotsOption#DELETE_SNAPSHOTS_ONLY} or
* {@link DeleteSnapshotsOption#INCLUDE_SNAPSHOTS} value in the
* <code>deleteSnapshotsOption</code> parameter to specify how the snapshots
* should be handled when the blob is deleted.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
void delete(OperationContext opContext, SelfRenewingLease lease)
throws StorageException;
/**
* Checks to see if the blob exists, using the specified operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @return <code>true</code> if the blob exists, otherwise
* <code>false</code>.
*
* @throws StorageException
* If a storage service error occurred.
*/
boolean exists(OperationContext opContext)
throws StorageException;
/**
* Populates a blob's properties and metadata using the specified operation
* context.
* <p>
* This method populates the blob's system properties and user-defined
* metadata. Before reading a blob's properties or metadata, call this
* method or its overload to retrieve the latest values for the blob's
* properties and metadata from the Windows Azure storage service.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
void downloadAttributes(OperationContext opContext)
throws StorageException;
/**
* Returns the blob's properties.
*
* @return A {@link BlobProperties} object that represents the properties of
* the blob.
*/
BlobProperties getProperties();
/**
* Opens a blob input stream to download the blob using the specified
* operation context.
* <p>
* Use {@link CloudBlobClient#setStreamMinimumReadSizeInBytes} to configure
* the read size.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @return An <code>InputStream</code> object that represents the stream to
* use for reading from the blob.
*
* @throws StorageException
* If a storage service error occurred.
*/
InputStream openInputStream(BlobRequestOptions options,
OperationContext opContext) throws StorageException;
/**
* Uploads the blob's metadata to the storage service using the specified
* lease ID, request options, and operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
void uploadMetadata(OperationContext opContext)
throws StorageException;
/**
* Uploads the blob's metadata to the storage service using the specified
* lease ID, request options, and operation context.
*
* @param accessCondition
* A {@link AccessCondition} object that represents the access conditions for the blob.
*
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
*
* @param opContext
* An {@link OperationContext} object that represents the context
* for the current operation. This object is used to track requests
* to the storage service, and to provide additional runtime
* information about the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/
void uploadMetadata(AccessCondition accessCondition, BlobRequestOptions options,
OperationContext opContext) throws StorageException;
void uploadProperties(OperationContext opContext,
SelfRenewingLease lease)
throws StorageException;
SelfRenewingLease acquireLease() throws StorageException;
/**
* Sets the minimum read block size to use with this Blob.
*
* @param minimumReadSizeBytes
* The maximum block size, in bytes, for reading from a block blob
* while using a {@link BlobInputStream} object, ranging from 512
* bytes to 64 MB, inclusive.
*/
void setStreamMinimumReadSizeInBytes(
int minimumReadSizeBytes);
/**
* Sets the write block size to use with this Blob.
*
* @param writeBlockSizeBytes
* The maximum block size, in bytes, for writing to a block blob
* while using a {@link BlobOutputStream} object, ranging from 1 MB
* to 4 MB, inclusive.
*
* @throws IllegalArgumentException
* If <code>writeBlockSizeInBytes</code> is less than 1 MB or
* greater than 4 MB.
*/
void setWriteBlockSizeInBytes(int writeBlockSizeBytes);
CloudBlob getBlob();
}
/**
* A thin wrapper over the {@link CloudBlockBlob} class that simply redirects calls
* to the real object except in unit tests.
*/
public abstract interface CloudBlockBlobWrapper
extends CloudBlobWrapper {
/**
* Creates and opens an output stream to write data to the block blob using the specified
* operation context.
*
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @return A {@link BlobOutputStream} object used to write data to the blob.
*
* @throws StorageException
* If a storage service error occurred.
*/
OutputStream openOutputStream(
BlobRequestOptions options,
OperationContext opContext) throws StorageException;
/**
*
* @param filter A {@link BlockListingFilter} value that specifies whether to download
* committed blocks, uncommitted blocks, or all blocks.
* @param options A {@link BlobRequestOptions} object that specifies any additional options for
* the request. Specifying null will use the default request options from
* the associated service client ( CloudBlobClient).
* @param opContext An {@link OperationContext} object that represents the context for the current
* operation. This object is used to track requests to the storage service,
* and to provide additional runtime information about the operation.
* @return An ArrayList object of {@link BlockEntry} objects that represent the list
* block items downloaded from the block blob.
* @throws IOException If an I/O error occurred.
* @throws StorageException If a storage service error occurred.
*/
List<BlockEntry> downloadBlockList(BlockListingFilter filter, BlobRequestOptions options,
OperationContext opContext) throws IOException, StorageException;
/**
*
* @param blockId A String that represents the Base-64 encoded block ID. Note for a given blob
* the length of all Block IDs must be identical.
* @param sourceStream An {@link InputStream} object that represents the input stream to write to the
* block blob.
* @param length A long which represents the length, in bytes, of the stream data,
* or -1 if unknown.
* @param options A {@link BlobRequestOptions} object that specifies any additional options for the
* request. Specifying null will use the default request options from the
* associated service client ( CloudBlobClient).
* @param opContext An {@link OperationContext} object that represents the context for the current operation.
* This object is used to track requests to the storage service, and to provide
* additional runtime information about the operation.
* @throws IOException If an I/O error occurred.
* @throws StorageException If a storage service error occurred.
*/
void uploadBlock(String blockId, InputStream sourceStream,
long length, BlobRequestOptions options,
OperationContext opContext) throws IOException, StorageException;
/**
*
* @param blockList An enumerable collection of {@link BlockEntry} objects that represents the list
* block items being committed. The size field is ignored.
* @param accessCondition An {@link AccessCondition} object that represents the access conditions for the blob.
* @param options A {@link BlobRequestOptions} object that specifies any additional options for the
* request. Specifying null will use the default request options from the associated
* service client ( CloudBlobClient).
* @param opContext An {@link OperationContext} object that represents the context for the current operation.
* This object is used to track requests to the storage service, and to provide additional
* runtime information about the operation.
* @throws IOException If an I/O error occurred.
* @throws StorageException If a storage service error occurred.
*/
void commitBlockList(List<BlockEntry> blockList, AccessCondition accessCondition, BlobRequestOptions options,
OperationContext opContext) throws IOException, StorageException;
}
/**
* A thin wrapper over the {@link CloudPageBlob} class that simply redirects calls
* to the real object except in unit tests.
*/
public abstract interface CloudPageBlobWrapper
extends CloudBlobWrapper {
/**
* Creates a page blob using the specified request options and operation context.
*
* @param length
* The size, in bytes, of the page blob.
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws IllegalArgumentException
* If the length is not a multiple of 512.
*
* @throws StorageException
* If a storage service error occurred.
*/
void create(final long length, BlobRequestOptions options,
OperationContext opContext) throws StorageException;
/**
* Uploads a range of contiguous pages, up to 4 MB in size, at the specified offset in the page blob, using the
* specified lease ID, request options, and operation context.
*
* @param sourceStream
* An <code>InputStream</code> object that represents the input stream to write to the page blob.
* @param offset
* The offset, in number of bytes, at which to begin writing the data. This value must be a multiple of
* 512.
* @param length
* The length, in bytes, of the data to write. This value must be a multiple of 512.
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws IllegalArgumentException
* If the offset or length are not multiples of 512, or if the length is greater than 4 MB.
* @throws IOException
* If an I/O exception occurred.
* @throws StorageException
* If a storage service error occurred.
*/
void uploadPages(final InputStream sourceStream, final long offset,
final long length, BlobRequestOptions options,
OperationContext opContext) throws StorageException, IOException;
/**
* Returns a collection of page ranges and their starting and ending byte offsets using the specified request
* options and operation context.
*
* @param options
* A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudBlobClient}).
* @param opContext
* An {@link OperationContext} object that represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @return An <code>ArrayList</code> object that represents the set of page ranges and their starting and ending
* byte offsets.
*
* @throws StorageException
* If a storage service error occurred.
*/
ArrayList<PageRange> downloadPageRanges(BlobRequestOptions options,
OperationContext opContext) throws StorageException;
void uploadMetadata(OperationContext opContext)
throws StorageException;
}
} | {
"content_hash": "235f4ae94ede4b9f8096a585fa3b41a2",
"timestamp": "",
"source": "github",
"line_count": 763,
"max_line_length": 119,
"avg_line_length": 42.66448230668414,
"alnum_prop": 0.6561300033791049,
"repo_name": "NJUJYB/disYarn",
"id": "c2169a475b547f892e8d0bb915ab552e5a0481bb",
"size": "33359",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/StorageInterface.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "68425"
},
{
"name": "C",
"bytes": "1347257"
},
{
"name": "C++",
"bytes": "1749003"
},
{
"name": "CMake",
"bytes": "50329"
},
{
"name": "CSS",
"bytes": "53240"
},
{
"name": "HTML",
"bytes": "156395"
},
{
"name": "Java",
"bytes": "58266706"
},
{
"name": "JavaScript",
"bytes": "56198"
},
{
"name": "Protocol Buffer",
"bytes": "258723"
},
{
"name": "Python",
"bytes": "11969"
},
{
"name": "Shell",
"bytes": "337816"
},
{
"name": "TLA",
"bytes": "14993"
},
{
"name": "TeX",
"bytes": "19322"
},
{
"name": "XSLT",
"bytes": "15460"
}
],
"symlink_target": ""
} |
package com.ashish;
import org.testng.annotations.Test;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
/**
* @author Ashish Sharma
* on 10/23/2015.
*/
public class SynchronizedPrintingThreadTest {
@Test
public void synchronizedPrinting() throws InterruptedException {
ExecutorService executorService = Executors.newFixedThreadPool(2);
Print print = new Print();
executorService.execute(new PrintStatement(print));
executorService.execute(new PrintName(print));
TimeUnit.MILLISECONDS.sleep(100);
executorService.shutdown();
}
public class Print {
private boolean isNamePrinted;
private boolean isStatementPrinted;
public Print() {
isNamePrinted = true;
isStatementPrinted = false;
}
public synchronized void printStatement() throws InterruptedException {
while (!isNamePrinted) {
wait();
}
System.out.println("My name is");
isStatementPrinted = true;
isNamePrinted = false;
notifyAll();
}
public synchronized void printName() throws InterruptedException {
while (!isStatementPrinted) {
wait();
}
System.out.println("Ashish Sharma");
isNamePrinted = true;
isStatementPrinted = false;
notifyAll();
}
}
public class PrintStatement implements Runnable {
private Print print;
public PrintStatement(Print print) {
this.print = print;
}
@Override
public void run() {
do {
try {
if (!Thread.interrupted()) {
print.printStatement();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} while (true);
}
}
public class PrintName implements Runnable {
private Print print;
public PrintName(Print print) {
this.print = print;
}
@Override
public void run() {
do {
try {
if (!Thread.interrupted()) {
print.printName();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} while (true);
}
}
}
| {
"content_hash": "397e30d7ce00884c91a4e060b6fe07fb",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 79,
"avg_line_length": 25.534653465346533,
"alnum_prop": 0.5257851880573866,
"repo_name": "ashiishsharma/PracticeCode",
"id": "577223554951994184da29ef4f2b4dd0bff19d03",
"size": "2579",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "thread-concepts/src/test/java/com/ashish/SynchronizedPrintingThreadTest.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "637299"
}
],
"symlink_target": ""
} |
package slog
// Severity is Stackdriver Logging Log Level
type Severity int
// Stackdriver Logging Log Level List
const (
DEBUG Severity = iota
INFO
WARNING
ERROR
)
| {
"content_hash": "1508d3ded544e0d5d9b9fc9415d451a7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 44,
"avg_line_length": 14.25,
"alnum_prop": 0.7602339181286549,
"repo_name": "sinmetal/slog",
"id": "113b8cdf5a79448b23c526bbe151511bf6a6a9d4",
"size": "171",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "v2/severity.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "16730"
},
{
"name": "Shell",
"bytes": "23"
}
],
"symlink_target": ""
} |
import unittest
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import gradient_check
from chainer import initializers
from chainer import links
from chainer import memory_layouts
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
import chainerx
_parameterize = testing.parameterize(*(testing.product_dict(
testing.product({
'test': [True, False],
'size': ['skip', 'explicit'],
'dtype': [numpy.float16, numpy.float32, numpy.float64,
chainer.mixed16],
}),
testing.product({
'ndim': [0, 1, 2, 3],
}) + [
{'input_shape': (5, 4, 3, 2), 'axis': (0, 2, 3)},
{'input_shape': (5, 4), 'axis': 0},
{'input_shape': (5, 4, 3), 'axis': (0, 1)},
]
)))
_inject_backend_tests = testing.inject_backend_tests(
None,
# CPU tests
[
{},
{'use_ideep': 'always'},
]
# GPU tests
+ testing.product({
'use_cuda': [True],
'use_cudnn': ['never', 'always'],
'cuda_device': [0, 1],
})
# ChainerX tests
+ [
{'use_chainerx': True, 'chainerx_device': 'native:0'},
{'use_chainerx': True, 'chainerx_device': 'cuda:0'},
{'use_chainerx': True, 'chainerx_device': 'cuda:1'},
])
def _batch_normalization(expander, gamma, beta, x, mean, var, eps, test):
mean = mean[expander]
if test:
std = numpy.sqrt(var[expander])
else:
std = numpy.sqrt(var[expander] + eps)
y_expect = gamma * (x - mean) / std + beta
return y_expect
class BatchNormalizationTestBase(object):
param_names = ('gamma', 'beta')
def setUp(self):
if self.dtype == chainer.mixed16:
self.highprec_dtype = numpy.float32
else:
self.highprec_dtype = self.dtype
if hasattr(self, 'axis') and hasattr(self, 'input_shape'):
aggr_axes = self.axis
if isinstance(aggr_axes, int):
aggr_axes = aggr_axes,
shape = self.input_shape
param_shape = tuple(
s for i, s in enumerate(shape) if i not in aggr_axes)
expander = tuple(
None if i in aggr_axes else slice(None)
for i in range(len(shape)))
elif hasattr(self, 'ndim'):
aggr_axes = (0,) + tuple(six.moves.range(2, self.ndim + 2))
shape = (5, 3) + (2,) * self.ndim
param_shape = shape[1]
expander = (None, Ellipsis) + (None,) * self.ndim
else:
assert False
self.aggr_axes = aggr_axes
self.shape = shape
self.param_shape = param_shape
self.expander = expander
self.finetune = False
self.eps = 2e-5
if self.test:
self.mean = numpy.random.uniform(
-1, 1, param_shape).astype(self.highprec_dtype)
self.var = numpy.random.uniform(
0.5, 1, param_shape).astype(self.highprec_dtype)
else:
self.mean = None
self.var = None
self.check_forward_options = {'atol': 1e-4, 'rtol': 1e-3}
self.check_backward_options = {'atol': 1e-4, 'rtol': 1e-3}
if self.dtype in (numpy.float16, chainer.mixed16):
self.check_forward_options = {'atol': 1e-2, 'rtol': 1e-1}
self.check_backward_options = {'atol': 5e-1, 'rtol': 1e-1}
def before_test(self, test_name):
if (self.dtype == chainer.mixed16
and self.backend_config.xp is chainerx):
raise unittest.SkipTest(
'ChainerX does not yet support mixed-FP16 mode.')
def generate_params(self):
initial_gamma = numpy.random.uniform(
-1, 1, self.param_shape).astype(self.highprec_dtype)
initial_beta = numpy.random.uniform(
-1, 1, self.param_shape).astype(self.highprec_dtype)
return initial_gamma, initial_beta
def create_link(self, initializers):
initial_gamma, initial_beta = initializers
size = self.param_shape if self.size == 'explicit' else None
initial_avg_mean = None if self.mean is None else self.mean.copy()
initial_avg_var = None if self.var is None else self.var.copy()
link = links.BatchNormalization(
size=size,
axis=self.aggr_axes,
eps=self.eps,
dtype=self.dtype,
initial_gamma=initial_gamma,
initial_beta=initial_beta,
initial_avg_mean=initial_avg_mean,
initial_avg_var=initial_avg_var)
return link
def generate_inputs(self):
x = numpy.random.uniform(-1, 1, self.shape).astype(self.dtype)
return x,
def forward(self, link, inputs, device):
x, = inputs
# The inputs might be of different dtype than what the link was
# initialized with. In that case, persistent values must be manually
# cast. This is needed when forward is called in order to compute
# numerical gradients.
if ((self.dtype == chainer.mixed16 and x.dtype != numpy.float16)
or (self.dtype != chainer.mixed16 and link.avg_mean is not None
and x.dtype != link.avg_mean.dtype)):
link.avg_mean = link.avg_mean.astype(x.dtype)
link.avg_var = link.avg_var.astype(x.dtype)
with chainer.using_config('train', not self.test):
y = link(x, finetune=self.finetune)
return y,
def forward_expected(self, link, inputs):
gamma = link.gamma.array
beta = link.beta.array
x, = inputs
if self.test:
mean = self.mean[self.expander]
var = self.var[self.expander]
std = numpy.sqrt(var)
else:
mean = x.mean(
axis=self.aggr_axes, dtype=self.highprec_dtype, keepdims=True)
var = x.var(
axis=self.aggr_axes, dtype=self.highprec_dtype, keepdims=True)
std = numpy.sqrt(var + self.eps)
y = gamma[self.expander] * (x - mean) / std + beta[self.expander]
return y.astype(self.dtype),
def check_forward_outputs(self, outputs, expected_outputs):
super(BatchNormalizationTestBase, self).check_forward_outputs(
outputs, expected_outputs)
y, = outputs
assert y.dtype == chainer.get_dtype(self.dtype)
@_inject_backend_tests
@_parameterize
class BatchNormalizationTest(BatchNormalizationTestBase, testing.LinkTestCase):
pass
# TODO(hvy): Safely remove this test class when BackendConfig no longer
# modifies the current device since those cases should be covered by the tests
# above.
@testing.inject_backend_tests(
None,
testing.product({
'use_cuda': [True],
'use_cudnn': ['never', 'always'],
'cuda_device': [0],
}))
@_parameterize
@attr.multi_gpu(2)
class BatchNormalizationMultiGpuTest(
BatchNormalizationTestBase, testing.LinkTestCase):
skip_backward_test = True
# TODO(hvy): Remove this relaxation. It is currently needed as the
# inter-device copy in CuPy with non-contiguous arrays are broken.
contiguous = 'C'
def forward(self, link, inputs, device):
x, = inputs
device_1 = backend.GpuDevice.from_device_id(1)
link.to_device(device_1)
x.to_device(device_1)
device_0 = backend.GpuDevice.from_device_id(0)
with chainer.using_device(device_0):
with chainer.using_config('train', not self.test):
y = link(x, finetune=self.finetune)
return y,
@testing.parameterize(*(testing.product_dict(
testing.product({
'dtype': [numpy.float16, numpy.float32, numpy.float64],
}))))
@_inject_backend_tests
class BatchNormalizationInitializersTest(
BatchNormalizationTestBase, testing.LinkInitializersTestCase):
test = False
size = 'skip'
ndim = 1
input_shape = (5, 4)
axis = 0
def get_initializers(self):
initial_gamma = [
initializers.Constant(2), 2, testing.InitializerArgument(None, 1)]
initial_beta = [
initializers.Constant(2), 2, testing.InitializerArgument(None, 0)]
return initial_gamma, initial_beta
@testing.parameterize(
{'nx': 10, 'ny': 10, 'eps': 2e-5},
{'nx': 10, 'ny': 10, 'eps': 1e-1},
# TODO(Kenta Oono)
# Pass the case below (this test does not pass when nx != ny).
# {'nx': 10, 'ny': 15}
)
class TestPopulationStatistics(unittest.TestCase):
def setUp(self):
self.decay = 0.9
self.size = 3
self.link = links.BatchNormalization(self.size, self.decay, self.eps)
self.x = numpy.random.uniform(
-1, 1, (self.nx, self.size)).astype(numpy.float32)
self.y = numpy.random.uniform(
-1, 1, (self.ny, self.size)).astype(numpy.float32)
def check_statistics(self, x, y):
x = chainer.Variable(x)
self.link(x, finetune=True)
mean = self.x.mean(axis=0)
testing.assert_allclose(mean, self.link.avg_mean)
unbiased_var = self.x.var(axis=0) * self.nx / (self.nx - 1)
testing.assert_allclose(unbiased_var, self.link.avg_var)
y = chainer.Variable(y)
with chainer.using_config('train', False):
self.link(y, finetune=True)
testing.assert_allclose(mean, self.link.avg_mean)
testing.assert_allclose(unbiased_var, self.link.avg_var)
def test_statistics_cpu(self):
self.check_statistics(self.x, self.y)
@attr.gpu
def test_statistics_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
self.check_statistics(cuda.to_gpu(self.x), cuda.to_gpu(self.y))
@attr.cudnn
def test_statistics_gpu_without_cudnn(self):
with chainer.using_config('use_cudnn', 'never'):
self.test_statistics_gpu()
def check_statistics2(self, x, y):
x = chainer.Variable(x)
y = chainer.Variable(y)
self.link(x, finetune=True)
self.link(y, finetune=True)
mean = (self.x.sum(axis=0) + self.y.sum(axis=0)) / (self.nx + self.ny)
var = (self.x.var(axis=0) * self.nx +
self.y.var(axis=0) * self.ny) / (self.nx + self.ny)
# TODO(Kenta Oono)
# Fix the estimate of the unbiased variance.
# Unbiased variance should be (nx + ny) / (nx + ny - 1) times of
# the variance.
# But the multiplier is ny / (ny - 1) in current implementation
# these two values are different when nx is not equal to ny.
unbiased_var = var * self.ny / (self.ny - 1)
testing.assert_allclose(mean, self.link.avg_mean)
testing.assert_allclose(unbiased_var, self.link.avg_var)
def test_statistics2_cpu(self):
self.check_statistics2(self.x, self.y)
@attr.gpu
def test_statistics2_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
self.check_statistics2(
cuda.to_gpu(self.x),
cuda.to_gpu(self.y))
@attr.cudnn
def test_statistics2_gpu_without_cudnn(self):
with chainer.using_config('use_cudnn', 'never'):
self.test_statistics2_gpu()
# TODO(hvy): Rewrite this test using testing.LinkTestCase.
@testing.parameterize(*testing.product({
'test': [True, False],
'ndim': [0, 1, 2, 3],
}))
class BatchNormalizationTestWithoutGammaAndBeta(unittest.TestCase):
def setUp(self):
self.link = links.BatchNormalization(
3, use_gamma=False, use_beta=False)
if self.test:
mean = numpy.random.uniform(-1, 1, (3,)).astype(numpy.float32)
self.link.avg_mean[...] = mean
var = numpy.random.uniform(0.5, 1, (3,)).astype(numpy.float32)
self.link.avg_var[...] = var
self.link.cleargrads()
shape = (7, 3) + (2,) * self.ndim
self.x = numpy.random.uniform(-1, 1, shape).astype(numpy.float32)
self.gy = numpy.random.uniform(-1, 1, shape).astype(numpy.float32)
expander = (None, Ellipsis) + (None,) * self.ndim
gamma = numpy.ones((3,), dtype=numpy.float32)[expander]
beta = numpy.zeros((3,), dtype=numpy.float32)[expander]
if self.test:
mean = self.link.avg_mean
var = self.link.avg_var
else:
aggr_axes = (0,) + tuple(six.moves.range(2, self.ndim + 2))
mean = self.x.mean(axis=aggr_axes)
var = self.x.var(axis=aggr_axes)
self.y_expected = _batch_normalization(
expander, gamma, beta, self.x, mean, var, self.link.eps, self.test)
def test_no_gamma_and_beta(self):
assert self.link.gamma is None
assert self.link.beta is None
def check_forward(self, x_data):
x = chainer.Variable(x_data)
with chainer.using_config('train', not self.test):
y = self.link(x)
testing.assert_allclose(self.y_expected, y.data)
def test_forward_cpu(self):
self.check_forward(self.x)
@attr.gpu
def test_forward_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
x = cuda.to_gpu(self.x)
self.check_forward(x)
@attr.multi_gpu(2)
def test_forward_gpu_multi(self):
with cuda.get_device_from_id(0):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
x = cuda.to_gpu(self.x)
with cuda.get_device_from_id(1):
self.check_forward(x)
@attr.cudnn
def test_forward_gpu_without_cudnn(self):
with chainer.using_config('use_cudnn', 'never'):
self.test_forward_gpu()
def check_backward(self, x_data, y_grad):
gradient_check.check_backward(self.link, x_data, y_grad,
eps=1e-2, rtol=1e-3, atol=1e-4)
@condition.retry(3)
def test_backward_cpu(self):
self.check_backward(self.x, self.gy)
@attr.gpu
@condition.retry(3)
def test_backward_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
x = cuda.to_gpu(self.x)
gy = cuda.to_gpu(self.gy)
self.check_backward(x, gy)
@attr.cudnn
def test_backward_gpu_without_cudnn(self):
with chainer.using_config('use_cudnn', 'never'):
self.test_backward_gpu()
def _generate_uniform(low, high, shape, dtype=numpy.float32):
return numpy.random.uniform(low, high, shape).astype(dtype)
@testing.parameterize(*testing.product({
'size': [3, (2, 3)],
}))
class TestInitialize(unittest.TestCase):
def setUp(self):
self.decay = 0.9
self.initial_gamma = _generate_uniform(-1, 1, self.size)
self.initial_beta = _generate_uniform(-1, 1, self.size)
self.initial_avg_mean = _generate_uniform(-1, 1, self.size)
self.initial_avg_var = _generate_uniform(-1, 1, self.size)
self.link = links.BatchNormalization(
self.size, self.decay,
initial_gamma=self.initial_gamma,
initial_beta=self.initial_beta,
initial_avg_mean=self.initial_avg_mean,
initial_avg_var=self.initial_avg_var,
)
@condition.retry(3)
def test_initialize_cpu(self):
testing.assert_allclose(self.initial_gamma, self.link.gamma.data)
testing.assert_allclose(self.initial_beta, self.link.beta.data)
testing.assert_allclose(self.initial_avg_mean, self.link.avg_mean)
testing.assert_allclose(self.initial_avg_var, self.link.avg_var)
@attr.gpu
@condition.retry(3)
def test_initialize_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
testing.assert_allclose(self.initial_gamma, self.link.gamma.data)
testing.assert_allclose(self.initial_beta, self.link.beta.data)
testing.assert_allclose(self.initial_avg_mean, self.link.avg_mean)
testing.assert_allclose(self.initial_avg_var, self.link.avg_var)
@testing.parameterize(*testing.product({
'dtype': [numpy.float32, numpy.float16, chainer.mixed16],
}))
class TestDefaultInitializer(unittest.TestCase):
def setUp(self):
self.decay = 0.9
self.size = 3
with chainer.using_config('dtype', self.dtype):
self.link = links.BatchNormalization(self.size, self.decay)
dtype = numpy.float32 if self.dtype == chainer.mixed16 else self.dtype
assert self.link.beta.dtype == dtype
assert self.link.gamma.dtype == dtype
assert self.link.avg_mean.dtype == dtype
assert self.link.avg_var.dtype == dtype
self.x = numpy.arange(6, dtype=self.dtype).reshape(2, 3)
def check_initialize(self):
testing.assert_allclose(numpy.ones(self.size), self.link.gamma.array)
testing.assert_allclose(numpy.zeros(self.size), self.link.beta.array)
testing.assert_allclose(0, self.link.avg_mean)
testing.assert_allclose(1, self.link.avg_var)
y = self.link(self.x)
assert y.dtype == self.x.dtype
def test_initialize_cpu(self):
self.check_initialize()
@attr.gpu
def test_initialize_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
self.x = cuda.to_gpu(self.x)
self.check_initialize()
@testing.parameterize(*testing.product({
'shape': [(2, 4), (2, 5, 3, 4)],
}))
class TestInvalidInput(unittest.TestCase):
def setUp(self):
self.link = links.BatchNormalization(3)
def test_invalid_shape_cpu(self):
with self.assertRaises(type_check.InvalidType):
self.link(chainer.Variable(numpy.zeros(self.shape, dtype='f')))
@attr.gpu
def test_invalid_shape_gpu(self):
with testing.assert_warns(DeprecationWarning):
self.link.to_gpu()
with self.assertRaises(type_check.InvalidType):
self.link(chainer.Variable(cuda.cupy.zeros(self.shape, dtype='f')))
class TestInvalidInitialize(unittest.TestCase):
def test_invalid_type(self):
with self.assertRaises(TypeError):
self.link = links.BatchNormalization({})
class TestInvalidArgument(unittest.TestCase):
def setUp(self):
self.link = links.BatchNormalization(1)
self.x = numpy.random.uniform(-1, 1, (3,)).astype('f')
def test_test_argument(self):
with self.assertRaises(ValueError):
self.link(self.x, test=True)
def test_positional_argument(self):
# positional argument is prohibited from v2
with self.assertRaises(TypeError):
self.link(self.x, True)
def test_redundant_argument(self):
with self.assertRaises(TypeError):
self.link(self.x, unknown_argument=1)
@testing.parameterize(
{'shape': (5, 4, 3, 2), 'axis': (0, 2, 3)},
{'shape': (5, 4), 'axis': 0},
{'shape': (5, 4, 3), 'axis': (0, 1)},
)
class TestChannalSizeInference(unittest.TestCase):
def setUp(self):
self.x = numpy.random.randn(*self.shape).astype('f')
axis = self.axis
if isinstance(axis, int):
axis = (axis,)
self.expected_size = tuple(
n
for i, n in enumerate(self.shape)
if i not in axis
)
def test_no_inference(self):
bn = links.BatchNormalization(self.expected_size)
assert bn.avg_mean is not None
assert bn.avg_var is not None
def test_inference_cpu(self):
bn = links.BatchNormalization(axis=self.axis)
bn(self.x)
assert bn.beta.shape == self.expected_size
assert bn.gamma.shape == self.expected_size
assert bn.avg_mean.shape == self.expected_size
assert bn.avg_var.shape == self.expected_size
@attr.gpu
def test_inference_gpu(self):
bn = links.BatchNormalization(axis=self.axis)
with testing.assert_warns(DeprecationWarning):
bn.to_gpu()
bn(cuda.to_gpu(self.x))
assert isinstance(bn.beta.data, cuda.cupy.ndarray)
assert isinstance(bn.gamma.data, cuda.cupy.ndarray)
assert isinstance(bn.avg_mean, cuda.cupy.ndarray)
assert isinstance(bn.avg_var, cuda.cupy.ndarray)
assert bn.beta.shape == self.expected_size
assert bn.gamma.shape == self.expected_size
assert bn.avg_mean.shape == self.expected_size
assert bn.avg_var.shape == self.expected_size
def test_no_gamma(self):
bn = links.BatchNormalization(axis=self.axis, use_gamma=False)
assert bn.gamma is None
bn(self.x)
assert bn.gamma is None
def test_no_beta(self):
bn = links.BatchNormalization(axis=self.axis, use_beta=False)
assert bn.beta is None
bn(self.x)
assert bn.beta is None
class TestFailChannalSizeInference(unittest.TestCase):
def test_fail_inference(self):
with self.assertRaises(RuntimeError):
links.BatchNormalization()
@attr.multi_gpu(2)
class TestLazyInitializationWithNonZeroCurrentCudaDevice(unittest.TestCase):
def test_lazy_initialization_with_non_zero_current_cuda_device(self):
# Create a lazily initialized BatchNormalization link.
bn = links.BatchNormalization(axis=(0, 2, 3))
assert bn.xp is numpy
device = backend.GpuDevice.from_device_id(1)
bn.to_device(device)
assert bn.xp is cuda.cupy
assert bn.device == device
assert bn.beta.device == device
assert bn.gamma.device == device
assert bn.avg_mean is None
assert bn.avg_var is None
x = numpy.random.randn(5, 4, 3, 2).astype(numpy.float32)
x = device.send(x)
# All parameters and persistent values should correctly be initialized
# on device 1, and not device 0, meaning forward pass should not raise
# any errors.
bn(x)
assert bn.xp is cuda.cupy
assert bn.device == device
assert bn.beta.device == device
assert bn.gamma.device == device
assert bn.avg_mean is not None
assert bn.avg_var is not None
assert backend.GpuDevice.from_array(bn.avg_mean) == device
assert backend.GpuDevice.from_array(bn.avg_var) == device
@testing.parameterize(*testing.product({
'x_shape,bn_kwargs': [
((4, 3), {'axis': (0,)}),
((4, 3), {'size': (3,)}),
],
}))
class TestSerialize(unittest.TestCase):
def create_link(self):
return links.BatchNormalization(**self.bn_kwargs)
def train_link(self, bn):
x = numpy.random.rand(*self.x_shape).astype(numpy.float32)
bn(x)
x = numpy.random.rand(*self.x_shape).astype(numpy.float32)
bn(x, finetune=True)
# has non-trivial values to be stored
assert bn.avg_mean is not None
assert bn.N == 1
def create_serializer_pair(self):
target = {}
return (
chainer.serializers.DictionarySerializer(target),
chainer.serializers.NpzDeserializer(target),
)
def test_serialize(self):
ser, de = self.create_serializer_pair()
link1 = self.create_link()
self.train_link(link1)
link1.serialize(ser)
link2 = self.create_link()
link2.serialize(de)
testing.assert_allclose(link2.avg_mean, link1.avg_mean)
testing.assert_allclose(link2.avg_var, link1.avg_var)
testing.assert_allclose(link2.beta.array, link1.beta.array)
testing.assert_allclose(link2.gamma.array, link1.gamma.array)
assert link2.N == link1.N
@testing.inject_backend_tests(
[
'test_param_layout_to_device',
'test_forward',
],
# CPU tests
[{}]
# GPU tests
+ testing.product({
'use_cuda': [True],
'use_cudnn': ['never', 'always'],
}))
class TestBatchNormalizationMemoryLayouts(unittest.TestCase):
batch = 2
channels = 3
height = 13
width = 11
axis = None
dtype = numpy.float32
def create_link(self):
channel_dims = (self.channels,)
link = links.BatchNormalization(
channel_dims,
axis=self.axis)
return link
def create_input_array(self, xp):
x_shape = (self.batch, self.height, self.width, self.channels)
x = xp.ones(x_shape, self.dtype)
return x
def test_param_layout(self):
with chainer.using_config('compute_mode', 'cudnn_fast'):
link = self.create_link()
assert link.gamma.layout is None
assert link.beta.layout is None
def test_param_layout_to_device(self, backend_config):
with chainer.using_config('compute_mode', 'cudnn_fast'):
link = self.create_link()
assert link.gamma.device == chainer.get_device('@numpy')
assert link.beta.device == chainer.get_device('@numpy')
link.to_device(backend_config.device)
assert link.gamma.device == backend_config.device
assert link.beta.device == backend_config.device
assert link.gamma.layout is None
assert link.beta.layout is None
def test_forward(self, backend_config):
with chainer.using_config('compute_mode', 'cudnn_fast'):
link = self.create_link()
link.to_device(backend_config.device)
x = self.create_input_array(backend_config.xp)
x = chainer.Variable(x, layout=memory_layouts.CUDNN_CHANNEL_LAST_X)
x.to_device(backend_config.device)
with backend_config:
y = link(x)
assert link.gamma.device == backend_config.device
assert link.beta.device == backend_config.device
assert y.layout == memory_layouts.CUDNN_CHANNEL_LAST_X
assert y.shape == (
self.batch,
self.channels,
self.height,
self.width)
testing.run_module(__name__, __file__)
| {
"content_hash": "6a1c017feef8e81ec5ff175360235fcd",
"timestamp": "",
"source": "github",
"line_count": 774,
"max_line_length": 79,
"avg_line_length": 33.622739018087856,
"alnum_prop": 0.6077851214263756,
"repo_name": "pfnet/chainer",
"id": "b4bf70ae5ec5320ba58409c9a01267828e3102db",
"size": "26024",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/chainer_tests/links_tests/normalization_tests/test_batch_normalization.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3366"
},
{
"name": "PowerShell",
"bytes": "7195"
},
{
"name": "Python",
"bytes": "2564338"
}
],
"symlink_target": ""
} |
package guiobjects
import gamelogic.{Card, GameEvents}
import graphics.CardGraphics
import gui._
/**
* A small Frame put at the BottomLeft of the screen that displays the Trump for the Deal.
*/
object TrumpFrame extends Frame(UIParent) {
private val cardWidth: Double = 100
setPoint(BottomLeft)
setWidth(cardWidth * 1.1)
setHeight(width / 500 * 726)
private val border = createTexture()
border.setAllPoints()
border.setVertexColor(198 / 255.0, 195 / 255.0, 214 / 255.0)
border.setMode(LineMode)
border.lineWidth = 5
private val title = createFontString()
title.setPoint(Bottom, this, Top)
title.setWidth(width)
title.setHeight(25)
title.setText("Trump:")
title.setTextColor(198 / 255.0, 195 / 255.0, 214 / 255.0)
title.setJustifyH(JustifyLeft)
private val cardImage = createTexture()
cardImage.setPoint(Center)
cardImage.setSize(cardWidth, cardWidth / 500 * 726)
private var cardGraphics: Option[CardGraphics] = None
def setTrumpCard(card: Card): Unit = {
cardGraphics = Some(new CardGraphics(card))
cardGraphics.get.setCenter(center._1, center._2)
cardGraphics.get.setWidth(cardWidth)
cardGraphics.get.setHeight(cardWidth / 500 * 726)
cardImage.setTexture(Some(cardGraphics.get.image))
}
def underMouse(x: Double, y: Double): Option[CardGraphics] = cardGraphics match {
case Some(card) if card.isMouseOver(x, y) => Some(card)
case _ => None
}
registerEvent(GameEvents.onChooseTrump)((_: Frame, card: Card) => {setTrumpCard(card)})
}
| {
"content_hash": "ec8d4a2697092ab10fed4fbc050e58b5",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 90,
"avg_line_length": 29.79245283018868,
"alnum_prop": 0.694743508549715,
"repo_name": "sherpal/oh-hell-card-game",
"id": "cc8575d66b3d1897b1e416f61e8153409031b23f",
"size": "1579",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "gameplaying/src/main/scala/guiobjects/TrumpFrame.scala",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "21617"
},
{
"name": "JavaScript",
"bytes": "391"
},
{
"name": "Scala",
"bytes": "191524"
}
],
"symlink_target": ""
} |
import mock
import pytest
from future.moves.urllib.parse import quote
from django.utils import timezone
from django.core.exceptions import MultipleObjectsReturned
from osf.models import Guid, NodeLicenseRecord, OSFUser
from osf_tests.factories import AuthUserFactory, UserFactory, NodeFactory, NodeLicenseRecordFactory, \
RegistrationFactory, PreprintFactory, PreprintProviderFactory
from osf.utils.permissions import ADMIN
from tests.base import OsfTestCase
from tests.test_websitefiles import TestFile
from website.settings import MFR_SERVER_URL, WATERBUTLER_URL
@pytest.mark.django_db
class TestGuid:
def test_long_id_gets_generated_on_creation(self):
obj = NodeLicenseRecordFactory()
assert obj._id
assert len(obj._id) > 5
def test_loading_by_object_id(self):
obj = NodeLicenseRecordFactory()
assert NodeLicenseRecord.load(obj._id) == obj
def test_loading_by_short_guid(self):
obj = UserFactory()
assert OSFUser.load(obj._id) == obj
@pytest.mark.parametrize('Factory',
[
UserFactory,
NodeFactory,
RegistrationFactory,
])
def test_short_guid_gets_generated_on_creation(self, Factory):
obj = Factory()
assert obj._id
assert len(obj._id) == 5
@pytest.mark.django_db
class TestReferent:
@pytest.mark.parametrize('Factory',
[
UserFactory,
NodeFactory
])
def test_referent(self, Factory):
obj = Factory()
guid = Guid.objects.get(_id=obj._id)
assert guid.referent == obj
@pytest.mark.parametrize('Factory',
[
UserFactory,
NodeFactory
])
def test_referent_can_be_set(self, Factory):
obj = Factory()
obj1 = Factory()
guid = Guid.load(obj._id)
assert guid.referent == obj # sanity check
guid.referent = obj1
assert guid.referent == obj1
@pytest.mark.skip('I don\'t actually think we do this anywhere')
def test_swapping_guids(self):
user = UserFactory()
node = NodeFactory()
user_guid = user.guids[0]
node_guid = node.guids[0]
user._id = node_guid._id
node._id = user_guid._id
assert node_guid._id == user._id
assert user_guid._id == node._id
def test_id_matches(self):
user = UserFactory()
guid = Guid.objects.get(_id=user._id)
assert user._id == guid._id
@pytest.mark.skip('I don\'t actually think we do this anywhere')
@pytest.mark.parametrize('Factory',
[
UserFactory,
NodeFactory
])
def test_nulling_out_guid(self, Factory):
obj = Factory()
guid = Guid.load(obj._id)
obj.guid = None
obj.save()
obj.refresh_from_db()
# queryset cache returns the old version
guid.refresh_from_db()
assert obj.guid != guid
assert guid.guid != obj.guid.guid
@pytest.mark.parametrize('Factory',
[
UserFactory,
NodeFactory,
])
def test_querying_with_multiple_guids(self, Factory):
obj = Factory()
guids = [obj.guids.first()]
for i in range(0, 16):
guids.append(Guid.objects.create(referent=obj))
try:
Factory._meta.model.objects.get(id=obj.id)
except MultipleObjectsReturned as ex:
pytest.fail('Multiple objects returned for {} with multiple guids. {}'.format(Factory._meta.model, ex))
@pytest.mark.enable_bookmark_creation
class TestResolveGuid(OsfTestCase):
def setUp(self):
super(TestResolveGuid, self).setUp()
self.node = NodeFactory()
def test_resolve_guid(self):
res_guid = self.app.get(self.node.web_url_for('node_setting', _guid=True), auth=self.node.creator.auth)
res_full = self.app.get(self.node.web_url_for('node_setting'), auth=self.node.creator.auth)
assert res_guid.text == res_full.text
def test_resolve_guid_no_referent(self):
guid = Guid.load(self.node._id)
guid.referent = None
guid.save()
res = self.app.get(
self.node.web_url_for('node_setting', _guid=True),
auth=self.node.creator.auth,
expect_errors=True,
)
assert res.status_code == 404
@mock.patch('osf.models.node.Node.deep_url', None)
def test_resolve_guid_no_url(self):
res = self.app.get(
self.node.web_url_for('node_setting', _guid=True),
auth=self.node.creator.auth,
expect_errors=True,
)
assert res.status_code == 404
def test_resolve_guid_no_auth_redirect_to_cas_includes_public(self):
"""
Unauthenticated users are sent to login when visiting private projects, but not if the projects are public.
"""
res = self.app.get(
self.node.web_url_for('resolve_guid', guid=self.node._id),
expect_errors=True,
)
assert res.status_code == 302
assert '/login?service=' in res.location
self.node.is_public = True
self.node.save()
res = self.app.get(
self.node.web_url_for('resolve_guid', guid=self.node._id),
expect_errors=True,
)
assert res.status_code == 200
def test_resolve_guid_no_auth_redirect_to_cas_includes_public_with_url_segments(self):
"""
Unauthenticated users are sent to login when visiting private projects related URLs, but not if the projects are
public
"""
for segment in ('comments', 'links', 'components', 'files', 'files/osfstorage', 'files/addon'):
self.node.is_public = False
self.node.save()
res = self.app.get(
f'{self.node.web_url_for("resolve_guid", guid=self.node._id)}/{segment}/',
expect_errors=True,
)
assert res.status_code == 302
assert '/login?service=' in res.location
self.node.is_public = True
self.node.save()
res = self.app.get(
f'{self.node.web_url_for("resolve_guid", guid=self.node._id)}/{segment}/',
expect_errors=True,
)
assert res.status_code == 200
def test_resolve_guid_private_request_access_or_redirect_to_cas(self):
"""
Authenticated users are sent to the request access page when it is set to true on the node, otherwise they get a
legacy Forbidden page.
"""
non_contrib = AuthUserFactory()
self.node.access_requests_enabled = False
self.node.save()
res = self.app.get(
self.node.web_url_for('resolve_guid', guid=self.node._id),
auth=non_contrib.auth,
expect_errors=True,
)
assert '<title>OSF | Forbidden</title>' in res.body.decode()
assert res.status_code == 403
self.node.access_requests_enabled = True
self.node.save()
res = self.app.get(
self.node.web_url_for('resolve_guid', guid=self.node._id),
auth=non_contrib.auth,
expect_errors=True,
)
assert res.status_code == 403
assert '<title>OSF | Request Access</title>' in res.body.decode()
def test_resolve_guid_download_file(self):
pp = PreprintFactory(finish=True)
res = self.app.get(pp.url + 'download')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get(pp.url + 'download/')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get('/{}/download'.format(pp.primary_file.get_guid(create=True)._id))
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
pp.primary_file.create_version(
creator=pp.creator,
location={u'folder': u'osf', u'object': u'deadbe', u'service': u'cloud'},
metadata={u'contentType': u'img/png', u'size': 9001}
)
pp.primary_file.save()
res = self.app.get(pp.url + 'download/')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=2'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get(pp.url + 'download/?version=1')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?version=1&action=download&direct'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
unpub_pp = PreprintFactory(project=self.node, is_published=False)
res = self.app.get(unpub_pp.url + 'download/?version=1', auth=unpub_pp.creator.auth)
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?version=1&action=download&direct'.format(WATERBUTLER_URL, unpub_pp._id, unpub_pp.primary_file.provider, unpub_pp.primary_file.path) in res.location
@mock.patch('website.settings.USE_EXTERNAL_EMBER', True)
@mock.patch('website.settings.EXTERNAL_EMBER_APPS', {
'preprints': {
'server': 'http://localhost:4200',
'path': '/preprints/'
},
})
def test_resolve_guid_download_file_from_emberapp_preprints(self):
provider = PreprintProviderFactory(_id='sockarxiv', name='Sockarxiv')
pp = PreprintFactory(finish=True, provider=provider)
assert pp.url.startswith('/preprints/sockarxiv')
res = self.app.get(pp.url + 'download')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get(pp.url + 'download/')
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
@mock.patch('website.settings.USE_EXTERNAL_EMBER', True)
@mock.patch('website.settings.EXTERNAL_EMBER_APPS', {
'preprints': {
'server': 'http://localhost:4200',
'path': '/preprints/'
},
})
def test_resolve_guid_download_file_from_emberapp_preprints_unpublished(self):
# non-branded domains
provider = PreprintProviderFactory(_id='sockarxiv', name='Sockarxiv', reviews_workflow='pre-moderation')
# branded domains
branded_provider = PreprintProviderFactory(_id='spot', name='Spotarxiv', reviews_workflow='pre-moderation')
branded_provider.allow_submissions = False
branded_provider.domain = 'https://www.spotarxiv.com'
branded_provider.description = 'spots not dots'
branded_provider.domain_redirect_enabled = True
branded_provider.share_publish_type = 'Thesis'
branded_provider.save()
# test_provider_submitter_can_download_unpublished
submitter = AuthUserFactory()
pp = PreprintFactory(finish=True, provider=provider, is_published=False, creator=submitter)
pp.run_submit(submitter)
pp_branded = PreprintFactory(finish=True, provider=branded_provider, is_published=False, filename='preprint_file_two.txt', creator=submitter)
pp_branded.run_submit(submitter)
res = self.app.get('{}download'.format(pp.url), auth=submitter.auth)
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get('{}download'.format(pp_branded.url), auth=submitter.auth)
assert res.status_code == 302
# test_provider_super_user_can_download_unpublished
super_user = AuthUserFactory()
super_user.is_superuser = True
super_user.save()
res = self.app.get('{}download'.format(pp.url), auth=super_user.auth)
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get('{}download'.format(pp_branded.url), auth=super_user.auth)
assert res.status_code == 302
# test_provider_moderator_can_download_unpublished
moderator = AuthUserFactory()
provider.add_to_group(moderator, 'moderator')
provider.save()
res = self.app.get('{}download'.format(pp.url), auth=moderator.auth)
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
branded_provider.add_to_group(moderator, 'moderator')
branded_provider.save()
res = self.app.get('{}download'.format(pp_branded.url), auth=moderator.auth)
assert res.status_code == 302
# test_provider_admin_can_download_unpublished
admin = AuthUserFactory()
provider.add_to_group(admin, ADMIN)
provider.save()
res = self.app.get('{}download'.format(pp.url), auth=admin.auth)
assert res.status_code == 302
assert '{}/v1/resources/{}/providers/{}{}?action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
branded_provider.add_to_group(admin, ADMIN)
branded_provider.save()
res = self.app.get('{}download'.format(pp_branded.url), auth=admin.auth)
assert res.status_code == 302
def test_resolve_guid_download_file_export(self):
pp = PreprintFactory(finish=True)
res = self.app.get(pp.url + 'download?format=asdf')
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3Fformat%3Dasdf%26action%3Ddownload%26direct%26version%3D1'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get(pp.url + 'download/?format=asdf')
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3Fformat%3Dasdf%26action%3Ddownload%26direct%26version%3D1'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get('/{}/download?format=asdf'.format(pp.primary_file.get_guid(create=True)._id))
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3Fformat%3Dasdf%26action%3Ddownload%26direct%26version%3D1'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
res = self.app.get('/{}/download/?format=asdf'.format(pp.primary_file.get_guid(create=True)._id))
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3Fformat%3Dasdf%26action%3Ddownload%26direct%26version%3D1'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
pp.primary_file.create_version(
creator=pp.creator,
location={u'folder': u'osf', u'object': u'deadbe', u'service': u'cloud'},
metadata={u'contentType': u'img/png', u'size': 9001}
)
pp.primary_file.save()
res = self.app.get(pp.url + 'download/?format=asdf')
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3F'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
quarams = res.location.split('%3F')[1].split('%26')
assert 'action%3Ddownload' in quarams
assert 'version%3D2' in quarams
assert 'direct' in quarams
res = self.app.get(pp.url + 'download/?format=asdf&version=1')
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3F'.format(quote(WATERBUTLER_URL), pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
quarams = res.location.split('%3F')[1].split('%26')
assert 'action%3Ddownload' in quarams
assert 'version%3D1' in quarams
assert 'direct' in quarams
unpub_pp = PreprintFactory(project=self.node, is_published=False)
res = self.app.get(unpub_pp.url + 'download?format=asdf', auth=unpub_pp.creator.auth)
assert res.status_code == 302
assert res.status_code == 302
assert '{}/export?format=asdf&url='.format(MFR_SERVER_URL) in res.location
assert '{}/v1/resources/{}/providers/{}{}%3F'.format(quote(WATERBUTLER_URL), unpub_pp._id, unpub_pp.primary_file.provider, unpub_pp.primary_file.path) in res.location
quarams = res.location.split('%3F')[1].split('%26')
assert 'action%3Ddownload' in quarams
assert 'version%3D1' in quarams
assert 'direct' in quarams
def test_resolve_guid_download_file_export_same_format_optimization(self):
pp = PreprintFactory(filename='test.pdf', finish=True)
res = self.app.get(pp.url + 'download/?format=pdf')
assert res.status_code == 302
assert '{}/export?'.format(MFR_SERVER_URL) not in res.location
assert '{}/v1/resources/{}/providers/{}{}?format=pdf&action=download&direct&version=1'.format(WATERBUTLER_URL, pp._id, pp.primary_file.provider, pp.primary_file.path) in res.location
def test_resolve_guid_download_errors(self):
testfile = TestFile.get_or_create(self.node, 'folder/path')
testfile.name = 'asdf'
testfile.materialized_path = '/folder/path'
guid = testfile.get_guid(create=True)
testfile.save()
testfile.delete()
res = self.app.get('/{}/download'.format(guid), expect_errors=True)
assert res.status_code == 404
pp = PreprintFactory(is_published=False)
res = self.app.get(pp.url + 'download', expect_errors=True)
assert res.status_code == 404
pp.is_published = True
pp.save()
pp.is_public = False
pp.save()
non_contrib = AuthUserFactory()
res = self.app.get(pp.url + 'download', auth=non_contrib.auth, expect_errors=True)
assert res.status_code == 403
pp.deleted = timezone.now()
pp.save()
res = self.app.get(pp.url + 'download', auth=non_contrib.auth, expect_errors=True)
assert res.status_code == 410
| {
"content_hash": "cb5ecb089e7d80ed9906f4f305dddc81",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 212,
"avg_line_length": 42.23644251626898,
"alnum_prop": 0.6343279749370859,
"repo_name": "aaxelb/osf.io",
"id": "d3b5d9bd87a8636745bd21225f0db7296d09ce1e",
"size": "19471",
"binary": false,
"copies": "5",
"ref": "refs/heads/feature/keen-replacement",
"path": "osf_tests/test_guid.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "93635"
},
{
"name": "Dockerfile",
"bytes": "5876"
},
{
"name": "HTML",
"bytes": "373758"
},
{
"name": "JavaScript",
"bytes": "1596130"
},
{
"name": "Jupyter Notebook",
"bytes": "41326"
},
{
"name": "Mako",
"bytes": "679193"
},
{
"name": "Python",
"bytes": "12036193"
},
{
"name": "Shell",
"bytes": "2841"
},
{
"name": "VCL",
"bytes": "13885"
}
],
"symlink_target": ""
} |
package r
import (
"fmt"
"reflect"
"strings"
"sync"
"time"
)
var (
typeCache = make(map[reflect.Value]map[string]int)
typeLock sync.RWMutex
)
// Resolves the value of field within data
func ResolveField(data interface{}, field string) (value interface{}, exists bool) {
switch typed := data.(type) {
case map[string]string:
value, exists = typed[field]
return
case map[string]interface{}:
value, exists = typed[field]
return
case map[string]int:
value, exists = typed[field]
return
case map[string]bool:
value, exists = typed[field]
return
case map[string]float64:
value, exists = typed[field]
return
case map[string]byte:
value, exists = typed[field]
return
case map[string][]byte:
value, exists = typed[field]
return
}
v := reflect.ValueOf(data)
switch v.Kind() {
case reflect.Map:
value := v.MapIndex(reflect.ValueOf(field))
if value.IsValid() {
return value.Interface(), true
}
return nil, false
case reflect.Struct:
return resolveStruct(v, field)
case reflect.Ptr:
v = reflect.Indirect(v)
if v.Kind() != reflect.Struct {
return nil, false
}
return resolveStruct(v, field)
default:
return nil, true
}
}
// This is necessary in the case where the value references a struct directly:
// template := "{{ user }}""
// data := map[string]interface{}{"user": &User{"Leto"}},
// Without this step, the above would result in a value which points to the User
// we need to resolve this a step further and get the value of "User" (which
// will either me the output of its String() method, or %v)
//
// Of course, we only want this final resolution once we need the value. If we
// call this too early, say in Resolve above, we won't be able to build nested
// paths
func ResolveFinal(value interface{}) interface{} {
if _, ok := value.(time.Time); ok {
return value
}
kind := reflect.ValueOf(value).Kind()
if kind == reflect.Ptr || kind == reflect.Struct {
return resolvePtrOrStruct(value)
}
return value
}
func resolvePtrOrStruct(value interface{}) interface{} {
if s, ok := value.(fmt.Stringer); ok {
return s.String()
}
return ToBytes(value)
}
func resolveStruct(value reflect.Value, field string) (interface{}, bool) {
typeLock.RLock()
typeData, exists := typeCache[value]
typeLock.RUnlock()
if exists == false {
typeData = buildTypeData(value)
}
if index, exists := typeData[field]; exists {
return value.Field(index).Interface(), true
}
return nil, false
}
func buildTypeData(value reflect.Value) map[string]int {
t := value.Type()
fieldCount := t.NumField()
typeData := make(map[string]int, fieldCount)
for i := 0; i < fieldCount; i++ {
typeData[strings.ToLower(t.Field(i).Name)] = i
}
typeLock.Lock()
defer typeLock.Unlock()
if typeData, exists := typeCache[value]; exists {
return typeData
}
typeCache[value] = typeData
return typeData
}
//gets the length of string, map or array
func ToLength(input interface{}) (int, bool) {
if s, ok := input.(string); ok {
return len(s), true
}
value := reflect.ValueOf(input)
kind := value.Kind()
if kind == reflect.Array || kind == reflect.Slice || kind == reflect.Map {
return value.Len(), true
}
return 0, false
}
| {
"content_hash": "d5884e66dde0952fc9a47ed62b92b1a9",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 84,
"avg_line_length": 24.082706766917294,
"alnum_prop": 0.6846706212925382,
"repo_name": "jmptrader/gerb",
"id": "8f59e201fed5dc47773a0940d1cc6cf504f11563",
"size": "3203",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "r/resolve.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "82719"
},
{
"name": "Makefile",
"bytes": "36"
}
],
"symlink_target": ""
} |
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;
namespace DD.CBU.Compute.Api.Contracts.Server
{
/// <summary>
/// A new server to deploy
/// </summary>
[GeneratedCode("xsd", "4.0.30319.1")]
[Serializable]
[DebuggerStepThrough]
[DesignerCategory("code")]
[XmlType(AnonymousType = true, Namespace = XmlNamespaceConstants.Server)]
[XmlRoot(Namespace = XmlNamespaceConstants.Server, IsNullable = false, ElementName = "Server")]
public class NewServerToDeploy
{
/// <remarks/>
public string name;
/// <remarks/>
public string description;
/// <remarks/>
public string vlanResourcePath;
/// <remarks/>
public string imageResourcePath;
/// <remarks/>
public string administratorPassword;
/// <remarks/>
public bool isStarted;
}
} | {
"content_hash": "44dc8f16d231a16c516a0aae68b5ac5d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 99,
"avg_line_length": 25.157894736842106,
"alnum_prop": 0.6380753138075314,
"repo_name": "shai-guy/CaaS_PS",
"id": "2e0a43fd66349621d3b446ad57f4eca96b2dd883",
"size": "956",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "ComputeClient/Compute.Contracts/Server/NewServerToDeploy.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "490378"
}
],
"symlink_target": ""
} |
include ../../../Make.inc
TARG=os/signal
GOFILES=\
signal.go\
include ../../../Make.pkg
| {
"content_hash": "f4fbfb9b215310efebd24e927bc8bba0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 25,
"avg_line_length": 13,
"alnum_prop": 0.6043956043956044,
"repo_name": "niemeyer/golang",
"id": "26f58760e2b518370e495dba196823ddb62c7345",
"size": "248",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/pkg/os/signal/Makefile",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Assembly",
"bytes": "201537"
},
{
"name": "C",
"bytes": "3752019"
},
{
"name": "C++",
"bytes": "597"
},
{
"name": "D",
"bytes": "13711763"
},
{
"name": "Emacs Lisp",
"bytes": "21395"
},
{
"name": "Go",
"bytes": "11717609"
},
{
"name": "JavaScript",
"bytes": "81714"
},
{
"name": "Perl",
"bytes": "23176"
},
{
"name": "Python",
"bytes": "154466"
},
{
"name": "Shell",
"bytes": "62986"
},
{
"name": "VimL",
"bytes": "20658"
}
],
"symlink_target": ""
} |
<?php
Yii::import('zii.widgets.jui.CJuiInputWidget');
/**
* CJuiDatePicker displays a datepicker.
*
* CJuiDatePicker encapsulates the {@link http://jqueryui.com/demos/datepicker/ JUI
* datepicker} plugin.
*
* To use this widget, you may insert the following code in a view:
* <pre>
* $this->widget('zii.widgets.jui.CJuiDatePicker', array(
* 'name'=>'publishDate',
* // additional javascript options for the date picker plugin
* 'options'=>array(
* 'showAnim'=>'fold',
* ),
* 'htmlOptions'=>array(
* 'style'=>'height:20px;'
* ),
* ));
* </pre>
*
* By configuring the {@link options} property, you may specify the options
* that need to be passed to the JUI datepicker plugin. Please refer to
* the {@link http://jqueryui.com/demos/datepicker/ JUI datepicker} documentation
* for possible options (name-value pairs).
*
* @author Sebastian Thierer <[email protected]>
* @version $Id: CJuiDatePicker.php 3539 2012-01-15 18:55:01Z mdomba $
* @package zii.widgets.jui
* @since 1.1
*/
class CJuiDatePicker extends CJuiInputWidget
{
/**
* @var string the locale ID (eg 'fr', 'de') for the language to be used by the date picker.
* If this property is not set, I18N will not be involved. That is, the date picker will show in English.
* You can force English language by setting the language attribute as '' (empty string)
*/
public $language;
/**
* @var string The i18n Jquery UI script file. It uses scriptUrl property as base url.
*/
public $i18nScriptFile = 'jquery-ui-i18n.min.js';
/**
* @var array The default options called just one time per request. This options will alter every other CJuiDatePicker instance in the page.
* It has to be set at the first call of CJuiDatePicker widget in the request.
*/
public $defaultOptions;
/**
* @var boolean If true, shows the widget as an inline calendar and the input as a hidden field. Use the onSelect event to update the hidden field
*/
public $flat = false;
/**
* Run this widget.
* This method registers necessary javascript and renders the needed HTML code.
*/
public function run()
{
list($name,$id)=$this->resolveNameID();
if(isset($this->htmlOptions['id']))
$id=$this->htmlOptions['id'];
else
$this->htmlOptions['id']=$id;
if(isset($this->htmlOptions['name']))
$name=$this->htmlOptions['name'];
if ($this->flat===false)
{
if($this->hasModel())
echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions);
else
echo CHtml::textField($name,$this->value,$this->htmlOptions);
}
else
{
if($this->hasModel())
{
echo CHtml::activeHiddenField($this->model,$this->attribute,$this->htmlOptions);
$attribute = $this->attribute;
$this->options['defaultDate'] = $this->model->$attribute;
}
else
{
echo CHtml::hiddenField($name,$this->value,$this->htmlOptions);
$this->options['defaultDate'] = $this->value;
}
if (!isset($this->options['onSelect']))
$this->options['onSelect']="js:function( selectedDate ) { jQuery('#{$id}').val(selectedDate);}";
$id = $this->htmlOptions['id'] = $id.'_container';
$this->htmlOptions['name'] = $name.'_container';
echo CHtml::tag('div', $this->htmlOptions, '');
}
$options=CJavaScript::encode($this->options);
$js = "jQuery('#{$id}').datepicker($options);";
if ($this->language!='' && $this->language!='en')
{
$this->registerScriptFile($this->i18nScriptFile);
$js = "jQuery('#{$id}').datepicker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));";
}
$cs = Yii::app()->getClientScript();
if (isset($this->defaultOptions))
{
$this->registerScriptFile($this->i18nScriptFile);
$cs->registerScript(__CLASS__, $this->defaultOptions!==null?'jQuery.datepicker.setDefaults('.CJavaScript::encode($this->defaultOptions).');':'');
}
$cs->registerScript(__CLASS__.'#'.$id, $js);
}
} | {
"content_hash": "06956a2673a37b394716396e61d7136c",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 149,
"avg_line_length": 32.46825396825397,
"alnum_prop": 0.6394524566120753,
"repo_name": "piaoxuedtian/myrepo",
"id": "2dc8d9d6b7617e5386bc917f8f4e332edc47967e",
"size": "4332",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "framework/zii/widgets/jui/CJuiDatePicker.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
namespace content {
AccessibilityNotificationWaiter::AccessibilityNotificationWaiter(
WebContents* web_contents)
: event_to_wait_for_(ui::AX_EVENT_NONE),
loop_runner_(new MessageLoopRunner()),
event_target_id_(0),
event_render_frame_host_(nullptr),
weak_factory_(this) {
frame_host_ = static_cast<RenderFrameHostImpl*>(
web_contents->GetMainFrame());
frame_host_->SetAccessibilityCallbackForTesting(
base::Bind(&AccessibilityNotificationWaiter::OnAccessibilityEvent,
weak_factory_.GetWeakPtr()));
}
AccessibilityNotificationWaiter::AccessibilityNotificationWaiter(
WebContents* web_contents,
AccessibilityMode accessibility_mode,
ui::AXEvent event_type)
: event_to_wait_for_(event_type),
loop_runner_(new MessageLoopRunner()),
event_target_id_(0),
weak_factory_(this) {
WebContentsImpl* web_contents_impl = static_cast<WebContentsImpl*>(
web_contents);
frame_host_ = static_cast<RenderFrameHostImpl*>(
web_contents_impl->GetMainFrame());
frame_host_->SetAccessibilityCallbackForTesting(
base::Bind(&AccessibilityNotificationWaiter::OnAccessibilityEvent,
weak_factory_.GetWeakPtr()));
web_contents_impl->AddAccessibilityMode(accessibility_mode);
}
AccessibilityNotificationWaiter::AccessibilityNotificationWaiter(
RenderFrameHostImpl* frame_host,
ui::AXEvent event_type)
: frame_host_(frame_host),
event_to_wait_for_(event_type),
loop_runner_(new MessageLoopRunner()),
event_target_id_(0),
weak_factory_(this) {
frame_host_->SetAccessibilityCallbackForTesting(
base::Bind(&AccessibilityNotificationWaiter::OnAccessibilityEvent,
weak_factory_.GetWeakPtr()));
}
AccessibilityNotificationWaiter::~AccessibilityNotificationWaiter() {
}
void AccessibilityNotificationWaiter::ListenToAdditionalFrame(
RenderFrameHostImpl* frame_host) {
frame_host->SetAccessibilityCallbackForTesting(
base::Bind(&AccessibilityNotificationWaiter::OnAccessibilityEvent,
weak_factory_.GetWeakPtr()));
}
void AccessibilityNotificationWaiter::WaitForNotification() {
loop_runner_->Run();
// Each loop runner can only be called once. Create a new one in case
// the caller wants to call this again to wait for the next notification.
loop_runner_ = new MessageLoopRunner();
}
const ui::AXTree& AccessibilityNotificationWaiter::GetAXTree() const {
CR_DEFINE_STATIC_LOCAL(ui::AXTree, empty_tree, ());
const ui::AXTree* tree = frame_host_->GetAXTreeForTesting();
if (tree)
return *tree;
return empty_tree;
}
void AccessibilityNotificationWaiter::OnAccessibilityEvent(
RenderFrameHostImpl* rfhi,
ui::AXEvent event_type,
int event_target_id) {
if (!IsAboutBlank() && (event_to_wait_for_ == ui::AX_EVENT_NONE ||
event_to_wait_for_ == event_type)) {
event_target_id_ = event_target_id;
event_render_frame_host_ = rfhi;
loop_runner_->Quit();
}
}
bool AccessibilityNotificationWaiter::IsAboutBlank() {
// Skip any accessibility notifications related to "about:blank",
// to avoid a possible race condition between the test beginning
// listening for accessibility events and "about:blank" loading.
return GetAXTree().data().url == url::kAboutBlankURL;
}
} // namespace content
| {
"content_hash": "febf6a0c9146df812e734c60852063ce",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 75,
"avg_line_length": 36.16129032258065,
"alnum_prop": 0.7124591138864109,
"repo_name": "Samsung/ChromiumGStreamerBackend",
"id": "c9541781622f91cb6b09060be31ca2870861991d",
"size": "4148",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "content/test/accessibility_browser_test_utils.cc",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
print PROJECT_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'dev.db', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': '',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []
# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
TIME_ZONE = 'America/Chicago'
# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True
# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True
# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/", "http://media.example.com/"
MEDIA_URL = '/media/'
# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''
# URL prefix for static files.
# Example: "http://example.com/static/", "http://static.example.com/"
STATIC_URL = '/static/'
# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, 'static'),
)
# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
# 'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '*g104nbk9h8t3%5pjj(jz8b0pxm_7_2y**m++3=uow5zmwbcbh'
# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)
ROOT_URLCONF = 'website.urls'
# Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'website.wsgi.application'
TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_ROOT, 'templates'),
)
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'crispy_forms',
'south',
'rest_framework',
'posts',
'profiles',
'relationships',
)
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error when DEBUG=False.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
}
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}
# Extra Settings.
AUTH_LOGIN_URL = '/login/'
AUTH_USER_MODEL = 'profiles.SiteUser'
CRISPY_TEMPLATE_PACK = 'bootstrap3'
REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
)
}
| {
"content_hash": "76cf0014e92590940dbaa604ab669769",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 127,
"avg_line_length": 32.733333333333334,
"alnum_prop": 0.6860149355057705,
"repo_name": "bajubullet/twitter-clone",
"id": "53d1fd669f0476b98c67cb5e715079dc0e4354c3",
"size": "5931",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "website/website/settings.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "305"
},
{
"name": "JavaScript",
"bytes": "3030"
},
{
"name": "Python",
"bytes": "43028"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/group"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<Button
android:id="@+id/add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add New"
android:onClick="onClick"/>
<Button
android:id="@+id/delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Delete First"
android:onClick="onClick"/>
</LinearLayout>
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Hello" />
</LinearLayout> | {
"content_hash": "39c3f06385f0249e9b4509a7de361f81",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 33.411764705882355,
"alnum_prop": 0.5501760563380281,
"repo_name": "frazer-rbsn/KukubaPlayer",
"id": "4a1bcded9d08633f062aa6b535f288f19fb7315f",
"size": "1136",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/layout/quiz_list_activity_new.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "75891"
}
],
"symlink_target": ""
} |
@interface MIUDescription : MIUMethod
@property(nonatomic, weak) NSSet *enums;
@end
| {
"content_hash": "7648db546aa62ce42fc0fe6c2a1ea487",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 17.2,
"alnum_prop": 0.7674418604651163,
"repo_name": "NixSolutionsMobile/MIU",
"id": "a267fcfb6928629389acca32fd13b649c48fa9cf",
"size": "264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AppMIU/Sources/MIUSource/MIUMethods/MIUDescriptions/MIUDescription.h",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "76"
},
{
"name": "Objective-C",
"bytes": "265993"
}
],
"symlink_target": ""
} |
package com.space.invaders.controladores;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.space.invaders.controladores.base.ControladorEstadoJuegoBase;
import com.space.invaders.entidades.menu.OpcionMenu;
import com.space.invaders.interfaces.mensajes.IColega;
import com.space.invaders.interfaces.mensajes.IMediador;
import com.space.invaders.modelos.ModeloMenuNivelCompletado;
import com.space.invaders.modelos.ModeloPartidaJuego;
import com.space.invaders.navegacion.NombreEstado;
import com.space.invaders.recursos.sonido.NombreSonido;
import com.space.invaders.vistas.VistaEstadoMenu;
public class ControladorEstadoNivelCompletado extends ControladorEstadoJuegoBase implements IColega{
private VistaEstadoMenu vista;
public ModeloMenuNivelCompletado modelo;
private final String textoTitulo = "¡Misión Completada!";
private final String FORMATO_PUNTOS = "Has obtenido: $%s";
public ControladorEstadoNivelCompletado() {
vista = new VistaEstadoMenu(this, textoTitulo);
modelo = new ModeloMenuNivelCompletado();
}
@Override
public void actualizar(float deltaTiempo) {
vista.actualizar(deltaTiempo);
}
@Override
public void renderizar() {
vista.renderizar();
}
@Override
public void manejarEntradas() {
if (Gdx.input.isKeyJustPressed(Input.Keys.ENTER)) {
reproducirSonido(NombreSonido.MENU_SELECCIONAR);
OpcionMenu elementoMenuActual = modelo.getElementoMenuActual();
if (elementoMenuActual != null) {
NombreEstado nombreEstado = elementoMenuActual.getNombreRuta();
switch (nombreEstado) {
case SiguienteNivel:
cambiarEstado(NombreEstado.Juego);
mediador.enviarMensaje(this,"SiguienteNivel", null);
break;
case ReiniciarNivel:
cambiarEstado(NombreEstado.Juego);
mediador.enviarMensaje(this,"ReiniciarNivel", null);
break;
case MenuPrincipal:
cambiarEstado(NombreEstado.MenuPrincipal);
break;
case Salir:
Gdx.app.exit();
break;
default:
break;
}
}
}
if (Gdx.input.isKeyJustPressed(Input.Keys.UP)) {
reproducirSonido(NombreSonido.MENU_MOVER);
modelo.moverElementoAnterior();
}
if (Gdx.input.isKeyJustPressed(Input.Keys.DOWN)) {
reproducirSonido(NombreSonido.MENU_MOVER);
modelo.moverElementoSiguiente();
}
}
@Override
public void dispose() {
vista.dispose();
}
@Override
public void inicializar() {
vista.inicializar();
ModeloPartidaJuego modeloPartidaJuego = ModeloPartidaJuego.getInstancia();
vista.setSubTitulo(String.format(FORMATO_PUNTOS,modeloPartidaJuego.getPuntos()));
vista.setOpcionesMenu(modelo.getElementosMenu());
}
private IMediador mediador;
@Override
public void setMediador(IMediador mediador) {
this.mediador = mediador;
}
@Override
public void recibirMensaje(String mensaje, Object data) {
// TODO Auto-generated method stub
}
}
| {
"content_hash": "82e9cecbbc0adfb05bac134d82c59ede",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 26.850467289719628,
"alnum_prop": 0.7608771319178559,
"repo_name": "wilmerbz/dp-final-project",
"id": "05fe8004ca7b3bc54f5ef740e62e4b62e57185f4",
"size": "2875",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SpaceInvaders/core/src/com/space/invaders/controladores/ControladorEstadoNivelCompletado.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "172053"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html>
<body>
<h1> Enigma - Gamechanger in the Second World War. </h1>
This is the Enigma learning panel.
</body>
</html>
| {
"content_hash": "92e5093fb528f47f45d1541dbfd7053b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 16.555555555555557,
"alnum_prop": 0.6375838926174496,
"repo_name": "PSeminarKryptographie/MonkeyCrypt",
"id": "5ba8d2d6e56aa4eb87f054210f337b430dee031a",
"size": "149",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "src/text/did/pl/enigma_did.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "334784"
},
{
"name": "Java",
"bytes": "405816"
}
],
"symlink_target": ""
} |
<?php
/**
* @group lambdas
* @group functional
*/
class Mustache_Test_FiveThree_Functional_ClosureQuirksTest extends PHPUnit_Framework_TestCase
{
private $mustache;
public function setUp()
{
$this->mustache = new Mustache_Engine();
}
public function testClosuresDontLikeItWhenYouTouchTheirProperties()
{
$tpl = $this->mustache->loadTemplate('{{ foo.bar }}');
$this->assertEquals('', $tpl->render(array('foo' => function () {
return 'FOO';
})));
}
}
| {
"content_hash": "baa37fde94e2a6cd445e892eae66e2eb",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 93,
"avg_line_length": 21.16,
"alnum_prop": 0.610586011342155,
"repo_name": "MrFibunacci/Framy",
"id": "c997a1d2dd98c7f1b2269838966c7cb9f7d461f4",
"size": "738",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "app/framework/Component/TemplateEngine/Bridge/mustache/test/Mustache/Test/FiveThree/Functional/ClosureQuirksTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "2536"
},
{
"name": "MAXScript",
"bytes": "27"
},
{
"name": "PHP",
"bytes": "2302430"
},
{
"name": "Smarty",
"bytes": "7201"
},
{
"name": "Yacc",
"bytes": "44626"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.iot.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.Request;
import com.amazonaws.http.HttpMethodName;
import com.amazonaws.services.iot.model.*;
import com.amazonaws.transform.Marshaller;
import com.amazonaws.protocol.*;
import com.amazonaws.protocol.Protocol;
import com.amazonaws.annotation.SdkInternalApi;
/**
* GetCardinalityRequest Marshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class GetCardinalityRequestProtocolMarshaller implements Marshaller<Request<GetCardinalityRequest>, GetCardinalityRequest> {
private static final OperationInfo SDK_OPERATION_BINDING = OperationInfo.builder().protocol(Protocol.REST_JSON).requestUri("/indices/cardinality")
.httpMethodName(HttpMethodName.POST).hasExplicitPayloadMember(false).hasPayloadMembers(true).serviceName("AWSIot").build();
private final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory;
public GetCardinalityRequestProtocolMarshaller(com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory) {
this.protocolFactory = protocolFactory;
}
public Request<GetCardinalityRequest> marshall(GetCardinalityRequest getCardinalityRequest) {
if (getCardinalityRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
final ProtocolRequestMarshaller<GetCardinalityRequest> protocolMarshaller = protocolFactory.createProtocolMarshaller(SDK_OPERATION_BINDING,
getCardinalityRequest);
protocolMarshaller.startMarshalling();
GetCardinalityRequestMarshaller.getInstance().marshall(getCardinalityRequest, protocolMarshaller);
return protocolMarshaller.finishMarshalling();
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "d14c36f26953e1a4a6af4c4e1ebc5621",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 151,
"avg_line_length": 39.98039215686274,
"alnum_prop": 0.7631191760666993,
"repo_name": "aws/aws-sdk-java",
"id": "de97401bf179bd4eebec748225a206a5bce01128",
"size": "2619",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/transform/GetCardinalityRequestProtocolMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
see docker location on docker hub
- https://hub.docker.com/r/jumpscale/ubuntu1604_golang/
std passwd
- root/gig1234
## use from non jumpscale enabled system
easiest way to use (windows & max)
- install https://www.docker.com/toolbox
- login using your docker account (create one if you don't have yet)
- click create
- look for jumpscale/ubuntu1604_golang
careful the std passwd is now used, use jsdocker for more security (see below)
## use from jumpscale enabled system
```
docker pull jumpscale/ubuntu1604_golang
jsdocker new -n golangtest -b jumpscale/ubuntu1604_golang --start
```
you can now login with
```
ssh localhost -p 9022
```
port will change depending nr of dockers on your machine
# to build
make sure jumpscale has been installed on system
```
mkdir -p /opt/code/github/jumpscale
cd /opt/code/github/jumpscale
git clone https://github.com/Jumpscale/dockers.git
cd dockers/js8
js buildall.py
```
# to push back to the docker hub
we do an autobuild in jumpscale/ubuntu1604_golang so no real need to do this manually
```
docker login
docker push jumpscale/ubuntu1604_golang
```
# remarks
## runit
this docker uses runit to schedule all processes some useful commands
- more info on http://smarden.org/runit/faq.html
imagine the docker name is 04c9611bd06a
```
#find docker id 04...
docker ps
#restart ssh
docker exec 04c9611bd06a sv restart sshd
```
## ssh troubles
ssh tries to use all private local keys
it could be your ssh server is configured to not allow too many attempts
to make sure that no ssh keys are used and only try with login/passwd combination do following
```
ssh -o PubkeyAuthentication=no localhost -p 9026
```
port you can find by doing 'docker ps'
| {
"content_hash": "815c934f83e630829e360b97a5939f0b",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 94,
"avg_line_length": 23.315068493150687,
"alnum_prop": 0.7614571092831962,
"repo_name": "Jumpscale/dockers",
"id": "e7774ee153090ed82f4eb5de2a970939651b8433",
"size": "1744",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "js8/x86_64/_archive/41_ubuntu1604_golang/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "122275"
},
{
"name": "Shell",
"bytes": "39362"
}
],
"symlink_target": ""
} |
---
uid: SolidEdgeAssembly.AssemblyBody.Mirror(System.Object)
summary:
remarks:
syntax:
parameters:
- id: pPlane
description: Specifies the reference plane about which the referenced Occurrence object is mirrored.
---
| {
"content_hash": "b130e96b1624667fe05fe66c45ba8c45",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 106,
"avg_line_length": 26.11111111111111,
"alnum_prop": 0.7404255319148936,
"repo_name": "SolidEdgeCommunity/docs",
"id": "bc570d8b5fc3632f36487a5ed3122e71dac38d56",
"size": "237",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docfx_project/apidoc/SolidEdgeAssembly.AssemblyBody.Mirror.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "38"
},
{
"name": "C#",
"bytes": "5048212"
},
{
"name": "C++",
"bytes": "2265"
},
{
"name": "CSS",
"bytes": "148"
},
{
"name": "PowerShell",
"bytes": "180"
},
{
"name": "Smalltalk",
"bytes": "1996"
},
{
"name": "Visual Basic",
"bytes": "10236277"
}
],
"symlink_target": ""
} |
<?php
namespace Ibuildings\QaTools\Core\Task\Executor;
use Ibuildings\QaTools\Core\Composer\Configuration;
use Ibuildings\QaTools\Core\Composer\Package;
use Ibuildings\QaTools\Core\Composer\PackageSet;
use Ibuildings\QaTools\Core\Composer\Project as ComposerProject;
use Ibuildings\QaTools\Core\Composer\ProjectFactory as ComposerProjectFactory;
use Ibuildings\QaTools\Core\Composer\RuntimeException as ComposerRuntimeException;
use Ibuildings\QaTools\Core\Interviewer\Answer\YesOrNoAnswer;
use Ibuildings\QaTools\Core\Interviewer\Interviewer;
use Ibuildings\QaTools\Core\Interviewer\Question\QuestionFactory;
use Ibuildings\QaTools\Core\Project\Project;
use Ibuildings\QaTools\Core\Task\InstallComposerDevDependencyTask;
use Ibuildings\QaTools\Core\Task\Task;
use Ibuildings\QaTools\Core\Task\TaskList;
/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects) -- Due to wide-spread value object usage a higher coupling is
* acceptable
*/
final class InstallComposerDevDependencyTaskExecutor implements Executor
{
/** @var ComposerProjectFactory */
private $composerProjectFactory;
/** @var ComposerProject|null */
private $composerProject;
/** @var Configuration|null */
private $configurationBackup;
public function __construct(ComposerProjectFactory $composerProjectFactory)
{
$this->composerProjectFactory = $composerProjectFactory;
}
public function supports(Task $task)
{
return $task instanceof InstallComposerDevDependencyTask;
}
public function arePrerequisitesMet(TaskList $tasks, Project $project, Interviewer $interviewer)
{
$interviewer->notice(
" * Verifying installation of Composer development dependencies won't cause a conflict..."
);
$packages = $this->getPackagesToAddAsDevDependency($tasks);
foreach ($packages as $package) {
/** @var Package $package */
$interviewer->giveDetails(sprintf(' - %s', $package->getDescriptor()));
}
$this->composerProject =
$this->composerProjectFactory->forDirectory($project->getRootDirectory()->getDirectory());
if (!$this->composerProject->isInitialised()) {
$questionText = 'There is no Composer project initialised in this directory. Initialise one?';
/** @var YesOrNoAnswer $answer */
$answer = $interviewer->ask(QuestionFactory::createYesOrNo($questionText, YesOrNoAnswer::YES));
if ($answer->is(YesOrNoAnswer::NO)) {
$interviewer->warn('Cannot continue without an initialised Composer project. Aborting...');
return false;
}
try {
$this->composerProject->initialise();
} catch (ComposerRuntimeException $e) {
$interviewer->warn('Something went wrong while initialising the Composer project');
return false;
}
$interviewer->notice(
"Verifying installation of Composer development dependencies won't cause a conflict..."
);
}
try {
$this->composerProject->verifyDevDependenciesWillNotConflict($packages);
} catch (ComposerRuntimeException $e) {
$interviewer->warn('Something went wrong while performing a dry-run install:');
$interviewer->giveDetails('');
$indentedCause = preg_replace('/^/m', ' ', $e->getCause());
$interviewer->giveDetails($indentedCause);
$interviewer->giveDetails('');
$escapedRequirements = join(' ', array_map('escapeshellarg', $packages->getDescriptors()));
$interviewer->notice(
'QA Tools will be unable to installed the require development dependencies. Most ' .
'likely one of the requirements conflicts with your currently installed ' .
'dependencies. To help you resolve the situation, you can execute the following ' .
'command to reproduce the error:'
);
$interviewer->giveDetails('');
$interviewer->giveDetails(sprintf(' composer require --dev %s', $escapedRequirements));
$interviewer->giveDetails('');
return false;
}
return true;
}
public function execute(TaskList $tasks, Project $project, Interviewer $interviewer)
{
$interviewer->notice(" * Installing Composer development dependencies...");
$packages = $this->getPackagesToAddAsDevDependency($tasks);
$this->configurationBackup = $this->composerProject->readConfiguration();
$this->composerProject->requireDevDependencies($packages);
}
public function cleanUp(TaskList $tasks, Project $project, Interviewer $interviewer)
{
}
public function rollBack(TaskList $tasks, Project $project, Interviewer $interviewer)
{
$interviewer->notice(" * Restoring Composer configuration...");
$this->composerProject->restoreConfiguration($this->configurationBackup);
}
/**
* @param TaskList $tasks
* @return PackageSet
*/
private function getPackagesToAddAsDevDependency(TaskList $tasks)
{
$packages = new PackageSet();
foreach ($tasks as $task) {
/** @var InstallComposerDevDependencyTask $task */
$packages = $packages->add(Package::of($task->getPackageName(), $task->getPackageVersionConstraint()));
}
return $packages;
}
}
| {
"content_hash": "574b3eb7f52fb81641b7a82780893ec6",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 115,
"avg_line_length": 38.61538461538461,
"alnum_prop": 0.6617167692864904,
"repo_name": "ibuildingsnl/qa-tools",
"id": "a84fa67c540a6ede94d41eead65025d4be9dec01",
"size": "5522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Core/Task/Executor/InstallComposerDevDependencyTaskExecutor.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "10950"
},
{
"name": "Makefile",
"bytes": "4567"
},
{
"name": "PHP",
"bytes": "577830"
},
{
"name": "Shell",
"bytes": "52"
},
{
"name": "Tcl",
"bytes": "20723"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Sat Mar 16 04:11:57 MST 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.wildfly.swarm.config.management.access.SyslogHandler (BOM: * : All 2.3.1.Final-SNAPSHOT API)</title>
<meta name="date" content="2019-03-16">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.wildfly.swarm.config.management.access.SyslogHandler (BOM: * : All 2.3.1.Final-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">Class</a></li>
<li class="navBarCell1Rev">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 class="aboutLanguage">Thorntail API, 2.3.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/management/access/class-use/SyslogHandler.html" target="_top">Frames</a></li>
<li><a href="SyslogHandler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.wildfly.swarm.config.management.access.SyslogHandler" class="title">Uses of Class<br>org.wildfly.swarm.config.management.access.SyslogHandler</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.management">org.wildfly.swarm.config.management</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.wildfly.swarm.config.management.access">org.wildfly.swarm.config.management.access</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.wildfly.swarm.config.management">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a> in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> that return <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></code></td>
<td class="colLast"><span class="typeNameLabel">AuditAccess.AuditAccessResources.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.AuditAccessResources.html#syslogHandler-java.lang.String-">syslogHandler</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> key)</code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> that return types with arguments of type <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a>></code></td>
<td class="colLast"><span class="typeNameLabel">AuditAccess.AuditAccessResources.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.AuditAccessResources.html#syslogHandlers--">syslogHandlers</a></span>()</code>
<div class="block">Get the list of SyslogHandler resources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.html" title="type parameter in AuditAccess">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">AuditAccess.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.html#syslogHandler-org.wildfly.swarm.config.management.access.SyslogHandler-">syslogHandler</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a> value)</code>
<div class="block">Add the SyslogHandler object to the list of subresources</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Method parameters in <a href="../../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a> with type arguments of type <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.html" title="type parameter in AuditAccess">T</a></code></td>
<td class="colLast"><span class="typeNameLabel">AuditAccess.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/AuditAccess.html#syslogHandlers-java.util.List-">syslogHandlers</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a>> value)</code>
<div class="block">Add all SyslogHandler objects to this subresource</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.wildfly.swarm.config.management.access">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a> in <a href="../../../../../../../org/wildfly/swarm/config/management/access/package-summary.html">org.wildfly.swarm.config.management.access</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../org/wildfly/swarm/config/management/access/package-summary.html">org.wildfly.swarm.config.management.access</a> with type parameters of type <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a><T>></span></code>
<div class="block">A syslog handler for use with the management audit logging service.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandlerConsumer.html" title="interface in org.wildfly.swarm.config.management.access">SyslogHandlerConsumer</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a><T>></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>interface </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandlerSupplier.html" title="interface in org.wildfly.swarm.config.management.access">SyslogHandlerSupplier</a><T extends <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a>></span></code> </td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/management/access/package-summary.html">org.wildfly.swarm.config.management.access</a> that return <a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">SyslogHandler</a></code></td>
<td class="colLast"><span class="typeNameLabel">SyslogHandlerSupplier.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandlerSupplier.html#get--">get</a></span>()</code>
<div class="block">Constructed instance of SyslogHandler resource</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/wildfly/swarm/config/management/access/SyslogHandler.html" title="class in org.wildfly.swarm.config.management.access">Class</a></li>
<li class="navBarCell1Rev">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 class="aboutLanguage">Thorntail API, 2.3.1.Final-SNAPSHOT</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/wildfly/swarm/config/management/access/class-use/SyslogHandler.html" target="_top">Frames</a></li>
<li><a href="SyslogHandler.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "d55896600aaf5fae5fe13b0fb41bd5b4",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 577,
"avg_line_length": 62.78076923076923,
"alnum_prop": 0.6768363658641181,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "b294e6055ae233118d43718a305bd66bdd7a0437",
"size": "16323",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.3.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/config/management/access/class-use/SyslogHandler.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
namespace TYPO3\CMS\Install\Tests\Unit;
use org\bovigo\vfs\vfsStream;
/**
* Test case
*/
abstract class FolderStructureTestCase extends \TYPO3\CMS\Core\Tests\UnitTestCase
{
/**
* Create a random directory in the virtual file system and return the path.
*
* @param string $prefix
* @return string
*/
protected function getVirtualTestDir($prefix = 'root_')
{
$root = vfsStream::setup();
$path = $root->url() . '/typo3temp/' . $this->getUniqueId($prefix);
\TYPO3\CMS\Core\Utility\GeneralUtility::mkdir_deep($path);
return $path;
}
/**
* Return a random test filename within a virtual test directory
*
* @param string $prefix
* @return string
*/
protected function getVirtualTestFilePath($prefix = 'file_')
{
return $this->getVirtualTestDir() . '/' . $this->getUniqueId($prefix);
}
}
| {
"content_hash": "d4ea1ef9a2fd95ea7f1be90b4e519645",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 81,
"avg_line_length": 24.72972972972973,
"alnum_prop": 0.6185792349726776,
"repo_name": "ahmedRguei/blogTypo",
"id": "7c5e3a2de4ab994e228dcb51ea9a33b6c75c49ab",
"size": "1335",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "typo3/sysext/install/Tests/Unit/FolderStructureTestCase.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3425"
},
{
"name": "CSS",
"bytes": "1591892"
},
{
"name": "HTML",
"bytes": "617019"
},
{
"name": "JavaScript",
"bytes": "3011598"
},
{
"name": "PHP",
"bytes": "25967799"
},
{
"name": "PLpgSQL",
"bytes": "3957"
},
{
"name": "Shell",
"bytes": "7244"
},
{
"name": "Smarty",
"bytes": "302"
},
{
"name": "TypeScript",
"bytes": "122147"
},
{
"name": "XSLT",
"bytes": "27654"
}
],
"symlink_target": ""
} |
"""Test class for Fake driver."""
import mock
from ironic.common import boot_devices
from ironic.common import driver_factory
from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers import base as driver_base
from ironic.tests.unit.conductor import mgr_utils
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
class FakeDriverTestCase(db_base.DbTestCase):
def setUp(self):
super(FakeDriverTestCase, self).setUp()
mgr_utils.mock_the_extension_manager()
self.driver = driver_factory.get_driver("fake")
self.node = obj_utils.get_test_node(self.context)
self.task = mock.MagicMock(spec=task_manager.TaskManager)
self.task.shared = False
self.task.node = self.node
self.task.driver = self.driver
def test_driver_interfaces(self):
self.assertIsInstance(self.driver.power, driver_base.PowerInterface)
self.assertIsInstance(self.driver.deploy, driver_base.DeployInterface)
self.assertIsInstance(self.driver.boot, driver_base.BootInterface)
self.assertIsInstance(self.driver.vendor, driver_base.VendorInterface)
self.assertIsInstance(self.driver.console,
driver_base.ConsoleInterface)
self.assertIsNone(self.driver.rescue)
def test_get_properties(self):
expected = ['A1', 'A2', 'B1', 'B2']
properties = self.driver.get_properties()
self.assertEqual(sorted(expected), sorted(properties.keys()))
def test_power_interface(self):
self.assertEqual({}, self.driver.power.get_properties())
self.driver.power.validate(self.task)
self.driver.power.get_power_state(self.task)
self.assertRaises(exception.InvalidParameterValue,
self.driver.power.set_power_state,
self.task, states.NOSTATE)
self.driver.power.set_power_state(self.task, states.POWER_ON)
self.driver.power.reboot(self.task)
def test_deploy_interface(self):
self.assertEqual({}, self.driver.deploy.get_properties())
self.driver.deploy.validate(None)
self.driver.deploy.prepare(None)
self.driver.deploy.deploy(None)
self.driver.deploy.take_over(None)
self.driver.deploy.clean_up(None)
self.driver.deploy.tear_down(None)
def test_boot_interface(self):
self.assertEqual({}, self.driver.boot.get_properties())
self.driver.boot.validate(self.task)
self.driver.boot.prepare_ramdisk(self.task, {})
self.driver.boot.clean_up_ramdisk(self.task)
self.driver.boot.prepare_instance(self.task)
self.driver.boot.clean_up_instance(self.task)
def test_console_interface(self):
self.assertEqual({}, self.driver.console.get_properties())
self.driver.console.validate(self.task)
self.driver.console.start_console(self.task)
self.driver.console.stop_console(self.task)
self.driver.console.get_console(self.task)
def test_management_interface_get_properties(self):
self.assertEqual({}, self.driver.management.get_properties())
def test_management_interface_validate(self):
self.driver.management.validate(self.task)
def test_management_interface_set_boot_device_good(self):
self.driver.management.set_boot_device(self.task, boot_devices.PXE)
def test_management_interface_set_boot_device_fail(self):
self.assertRaises(exception.InvalidParameterValue,
self.driver.management.set_boot_device, self.task,
'not-supported')
def test_management_interface_get_supported_boot_devices(self):
expected = [boot_devices.PXE]
self.assertEqual(
expected,
self.driver.management.get_supported_boot_devices(self.task))
def test_management_interface_get_boot_device(self):
expected = {'boot_device': boot_devices.PXE, 'persistent': False}
self.assertEqual(expected,
self.driver.management.get_boot_device(self.task))
def test_inspect_interface(self):
self.assertEqual({}, self.driver.inspect.get_properties())
self.driver.inspect.validate(self.task)
self.driver.inspect.inspect_hardware(self.task)
| {
"content_hash": "67daca29980a070b1fa94827670a3c87",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 79,
"avg_line_length": 41.242990654205606,
"alnum_prop": 0.6798096532970768,
"repo_name": "ruyang/ironic",
"id": "c0a849f5a522cb49a458ed62d569d0e1538ee057",
"size": "5086",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "ironic/tests/unit/drivers/test_fake.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Mako",
"bytes": "349"
},
{
"name": "Python",
"bytes": "5133461"
},
{
"name": "Shell",
"bytes": "107097"
}
],
"symlink_target": ""
} |
package java.security.spec;
import java.math.BigInteger;
import java.security.spec.AlgorithmParameterSpec;
/**
* This class specifies the set of parameters used to generate an RSA
* key pair.
*
* @author Jan Luehe
*
* @see java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
*
* @since 1.3
*/
public class RSAKeyGenParameterSpec implements AlgorithmParameterSpec {
private int keysize;
private BigInteger publicExponent;
private AlgorithmParameterSpec keyParams;
/**
* The public-exponent value F0 = 3.
*/
public static final BigInteger F0 = BigInteger.valueOf(3);
/**
* The public exponent-value F4 = 65537.
*/
public static final BigInteger F4 = BigInteger.valueOf(65537);
/**
* Constructs a new {@code RSAKeyGenParameterSpec} object from the
* given keysize, public-exponent value, and null key parameters.
*
* @param keysize the modulus size (specified in number of bits)
* @param publicExponent the public exponent
*/
public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent) {
this(keysize, publicExponent, null);
}
/**
* Constructs a new {@code RSAKeyGenParameterSpec} object from the
* given keysize, public-exponent value, and key parameters.
*
* @param keysize the modulus size (specified in number of bits)
* @param publicExponent the public exponent
* @param keyParams the key parameters, may be null
* @since 11
*/
public RSAKeyGenParameterSpec(int keysize, BigInteger publicExponent,
AlgorithmParameterSpec keyParams) {
this.keysize = keysize;
this.publicExponent = publicExponent;
this.keyParams = keyParams;
}
/**
* Returns the keysize.
*
* @return the keysize.
*/
public int getKeysize() {
return keysize;
}
/**
* Returns the public-exponent value.
*
* @return the public-exponent value.
*/
public BigInteger getPublicExponent() {
return publicExponent;
}
/**
* Returns the parameters to be associated with key.
*
* @return the associated parameters, may be null if
* not present
* @since 11
*/
public AlgorithmParameterSpec getKeyParams() {
return keyParams;
}
}
| {
"content_hash": "64315557c79121ef749a52ffa445883a",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 92,
"avg_line_length": 26.355555555555554,
"alnum_prop": 0.657672849915683,
"repo_name": "mirkosertic/Bytecoder",
"id": "c13a8cc3a1c3873880f0c1aeae3337adb94558bd",
"size": "3584",
"binary": false,
"copies": "10",
"ref": "refs/heads/master",
"path": "classlib/java.base/src/main/resources/META-INF/modules/java.base/classes/java/security/spec/RSAKeyGenParameterSpec.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "153"
},
{
"name": "C++",
"bytes": "1301"
},
{
"name": "CSS",
"bytes": "5154"
},
{
"name": "Clojure",
"bytes": "87"
},
{
"name": "HTML",
"bytes": "599386"
},
{
"name": "Java",
"bytes": "106011215"
},
{
"name": "Kotlin",
"bytes": "15858"
},
{
"name": "LLVM",
"bytes": "2839"
},
{
"name": "Shell",
"bytes": "164"
}
],
"symlink_target": ""
} |
using log4net;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Server.Handlers.Simulation;
using OpenSim.Services.Interfaces;
using System;
using System.Collections;
using System.Net;
using System.Reflection;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Server.Handlers.Hypergrid
{
public class HomeAgentHandler : AgentPostHandler
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private IUserAgentService m_UserAgentService;
private string m_LoginServerIP;
public HomeAgentHandler(IUserAgentService userAgentService, string loginServerIP, bool proxy) :
base("/homeagent")
{
m_UserAgentService = userAgentService;
m_LoginServerIP = loginServerIP;
m_Proxy = proxy;
}
protected override AgentDestinationData CreateAgentDestinationData()
{
return new ExtendedAgentDestinationData();
}
protected override void UnpackData(OSDMap args, AgentDestinationData d, Hashtable request)
{
base.UnpackData(args, d, request);
ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
try
{
if (args.ContainsKey("gatekeeper_host") && args["gatekeeper_host"] != null)
data.host = args["gatekeeper_host"].AsString();
if (args.ContainsKey("gatekeeper_port") && args["gatekeeper_port"] != null)
Int32.TryParse(args["gatekeeper_port"].AsString(), out data.port);
if (args.ContainsKey("gatekeeper_serveruri") && args["gatekeeper_serveruri"] != null)
data.gatekeeperServerURI = args["gatekeeper_serveruri"];
if (args.ContainsKey("destination_serveruri") && args["destination_serveruri"] != null)
data.destinationServerURI = args["destination_serveruri"];
}
catch (InvalidCastException)
{
m_log.ErrorFormat("[HOME AGENT HANDLER]: Bad cast in UnpackData");
}
string callerIP = GetCallerIP(request);
// Verify if this call came from the login server
if (callerIP == m_LoginServerIP)
data.fromLogin = true;
}
protected override GridRegion ExtractGatekeeper(AgentDestinationData d)
{
if (d is ExtendedAgentDestinationData)
{
ExtendedAgentDestinationData data = (ExtendedAgentDestinationData)d;
GridRegion gatekeeper = new GridRegion();
gatekeeper.ServerURI = data.gatekeeperServerURI;
gatekeeper.ExternalHostName = data.host;
gatekeeper.HttpPort = (uint)data.port;
gatekeeper.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0);
return gatekeeper;
}
else
m_log.WarnFormat("[HOME AGENT HANDLER]: Wrong data type");
return null;
}
protected override bool CreateAgent(GridRegion source, GridRegion gatekeeper, GridRegion destination,
AgentCircuitData aCircuit, uint teleportFlags, bool fromLogin, out string reason)
{
return m_UserAgentService.LoginAgentToGrid(source, aCircuit, gatekeeper, destination, fromLogin, out reason);
}
}
public class ExtendedAgentDestinationData : AgentDestinationData
{
public string host;
public int port;
public string gatekeeperServerURI;
public string destinationServerURI;
}
}
| {
"content_hash": "4231689e07820d8a33210819931b447d",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 121,
"avg_line_length": 36.46078431372549,
"alnum_prop": 0.6316214036031191,
"repo_name": "BogusCurry/arribasim-dev",
"id": "12bdffcd89fa54abe54c02a44a88178ee839041a",
"size": "5336",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "1255"
},
{
"name": "C#",
"bytes": "16782866"
},
{
"name": "CSS",
"bytes": "1683"
},
{
"name": "HTML",
"bytes": "9537"
},
{
"name": "JavaScript",
"bytes": "556"
},
{
"name": "LSL",
"bytes": "36962"
},
{
"name": "Makefile",
"bytes": "776"
},
{
"name": "PLpgSQL",
"bytes": "599"
},
{
"name": "Python",
"bytes": "5053"
},
{
"name": "Ruby",
"bytes": "1111"
},
{
"name": "Shell",
"bytes": "955"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.