text
stringlengths
2
1.04M
meta
dict
/* BlockRegExp version 0.1.0 */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.BlockRegExp = factory()); }(this, (function () { 'use strict'; function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } function reg(literals) { var liters = literals.raw; for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { values[_key - 1] = arguments[_key]; } var regLiter = concatLiterals(liters, values).trim(); var flagsComment = regLiter.match(/# *flags *=.*$/m); var flags = flagsComment ? flagsComment[0].replace(/^#/, '').split('=')[1] : ''; flags = flags.trim(); flags = filterSubstr('img', flags); var removeComment = regLiter.replace(/([^\\])?#.+/g, '$1'); var removeSpace = removeComment.replace(/\s/g, ''); return new RegExp(removeSpace, flags); } function concatLiterals(literals, values) { var result = ''; for (var i = 0; i < literals.length; i++) { result += literals[i]; if (i < values.length) { result += values[i]; } } return result; } function filterSubstr(pattern, str) { str = [].concat(_toConsumableArray(new Set(Array.from(str)))); return str.filter(function (s) { return pattern.indexOf(s) >= 0; }).join(''); } return reg; })));
{ "content_hash": "d4611431c07997acab470f3771a0551d", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 195, "avg_line_length": 31.653061224489797, "alnum_prop": 0.6105738233397808, "repo_name": "x4storm/Block-RegExp", "id": "7808e494fec9981d0e986d57fc721a484625b71d", "size": "1551", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dist/block-regexp.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2163" } ], "symlink_target": "" }
var http = require("http"); // essential var st = require('st'); // essential var Router = require("routes-router"); // essential var pwd = require("pwd"); var redirect = require("redirecter"); var Session = require("generic-session"); var MemoryStore = require("generic-session").MemoryStore; var sendHtml = require("send-data/html"); // essential, also bring in send-data/json var formBody = require("body/form"); // essential var config = require('./config'); var templates = require('./server-templates/compiled-templates'); var db = require('orchestrate')(config.dbKey); //essential var store = MemoryStore(); var router = Router(); var _ = require('underscore'); function showSession(session) { console.log(_.pick(session,['options','store','expire','token','id'])); // excludes: 'cookies','request','response' } function createUser (user, password) { pwd.hash(password, function (err, salt, hash) { if (err) { throw err } user.salt = salt; user.hash = String(hash); db.put('users', user.name, user) .then(function (result) { console.log("success!") }) .fail(function (err) { console.error(err); }) }) } //uncomment to create a user createUser({name: "steve"}, "123"); function authenticate(name, password, callback) { db.get('users', name) .then(function(result){ var user = result.body; if (!user) { return callback(new Error("cannot find user")) } pwd.hash(password, user.salt, function (err, hash) { if (err) { return callback(err) } if (String(hash) === user.hash) { return callback(null, user) } callback(new Error("invalid password")) }) }) .fail(function (err) { console.error(err); }); } function restrict(handler) { return function (req, res, opts, callback) { var session = Session(req, res, store); session.get("user", function (err, user) { if (err) { return callback(err) } if (!user) { return session.set("message", { text: "Please enter your login credentials", type: "error" }, function (err) { if (err) { return callback(err) } redirect(req, res, "/login") }) } handler(req, res, opts, callback) }) } } router.addRoute("/", restrict(function (req, res) { var session = Session(req, res, store); session.get("user", function (err, user) { var message = "Welcome " + user.name.toString(); sendHtml(req, res, templates.index({message:message})); }); })); router.addRoute("/public/*", st({ path: __dirname + "/public", url: "/public" })); router.addRoute("/logout", function (req, res, opts, callback) { var session = Session(req, res, store) session.destroy(function (err) { if (err) { return callback(err) } redirect(req, res, "/login") }); }); router.addRoute("/login", { GET: function (req, res, opts, callback) { var session = Session(req, res, store) session.get("message", function (err, doc) { if (err) { return callback(err) } var message = "" if (doc && doc.type === "error") { message = "<p class='msg error'>" + doc.text + "</p>" } if (doc && doc.type === "success") { message = "<p class='msg success'>" + doc.text + "</p>" } session.del("message", function (err) { if (err) { return callback(err) } sendHtml(req, res, templates.login({ message: message })) }) }) }, POST: function (req, res, opts, callback) { //process login form... formBody(req, res, function (err, body) { // when form body is ready... if (err) { return callback(err) } authenticate(body.username, body.password, function (err, user) { var session = Session(req, res, store) if (err || !user) { return session.set("message", { type: "error", text: "Authentication failed, pleace check your " + " username and password." }, function (err) { if (err) { return callback(err) } redirect(req, res, "/login") }) } // else no err, proceed: showSession(session); session.del(function (err) { if (err) { return callback(err) } showSession(session); session.set("user", user, function (err) { if (err) { return callback(err) } showSession(session); session.set("message", { type: "success", text: "Authenticated as " + user.name + " click to <a href='/logout'>logout</a>. " }, function (err) { if (err) { return callback(err) } redirect(req, res, "/") })//session.set message })//session.set user })//session.del })//authenticate })//formBody } }); var server = http.createServer(router); server.listen(3000); console.log("example auth server listening on port 3000");
{ "content_hash": "c1ccb374eb66e44e557181b9892cebf7", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 84, "avg_line_length": 25.985221674876847, "alnum_prop": 0.5435071090047393, "repo_name": "portlandcodeschool/js-night", "id": "7a9726ca75e9d49a2977dd5753eeb43e58b64ae4", "size": "5275", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "backbone-lessons-w-persistence-NEW/small-module-node-with-auth-proposal/index.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1989195" }, { "name": "JavaScript", "bytes": "7568871" }, { "name": "TeX", "bytes": "1337" } ], "symlink_target": "" }
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_17a.html">Class Test_AbaRouteValidator_17a</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_36537_good </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_17a.html?line=34909#src-34909" >testAbaNumberCheck_36537_good</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:46:02 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_36537_good</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=29626#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.7352941</span>73.5% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="73.5% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:73.5%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
{ "content_hash": "d472ee3ee80c7a1df4643806499a7287", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 297, "avg_line_length": 43.942583732057415, "alnum_prop": 0.5099085365853658, "repo_name": "dcarda/aba.route.validator", "id": "1f1c41ecada7a6882b40d2cd3dfb33e48046c4f6", "size": "9184", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "target13/site/clover/com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_17a_testAbaNumberCheck_36537_good_muy.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "18715254" } ], "symlink_target": "" }
/** * Definition of Interval: * classs Interval { * int start, end; * Interval(int start, int end) { * this->start = start; * this->end = end; * } */ class Solution { public: /** * Insert newInterval into intervals. * @param intervals: Sorted interval list. * @param newInterval: new interval. * @return: A new interval list. */ vector<Interval> insert(vector<Interval> &intervals, Interval newInterval) { vector<Interval> out; bool inserted = false; for (auto &i : intervals) { if (newInterval.start > i.end) { out.push_back(i); } else { if (!inserted) { out.push_back(newInterval); inserted = true; } if (i.start > out.back().end) { out.push_back(i); } else { out.back().start = min(out.back().start, i.start); out.back().end = max(out.back().end, i.end); } } } if (!inserted) { out.push_back(newInterval); } return out; } };
{ "content_hash": "381fe20efeb74c52493aa0646f93dfce", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 28.325581395348838, "alnum_prop": 0.4523809523809524, "repo_name": "joshua-jin/algorithm-campus", "id": "f54691002a593e7bb8721a216d3e4fcc0afebd23", "size": "1218", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "chingjun/30-insert-interval.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "62223" }, { "name": "Java", "bytes": "192445" }, { "name": "Python", "bytes": "14225" } ], "symlink_target": "" }
package cfg import ( "database/sql" "flag" "github.com/golang/glog" _ "github.com/mattn/go-sqlite3" ) var configSqlite = flag.String("config.sqlite", "config.db", "path to config database") var db *sql.DB func init() { var err error if configSqlite != nil && *configSqlite != "" { db, err = sql.Open("sqlite3", *configSqlite) if err != nil { glog.Fatalf("unable to open config database %q", *configSqlite) } } } func Int(key string) (int, error) { var val int row := db.QueryRow("SELECT val FROM C WHERE key = ?;", key) err := row.Scan(&val) return val, err } func String(key string) (string, error) { var val string row := db.QueryRow("SELECT val FROM C WHERE key = ?;", key) err := row.Scan(&val) return val, err } func MustInt(key string) int { val, err := Int(key) if err != nil { glog.Fatalf("Unable to retrieve value for key %q", key) } return val } func MustString(key string) string { val, err := String(key) if err != nil { glog.Fatalf("Unable to retrieve value for key %q", key) } return val }
{ "content_hash": "f9016ca897a6eb2bfe9e582ee9c78aed", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 87, "avg_line_length": 20.153846153846153, "alnum_prop": 0.648854961832061, "repo_name": "mstone/atlas", "id": "2e2cb3adac7517d3b7aa5373224040f612efe957", "size": "1103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cfg/cfg.go", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "68207" }, { "name": "Go", "bytes": "72924" }, { "name": "JavaScript", "bytes": "1451322" }, { "name": "PHP", "bytes": "1702" }, { "name": "Shell", "bytes": "889" } ], "symlink_target": "" }
<div class="modal fade" id="registration" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> × </button> <h4 class="modal-title" id="myModalLabel"> Увійти/Реєстрація</h4> </div> <div class="modal-body"> <div class="container"> <div class="col-md-8" style="border-right: 1px dotted #C2C2C2;padding-right: 30px;"> <!-- Nav tabs --> <ul class="nav nav-tabs"> <li class="active"><a href="#Login" data-toggle="tab">Login</a></li> <li><a href="#Registration" data-toggle="tab">Registration</a></li> </ul> <!-- Tab panes --> <div class="tab-content"> <div class="tab-pane active" id="Login"> <form role="form" class="form-horizontal" action="{% url 'login' %}" method="post"> {% csrf_token %} <div class="form-group"> <label for="email" class="col-sm-2 control-label"> Email</label> <div class="col-sm-10"> {{ log_in_form.username }} </div> </div> <div class="form-group"> <label for="exampleInputPassword1" class="col-sm-2 control-label"> Password</label> <div class="col-sm-10"> {{ log_in_form.password }} </div> </div> <div class="container"> <div class="col-sm-2"> </div> <div class="col-sm-10"> <button type="submit" class="btn btn-primary btn-sm"> Надіслати </button> </div> </div> </form> </div> <div class="tab-pane" id="Registration"> <form role="form" class="form-horizontal" action="{% url 'registration' %}" method="post"> {% csrf_token %} <div class="form-group"> <label for="email" class="col-sm-2 control-label"> Ім'я</label> <div class="col-sm-10"> <div class="container"> <div class="col-md-9"> {{ reg_form.first_name }} </div> </div> </div> </div> <div class="form-group"> <label for="email" class="col-sm-2 control-label"> Прізвище</label> <div class="col-sm-10"> {{ reg_form.last_name }} </div> </div> <div class="form-group"> <label for="email" class="col-sm-2 control-label"> Username</label> <div class="col-sm-10"> {{ reg_form.username }} </div> </div> <div class="form-group"> <label for="mobile" class="col-sm-2 control-label"> Email</label> <div class="col-sm-10"> {{ reg_form.email }} </div> </div> <div class="form-group"> <label for="password" class="col-sm-2 control-label"> Password</label> <div class="col-sm-10"> {{ reg_form.password }} </div> </div> <div class="container"> <div class="col-sm-2"> </div> <div class="col-sm-10"> <button type="submit" class="btn btn-primary btn-sm"> Зберегти і продовжити </button> <button type="reset" class="btn btn-default btn-sm"> Cancel </button> </div> </div> </form> </div> </div> </div> </div> </div> </div> </div> </div> </div>
{ "content_hash": "7fde8e3aafdaae12ba8c7fceb4172e35", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 106, "avg_line_length": 38.91525423728814, "alnum_prop": 0.38806620209059234, "repo_name": "aodarc/flowers_room", "id": "72257e140ffff94fef499c89e79993612addbc45", "size": "4648", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "apps/userprofile/templates/registration_modal_form.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "88" }, { "name": "CSS", "bytes": "66095" }, { "name": "HTML", "bytes": "2811225" }, { "name": "JavaScript", "bytes": "4477001" }, { "name": "PHP", "bytes": "3345441" }, { "name": "Python", "bytes": "53185" } ], "symlink_target": "" }
package net.paultek.util.massive.annotation; import java.io.IOException; import java.io.Writer; import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.processing.AbstractProcessor; import javax.annotation.processing.Filer; import javax.annotation.processing.Messager; import javax.annotation.processing.RoundEnvironment; import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedSourceVersion; import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; /** * This processor handles the generation of code from interfaces. * * @author Paul Huynh [paul.viet.huynh@live.com] */ @SupportedAnnotationTypes(value = { "net.paultek.util.massive.annotation.GenerateCode" }) @SupportedSourceVersion(SourceVersion.RELEASE_8) public class Processor extends AbstractProcessor { // Public default constructor, in case reflective tools look for it public Processor() { } @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { final Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(GenerateCode.class); final Messager messager = processingEnv.getMessager(); final Filer filer = processingEnv.getFiler(); for (Element e : elements) { if (e.getKind() != ElementKind.INTERFACE) { messager.printMessage(Diagnostic.Kind.ERROR, GenerateCode.class.getSimpleName() + " can only be applied on interfaces", e); } } // Convert all the elements to TypeElements for (Element e : elements) { generateCode((TypeElement) e, filer); } return true; } protected void generateCode(TypeElement typeElement, Filer filer) { final VelocityEngine engine = new VelocityEngine(); engine.init(); final Template template = engine.getTemplate("generate_code_template.vm"); final VelocityContext context = new VelocityContext(); context.put("packageName", "net.paultek.util.massive"); context.put("interfaceName", typeElement.getSimpleName().toString()); try (Writer writer = filer.createSourceFile("Dummy").openWriter()) { template.merge(context, writer); } catch (IOException ex) { Logger.getLogger(getClass().getSimpleName()).log(Level.SEVERE, null, ex); } } }
{ "content_hash": "4f735ea7156e34347ff36bbc49303b08", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 139, "avg_line_length": 37.342465753424655, "alnum_prop": 0.7215700660308144, "repo_name": "knockhead/massive_collections", "id": "00254c32e4a4c2835a42afe411624e29cd8cf447", "size": "3348", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "MassiveCollections/Annotations/src/main/java/net/paultek/util/massive/annotation/Processor.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "17060" } ], "symlink_target": "" }
<?php namespace Magento\Framework\Setup\Option; /** * Multi-select option in deployment config tool */ class MultiSelectConfigOption extends AbstractConfigOption { /**#@+ * Frontend input types */ const FRONTEND_WIZARD_CHECKBOX = 'checkbox'; const FRONTEND_WIZARD_MULTISELECT = 'multiselect'; /**#@- */ /** * Available options * * @var array */ private $selectOptions; /** * Constructor * * @param string $name * @param string $frontendType * @param array $selectOptions * @param string $configPath * @param string $description * @param array $defaultValue * @param string|array|null $shortCut * @throws \InvalidArgumentException */ public function __construct( $name, $frontendType, array $selectOptions, $configPath, $description = '', array $defaultValue = [], $shortCut = null ) { if ($frontendType != self::FRONTEND_WIZARD_MULTISELECT && $frontendType != self::FRONTEND_WIZARD_CHECKBOX) { throw new \InvalidArgumentException( "Frontend input type has to be 'multiselect', 'textarea' or 'checkbox'." ); } if (!$selectOptions) { throw new \InvalidArgumentException('Select options can\'t be empty.'); } $this->selectOptions = $selectOptions; parent::__construct( $name, $frontendType, self::VALUE_REQUIRED | self::VALUE_IS_ARRAY, $configPath, $description, $defaultValue, $shortCut ); } /** * Get available options * * @return array */ public function getSelectOptions() { return $this->selectOptions; } /** * Validates input data * * @param mixed $data * @return void * @throws \InvalidArgumentException */ public function validate($data) { if (is_array($data)) { foreach ($data as $value) { if (!in_array($value, $this->getSelectOptions())) { throw new \InvalidArgumentException( "Value specified for '{$this->getName()}' is not supported: '{$value}'" ); } } } parent::validate($data); } }
{ "content_hash": "4008a5410afd8354ae01ecc11d870636", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 116, "avg_line_length": 25.36842105263158, "alnum_prop": 0.5344398340248963, "repo_name": "tarikgwa/test", "id": "03feebaca18ff50ca6607fb08bdc6c57e3952769", "size": "2508", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "html/lib/internal/Magento/Framework/Setup/Option/MultiSelectConfigOption.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "26588" }, { "name": "CSS", "bytes": "4874492" }, { "name": "HTML", "bytes": "8635167" }, { "name": "JavaScript", "bytes": "6810903" }, { "name": "PHP", "bytes": "55645559" }, { "name": "Perl", "bytes": "7938" }, { "name": "Shell", "bytes": "4505" }, { "name": "XSLT", "bytes": "19889" } ], "symlink_target": "" }
package org.oscm.string; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collection; /** * Utility class for working with strings. */ public class Strings { /** * Shortens the given text to the given maximum number of characters. The * shortened text is appended with dots. * * @param text * The text to shorten * @param maxNumberOfChars * Max length of the returned string * @return String */ public static String shortenText(String text, int maxNumberOfChars) { if (text == null) { return null; } String trimmedText = text.trim(); if (trimmedText.length() > maxNumberOfChars) { return trimmedText.substring(0, maxNumberOfChars - 3) + "..."; //$NON-NLS-1$ } return trimmedText; } /** * Encodes the given string as bytes in UTF-8 encoding. * * @param value * Value to encode * @return byte[] */ public static byte[] toBytes(String value) { return doToBytes(value, "UTF-8"); //$NON-NLS-1$ } static byte[] doToBytes(String value, String encoding) { try { return value.getBytes(encoding); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException( "UTF-8 encoding is not supported", e); //$NON-NLS-1$ } } /** * Constructs a new string by decoding the given bytes using UTF-8. <br> * <br> * WARNING: This method cannot be applied to random bytes. The result might * be crippled in this case. This method may only be used if the given bytes * have been encoded from a string. <br> * * @param value * Value to decode * @return String */ public static String toString(byte[] value) { return doToString(value, "UTF-8");//$NON-NLS-1$ } static String doToString(byte[] value, String encoding) { try { return new String(value, encoding); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException( "UTF-8 encoding is not supported", e); //$NON-NLS-1$ } } /** * Checks if the provided value is null or trimmed empty * * @param value * the {@link String} to check * @return <code>true</code> if empty otherwise false */ public static boolean isEmpty(String value) { return (value == null || value.trim().length() == 0); } /** * Joins the elements of the provided collection into a single * <code>String</code> containing the provided elements. No delimiter is * added before or after the list. A <code>null</code> separator is the same * as an empty <code>String</code> (""). * * @param collection * the Collection of values to join together, may be null * @param separator * the separator string to use * @return the joined <code>String</code>, <code>null</code> if null * iterator input * @see org.apache.commons.lang.StringUtils#join() */ public static String join(Collection<?> collection, String separator) { if (collection == null) { return null; } if (separator == null) { separator = ""; } StringBuffer buff = new StringBuffer(); for (Object object : collection) { if (buff.length() > 0) { buff.append(separator); } buff.append(object); } return buff.toString(); } /** * Returns if the two strings are equal. In case both are <code>null</code>, * they are also considered to be equal. * * @param s1 * String 1. * @param s2 * String 2. * @return <code>true</code> in case the strings are equal, * <code>false</code> otherwise. */ public static boolean areStringsEqual(String s1, String s2) { if (s1 == null) { return s2 == null; } return s1.equals(s2); } /** * Returns a string whose first character is upper case, following * characters of the given string are untouched. Given null or empty strings * are returned as they are. */ public static String firstCharToUppercase(String word) { if (word == null || word.length() == 0) { return word; } return word.substring(0, 1).toUpperCase().concat(word.substring(1)); } /** * Reads a text file and converts it into a String object. * * @param path * the path to the text file * @return string object representing the text file * @throws IOException * if an I/O error occurs reading from the stream */ public static String textFileToString(String path) throws IOException { byte[] encoded = Files.readAllBytes(Paths.get(path)); return StandardCharsets.UTF_8.decode(ByteBuffer.wrap(encoded)) .toString(); } /** * Returns an empty string in case of null, otherwise the same string. * * @param str * @return string object */ public static String nullToEmpty(String str) { if (str == null) { return ""; } return str; } /** * Replaces a substring, from and to are included. */ public static String replaceSubstring(int from, int to, String str, String value) { String result = null; if ((str != null) && (value != null) && (from >= 0) && (from <= to) && (to < str.length())) { String head = null; String tail = null; head = str.substring(0, from); tail = str.substring(to + 1, str.length()); result = head + value + tail; } return result; } }
{ "content_hash": "b7e01a170edddf3179ab59476b314b17", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 88, "avg_line_length": 30.067961165048544, "alnum_prop": 0.5637713916693574, "repo_name": "opetrovski/development", "id": "b8ebf76ddaf0c1902a24950724df333468249e7c", "size": "6391", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "oscm-common/javasrc/org/oscm/string/Strings.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "5304" }, { "name": "Batchfile", "bytes": "273" }, { "name": "CSS", "bytes": "389539" }, { "name": "HTML", "bytes": "1884410" }, { "name": "Java", "bytes": "41884121" }, { "name": "JavaScript", "bytes": "259479" }, { "name": "PHP", "bytes": "620531" }, { "name": "PLSQL", "bytes": "4929" }, { "name": "SQLPL", "bytes": "25278" }, { "name": "Shell", "bytes": "3250" } ], "symlink_target": "" }
<?php namespace BlogBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; class CategoryType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('name',TextType::class,array("label"=>"Nombre","required"=>"required","attr"=>array( "class"=>"form-surmname form-control", ))) ->add('description',TextareaType::class,array("label"=>"Descripción","required"=>"required","attr"=>array( "class"=>"form-surmname form-control", ))) ->add("Guardar",SubmitType::class,array("attr"=>array( "class"=>"form-submit btn btn-success", ))) ; } /** * @param OptionsResolver $resolver */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => 'BlogBundle\Entity\Category' )); } }
{ "content_hash": "2ef6d730dc33cfbef276d26d4af9e96c", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 118, "avg_line_length": 30.791666666666668, "alnum_prop": 0.6481732070365359, "repo_name": "jcg678/pruebasSymfony", "id": "83459a4362664f7400836549584acec49fd179bc", "size": "1478", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/BlogBundle/Form/CategoryType.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3605" }, { "name": "HTML", "bytes": "19853" }, { "name": "PHP", "bytes": "102790" } ], "symlink_target": "" }
DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S.%f" DATE_FORMAT = '%Y-%m-%d' DEFAULT_BASE_URL = 'https://acm.pdx.edu/api/v1' from .parser import parser from .routines import * from acmlib import AcmLib def acmcli(): args = parser.parse_args() acmlib = AcmLib( username = args.username, password = args.password, base_url = args.base_url, ) if args.subparser1 == 'events': if args.subparser2 == 'add': events_add(acmlib, args) elif args.subparser2 == 'update': events_update(acmlib, args) elif args.subparser2 == 'list': events_list(acmlib, args) elif args.subparser1 == 'posts': if args.subparser2 == 'add': posts_add(acmlib, args) elif args.subparser2 == 'update': posts_update(acmlib, args) elif args.subparser2 == 'list': posts_list(acmlib, args) elif args.subparser1 == 'people': if args.subparser2 == 'add': people_add(acmlib, args) elif args.subparser2 == 'update': people_update(acmlib, args) elif args.subparser2 == 'list': people_list(acmlib, args) elif args.subparser2 == 'delete': people_delete(acmlib, args) elif args.subparser1 == 'memberships': if args.subparser2 == 'add': memberships_add(acmlib, args) elif args.subparser2 == 'update': memberships_update(acmlib, args) elif args.subparser2 == 'list': memberships_list(acmlib, args) elif args.subparser2 == 'delete': memberships_delete(acmlib, args) elif args.subparser1 == 'officerships': if args.subparser2 == 'add': officerships_add(acmlib, args) elif args.subparser2 == 'update': officerships_update(acmlib, args) elif args.subparser2 == 'list': officerships_list(acmlib, args) elif args.subparser2 == 'delete': officerships_delete(acmlib, args) elif args.subparser1 == 'database': database_get(acmlib, args)
{ "content_hash": "8e91e5fc57ade920e6eabf0d4526fd8e", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 47, "avg_line_length": 35.4, "alnum_prop": 0.57015065913371, "repo_name": "pdxacm/acmcli", "id": "2dbfe4f90e44af363d128409f93622731e5f9385", "size": "2124", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "acmcli/__init__.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Python", "bytes": "15954" } ], "symlink_target": "" }
#pragma once #include "ViewTree.h" class CFileViewToolBar : public CMFCToolBar { virtual void OnUpdateCmdUI(CFrameWnd* /*pTarget*/, BOOL bDisableIfNoHndler) { CMFCToolBar::OnUpdateCmdUI((CFrameWnd*) GetOwner(), bDisableIfNoHndler); } virtual BOOL AllowShowOnList() const { return FALSE; } }; class CFileView : public CDockablePane { // Construcción public: CFileView(); void AdjustLayout(); void OnChangeVisualStyle(); // Atributos protected: CViewTree m_wndFileView; CImageList m_FileViewImages; CFileViewToolBar m_wndToolBar; protected: void FillFileView(); // Implementación public: virtual ~CFileView(); protected: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); afx_msg void OnProperties(); afx_msg void OnFileOpen(); afx_msg void OnFileOpenWith(); afx_msg void OnDummyCompile(); afx_msg void OnEditCut(); afx_msg void OnEditCopy(); afx_msg void OnEditClear(); afx_msg void OnPaint(); afx_msg void OnSetFocus(CWnd* pOldWnd); DECLARE_MESSAGE_MAP() };
{ "content_hash": "273702eb47914c5b58fcfa1b6ce7dbec", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 76, "avg_line_length": 20.054545454545455, "alnum_prop": 0.7470534904805077, "repo_name": "temcocontrols/T3000_CrossPlatform", "id": "42df24ec62a407c0e461adc023d9ebc53a2d3ccc", "size": "1103", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "VCCEditor/MFCTestEditor/FileView.h", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "5731" }, { "name": "C#", "bytes": "3215425" }, { "name": "C++", "bytes": "81668" }, { "name": "Rich Text Format", "bytes": "68766" }, { "name": "Vim Snippet", "bytes": "872" }, { "name": "Visual Basic .NET", "bytes": "1443" }, { "name": "xBase", "bytes": "113644" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Text; namespace Newtonsoft.Json { /// <summary> /// Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. /// </summary> internal class StringBuffer { private char[] _buffer; private int _position; private static char[] _emptyBuffer = new char[0]; public int Position { get { return _position; } set { _position = value; } } public StringBuffer() { _buffer = _emptyBuffer; } public StringBuffer(int initalSize) { _buffer = new char[initalSize]; } public void Append(char value) { // test if the buffer array is large enough to take the value if (_position + 1 > _buffer.Length) { EnsureSize(1); } // set value and increment poisition _buffer[_position++] = value; } public void Clear() { _buffer = _emptyBuffer; _position = 0; } private void EnsureSize(int appendLength) { char[] newBuffer = new char[_position + appendLength * 2]; Array.Copy(_buffer, newBuffer, _position); _buffer = newBuffer; } public override string ToString() { return new string(_buffer, 0, _position); } } }
{ "content_hash": "3a69436fd371c235bc7f232870e70ca9", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 90, "avg_line_length": 18.338461538461537, "alnum_prop": 0.6493288590604027, "repo_name": "blancosj/dodonet", "id": "506fdbb54c152c335a9d01b0c866b26f447d3388", "size": "1993", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Newtonsoft.Json/StringBuffer.cs", "mode": "33261", "license": "mit", "language": [ { "name": "C#", "bytes": "5660049" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <settings> <!-- 开启驼峰匹配 --> <setting name="mapUnderscoreToCamelCase" value="true"/> </settings> <!-- 分页助手 --> <plugins> <!-- com.github.pagehelper为PageHelper类所在包名 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <!-- 数据库方言 --> <property name="dialect" value="mysql"/> <!-- 设置为true时,使用RowBounds分页会进行count查询,会去查询出总数 --> <property name="rowBoundsWithCount" value="true"/> </plugin> </plugins> </configuration>
{ "content_hash": "6f97900d1362cd1a88223a50d81de220", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 59, "avg_line_length": 24.884615384615383, "alnum_prop": 0.6414219474497682, "repo_name": "zhaoshuxue/ssm", "id": "abedab470819553cdcaea8bf216e9da9abd4fdba", "size": "731", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/resources/mybatis/mybatis-config.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9281" }, { "name": "Java", "bytes": "40892" }, { "name": "Shell", "bytes": "1570" } ], "symlink_target": "" }
import path from 'path'; import {PackageJson} from 'type-fest'; import {Ignore} from 'ignore'; import {Rules} from '../native-rules'; import {parseJsonFile} from '../file-parser'; import {LintIssue} from '../lint-issue'; import {RuleType} from '../types/rule-type'; import {Severity} from '../types/severity'; import {aggregateCountsPerFile, aggregateOverallCounts, OverallAggregatedResultCounts} from './results-helper'; import {Config} from '../configuration'; import {PackageJsonFileLintingResult} from '../types/package-json-linting-result'; // eslint-disable-next-line @typescript-eslint/no-var-requires const debug = require('debug')('npm-package-json-lint:linter'); export interface CreateResultObjectOptions { /** * The current working directory. */ cwd: string; /** * An optional string representing the package.json file. */ fileName: string; /** * A flag indicating that the file was skipped. */ ignored: boolean; /** * A list of issues. */ issues: LintIssue[]; /** * Number of errors. */ errorCount: number; /** * Number of warnings. */ warningCount: number; } /** * Creates a results object. * * @param options A {@link CreateResultObjectOptions} object * @returns The lint results {@link PackageJsonFileLintingResult} for the package.json file. * @internal */ const createResultObject = (options: CreateResultObjectOptions): PackageJsonFileLintingResult => { const {cwd, fileName, ignored, issues, errorCount, warningCount} = options; return { filePath: `./${path.relative(cwd, fileName)}`, issues, ignored, errorCount, warningCount, }; }; /** * Runs configured rules against the provided package.json object. * * @param packageJsonData Valid package.json data * @param configObj Configuration object * @param rules Object of rule definitions * @return An array of {@link LintIssue} objects. * @internal */ // eslint-disable-next-line @typescript-eslint/no-explicit-any const lint = (packageJsonData: any, configObj, rules: Rules): LintIssue[] => { const lintIssues = []; // eslint-disable-next-line no-restricted-syntax, guard-for-in for (const rule in configObj) { const ruleModule = rules.get(rule); let severity = Severity.Off; let ruleConfig; if (ruleModule.ruleType === RuleType.Array || ruleModule.ruleType === RuleType.Object) { severity = typeof configObj[rule] === 'string' && configObj[rule] === 'off' ? configObj[rule] : configObj[rule][0]; ruleConfig = typeof configObj[rule] === 'string' ? {} : configObj[rule][1]; } else if (ruleModule.ruleType === RuleType.OptionalObject) { if (typeof configObj[rule] === 'string') { severity = configObj[rule]; ruleConfig = {}; } else { // eslint-disable-next-line prefer-destructuring severity = configObj[rule][0]; // eslint-disable-next-line prefer-destructuring ruleConfig = configObj[rule][1]; } } else { severity = configObj[rule]; } if (severity !== Severity.Off) { const lintResult = ruleModule.lint(packageJsonData, severity, ruleConfig); if (lintResult !== null) { lintIssues.push(lintResult); } } } return lintIssues; }; /** * Processes package.json object * * @param cwd The current working directory. * @param packageJsonObj An object representation of a package.json file. * @param config A config object. * @param fileName An optional string representing the package.json file. * @param rules An instance of `Rules`. * @returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file. * @internal */ const processPackageJsonObject = ( cwd: string, // eslint-disable-next-line @typescript-eslint/no-explicit-any packageJsonObj: PackageJson | any, // TODO: Type config, fileName: string, rules: Rules ): PackageJsonFileLintingResult => { const lintIssues = lint(packageJsonObj, config, rules); const counts = aggregateCountsPerFile(lintIssues); const result = createResultObject({ cwd, fileName, ignored: false, issues: lintIssues, errorCount: counts.errorCount, warningCount: counts.warningCount, }); return result; }; /** * Processes a package.json file. * * @param cwd The current working directory. * @param fileName The filename of the file being linted. * @param config A config object. * @param rules An instance of `Rules`. * @returns A {@link PackageJsonFileLintingResult} object with the result of linting a package.json file. * @internal */ // TODO: Type const processPackageJsonFile = (cwd: string, fileName: string, config, rules: Rules): PackageJsonFileLintingResult => { const packageJsonObj = parseJsonFile(path.resolve(fileName)); return processPackageJsonObject(cwd, packageJsonObj, config, fileName, rules); }; export interface LinterResult { results: LintIssue[]; ignoreCount: number; /** * Number of errors for the package.json file. */ errorCount: number; /** * Number of warnings for the package.json file. */ warningCount: number; } export interface ExecuteOnPackageJsonObjectOptions { /** * The current working directory. */ cwd: string; /** * An object representation of a package.json file. */ // eslint-disable-next-line @typescript-eslint/no-explicit-any packageJsonObject: PackageJson | any; /** * An optional string representing the texts filename. */ filename?: string; /** * An instance of the `ignore` module. */ ignorer: Ignore; /** * An instance of {@Config}. */ configHelper: Config; /** * An instance of {@link Rules} */ rules: Rules; } export interface OverallLintingResult extends OverallAggregatedResultCounts { results: PackageJsonFileLintingResult[]; } /** * Executes linter on package.json object * * @param options A {@link ExecuteOnPackageJsonObjectOptions} object * @returns The results {@link OverallLintingResult} from linting a collection of package.json files. */ export const executeOnPackageJsonObject = (options: ExecuteOnPackageJsonObjectOptions): OverallLintingResult => { const {cwd, packageJsonObject, filename, ignorer, configHelper, rules} = options; debug('executing on package.json object'); const results = []; const filenameDefaulted = filename || ''; const resolvedFilename = path.isAbsolute(filenameDefaulted) ? filenameDefaulted : path.resolve(cwd, filenameDefaulted); const relativeFilePath = path.relative(cwd, resolvedFilename); if (ignorer.ignores(relativeFilePath)) { debug(`Ignored: ${relativeFilePath}`); const result = createResultObject({ cwd, fileName: resolvedFilename, ignored: true, issues: [], errorCount: 0, warningCount: 0, }); results.push(result); } else { debug(`Getting config for ${resolvedFilename}`); const config = configHelper.getConfigForFile(resolvedFilename); debug(`Config fetched for ${resolvedFilename}`); const result = processPackageJsonObject(cwd, packageJsonObject, config, resolvedFilename, rules); results.push(result); } debug('Aggregating overall counts'); const stats = aggregateOverallCounts(results); debug('stats'); debug(stats); return { results, ignoreCount: stats.ignoreCount, errorCount: stats.errorCount, warningCount: stats.warningCount, }; }; export interface ExecuteOnPackageJsonFilesOptions { /** * The current working directory. */ cwd: string; /** * An array of files and directory names. */ fileList: string[]; /** * An instance of the `ignore` module. */ ignorer: Ignore; /** * An instance of {@Config}. */ configHelper: Config; /** * An instance of {@link Rules} */ rules: Rules; } /** * Executes the current configuration on an array of file and directory names. * @param options A {@link ExecuteOnPackageJsonFilesOptions} object * @returns The results {@link OverallLintingResult} from linting a collection of package.json files. */ export const executeOnPackageJsonFiles = (options: ExecuteOnPackageJsonFilesOptions): OverallLintingResult => { const {cwd, fileList, ignorer, configHelper, rules} = options; debug('executing on package.json files'); const results = fileList.map((filePath) => { const relativeFilePath = path.relative(cwd, filePath); if (ignorer.ignores(relativeFilePath)) { debug(`Ignored: ${relativeFilePath}`); return createResultObject({ cwd, fileName: filePath, ignored: true, issues: [], errorCount: 0, warningCount: 0, }); } debug(`Getting config for ${filePath}`); const config = configHelper.getConfigForFile(filePath); debug(`Config fetched for ${filePath}`); return processPackageJsonFile(cwd, filePath, config, rules); }); debug('Aggregating overall counts'); const stats = aggregateOverallCounts(results); debug('stats'); debug(stats); return { results, ignoreCount: stats.ignoreCount, errorCount: stats.errorCount, warningCount: stats.warningCount, }; };
{ "content_hash": "ffc80dedb80eb1cc707d360d1ba60118", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 121, "avg_line_length": 28.021341463414632, "alnum_prop": 0.6890436296376891, "repo_name": "tclindner/npm-package-json-lint", "id": "68cb5c42350ea553d206104e23c2204da520b1d9", "size": "9191", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/linter/linter.ts", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1587" }, { "name": "JavaScript", "bytes": "31098" }, { "name": "TypeScript", "bytes": "550934" } ], "symlink_target": "" }
// ----------------------------------------------------------------------- // <copyright file="Program.cs" company="Asynkron HB"> // Copyright (C) 2015-2018 Asynkron HB All rights reserved // </copyright> // ----------------------------------------------------------------------- using System; using Proto; class Program { static void Main(string[] args) { var context = new RootContext(); var props = Props.FromFunc(ctx => { if (ctx.Message is string) { ctx.Respond("hey"); } return Actor.Done; }); var pid = context.Spawn(props); var reply = context.RequestAsync<object>(pid ,"hello").Result; Console.WriteLine(reply); Console.ReadLine(); } }
{ "content_hash": "07c917ae52f7b337b84e2a3eb02fe9a3", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 75, "avg_line_length": 28.379310344827587, "alnum_prop": 0.42770352369380316, "repo_name": "tomliversidge/protoactor-dotnet", "id": "5a075238107db6942324e6c3f0b5f7894bb04d74", "size": "825", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "examples/Futures/Program.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "884" }, { "name": "C#", "bytes": "600532" }, { "name": "PowerShell", "bytes": "6109" }, { "name": "Shell", "bytes": "3419" } ], "symlink_target": "" }
var defaults = require('../defaults'), moment = require('moment').utc, _ = require('lodash'); exports.details = function(result){ var details = { relays: [], bridges: [] }; if(result && result.hasOwnProperty('relays') && result.hasOwnProperty('bridges')){ var consensus = { bridges: moment(result.bridges_published), relays: moment(result.relays_published) }; if(result.relays.length){ for(var i = 0, numRelays = result.relays.length; i < numRelays; i++){ // process result relays var relay = _.merge({}, defaults.relay, result.relays[i]), relayLastSeenMoment = moment(relay.last_seen); // check if consensus.relays and lastSeenMoment exist if( consensus.relays && relayLastSeenMoment && // check if both are valid (moment.isValid) consensus.relays.isValid() && relayLastSeenMoment.isValid()){ relay.inLatestConsensus = consensus.relays.isSame(relayLastSeenMoment); } details.relays.push(relay); } } if(result.bridges.length){ for(var j = 0, numBridges = result.bridges.length; j < numBridges; j++){ // process result bridges var bridge = _.merge({}, defaults.bridge, result.bridges[j]), bridgeLastSeenMoment = moment(bridge.last_seen); // check if consensus.relays and lastSeenMoment exist if( consensus.bridges && bridgeLastSeenMoment && // check if both are valid (moment.isValid) consensus.bridges.isValid() && bridgeLastSeenMoment.isValid()){ bridge.inLatestConsensus = consensus.bridges.isSame(bridgeLastSeenMoment); } details.bridges.push(bridge); } } } return details; };
{ "content_hash": "467d0779f87125ed2bf7bdb2fd8ac836", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 94, "avg_line_length": 35.473684210526315, "alnum_prop": 0.5425321463897131, "repo_name": "makepanic/globe-node", "id": "2ad38ff2277d6566a6ee49ae8c83ec95f58441a7", "size": "2022", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/onionoo/util/normalize.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "197478" }, { "name": "JavaScript", "bytes": "79235" }, { "name": "Shell", "bytes": "512" } ], "symlink_target": "" }
<?php namespace ElkArte\Notifiers; use ElkArte\Mentions\MentionType\NotificationInterface; use ElkArte\Notifications\NotificationsTask; /** * Class Notifications * * Core area for notifications, defines the abstract model */ Interface NotifierInterface { /** * Process a certain task in order to send out the notifications. * * @param \ElkArte\Mentions\MentionType\NotificationInterface $obj * @param \ElkArte\Notifications\NotificationsTask $task * @param string[] $bodies */ public function send(NotificationInterface $obj, NotificationsTask $task, $bodies); }
{ "content_hash": "02ed6a0b58a1d0235abc606611f0f697", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 84, "avg_line_length": 23.44, "alnum_prop": 0.7627986348122867, "repo_name": "elkarte/Elkarte", "id": "fd59c186605c511a8b0106f01fc345c48e9b2335", "size": "871", "binary": false, "copies": "2", "ref": "refs/heads/development", "path": "sources/ElkArte/Notifiers/NotifierInterface.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "490484" }, { "name": "JavaScript", "bytes": "611986" }, { "name": "PHP", "bytes": "8520988" }, { "name": "Shell", "bytes": "1179" } ], "symlink_target": "" }
<!DOCTYPE html> <meta charset="utf-8"> <style> body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; width: 780px; margin: 30px auto; color: #222; font-size: 15px; text-align: center; } path { fill: none; stroke-linejoin: round; } .land { fill: #e6e6e6; } .states { stroke: #fff; } .hexagons path { stroke-width: 0.5px; stroke-opacity: 0.5; stroke: none; } .button { text-decoration: none; color: #fff; border-radius: 3px; padding: 3px; font-size: 13px; cursor: pointer; background: #ddd; } .notes { background: #eee; margin: 120px; padding: 10px 10px 20px; text-align: left; } </style> <body> <h3>Lizard/Woodrat Test</h3> <p>Note: You probably want <a href="lizards-woodrats.html">Lizards and Woodrats</a></p> <p>Hexbin Radius - <strong><span id="bin-size-print">4</span> px</strong> <input type="range" id="bin-size" value="6" min="1" max="20"></p> <p>Color Palette - <select id="colorbrewer"><option>RdBu</option></select></p> <div id="maps"></div> <div class="notes"> <small> <p>Things to Try:</p> <p>Non-georeferenced observations excluded.</p> <p>Queries </p> <ul id="query-list"> <a id="query1"></a> </ul> </small> </div> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="http://d3js.org/d3.hexbin.v0.min.js"></script> <script src="http://d3js.org/queue.v1.min.js"></script> <script src="http://d3js.org/topojson.v1.min.js"></script> <script src="../lib/colorbrewer.js"></script> <script> // Based on http://bl.ocks.org/mbostock/4330486 var lizards = [ [], [] ]; /* Configuration */ var api_root = "https://ecoengine.berkeley.edu/api/observations/"; var queries = [ '?selected_facets=scientific_name_exact%3A"Sceloporus occidentalis"&q=&page_size=200', '?selected_facets=genus_exact%3A"neotoma"&q=&page_size=200' ]; var color = d3.scale.quantize() .domain([-1,1]) .range(colorbrewer.RdBu[5]); queries.forEach(function(q,i) { loadQuery(api_root + q, i); }); /* Interface */ d3.select("#query-list") .selectAll("li") .data(queries) .enter().append("li") .append("a") .attr("href", function(d) { return api_root + d; }) .text(function(d) { return d; }) d3.select("#bin-size") .on("change", function() { d3.select("#bin-size-print").text(this.value); hexbin.radius(this.value); radius.range([1, this.value]); d3.selectAll(".hexagons path").remove(); ready(); }); d3.select("#colorbrewer") .on("change", function() { color.range(colorbrewer[this.value][7]); ready(); }) .selectAll("option") .data(d3.keys(colorbrewer)) .enter().append("option") .text(String) /* Chart */ var width = 280, height = 160, parseDate = d3.time.format("%x").parse; var hexbin = d3.hexbin() .size([width, height]) .radius(4); var radius = d3.scale.sqrt() .domain([1, 500]) .range([1, 4.5]); var projection = d3.geo.albers() .scale(260) .translate([width / 2, height / 2]) .precision(.1); var path = d3.geo.path() .projection(projection); var svg = d3.select("#maps") .append("svg") .attr("width", width) .attr("height", height); var background = svg.append("g") .attr("class", "us-map"); var hexagons = svg.append("g") .attr("class", "hexagons") function ready() { var combined = []; lizards.forEach(function(dataset) { combined = combined.concat(dataset); }); var hexbins = hexbin(combined) .sort(function(a, b) { return b.length - a.length; }); radius.domain([1, d3.max(hexbins, function(d) { return d.length; })]) var hexes = hexagons.selectAll("path") .data(hexbins, function(d) { return [d.x, d.y].join(""); }) hexes.enter().append("path") .attr("d", function(d) { return hexbin.hexagon(radius(d.length)); }) .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }); hexes.exit() .transition() .attr("d", function(d) { return hexbin.hexagon(0); }) hexes .transition() .attr("d", function(d) { return hexbin.hexagon(radius(d.length)); }) .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .style("fill", function(d) { var count = queries.map(function(d) { return 0; }); d.forEach(function(p) { count[p.queryIndex]++; }); var metric = (count[0] - count[1]) / d.length; return color(metric); }); } function loadQuery(url,index) { d3.json(url, function(error, data) { //console.log(data); // use only lizards with geojson lizards[index] = lizards[index].concat(data.results.filter(function(d) { return !!d.geometry; }).map(function(d) { var p = projection(d.geometry.coordinates); d.queryIndex = index; d[0] = p[0]; d[1] = p[1]; return d; }) ); ready(); if (data.next) { function loadNext() { //console.log("load next"); loadQuery(data.next, index); }; setTimeout(loadNext, 30); } else { //console.log("done."); } }); } // background us states layer d3.json("us.json", function(error, us) { background.append("path") .datum(topojson.feature(us, us.objects.land)) .attr("class", "land") .attr("d", path); }); </script>
{ "content_hash": "2adbe6568842b199b26f7913c3d18f0f", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 140, "avg_line_length": 23.589285714285715, "alnum_prop": 0.5985995457986374, "repo_name": "berkeley-gif/ecoengine", "id": "762d3286d94bccad981aeb170854bc4cab2d5907", "size": "5284", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "prototypes/covis/covis-temp.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "21418" }, { "name": "HTML", "bytes": "163026" }, { "name": "JavaScript", "bytes": "57397" } ], "symlink_target": "" }
Rails.application.routes.draw do get 'welcome/index' # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". # Set up the initial articles routing resources :articles do resources :comments end # You can have the root of your site routed with "root" root 'welcome#index' # Example of regular route: # get 'products/:id' => 'catalog#view' # Example of named route that can be invoked with purchase_url(id: product.id) # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase # Example resource route (maps HTTP verbs to controller actions automatically): # resources :products # Example resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end # Example resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end # Example resource route with more complex sub-resources: # resources :products do # resources :comments # resources :sales do # get 'recent', on: :collection # end # end # Example resource route with concerns: # concern :toggleable do # post 'toggle' # end # resources :posts, concerns: :toggleable # resources :photos, concerns: :toggleable # Example resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end end
{ "content_hash": "e7b47549771cca8f065a24e7fa5759b1", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 84, "avg_line_length": 27.285714285714285, "alnum_prop": 0.6503781268179174, "repo_name": "davidhostios/mynewnewblog", "id": "4fab88c2b937d9ee4fdc0c2a21304e94b8bdd847", "size": "1719", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/routes.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1918" }, { "name": "CoffeeScript", "bytes": "633" }, { "name": "HTML", "bytes": "8910" }, { "name": "JavaScript", "bytes": "637" }, { "name": "Ruby", "bytes": "25421" } ], "symlink_target": "" }
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H #include <grpc/support/port_platform.h> #include <grpc/support/slice.h> #include <grpc/support/slice_buffer.h> #include "src/core/ext/transport/chttp2/transport/frame.h" #include "src/core/lib/iomgr/exec_ctx.h" typedef enum { GRPC_CHTTP2_GOAWAY_LSI0, GRPC_CHTTP2_GOAWAY_LSI1, GRPC_CHTTP2_GOAWAY_LSI2, GRPC_CHTTP2_GOAWAY_LSI3, GRPC_CHTTP2_GOAWAY_ERR0, GRPC_CHTTP2_GOAWAY_ERR1, GRPC_CHTTP2_GOAWAY_ERR2, GRPC_CHTTP2_GOAWAY_ERR3, GRPC_CHTTP2_GOAWAY_DEBUG } grpc_chttp2_goaway_parse_state; typedef struct { grpc_chttp2_goaway_parse_state state; uint32_t last_stream_id; uint32_t error_code; char *debug_data; uint32_t debug_length; uint32_t debug_pos; } grpc_chttp2_goaway_parser; void grpc_chttp2_goaway_parser_init(grpc_chttp2_goaway_parser *p); void grpc_chttp2_goaway_parser_destroy(grpc_chttp2_goaway_parser *p); grpc_chttp2_parse_error grpc_chttp2_goaway_parser_begin_frame( grpc_chttp2_goaway_parser *parser, uint32_t length, uint8_t flags); grpc_chttp2_parse_error grpc_chttp2_goaway_parser_parse( grpc_exec_ctx *exec_ctx, void *parser, grpc_chttp2_transport_parsing *transport_parsing, grpc_chttp2_stream_parsing *stream_parsing, gpr_slice slice, int is_last); void grpc_chttp2_goaway_append(uint32_t last_stream_id, uint32_t error_code, gpr_slice debug_data, gpr_slice_buffer *slice_buffer); #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_GOAWAY_H */
{ "content_hash": "3faf3b6dad7cc752d4ed08e045b07455", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 78, "avg_line_length": 35, "alnum_prop": 0.7304347826086957, "repo_name": "leifurhauks/grpc", "id": "7c38b26a39b985e738af7754dbea0bae9d5ff81c", "size": "3178", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/core/ext/transport/chttp2/transport/frame_goaway.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "12635" }, { "name": "C", "bytes": "4804665" }, { "name": "C#", "bytes": "1042810" }, { "name": "C++", "bytes": "1293677" }, { "name": "DTrace", "bytes": "147" }, { "name": "JavaScript", "bytes": "265235" }, { "name": "Makefile", "bytes": "558082" }, { "name": "Objective-C", "bytes": "272060" }, { "name": "PHP", "bytes": "129051" }, { "name": "Protocol Buffer", "bytes": "101725" }, { "name": "Python", "bytes": "1574612" }, { "name": "Ruby", "bytes": "461694" }, { "name": "Shell", "bytes": "49693" }, { "name": "Swift", "bytes": "5279" } ], "symlink_target": "" }
'''Runner for pyOCD .''' import os import sys from .core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration from .. import log DEFAULT_PYOCD_GDB_PORT = 3333 class PyOcdBinaryRunner(ZephyrBinaryRunner): '''Runner front-end for pyOCD.''' def __init__(self, cfg, target, flashtool='pyocd-flashtool', flash_addr=0x0, flashtool_opts=None, gdbserver='pyocd-gdbserver', gdb_port=DEFAULT_PYOCD_GDB_PORT, tui=False, board_id=None, daparg=None): super(PyOcdBinaryRunner, self).__init__(cfg) self.target_args = ['-t', target] self.flashtool = flashtool self.flash_addr_args = ['-a', hex(flash_addr)] if flash_addr else [] self.gdb_cmd = [cfg.gdb] if cfg.gdb is not None else None self.gdbserver = gdbserver self.gdb_port = gdb_port self.tui_args = ['-tui'] if tui else [] self.bin_name = cfg.kernel_bin self.elf_name = cfg.kernel_elf board_args = [] if board_id is not None: board_args = ['-b', board_id] self.board_args = board_args daparg_args = [] if daparg is not None: daparg_args = ['-da', daparg] self.daparg_args = daparg_args self.flashtool_extra = flashtool_opts if flashtool_opts else [] @classmethod def name(cls): return 'pyocd' @classmethod def capabilities(cls): return RunnerCaps(flash_addr=True) @classmethod def do_add_parser(cls, parser): parser.add_argument('--target', required=True, help='target override') parser.add_argument('--daparg', help='Additional -da arguments to pyocd tool') parser.add_argument('--flashtool', default='pyocd-flashtool', help='flash tool path, default is pyocd-flashtool') parser.add_argument('--flashtool-opt', default=[], action='append', help='''Additional options for pyocd-flashtool, e.g. -ce to chip erase''') parser.add_argument('--gdbserver', default='pyocd-gdbserver', help='GDB server, default is pyocd-gdbserver') parser.add_argument('--gdb-port', default=DEFAULT_PYOCD_GDB_PORT, help='pyocd gdb port, defaults to {}'.format( DEFAULT_PYOCD_GDB_PORT)) parser.add_argument('--tui', default=False, action='store_true', help='if given, GDB uses -tui') parser.add_argument('--board-id', help='ID of board to flash, default is to prompt') @classmethod def create(cls, cfg, args): daparg = os.environ.get('PYOCD_DAPARG') if daparg: log.wrn('Setting PYOCD_DAPARG in the environment is', 'deprecated; use the --daparg option instead.') if args.daparg is None: log.dbg('Missing --daparg set to {} from environment'.format( daparg), level=log.VERBOSE_VERY) args.daparg = daparg build_conf = BuildConfiguration(cfg.build_dir) flash_addr = cls.get_flash_address(args, build_conf) return PyOcdBinaryRunner( cfg, args.target, flashtool=args.flashtool, flash_addr=flash_addr, flashtool_opts=args.flashtool_opt, gdbserver=args.gdbserver, gdb_port=args.gdb_port, tui=args.tui, board_id=args.board_id, daparg=args.daparg) def port_args(self): return ['-p', str(self.gdb_port)] def do_run(self, command, **kwargs): if command == 'flash': self.flash(**kwargs) else: self.debug_debugserver(command, **kwargs) def flash(self, **kwargs): if self.bin_name is None: raise ValueError('Cannot flash; bin_name is missing') cmd = ([self.flashtool] + self.flash_addr_args + self.daparg_args + self.target_args + self.board_args + self.flashtool_extra + [self.bin_name]) log.inf('Flashing Target Device') self.check_call(cmd) def print_gdbserver_message(self): log.inf('pyOCD GDB server running on port {}'.format(self.gdb_port)) def debug_debugserver(self, command, **kwargs): server_cmd = ([self.gdbserver] + self.daparg_args + self.port_args() + self.target_args + self.board_args) if command == 'debugserver': self.print_gdbserver_message() self.check_call(server_cmd) else: if self.gdb_cmd is None: raise ValueError('Cannot debug; gdb is missing') if self.elf_name is None: raise ValueError('Cannot debug; elf is missing') client_cmd = (self.gdb_cmd + self.tui_args + [self.elf_name] + ['-ex', 'target remote :{}'.format(self.gdb_port), '-ex', 'load', '-ex', 'monitor reset halt']) self.print_gdbserver_message() self.run_server_and_client(server_cmd, client_cmd)
{ "content_hash": "4367e595e7c590450a2272e621bb0eec", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 79, "avg_line_length": 37.9020979020979, "alnum_prop": 0.5409594095940959, "repo_name": "mbolivar/zephyr", "id": "b8a6ee4ed4a9cd8a1130b45b7077a591000fbcf4", "size": "5498", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "scripts/meta/west/runner/pyocd.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "403733" }, { "name": "Batchfile", "bytes": "209" }, { "name": "C", "bytes": "269962976" }, { "name": "C++", "bytes": "2684696" }, { "name": "CMake", "bytes": "398610" }, { "name": "Makefile", "bytes": "2793" }, { "name": "Objective-C", "bytes": "33204" }, { "name": "Perl", "bytes": "202119" }, { "name": "Python", "bytes": "723350" }, { "name": "Shell", "bytes": "22632" }, { "name": "Verilog", "bytes": "6394" } ], "symlink_target": "" }
namespace Common { // 'StringView' is a pair of pointer to constant char and size. // It is recommended to pass 'StringView' to procedures by value. // 'StringView' supports 'EMPTY' and 'NIL' representations as follows: // 'data' == 'nullptr' && 'size' == 0 - EMPTY NIL // 'data' != 'nullptr' && 'size' == 0 - EMPTY NOTNIL // 'data' == 'nullptr' && 'size' > 0 - Undefined // 'data' != 'nullptr' && 'size' > 0 - NOTEMPTY NOTNIL class StringView { public: typedef char Object; typedef size_t Size; const static Size INVALID; const static StringView EMPTY; const static StringView NIL; // Default constructor. // Leaves object uninitialized. Any usage before initializing it is undefined. StringView(); // Direct constructor. // The behavior is undefined unless 'stringData' != 'nullptr' || 'stringSize' == 0 StringView(const Object* stringData, Size stringSize); // Constructor from C array. // The behavior is undefined unless 'stringData' != 'nullptr' || 'stringSize' == 0. Input state can be malformed using poiner conversions. template<Size stringSize> StringView(const Object(&stringData)[stringSize]) : data(stringData), size(stringSize - 1) { assert(data != nullptr || size == 0); } // Constructor from std::string StringView(const std::string& string); // Copy constructor. // Performs default action - bitwise copying of source object. // The behavior is undefined unless 'other' 'StringView' is in defined state, that is 'data' != 'nullptr' || 'size' == 0 StringView(const StringView& other); // Destructor. // No special action is performed. ~StringView(); // Copy assignment operator. // The behavior is undefined unless 'other' 'StringView' is in defined state, that is 'data' != 'nullptr' || 'size' == 0 StringView& operator=(const StringView& other); explicit operator std::string() const; const Object* getData() const; Size getSize() const; // Return false if 'StringView' is not EMPTY. // The behavior is undefined unless 'StringView' was initialized. bool isEmpty() const; // Return false if 'StringView' is not NIL. // The behavior is undefined unless 'StringView' was initialized. bool isNil() const; // Get 'StringView' element by index. // The behavior is undefined unless 'StringView' was initialized and 'index' < 'size'. const Object& operator[](Size index) const; // Get first element. // The behavior is undefined unless 'StringView' was initialized and 'size' > 0 const Object& first() const; // Get last element. // The behavior is undefined unless 'StringView' was initialized and 'size' > 0 const Object& last() const; // Return a pointer to the first element. // The behavior is undefined unless 'StringView' was initialized. const Object* begin() const; // Return a pointer after the last element. // The behavior is undefined unless 'StringView' was initialized. const Object* end() const; // Compare elements of two strings, return false if there is a difference. // EMPTY and NIL strings are considered equal. // The behavior is undefined unless both strings were initialized. bool operator==(StringView other) const; // Compare elements two strings, return false if there is no difference. // EMPTY and NIL strings are considered equal. // The behavior is undefined unless both strings were initialized. bool operator!=(StringView other) const; // Compare two strings character-wise. // The behavior is undefined unless both strings were initialized. bool operator<(StringView other) const; // Compare two strings character-wise. // The behavior is undefined unless both strings were initialized. bool operator<=(StringView other) const; // Compare two strings character-wise. // The behavior is undefined unless both strings were initialized. bool operator>(StringView other) const; // Compare two strings character-wise. // The behavior is undefined unless both strings were initialized. bool operator>=(StringView other) const; // Return false if 'StringView' does not contain 'object' at the beginning. // The behavior is undefined unless 'StringView' was initialized. bool beginsWith(const Object& object) const; // Return false if 'StringView' does not contain 'other' at the beginning. // The behavior is undefined unless both strings were initialized. bool beginsWith(StringView other) const; // Return false if 'StringView' does not contain 'object'. // The behavior is undefined unless 'StringView' was initialized. bool contains(const Object& object) const; // Return false if 'StringView' does not contain 'other'. // The behavior is undefined unless both strings were initialized. bool contains(StringView other) const; // Return false if 'StringView' does not contain 'object' at the end. // The behavior is undefined unless 'StringView' was initialized. bool endsWith(const Object& object) const; // Return false if 'StringView' does not contain 'other' at the end. // The behavior is undefined unless both strings were initialized. bool endsWith(StringView other) const; // Looks for the first occurence of 'object' in 'StringView', // returns index or INVALID if there are no occurences. // The behavior is undefined unless 'StringView' was initialized. Size find(const Object& object) const; // Looks for the first occurence of 'other' in 'StringView', // returns index or INVALID if there are no occurences. // The behavior is undefined unless both strings were initialized. Size find(StringView other) const; // Looks for the last occurence of 'object' in 'StringView', // returns index or INVALID if there are no occurences. // The behavior is undefined unless 'StringView' was initialized. Size findLast(const Object& object) const; // Looks for the first occurence of 'other' in 'StringView', // returns index or INVALID if there are no occurences. // The behavior is undefined unless both strings were initialized. Size findLast(StringView other) const; // Returns substring of 'headSize' first elements. // The behavior is undefined unless 'StringView' was initialized and 'headSize' <= 'size'. StringView head(Size headSize) const; // Returns substring of 'tailSize' last elements. // The behavior is undefined unless 'StringView' was initialized and 'tailSize' <= 'size'. StringView tail(Size tailSize) const; // Returns 'StringView' without 'headSize' first elements. // The behavior is undefined unless 'StringView' was initialized and 'headSize' <= 'size'. StringView unhead(Size headSize) const; // Returns 'StringView' without 'tailSize' last elements. // The behavior is undefined unless 'StringView' was initialized and 'tailSize' <= 'size'. StringView untail(Size tailSize) const; // Returns substring starting at 'startIndex' and contaning 'endIndex' - 'startIndex' elements. // The behavior is undefined unless 'StringView' was initialized and 'startIndex' <= 'endIndex' and 'endIndex' <= 'size'. StringView range(Size startIndex, Size endIndex) const; // Returns substring starting at 'startIndex' and contaning 'sliceSize' elements. // The behavior is undefined unless 'StringView' was initialized and 'startIndex' <= 'size' and 'startIndex' + 'sliceSize' <= 'size'. StringView slice(Size startIndex, Size sliceSize) const; protected: const Object* data; Size size; }; }
{ "content_hash": "4804e355e4d1310958cef2df44a3efca", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 140, "avg_line_length": 40.93956043956044, "alnum_prop": 0.7227217823110992, "repo_name": "tobeyrowe/StarKingdomCoin", "id": "93f73b0dade37ba6fad184a6bc620c327c938a8f", "size": "7700", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Common/StringView.h", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "23589" }, { "name": "C++", "bytes": "1234305" }, { "name": "Groff", "bytes": "12841" }, { "name": "Makefile", "bytes": "4061" }, { "name": "NSIS", "bytes": "6065" }, { "name": "Objective-C++", "bytes": "2463" }, { "name": "Python", "bytes": "47675" }, { "name": "QMake", "bytes": "9864" }, { "name": "Shell", "bytes": "1064" } ], "symlink_target": "" }
import superimport import numpy as np import matplotlib.pyplot as plt import pyprobml_utils as pml from scipy.stats import t, laplace, norm x = np.linspace(-4, 4, 100) plt.title('|x|^0.2') plt.plot(x, np.absolute(x)**.2) pml.savefig('lossFnQ2.pdf') plt.figure() plt.title('|x|') plt.plot(x, np.absolute(x)) pml.savefig('lossFnQ10.pdf') plt.figure() plt.title('|x|^2') plt.plot(x, np.absolute(x)**2) pml.savefig('lossFnQ20.pdf') plt.show()
{ "content_hash": "f577b693432dc876d23470d47b993b32", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 40, "avg_line_length": 20.136363636363637, "alnum_prop": 0.6997742663656885, "repo_name": "probml/pyprobml", "id": "c56c33d40bc7a29b1578648a3526e9d44d52e968", "size": "483", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "deprecated/scripts/regression_loss_fn_plot.py", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "410080351" }, { "name": "MATLAB", "bytes": "41510" }, { "name": "Python", "bytes": "1842224" }, { "name": "R", "bytes": "576" }, { "name": "Shell", "bytes": "45" }, { "name": "TeX", "bytes": "302617" } ], "symlink_target": "" }
cask "mullvadvpn-beta" do version "2022.5-beta2" sha256 "78b2571f0ac4b5d8bc99086172225009924dbb7619658707416622f095eb58e9" url "https://github.com/mullvad/mullvadvpn-app/releases/download/#{version}/MullvadVPN-#{version}.pkg", verified: "github.com/mullvad/mullvadvpn-app/" name "Mullvad VPN" desc "VPN client" homepage "https://mullvad.net/" livecheck do url "https://github.com/mullvad/mullvadvpn-app/releases" regex(%r{href=["']?[^"' >]*?/tag/v?(\d+(?:\.\d+)+[._-]beta\d*)["' >]}i) strategy :page_match end conflicts_with cask: "mullvadvpn" pkg "MullvadVPN-#{version}.pkg" uninstall pkgutil: "net.mullvad.vpn", quit: "net.mullvad.vpn", launchctl: "net.mullvad.daemon" zap trash: [ "~/Library/Application Support/Mullvad VPN", "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/net.mullvad.vpn.sfl*", "~/Library/Logs/Mullvad VPN", "~/Library/Preferences/net.mullvad.vpn.plist", "~/Library/Preferences/net.mullvad.vpn.helper.plist", ] end
{ "content_hash": "0320e9683df0e2c04be454bf74beb16d", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 136, "avg_line_length": 34.375, "alnum_prop": 0.6827272727272727, "repo_name": "mahori/homebrew-cask-versions", "id": "8b79ff155a8929b5d368be24812e254c3452545a", "size": "1100", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Casks/mullvadvpn-beta.rb", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Ruby", "bytes": "277510" } ], "symlink_target": "" }
class GURL; namespace blink { enum class WebAutofillState; class WebDocument; class WebElement; class WebFormControlElement; class WebFormElement; class WebInputElement; class WebLocalFrame; class WebNode; } // namespace blink namespace content { class RenderFrame; } // namespace content namespace autofill { struct FormData; struct FormFieldData; class FieldDataManager; namespace form_util { // Mapping from a form element's render id to results of button titles // heuristics for a given form element. using ButtonTitlesCache = base::flat_map<FormRendererId, ButtonTitleList>; // A bit field mask to extract data from WebFormControlElement. // Copied to components/autofill/ios/browser/resources/autofill_controller.js. enum ExtractMask { EXTRACT_NONE = 0, EXTRACT_VALUE = 1 << 0, // Extract value from WebFormControlElement. EXTRACT_OPTION_TEXT = 1 << 1, // Extract option text from // WebFormSelectElement. Only valid when // |EXTRACT_VALUE| is set. // This is used for form submission where // human readable value is captured. EXTRACT_OPTIONS = 1 << 2, // Extract options from // WebFormControlElement. EXTRACT_BOUNDS = 1 << 3, // Extract bounds from WebFormControlElement, // could trigger layout if needed. EXTRACT_DATALIST = 1 << 4, // Extract datalist from WebFormControlElement, // the total number of options is up to // kMaxListSize and each option has as far as // kMaxDataLength. }; // Autofill supports assigning <label for=x> tags to inputs if x its id/name, // or the id/name of a shadow host element containing the input. // This enum is used to track how often each case occurs in practise. enum class AssignedLabelSource { kId = 0, kName = 1, kShadowHostId = 2, kShadowHostName = 3, kMaxValue = kShadowHostName, }; // This temporary histogram is emitted inline, because browser files like // AutofillMetrics cannot be included here. // TODO(crbug.com/1339277): Remove. inline constexpr char kAssignedLabelSourceHistogram[] = "Autofill.LabelInference.AssignedLabelSource"; // Indicates if an iframe |element| is considered actually visible to the user. // // This function is not intended to implement a perfect visibility check. It // rather aims to strike balance between cheap tests and filtering invisible // frames, which can then be skipped during parsing. // // The current visibility check requires focusability and a sufficiently large // bounding box. Thus, particularly elements with "visibility: invisible", // "display: none", and "width: 0; height: 0" are considered invisible. // // Future potential improvements include: // * Detect potential visibility of elements with "overflow: visible". // (See WebElement::GetScrollSize().) // * Detect invisibility of elements with // - "position: absolute; {left,top,right,bottol}: -100px" // - "opacity: 0.0" // - "clip: rect(0,0,0,0)" // // Exposed for testing purposes. bool IsVisibleIframe(const blink::WebElement& iframe_element); // Returns the topmost <form> ancestor of |node|, or an IsNull() pointer. // // Generally, WebFormElements must not be nested [1]. When parsing HTML, Blink // ignores nested form tags; the inner forms therefore never make it into the // DOM. Howevery, nested forms can be created and added to the DOM dynamically, // in which case Blink associates each field with its closest ancestor. // // For some elements, Autofill determines the associated form without Blink's // help (currently, these are only iframe elements). For consistency with // Blink's behaviour, we associate them with their closest form element // ancestor. // // [1] https://html.spec.whatwg.org/multipage/forms.html#the-form-element blink::WebFormElement GetClosestAncestorFormElement(blink::WebNode node); // Returns true if a DOM traversal (pre-order, depth-first) visits `x` before // `y`. // As a performance improvement, `ancestor_hint` can be set to a suspected // ancestor of `x` and `y`. Otherwise, `ancestor_hint` can be arbitrary. // // This function is a simplified/specialised version of Blink's private // Node::compareDocumentPosition(). // // Exposed for testing purposes. bool IsDOMPredecessor(const blink::WebNode& x, const blink::WebNode& y, const blink::WebNode& ancestor_hint); // Gets up to kMaxListSize data list values (with corresponding label) for the // given element, each value and label have as far as kMaxDataLength. void GetDataListSuggestions(const blink::WebInputElement& element, std::vector<std::u16string>* values, std::vector<std::u16string>* labels); // Extract FormData from the form element and return whether the operation was // successful. bool ExtractFormData(const blink::WebFormElement& form_element, const FieldDataManager& field_data_manager, FormData* data); // Returns true if at least one element from |control_elements| is visible. bool IsSomeControlElementVisible( blink::WebLocalFrame* frame, const std::set<FieldRendererId>& control_elements); // Helper functions to assist in getting the canonical form of the action and // origin. The action will proplerly take into account <BASE>, and both will // strip unnecessary data (e.g. query params and HTTP credentials). GURL GetCanonicalActionForForm(const blink::WebFormElement& form); GURL GetDocumentUrlWithoutAuth(const blink::WebDocument& document); // Returns true if |element| is a month input element. bool IsMonthInput(const blink::WebInputElement& element); // Returns true if |element| is a text input element. bool IsTextInput(const blink::WebInputElement& element); // Returns true if |element| is a select element. bool IsSelectElement(const blink::WebFormControlElement& element); // Returns true if |element| is a textarea element. bool IsTextAreaElement(const blink::WebFormControlElement& element); // Returns true if `element` is a textarea element or a text input element. bool IsTextAreaElementOrTextInput(const blink::WebFormControlElement& element); // Returns true if |element| is a checkbox or a radio button element. bool IsCheckableElement(const blink::WebInputElement& element); // Returns true if |element| is one of the input element types that can be // autofilled. {Text, Radiobutton, Checkbox}. bool IsAutofillableInputElement(const blink::WebInputElement& element); // Returns true if |element| is one of the element types that can be autofilled. // {Text, Radiobutton, Checkbox, Select, TextArea}. bool IsAutofillableElement(const blink::WebFormControlElement& element); // True if this node can take focus. If the layout is blocked, then the function // checks if the element takes up space in the layout, i.e., this element or a // descendant has a non-empty bounding client rect. bool IsWebElementFocusable(const blink::WebElement& element); // A heuristic visibility detection. See crbug.com/1335257 for an overview of // relevant aspects. // // Note that WebElement::BoundsInWidget(), WebElement::GetClientSize(), // and WebElement::GetScrollSize() include the padding but do not include the // border and margin. BoundsInWidget() additionally scales the // dimensions according to the zoom factor. // // It seems that invisible fields on websites typically have dimensions between // 0 and 10 pixels, before the zoom factor. Therefore choosing `kMinPixelSize` // is easier without including the zoom factor. For that reason, this function // prefers GetClientSize() over BoundsInWidget(). // // This function does not check the position in the viewport because fields in // iframes commonly are visible despite the body having height zero. Therefore, // `e.GetDocument().Body().BoundsInWidget().Intersects( // e.BoundsInWidget())` yields false negatives. // // Exposed for testing purposes. // // TODO(crbug.com/1335257): Can input fields or iframes actually overflow? bool IsWebElementVisible(const blink::WebElement& element); // Returns the form's |name| attribute if non-empty; otherwise the form's |id| // attribute. std::u16string GetFormIdentifier(const blink::WebFormElement& form); // Returns the FormRendererId of a given WebFormElement. If // WebFormElement::IsNull(), returns a null form renderer id, which is the // renderer id of the unowned form. FormRendererId GetFormRendererId(const blink::WebFormElement& form); // Returns the FieldRendererId of a given WebFormControlElement. FieldRendererId GetFieldRendererId(const blink::WebFormControlElement& field); // Returns text alignment for |element|. base::i18n::TextDirection GetTextDirectionForElement( const blink::WebFormControlElement& element); // Returns all the auto-fillable form control elements in |control_elements|. std::vector<blink::WebFormControlElement> ExtractAutofillableElementsFromSet( const blink::WebVector<blink::WebFormControlElement>& control_elements); // Returns all the auto-fillable form control elements in |form_element|. std::vector<blink::WebFormControlElement> ExtractAutofillableElementsInForm( const blink::WebFormElement& form_element); struct ShadowFieldData; // Fills out a FormField object from a given WebFormControlElement. // |extract_mask|: See the enum ExtractMask above for details. Field properties // will be copied from |field_data_manager|, if the argument is not null and // has entry for |element| (see properties in FieldPropertiesFlags). void WebFormControlElementToFormField( FormRendererId form_renderer_id, const blink::WebFormControlElement& element, const FieldDataManager* field_data_manager, ExtractMask extract_mask, FormFieldData* field, ShadowFieldData* shadow_data = nullptr); // Fills |form| with the FormData object corresponding to the |form_element|. // If |field| is non-NULL, also fills |field| with the FormField object // corresponding to the |form_control_element|. |extract_mask| controls what // data is extracted. Returns true if |form| is filled out. Also returns false // if there are no fields or too many fields in the |form|. Field properties // will be copied from |field_data_manager|, if the argument is not null and // has entry for |element| (see properties in FieldPropertiesFlags). bool WebFormElementToFormData( const blink::WebFormElement& form_element, const blink::WebFormControlElement& form_control_element, const FieldDataManager* field_data_manager, ExtractMask extract_mask, FormData* form, FormFieldData* field); // Get all form control elements from |elements| that are not part of a form. // If |fieldsets| is not NULL, also append the fieldsets encountered that are // not part of a form. std::vector<blink::WebFormControlElement> GetUnownedFormFieldElements( const blink::WebDocument& document, std::vector<blink::WebElement>* fieldsets); // A shorthand for filtering the results of GetUnownedFormFieldElements with // ExtractAutofillableElementsFromSet. std::vector<blink::WebFormControlElement> GetUnownedAutofillableFormFieldElements( const blink::WebDocument& document, std::vector<blink::WebElement>* fieldsets); // Returns the <iframe> elements that are not in the scope of any <form>. std::vector<blink::WebElement> GetUnownedIframeElements( const blink::WebDocument& document); // Returns false iff the extraction fails because the number of fields exceeds // |kMaxParseableFields|, or |field| and |element| are not nullptr but // |element| is not among |control_elements|. bool UnownedFormElementsAndFieldSetsToFormData( const std::vector<blink::WebElement>& fieldsets, const std::vector<blink::WebFormControlElement>& control_elements, const std::vector<blink::WebElement>& iframe_elements, const blink::WebFormControlElement* element, const blink::WebDocument& document, const FieldDataManager* field_data_manager, ExtractMask extract_mask, FormData* form, FormFieldData* field); // Finds the form that contains |element| and returns it in |form|. If |field| // is non-NULL, fill it with the FormField representation for |element|. // |additional_extract_mask| control what to extract beside the default mask // which is EXTRACT_VALUE | EXTRACT_OPTIONS. Returns false if the form is not // found or cannot be serialized. bool FindFormAndFieldForFormControlElement( const blink::WebFormControlElement& element, const FieldDataManager* field_data_manager, ExtractMask additional_extract_mask, FormData* form, FormFieldData* field); // Same as above but with default ExtractMask. bool FindFormAndFieldForFormControlElement( const blink::WebFormControlElement& element, const FieldDataManager* field_data_manager, FormData* form, FormFieldData* field); // Fills or previews the form represented by |form|. |element| is the input // element that initiated the auto-fill process. Returns the filled fields. std::vector<blink::WebFormControlElement> FillOrPreviewForm( const FormData& form, const blink::WebFormControlElement& element, mojom::RendererFormDataAction action); // Clears the suggested values in |control_elements|. The state of // |initiating_element| is set to |old_autofill_state|; all other fields are set // to kNotFilled. void ClearPreviewedElements( std::vector<blink::WebFormControlElement>& control_elements, const blink::WebFormControlElement& initiating_element, blink::WebAutofillState old_autofill_state); // Indicates if |node| is owned by |frame| in the sense of // https://dom.spec.whatwg.org/#concept-node-document. Note that being owned by // a frame does not require being attached to its DOM. bool IsOwnedByFrame(const blink::WebNode& node, content::RenderFrame* frame); // Checks if the webpage is empty. // This kind of webpage is considered as empty: // <html> // <head> // </head> // <body> // </body> // </html> // Meta, script and title tags don't influence the emptiness of a webpage. bool IsWebpageEmpty(const blink::WebLocalFrame* frame); // This function checks whether the children of |element| // are of the type <script>, <meta>, or <title>. bool IsWebElementEmpty(const blink::WebElement& element); // Previews |suggestion| in |input_element| and highlights the suffix of // |suggestion| not included in the |input_element| text. |input_element| must // not be null. |user_input| should be the text typed by the user into // |input_element|. Note that |user_input| cannot be easily derived from // |input_element| by calling value(), because of http://crbug.com/507714. void PreviewSuggestion(const std::u16string& suggestion, const std::u16string& user_input, blink::WebFormControlElement* input_element); // Returns the aggregated values of the descendants of |element| that are // non-empty text nodes. This is a faster alternative to |innerText()| for // performance critical operations. It does a full depth-first search so can be // used when the structure is not directly known. However, unlike with // |innerText()|, the search depth and breadth are limited to a fixed threshold. // Whitespace is trimmed from text accumulated at descendant nodes. std::u16string FindChildText(const blink::WebNode& node); // Returns the button titles for |web_form| (or unowned buttons in |document| if // |web_form| is null). |button_titles_cache| can be used to spare recomputation // if called multiple times for the same form. Button titles computation for // unowned buttons is enabled only in Dev and Canary (crbug.com/1086446), // otherwise the method returns an empty list. ButtonTitleList GetButtonTitles(const blink::WebFormElement& web_form, const blink::WebDocument& document, ButtonTitlesCache* button_titles_cache); // Exposed for testing purposes. std::u16string FindChildTextWithIgnoreListForTesting( const blink::WebNode& node, const std::set<blink::WebNode>& divs_to_skip); bool InferLabelForElementForTesting(const blink::WebFormControlElement& element, std::u16string& label, FormFieldData::LabelSource& label_source); // Returns the form element by unique renderer id. Returns the null element if // there is no form with the |form_renderer_id|. blink::WebFormElement FindFormByUniqueRendererId( const blink::WebDocument& doc, FormRendererId form_renderer_id); // Returns the form control element by unique renderer id. It searches the // |form_to_be_searched| if specified, otherwise the whole document. Returns the // null element if there is no element with the |queried_form_control| renderer // id. blink::WebFormControlElement FindFormControlElementByUniqueRendererId( const blink::WebDocument& doc, FieldRendererId queried_form_control, absl::optional<FormRendererId> form_to_be_searched = absl::nullopt); // Note: The vector-based API of the following two functions is a tax for // limiting the frequency and duration of retrieving a lot of DOM elements. // Alternative solutions have been discussed on https://crrev.com/c/1108201. // Returns form control elements identified by the given unique renderer IDs. // The result has the same number of elements as |queried_form_controls| and // the i-th element of the result corresponds to the i-th element of // |queried_form_controls|. The call of this function might be time // expensive, because it retrieves all DOM elements. std::vector<blink::WebFormControlElement> FindFormControlElementsByUniqueRendererId( const blink::WebDocument& doc, const std::vector<FieldRendererId>& queried_form_controls); // Returns form control elements by unique renderer id from the form with // |form_renderer_id|. The result has the same number elements as // |queried_form_controls| and the i-th element of the result corresponds to // the i-th element of |queried_form_controls|. This function is faster than // the previous one, because it only retrieves form control elements from a // single form. std::vector<blink::WebFormControlElement> FindFormControlElementsByUniqueRendererId( const blink::WebDocument& doc, FormRendererId form_renderer_id, const std::vector<FieldRendererId>& queried_form_controls); // Returns the ARIA label text of the elements denoted by the aria-labelledby // attribute of |element| or the value of the aria-label attribute of // |element|, with priority given to the aria-labelledby attribute. std::u16string GetAriaLabel(const blink::WebDocument& document, const blink::WebElement& element); // Returns the ARIA label text of the elements denoted by the aria-describedby // attribute of |element|. std::u16string GetAriaDescription(const blink::WebDocument& document, const blink::WebElement& element); } // namespace form_util } // namespace autofill #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_FORM_AUTOFILL_UTIL_H_
{ "content_hash": "da71fcc209993a5b48e3fad2b7f90322", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 80, "avg_line_length": 45.78436018957346, "alnum_prop": 0.7379535220744268, "repo_name": "chromium/chromium", "id": "ece0116fa09368620b989129b1844029df649bc2", "size": "20213", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "components/autofill/content/renderer/form_autofill_util.h", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>mathcomp-real-closed: 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.15.2 / mathcomp-real-closed - 1.0.4</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> mathcomp-real-closed <small> 1.0.4 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-03 01:42:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-03 01:42:39 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.15.2 Formal proof management system dune 3.4.1 Fast, portable, and opinionated build system ocaml 4.07.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.07.1 Official release 4.07.1 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: &quot;2.0&quot; name: &quot;coq-mathcomp-real-closed&quot; maintainer: &quot;Mathematical Components &lt;mathcomp-dev@sympa.inria.fr&gt;&quot; homepage: &quot;https://github.com/math-comp/real-closed&quot; bug-reports: &quot;https://github.com/math-comp/real-closed/issues&quot; dev-repo: &quot;git+https://github.com/math-comp/real-closed.git&quot; license: &quot;CeCILL-B&quot; build: [ make &quot;-j&quot; &quot;%{jobs}%&quot; ] install: [ make &quot;install&quot; ] depends: [ &quot;coq&quot; { (&gt;= &quot;8.7&quot; &amp; &lt; &quot;8.12~&quot;) } &quot;coq-mathcomp-field&quot; {(&gt;= &quot;1.8.0&quot; &amp; &lt;= &quot;1.10.0&quot;)} &quot;coq-mathcomp-bigenough&quot; {(&gt;= &quot;1.0.0&quot; &amp; &lt; &quot;1.1~&quot;)} ] tags: [ &quot;keyword:real closed field&quot; &quot;keyword:small scale reflection&quot; &quot;keyword:mathematical components&quot; &quot;date:2019-05-23&quot; &quot;logpath:mathcomp&quot;] authors: [ &quot;Cyril Cohen &lt;&gt;&quot; &quot;Assia Mahboubi &lt;&gt;&quot; ] synopsis: &quot;Mathematical Components Library on real closed fields&quot; description: &quot;&quot;&quot; This library contains definitions and theorems about real closed fields, with a construction of the real closure and the algebraic closure (including a proof of the fundamental theorem of algebra). It also contains a proof of decidability of the first order theory of real closed field, through quantifier elimination. &quot;&quot;&quot; url { http: &quot;https://github.com/math-comp/real-closed/archive/1.0.4.tar.gz&quot; checksum: &quot;sha512=3e3b265d3a13581294541bc2e4a110c534663f55689712003c7493262f45c53d2928e02d852700060055fb7024c8f40b600be0556cd56671eee58d51e8f7eec8&quot; } </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-mathcomp-real-closed.1.0.4 coq.8.15.2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.2). The following dependencies couldn&#39;t be met: - coq-mathcomp-real-closed -&gt; coq &lt; 8.12~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;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-mathcomp-real-closed.1.0.4</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": "08f96a76024fb7d6ef2f1037cff2094d", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 190, "avg_line_length": 45.52906976744186, "alnum_prop": 0.5621248882645895, "repo_name": "coq-bench/coq-bench.github.io", "id": "b2ed65455791d908f5195fb085f2a5aa0006bf79", "size": "7856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.15.2/mathcomp-real-closed/1.0.4.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.eclipse.jetty.nosql.memcached.hashmap; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.TimeUnit; import org.eclipse.jetty.nosql.kvs.KeyValueStoreClientException; import org.eclipse.jetty.nosql.memcached.AbstractMemcachedClient; // intend to use this as test mock public class HashMapClient extends AbstractMemcachedClient { static class Entry { private byte[] data = null; private long expiry = 0; Entry(byte[] raw, long exp) { data = raw; expiry = exp; } byte[] getData() { return data; } long getExpiry() { return expiry; } } private static final int FOREVER = 0; private static Map<String, Entry> data = new ConcurrentHashMap<String, Entry>(); public HashMapClient() { this("127.0.0.1:11211"); } public HashMapClient(String serverString) { super(serverString); } public boolean establish() throws KeyValueStoreClientException { if (isAlive()) { shutdown(); } return true; } public boolean shutdown() throws KeyValueStoreClientException { return true; } public boolean isAlive() { return data != null; } public byte[] get(String key) throws KeyValueStoreClientException { if (!isAlive()) { throw(new KeyValueStoreClientException(new IllegalStateException("client not established"))); } byte[] raw = null; synchronized(data) { Entry entry = data.get(key); if ( entry != null) { long exp = entry.getExpiry(); if (System.currentTimeMillis() < exp || exp == FOREVER) { raw = entry.getData(); } else { data.remove(key); } } } return raw; } public boolean set(String key, byte[] raw) throws KeyValueStoreClientException { return this.set(key, raw, FOREVER); } public boolean set(String key, byte[] raw, int exp) throws KeyValueStoreClientException { if (!isAlive()) { throw(new KeyValueStoreClientException(new IllegalStateException("client not established"))); } data.put(key, new Entry(raw, expiryTimeMillis(exp))); return true; } public boolean add(String key, byte[] raw) throws KeyValueStoreClientException { return this.add(key, raw, FOREVER); } public boolean add(String key, byte[] raw, int exp) throws KeyValueStoreClientException { if (!isAlive()) { throw(new KeyValueStoreClientException(new IllegalStateException("client not established"))); } boolean notExists = false; synchronized(data) { notExists = !data.containsKey(key); if (notExists) { data.put(key, new Entry(raw, expiryTimeMillis(exp))); } } return notExists; } public boolean delete(String key) throws KeyValueStoreClientException { if (!isAlive()) { throw(new KeyValueStoreClientException(new IllegalStateException("client not established"))); } data.remove(key); return true; } private long expiryTimeMillis(int exp) { // the actual value sent may either be Unix time (number of seconds since // January 1, 1970, as a 32-bit value), or a number of seconds starting // from current time. In the latter case, this number of seconds may not // exceed 60*60*24*30 (number of seconds in 30 days); if the number sent // by a client is larger than that, the server will consider it to be real // Unix time value rather than an offset from current time. // http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt long timestamp; if (exp < 60*60*24*30) { // relative time timestamp = System.currentTimeMillis()+TimeUnit.SECONDS.toMillis(exp); } else { // absolute time timestamp = TimeUnit.SECONDS.toMillis(exp); } return timestamp; } }
{ "content_hash": "618d0e1b7e17453511346a2ace7d47d4", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 96, "avg_line_length": 28.555555555555557, "alnum_prop": 0.7095608671484158, "repo_name": "kauppalehti/jetty-nosql-memcached-legacy", "id": "848f116d19550a0c76da941cd7c589173d2a33b9", "size": "3598", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "jetty-nosql-memcached-legacy/src/main/java/org/eclipse/jetty/nosql/memcached/hashmap/HashMapClient.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "141296" } ], "symlink_target": "" }
package s_mach.aeondb.impl import s_mach.concurrent._ import s_mach.aeondb.{LocalProjection, Projection} trait LiftedLocalProjection[A,+B] extends Projection[A,B] { def local: LocalProjection[A,B] override def size = local.size.future override def find(key: A) = local.find(key).future override def keys = local.keys.future override def toMap = local.toMap.future } trait LiftedMapProjection[A,+B] extends Projection[A,B] { def local: Map[A,B] override def size = local.size.future override def find(key: A) = local.get(key).future override def keys = local.keys.future override def toMap = local.toMap.future } object LiftedMapProjection { case class LiftedMapProjectionImpl[A,+B]( local: Map[A,B] ) extends LiftedMapProjection[A,B] { override def filterKeys(f: (A) => Boolean) = LiftedMapProjectionImpl(local.filterKeys(f)) } def apply[A,B](local: Map[A,B]) : LiftedMapProjection[A,B] = LiftedMapProjectionImpl(local) }
{ "content_hash": "8485b9f6652089a68af2b6b6217943f4", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 62, "avg_line_length": 28.647058823529413, "alnum_prop": 0.7258726899383984, "repo_name": "S-Mach/aeondb", "id": "d12daa63880ceba8a65ccf52a213881994f1aac2", "size": "1712", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/scala/s_mach/aeondb/impl/LiftedLocalProjection.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Scala", "bytes": "74183" } ], "symlink_target": "" }
#!/bin/bash . $(dirname $0)/../setup.sh describe "Cookies should be removed from the response by fastly to improve caching" keep_headers "Age|X-Cache|X-Served-By|Server|Set-Cookie|Cookie" it "echoes Set-Cookie on origin server" until_fresh_curl_object 5 record_curl -k "${origin_url}/host/${target_event_id}/facets?q=and(and(has(inventorytypes,%22primary%22),has(offertypes,%22standard%22)),available)&show=facerange&by=accessibility+shape+inventorytypes+offers+offerTypes" -H 'Pragma: no-cache' -H 'Origin: http://fastly-hackathon.tmdev.co' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H "Referer: http://fastly-hackathon.tmdev.co/event/${target_event_id}?fg=ism" -H 'Connection: keep-alive' -H "X-Proxy-Authorization: Basic ${target_proxy_auth_token}" -H 'Set-Cookie: CMPS=Q5oQ2d5Dp4NJiGw9hOPvVwTUgwpc0LG7oFTYDCL9qFGv7yZOOnpbJuPC1zFXCC450KX5ygu/fEU=; path=/' --compressed expect_header Server; to_equal nginx if test -z "$(get_header Set-Cookie)"; then it "skips remaining tests since this origin server doesn't set cookies" exit 0 fi expect_header Set-Cookie; to_contain "CMPS=" it "cache misses and removes Set-Cookie on fastly" record_curl "${target_url}/host/${target_event_id}/facets?q=and(and(has(inventorytypes,%22primary%22),has(offertypes,%22standard%22)),available)&show=facerange&by=accessibility+shape+inventorytypes+offers+offerTypes" -H 'Pragma: no-cache' -H 'Origin: http://fastly-hackathon.tmdev.co' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H "Referer: http://fastly-hackathon.tmdev.co/event/${target_event_id}?fg=ism" -H 'Connection: keep-alive' -H "X-Proxy-Authorization: Basic ${target_proxy_auth_token}" -H 'Set-Cookie: CMPS=Q5oQ2d5Dp4NJiGw9hOPvVwTUgwpc0LG7oFTYDCL9qFGv7yZOOnpbJuPC1zFXCC450KX5ygu/fEU=; path=/' --compressed expect_header X-Cache; to_match MISS expect_header Set-Cookie; to_be_empty miss_age=$(get_header Age) it "cache hits and removes Set-Cookie on fastly" record_curl "${target_url}/host/${target_event_id}/facets?q=and(and(has(inventorytypes,%22primary%22),has(offertypes,%22standard%22)),available)&show=facerange&by=accessibility+shape+inventorytypes+offers+offerTypes" -H 'Pragma: no-cache' -H 'Origin: http://fastly-hackathon.tmdev.co' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36' -H 'Accept: */*' -H 'Cache-Control: no-cache' -H "Referer: http://fastly-hackathon.tmdev.co/event/${target_event_id}?fg=ism" -H 'Connection: keep-alive' -H "X-Proxy-Authorization: Basic ${target_proxy_auth_token}" -H 'Set-Cookie: CMPS=Q5oQ2d5Dp4NJiGw9hOPvVwTUgwpc0LG7oFTYDCL9qFGv7yZOOnpbJuPC1zFXCC450KX5ygu/fEU=; path=/' --compressed expect_header X-Cache; to_match HIT expect_header Age; to_be_between $((miss_age)) $((miss_age + 2)) expect_header Set-Cookie; to_be_empty
{ "content_hash": "b6feddf062751e39a28712b0e8898b50", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 852, "avg_line_length": 91.66666666666667, "alnum_prop": 0.7439393939393939, "repo_name": "mwolson/fastly-shell-tests", "id": "e43943af2ae1b83fc948b6c5fecb56f8a271433d", "size": "3300", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/remove_cookies.sh", "mode": "33261", "license": "mit", "language": [ { "name": "Shell", "bytes": "39213" } ], "symlink_target": "" }
#ifndef _LINUX_MTRR_H #define _LINUX_MTRR_H #include <linux/config.h> #include <linux/ioctl.h> #include <linux/compat.h> #define MTRR_IOCTL_BASE 'M' struct mtrr_sentry { unsigned long base; /* Base address */ unsigned int size; /* Size of region */ unsigned int type; /* Type of region */ }; /* Warning: this structure has a different order from i386 on x86-64. The 32bit emulation code takes care of that. But you need to use this for 64bit, otherwise your X server will break. */ struct mtrr_gentry { unsigned long base; /* Base address */ unsigned int size; /* Size of region */ unsigned int regnum; /* Register number */ unsigned int type; /* Type of region */ }; /* These are the various ioctls */ #define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry) #define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry) #define MTRRIOC_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry) #define MTRRIOC_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry) #define MTRRIOC_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry) #define MTRRIOC_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry) #define MTRRIOC_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry) #define MTRRIOC_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry) #define MTRRIOC_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry) #define MTRRIOC_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry) /* These are the region types */ #define MTRR_TYPE_UNCACHABLE 0 #define MTRR_TYPE_WRCOMB 1 /*#define MTRR_TYPE_ 2*/ /*#define MTRR_TYPE_ 3*/ #define MTRR_TYPE_WRTHROUGH 4 #define MTRR_TYPE_WRPROT 5 #define MTRR_TYPE_WRBACK 6 #define MTRR_NUM_TYPES 7 #ifdef __KERNEL__ /* The following functions are for use by other drivers */ # ifdef CONFIG_MTRR extern int mtrr_add (unsigned long base, unsigned long size, unsigned int type, char increment); extern int mtrr_add_page (unsigned long base, unsigned long size, unsigned int type, char increment); extern int mtrr_del (int reg, unsigned long base, unsigned long size); extern int mtrr_del_page (int reg, unsigned long base, unsigned long size); # else static __inline__ int mtrr_add (unsigned long base, unsigned long size, unsigned int type, char increment) { return -ENODEV; } static __inline__ int mtrr_add_page (unsigned long base, unsigned long size, unsigned int type, char increment) { return -ENODEV; } static __inline__ int mtrr_del (int reg, unsigned long base, unsigned long size) { return -ENODEV; } static __inline__ int mtrr_del_page (int reg, unsigned long base, unsigned long size) { return -ENODEV; } # endif #endif #ifdef CONFIG_COMPAT struct mtrr_sentry32 { compat_ulong_t base; /* Base address */ compat_uint_t size; /* Size of region */ compat_uint_t type; /* Type of region */ }; struct mtrr_gentry32 { compat_ulong_t regnum; /* Register number */ compat_uint_t base; /* Base address */ compat_uint_t size; /* Size of region */ compat_uint_t type; /* Type of region */ }; #define MTRR_IOCTL_BASE 'M' #define MTRRIOC32_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry32) #define MTRRIOC32_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry32) #define MTRRIOC32_DEL_ENTRY _IOW(MTRR_IOCTL_BASE, 2, struct mtrr_sentry32) #define MTRRIOC32_GET_ENTRY _IOWR(MTRR_IOCTL_BASE, 3, struct mtrr_gentry32) #define MTRRIOC32_KILL_ENTRY _IOW(MTRR_IOCTL_BASE, 4, struct mtrr_sentry32) #define MTRRIOC32_ADD_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 5, struct mtrr_sentry32) #define MTRRIOC32_SET_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 6, struct mtrr_sentry32) #define MTRRIOC32_DEL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 7, struct mtrr_sentry32) #define MTRRIOC32_GET_PAGE_ENTRY _IOWR(MTRR_IOCTL_BASE, 8, struct mtrr_gentry32) #define MTRRIOC32_KILL_PAGE_ENTRY _IOW(MTRR_IOCTL_BASE, 9, struct mtrr_sentry32) #endif /* CONFIG_COMPAT */ #endif /* _LINUX_MTRR_H */
{ "content_hash": "8449949d39f3df7beca88891598ad88f", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 82, "avg_line_length": 35.11666666666667, "alnum_prop": 0.674655908875178, "repo_name": "ut-osa/syncchar", "id": "66ac1c0f27e1d7eba11de129680617d3476a0f33", "size": "5216", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "linux-2.6.16-unmod/include/asm-x86_64/mtrr.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "4526" }, { "name": "Assembly", "bytes": "7269561" }, { "name": "C", "bytes": "191363313" }, { "name": "C++", "bytes": "2703790" }, { "name": "Objective-C", "bytes": "515305" }, { "name": "Perl", "bytes": "118289" }, { "name": "Python", "bytes": "160654" }, { "name": "Scala", "bytes": "12158" }, { "name": "Shell", "bytes": "48243" }, { "name": "TeX", "bytes": "51367" }, { "name": "UnrealScript", "bytes": "20822" }, { "name": "XSLT", "bytes": "310" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="./testcase.xsl"?> <test_definition> <suite name="tct-batterystatus-w3c-tests" category="W3C/HTML5 APIs"> <set name="Battery" type="js"> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="Navigator_getBattery" purpose="Check if the Navigator.getBattery exists and return BatteryManager object"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/Navigator_getBattery.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_charging" purpose="Check if the BatteryManager.charging attribute exists, readonly and typeof boolean"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_charging.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_chargingTime" purpose="Check if the BatteryManager.chargingTime attribute exists, readonly and typeof number"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_chargingTime.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_dischargingTime" purpose="Check if the BatteryManager.dischargingTime attribute exists, readonly and typeof number"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_dischargingTime.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_level" purpose="Check if the BatteryManager.level attribute exists, readonly and typeof number"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_level.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_onchargingchange" purpose="Check if the BatteryManager.onchargingchange attribute exists and typeof object"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_onchargingchange.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_onchargingtimechange" purpose="Check if the BatteryManager.onchargingtimechange attribute exists and typeof object"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_onchargingtimechange.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_ondischargingtimechange" purpose="Check if the BatteryManager.ondischargingtimechange attribute exists and typeof object"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_ondischargingtimechange.html</test_script_entry> </description> </testcase> <testcase component="WebAPI/Device/Battery Status API" execution_type="auto" id="BatteryManager_onlevelchange" purpose="Check if the BatteryManager.onlevelchange attribute exists and typeof object"> <description> <test_script_entry>/opt/tct-batterystatus-w3c-tests/batterystatus/BatteryManager_onlevelchange.html</test_script_entry> </description> </testcase> </set> </suite> </test_definition>
{ "content_hash": "a6fa35296a1e82e52a2e7c6d75d0e9f8", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 224, "avg_line_length": 73.45283018867924, "alnum_prop": 0.7382481376830208, "repo_name": "yugang/crosswalk-test-suite", "id": "62e90839a84f51ba0777e2ab25a9deb4b80890f1", "size": "3893", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "webapi/tct-batterystatus-w3c-tests/tests.xml", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "3495" }, { "name": "CSS", "bytes": "1694855" }, { "name": "Erlang", "bytes": "2850" }, { "name": "Java", "bytes": "155590" }, { "name": "JavaScript", "bytes": "32256550" }, { "name": "PHP", "bytes": "43783" }, { "name": "Perl", "bytes": "1696" }, { "name": "Python", "bytes": "4215706" }, { "name": "Shell", "bytes": "638387" }, { "name": "XSLT", "bytes": "2143471" } ], "symlink_target": "" }
'use strict'; /** * The parameters for updating a webhook. * */ class WebhookUpdateParameters { /** * Create a WebhookUpdateParameters. * @property {object} [tags] The tags for the webhook. * @property {string} [serviceUri] The service URI for the webhook to post * notifications. * @property {object} [customHeaders] Custom headers that will be added to * the webhook notifications. * @property {string} [status] The status of the webhook at the time the * operation was called. Possible values include: 'enabled', 'disabled' * @property {string} [scope] The scope of repositories where the event can * be triggered. For example, 'foo:*' means events for all tags under * repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is * equivalent to 'foo:latest'. Empty means all events. * @property {array} [actions] The list of actions that trigger the webhook * to post notifications. */ constructor() { } /** * Defines the metadata of WebhookUpdateParameters * * @returns {object} metadata of WebhookUpdateParameters * */ mapper() { return { required: false, serializedName: 'WebhookUpdateParameters', type: { name: 'Composite', className: 'WebhookUpdateParameters', modelProperties: { tags: { required: false, serializedName: 'tags', type: { name: 'Dictionary', value: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } }, serviceUri: { required: false, serializedName: 'properties.serviceUri', type: { name: 'String' } }, customHeaders: { required: false, serializedName: 'properties.customHeaders', type: { name: 'Dictionary', value: { required: false, serializedName: 'StringElementType', type: { name: 'String' } } } }, status: { required: false, serializedName: 'properties.status', type: { name: 'String' } }, scope: { required: false, serializedName: 'properties.scope', type: { name: 'String' } }, actions: { required: false, serializedName: 'properties.actions', type: { name: 'Sequence', element: { required: false, serializedName: 'WebhookActionElementType', type: { name: 'String' } } } } } } }; } } module.exports = WebhookUpdateParameters;
{ "content_hash": "3970cf1becc80ddf311efbf58ae3f3a0", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 77, "avg_line_length": 27.660714285714285, "alnum_prop": 0.49063912201420273, "repo_name": "Azure/azure-sdk-for-node", "id": "db47c6fae3894714829b70dd214addd3b048995b", "size": "3415", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/services/containerRegistryManagement/lib/models/webhookUpdateParameters.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "661" }, { "name": "JavaScript", "bytes": "123558116" }, { "name": "Shell", "bytes": "437" }, { "name": "TypeScript", "bytes": "2558" } ], "symlink_target": "" }
<?php return [ 'config_only_with_entity_node' => [ '<?xml version="1.0"?><config><entity type="type_one" /></config>', ["Element 'entity': Missing child element(s). Expected is ( attribute ).\nLine: 1\n"], ], 'field_code_must_be_unique' => [ '<?xml version="1.0"?><config><entity type="type_one"><attribute code="code_one"><field code="code_one_one" ' . 'locked="true" /><field code="code_one_one" locked="true" /></attribute></entity></config>', [ "Element 'field': Duplicate key-sequence ['code_one_one'] in unique identity-constraint " . "'uniqueFieldCode'.\nLine: 1\n" ], ], 'type_attribute_is_required' => [ '<?xml version="1.0"?><config><entity><attribute code="code_one"><field code="code_one_one" ' . 'locked="true" /></attribute></entity></config>', ["Element 'entity': The attribute 'type' is required but missing.\nLine: 1\n"], ], 'attribute_without_required_attributes' => [ '<?xml version="1.0"?><config><entity type="name"><attribute><field code="code_one_one" ' . 'locked="true" /></attribute></entity></config>', ["Element 'attribute': The attribute 'code' is required but missing.\nLine: 1\n"], ], 'field_node_without_required_attributes' => [ '<?xml version="1.0"?><config><entity type="name"><attribute code="code"><field code="code_one_one" />' . '<field locked="true"/></attribute></entity></config>', [ "Element 'field': The attribute 'locked' is required but missing.\nLine: 1\n", "Element 'field': The attribute " . "'code' is required but missing.\nLine: 1\n" ], ], 'locked_attribute_with_invalid_value' => [ '<?xml version="1.0"?><config><entity type="name"><attribute code="code"><field code="code_one" locked="7" />' . '<field code="code_one" locked="one_one" /></attribute></entity></config>', [ "Element 'field', attribute 'locked': '7' is not a valid value of the atomic type" . " 'xs:boolean'.\nLine: 1\n", "Element 'field', attribute 'locked': 'one_one' is not a valid value of the atomic type" . " 'xs:boolean'.\nLine: 1\n", "Element 'field': Duplicate key-sequence ['code_one'] in unique identity-constraint" . " 'uniqueFieldCode'.\nLine: 1\n" ], ], 'attribute_with_type_identifierType_with_invalid_value' => [ '<?xml version="1.0"?><config><entity type="Name"><attribute code="code1"><field code="code_one" ' . 'locked="true" /><field code="code::one" locked="false" /></attribute></entity></config>', [ "Element 'entity', attribute 'type': [facet 'pattern'] The value 'Name' is not accepted by the pattern " . "'[a-z_]+'.\nLine: 1\n", "Element 'entity', attribute 'type': 'Name' is not a valid value of the atomic type " . "'identifierType'.\nLine: 1\n", "Element 'entity', attribute 'type': Warning: No precomputed value available, the value" . " was either invalid or something strange happend.\nLine: 1\n", "Element 'attribute', attribute 'code': [facet " . "'pattern'] The value 'code1' is not accepted by the pattern '[a-z_]+'.\nLine: 1\n", "Element 'attribute', attribute " . "'code': 'code1' is not a valid value of the atomic type 'identifierType'.\nLine: 1\n", "Element 'attribute', attribute " . "'code': Warning: No precomputed value available, " . "the value was either invalid or something strange happend.\nLine: 1\n", "Element 'field', attribute 'code': [facet 'pattern'] " . "The value 'code::one' is not accepted by the pattern '" . "[a-z_]+'.\nLine: 1\n", "Element 'field', attribute 'code': 'code::one' is not a valid value of the atomic type " . "'identifierType'.\nLine: 1\n", "Element 'field', attribute 'code': Warning: No precomputed value available, the value " . "was either invalid or something strange happend.\nLine: 1\n" ], ] ];
{ "content_hash": "57f537b82ccdc297212a47437a9d85d7", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 120, "avg_line_length": 58.40277777777778, "alnum_prop": 0.5731272294887039, "repo_name": "j-froehlich/magento2_wk", "id": "7a78f5d3319b2393f5f8fff65cd2a65b100e0224", "size": "4313", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "vendor/magento/module-eav/Test/Unit/Model/Entity/Attribute/Config/_files/invalidEavAttributeXmlArray.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "13636" }, { "name": "CSS", "bytes": "2076720" }, { "name": "HTML", "bytes": "6151072" }, { "name": "JavaScript", "bytes": "2488727" }, { "name": "PHP", "bytes": "12466046" }, { "name": "Shell", "bytes": "6088" }, { "name": "XSLT", "bytes": "19979" } ], "symlink_target": "" }
'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i];for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } }return target; }; var React = require('react'); var GridTable = require('./gridTable.jsx'); var GridFilter = require('./gridFilter.jsx'); var GridPagination = require('./gridPagination.jsx'); var GridSettings = require('./gridSettings.jsx'); var GridNoData = require('./gridNoData.jsx'); var GridRow = require('./gridRow.jsx'); var GridRowContainer = require('./gridRowContainer.jsx'); var CustomRowComponentContainer = require('./customRowComponentContainer.jsx'); var CustomPaginationContainer = require('./customPaginationContainer.jsx'); var CustomFilterContainer = require('./customFilterContainer.jsx'); var ColumnProperties = require('./columnProperties'); var RowProperties = require('./rowProperties'); var deep = require('./deep'); var drop = require('lodash.drop'); var dropRight = require('lodash.dropright'); var find = require('lodash.find'); var first = require('lodash.take'); var forEach = require('lodash.foreach'); var initial = require('lodash.initial'); var isArray = require('lodash.isarray'); var isEmpty = require('lodash.isempty'); var isNull = require('lodash.isnull'); var isUndefined = require('lodash.isundefined'); var omit = require('lodash.omit'); var map = require('lodash.map'); var sortBy = require('lodash.sortby'); var extend = require('lodash.assign'); var _filter = require('lodash.filter'); var Griddle = React.createClass({ displayName: 'Griddle', statics: { GridTable: GridTable, GridFilter: GridFilter, GridPagination: GridPagination, GridSettings: GridSettings, GridRow: GridRow }, columnSettings: null, rowSettings: null, getDefaultProps: function getDefaultProps() { return { "columns": [], "gridMetadata": null, "columnMetadata": [], "rowMetadata": null, "results": [], // Used if all results are already loaded. "initialSort": "", "initialSortAscending": true, "gridClassName": "", "tableClassName": "", "customRowComponentClassName": "", "settingsText": "Settings", "filterPlaceholderText": "Filter Results", "nextText": "Next", "previousText": "Previous", "maxRowsText": "Rows per page", "enableCustomFormatText": "Enable Custom Formatting", //this column will determine which column holds subgrid data //it will be passed through with the data object but will not be rendered "childrenColumnName": "children", //Any column in this list will be treated as metadata and will be passed through with the data but won't be rendered "metadataColumns": [], "showFilter": false, "showSettings": false, "useCustomRowComponent": false, "useCustomGridComponent": false, "useCustomPagerComponent": false, "useCustomFilterer": false, "useCustomFilterComponent": false, "useGriddleStyles": true, "useGriddleIcons": true, "customRowComponent": null, "customGridComponent": null, "customPagerComponent": {}, "customFilterComponent": null, "customFilterer": null, "globalData": null, "enableToggleCustom": false, "noDataMessage": "There is no data to display.", "noDataClassName": "griddle-nodata", "customNoDataComponent": null, "showTableHeading": true, "showPager": true, "useFixedHeader": false, "useExternal": false, "externalSetPage": null, "externalChangeSort": null, "externalSetFilter": null, "externalSetPageSize": null, "externalMaxPage": null, "externalCurrentPage": null, "externalSortColumn": null, "externalSortAscending": true, "externalLoadingComponent": null, "externalIsLoading": false, "enableInfiniteScroll": false, "bodyHeight": null, "paddingHeight": 5, "rowHeight": 25, "infiniteScrollLoadTreshold": 50, "useFixedLayout": true, "isSubGriddle": false, "enableSort": true, "onRowClick": null, "onKeyPress": null, /* css class names */ "sortAscendingClassName": "sort-ascending", "sortDescendingClassName": "sort-descending", "parentRowCollapsedClassName": "parent-row", "parentRowExpandedClassName": "parent-row expanded", "settingsToggleClassName": "settings", "nextClassName": "griddle-next", "previousClassName": "griddle-previous", "headerStyles": {}, /* icon components */ "sortAscendingComponent": " ▲", "sortDescendingComponent": " ▼", "sortDefaultComponent": null, "parentRowCollapsedComponent": "▶", "parentRowExpandedComponent": "▼", "settingsIconComponent": "", "nextIconComponent": "", "previousIconComponent": "", "isMultipleSelection": false, //currently does not support subgrids "selectedRowIds": [], "uniqueIdentifier": "id" }; }, propTypes: { isMultipleSelection: React.PropTypes.bool, selectedRowIds: React.PropTypes.oneOfType([React.PropTypes.arrayOf(React.PropTypes.number), React.PropTypes.arrayOf(React.PropTypes.string)]), uniqueIdentifier: React.PropTypes.string }, defaultFilter: function defaultFilter(results, filter) { return _filter(results, function (item) { var arr = deep.keys(item); for (var i = 0; i < arr.length; i++) { if ((deep.getAt(item, arr[i]) || "").toString().toLowerCase().indexOf(filter.toLowerCase()) >= 0) { return true; } } return false; }); }, filterByColumnFilters: function filterByColumnFilters(columnFilters) { var filteredResults = Object.keys(columnFilters).reduce(function (previous, current) { return _filter(previous, function (item) { if (deep.getAt(item, current || "").toString().toLowerCase().indexOf(columnFilters[current].toLowerCase()) >= 0) { return true; } return false; }); }, this.props.results); var newState = { columnFilters: columnFilters }; if (columnFilters) { newState.filteredResults = filteredResults; newState.maxPage = this.getMaxPage(newState.filteredResults); } else if (this.state.filter) { newState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(this.props.results, filter) : this.defaultFilter(this.props.results, filter); } else { newState.filteredResults = null; } this.setState(newState); }, filterByColumn: function filterByColumn(filter, column) { var columnFilters = this.state.columnFilters; //if filter is "" remove it from the columnFilters object if (columnFilters.hasOwnProperty(column) && !filter) { columnFilters = omit(columnFilters, column); } else { var newObject = {}; newObject[column] = filter; columnFilters = extend({}, columnFilters, newObject); } this.filterByColumnFilters(columnFilters); }, /* if we have a filter display the max page and results accordingly */ setFilter: function setFilter(filter) { if (this.props.useExternal) { this.props.externalSetFilter(filter); return; } var that = this, updatedState = { page: 0, filter: filter }; // Obtain the state results. updatedState.filteredResults = this.props.useCustomFilterer ? this.props.customFilterer(this.props.results, filter) : this.defaultFilter(this.props.results, filter); // Update the max page. updatedState.maxPage = that.getMaxPage(updatedState.filteredResults); //if filter is null or undefined reset the filter. if (isUndefined(filter) || isNull(filter) || isEmpty(filter)) { updatedState.filter = filter; updatedState.filteredResults = null; } // Set the state. that.setState(updatedState); this._resetSelectedRows(); }, setPageSize: function setPageSize(size) { if (this.props.useExternal) { this.props.externalSetPageSize(size); return; } //make this better. this.state.resultsPerPage = size; this.setMaxPage(); }, toggleColumnChooser: function toggleColumnChooser() { this.setState({ showColumnChooser: !this.state.showColumnChooser }); }, toggleCustomComponent: function toggleCustomComponent() { if (this.state.customComponentType === "grid") { this.setProps({ useCustomGridComponent: !this.props.useCustomGridComponent }); } else if (this.state.customComponentType === "row") { this.setProps({ useCustomRowComponent: !this.props.useCustomRowComponent }); } }, getMaxPage: function getMaxPage(results, totalResults) { if (this.props.useExternal) { return this.props.externalMaxPage; } if (!totalResults) { totalResults = (results || this.getCurrentResults()).length; } var maxPage = Math.ceil(totalResults / this.state.resultsPerPage); return maxPage; }, setMaxPage: function setMaxPage(results) { var maxPage = this.getMaxPage(results); //re-render if we have new max page value if (this.state.maxPage !== maxPage) { this.setState({ page: 0, maxPage: maxPage, filteredColumns: this.columnSettings.filteredColumns }); } }, setPage: function setPage(number) { if (this.props.useExternal) { this.props.externalSetPage(number); return; } //check page size and move the filteredResults to pageSize * pageNumber if (number * this.state.resultsPerPage <= this.state.resultsPerPage * this.state.maxPage) { var that = this, state = { page: number }; that.setState(state); } //When infinite scrolling is enabled, uncheck the "select all" checkbox, since more unchecked rows will be appended at the end if (this.props.enableInfiniteScroll) { this.setState({ isSelectAllChecked: false }); } else { //When the paging is done on the server, the previously selected rows on a certain page might not // coincide with the new rows on that exact page page, if moving back and forth. Better reset the selection this._resetSelectedRows(); } }, setColumns: function setColumns(columns) { this.columnSettings.filteredColumns = isArray(columns) ? columns : [columns]; this.setState({ filteredColumns: this.columnSettings.filteredColumns }); }, nextPage: function nextPage() { var currentPage = this.getCurrentPage(); if (currentPage < this.getCurrentMaxPage() - 1) { this.setPage(currentPage + 1); } }, previousPage: function previousPage() { var currentPage = this.getCurrentPage(); if (currentPage > 0) { this.setPage(currentPage - 1); } }, changeSort: function changeSort(sort) { if (this.props.enableSort === false) { return; } // if(this.props.useExternal) { // this.props.externalChangeSort(sort, this.props.externalSortColumn === sort ? !this.props.externalSortAscending : true); // return; // } //externalChangeSort now just returns current sort state if (this.props.externalChangeSort) { this.props.externalChangeSort(sort, this.state.sortColumn == sort ? !this.state.sortAscending : true); } var that = this, state = { page: 0, sortColumn: sort, sortAscending: true }; // If this is the same column, reverse the sort. if (this.state.sortColumn == sort) { state.sortAscending = !this.state.sortAscending; } this.setState(state); //When the sorting is done on the server, the previously selected rows might not correspond with the new ones. //Better reset the selection this._resetSelectedRows(); }, componentWillReceiveProps: function componentWillReceiveProps(nextProps) { this.setMaxPage(nextProps.results); if (nextProps.results.length > 0) { var deepKeys = deep.keys(nextProps.results[0]); var is_same = this.columnSettings.allColumns.length == deepKeys.length && this.columnSettings.allColumns.every(function (element, index) { return element === deepKeys[index]; }); if (!is_same) { this.columnSettings.allColumns = deepKeys; } } else if (this.columnSettings.allColumns.length > 0) { this.columnSettings.allColumns = []; } if (nextProps.columns !== this.columnSettings.filteredColumns) { this.columnSettings.filteredColumns = nextProps.columns; } if (nextProps.selectedRowIds) { var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(nextProps.selectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), selectedRowIds: nextProps.selectedRowIds }); } }, getInitialState: function getInitialState() { var state = { maxPage: 0, page: 0, filteredResults: null, filteredColumns: [], filter: "", //this sets the individual column filters columnFilters: {}, resultsPerPage: this.props.resultsPerPage || 5, sortColumn: this.props.initialSort, sortAscending: this.props.initialSortAscending, showColumnChooser: false, isSelectAllChecked: false, selectedRowIds: this.props.selectedRowIds }; return state; }, componentWillMount: function componentWillMount() { this.verifyExternal(); this.verifyCustom(); this.columnSettings = new ColumnProperties(this.props.results.length > 0 ? deep.keys(this.props.results[0]) : [], this.props.columns, this.props.childrenColumnName, this.props.columnMetadata, this.props.metadataColumns); this.rowSettings = new RowProperties(this.props.rowMetadata, this.props.useCustomTableRowComponent && this.props.customTableRowComponent ? this.props.customTableRowComponent : GridRow, this.props.useCustomTableRowComponent); this.setMaxPage(); //don't like the magic strings if (this.props.useCustomGridComponent === true) { this.setState({ customComponentType: "grid" }); } else if (this.props.useCustomRowComponent === true) { this.setState({ customComponentType: "row" }); } else { this.setState({ filteredColumns: this.columnSettings.filteredColumns }); } }, //todo: clean these verify methods up verifyExternal: function verifyExternal() { if (this.props.useExternal === true) { //hooray for big ugly nested if if (this.props.externalSetPage === null) { console.error("useExternal is set to true but there is no externalSetPage function specified."); } if (this.props.externalChangeSort === null) { console.error("useExternal is set to true but there is no externalChangeSort function specified."); } if (this.props.externalSetFilter === null) { console.error("useExternal is set to true but there is no externalSetFilter function specified."); } if (this.props.externalSetPageSize === null) { console.error("useExternal is set to true but there is no externalSetPageSize function specified."); } if (this.props.externalMaxPage === null) { console.error("useExternal is set to true but externalMaxPage is not set."); } if (this.props.externalCurrentPage === null) { console.error("useExternal is set to true but externalCurrentPage is not set. Griddle will not page correctly without that property when using external data."); } } }, verifyCustom: function verifyCustom() { if (this.props.useCustomGridComponent === true && this.props.customGridComponent === null) { console.error("useCustomGridComponent is set to true but no custom component was specified."); } if (this.props.useCustomRowComponent === true && this.props.customRowComponent === null) { console.error("useCustomRowComponent is set to true but no custom component was specified."); } if (this.props.useCustomGridComponent === true && this.props.useCustomRowComponent === true) { console.error("Cannot currently use both customGridComponent and customRowComponent."); } if (this.props.useCustomFilterer === true && this.props.customFilterer === null) { console.error("useCustomFilterer is set to true but no custom filter function was specified."); } if (this.props.useCustomFilterComponent === true && this.props.customFilterComponent === null) { console.error("useCustomFilterComponent is set to true but no customFilterComponent was specified."); } }, getDataForRender: function getDataForRender(data, cols, pageList) { var that = this; //get the correct page size if (this.state.sortColumn !== "" || this.props.initialSort !== "") { var sortProperty = _filter(this.props.columnMetadata, { columnName: this.state.sortColumn }); sortProperty = sortProperty.length > 0 && sortProperty[0].hasOwnProperty("sortProperty") && sortProperty[0]["sortProperty"] || null; data = sortBy(data, function (item) { return sortProperty ? deep.getAt(item, that.state.sortColumn || that.props.initialSort)[sortProperty] : deep.getAt(item, that.state.sortColumn || that.props.initialSort); }); if (this.state.sortAscending === false) { data.reverse(); } } var currentPage = this.getCurrentPage(); if (!this.props.useExternal && pageList && this.state.resultsPerPage * (currentPage + 1) <= this.state.resultsPerPage * this.state.maxPage && currentPage >= 0) { if (this.isInfiniteScrollEnabled()) { // If we're doing infinite scroll, grab all results up to the current page. data = first(data, (currentPage + 1) * this.state.resultsPerPage); } else { //the 'rest' is grabbing the whole array from index on and the 'initial' is getting the first n results var rest = drop(data, currentPage * this.state.resultsPerPage); data = (dropRight || initial)(rest, rest.length - this.state.resultsPerPage); } } var meta = this.columnSettings.getMetadataColumns; var transformedData = []; for (var i = 0; i < data.length; i++) { var mappedData = data[i]; if (typeof mappedData[that.props.childrenColumnName] !== "undefined" && mappedData[that.props.childrenColumnName].length > 0) { //internally we're going to use children instead of whatever it is so we don't have to pass the custom name around mappedData["children"] = that.getDataForRender(mappedData[that.props.childrenColumnName], cols, false); if (that.props.childrenColumnName !== "children") { delete mappedData[that.props.childrenColumnName]; } } mappedData.rowNumber = this.getCurrentPage() * this.state.resultsPerPage + i + 1; transformedData.push(mappedData); } return transformedData; }, //this is the current results getCurrentResults: function getCurrentResults() { return this.state.filteredResults || this.props.results; }, getCurrentPage: function getCurrentPage() { return this.props.externalCurrentPage || this.state.page; }, getCurrentSort: function getCurrentSort() { return this.props.useExternal ? this.props.externalSortColumn : this.state.sortColumn; }, getCurrentSortAscending: function getCurrentSortAscending() { return this.props.useExternal ? this.props.externalSortAscending : this.state.sortAscending; }, getCurrentMaxPage: function getCurrentMaxPage() { return this.props.useExternal ? this.props.externalMaxPage : this.state.maxPage; }, //This takes the props relating to sort and puts them in one object getSortObject: function getSortObject() { return { enableSort: this.props.enableSort, changeSort: this.changeSort, sortColumn: this.getCurrentSort(), sortAscending: this.getCurrentSortAscending(), sortAscendingClassName: this.props.sortAscendingClassName, sortDescendingClassName: this.props.sortDescendingClassName, sortAscendingComponent: this.props.sortAscendingComponent, sortDescendingComponent: this.props.sortDescendingComponent, sortDefaultComponent: this.props.sortDefaultComponent }; }, _toggleSelectAll: function _toggleSelectAll() { var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newIsSelectAllChecked = !this.state.isSelectAllChecked, newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); var self = this; forEach(visibleRows, function (row) { self._updateSelectedRowIds(row[self.props.uniqueIdentifier], newSelectedRowIds, newIsSelectAllChecked); }, this); this.setState({ isSelectAllChecked: newIsSelectAllChecked, selectedRowIds: newSelectedRowIds }); }, _toggleSelectRow: function _toggleSelectRow(row, isChecked) { var visibleRows = this.getDataForRender(this.getCurrentResults(), this.columnSettings.getColumns(), true), newSelectedRowIds = JSON.parse(JSON.stringify(this.state.selectedRowIds)); this._updateSelectedRowIds(row[this.props.uniqueIdentifier], newSelectedRowIds, isChecked); this.setState({ isSelectAllChecked: this._getAreAllRowsChecked(newSelectedRowIds, map(visibleRows, this.props.uniqueIdentifier)), selectedRowIds: newSelectedRowIds }); }, _updateSelectedRowIds: function _updateSelectedRowIds(id, selectedRowIds, isChecked) { var isFound; if (isChecked) { isFound = find(selectedRowIds, function (item) { return id === item; }); if (isFound === undefined) { selectedRowIds.push(id); } } else { selectedRowIds.splice(selectedRowIds.indexOf(id), 1); } }, _getIsSelectAllChecked: function _getIsSelectAllChecked() { return this.state.isSelectAllChecked; }, _getAreAllRowsChecked: function _getAreAllRowsChecked(selectedRowIds, visibleRowIds) { var i, isFound; if (selectedRowIds.length !== visibleRowIds.length) { return false; } for (i = 0; i < selectedRowIds.length; i++) { isFound = find(visibleRowIds, function (visibleRowId) { return selectedRowIds[i] === visibleRowId; }); if (isFound === undefined) { return false; } } return true; }, _getIsRowChecked: function _getIsRowChecked(row) { return this.state.selectedRowIds.indexOf(row[this.props.uniqueIdentifier]) > -1 ? true : false; }, getSelectedRowIds: function getSelectedRowIds() { return this.state.selectedRowIds; }, _resetSelectedRows: function _resetSelectedRows() { this.setState({ isSelectAllChecked: false, selectedRowIds: [] }); }, //This takes the props relating to multiple selection and puts them in one object getMultipleSelectionObject: function getMultipleSelectionObject() { return { isMultipleSelection: find(this.props.results, function (result) { return 'children' in result; }) ? false : this.props.isMultipleSelection, //does not support subgrids toggleSelectAll: this._toggleSelectAll, getIsSelectAllChecked: this._getIsSelectAllChecked, toggleSelectRow: this._toggleSelectRow, getSelectedRowIds: this.getSelectedRowIds, getIsRowChecked: this._getIsRowChecked }; }, isInfiniteScrollEnabled: function isInfiniteScrollEnabled() { // If a custom pager is included, don't allow for infinite scrolling. if (this.props.useCustomPagerComponent) { return false; } // Otherwise, send back the property. return this.props.enableInfiniteScroll; }, getClearFixStyles: function getClearFixStyles() { return { clear: "both", display: "table", width: "100%" }; }, getSettingsStyles: function getSettingsStyles() { return { "float": "left", width: "50%", textAlign: "right" }; }, getFilterStyles: function getFilterStyles() { return { "float": "left", width: "50%", textAlign: "left", color: "#222", minHeight: "1px" }; }, getFilter: function getFilter() { return this.props.showFilter && this.props.useCustomGridComponent === false ? this.props.useCustomFilterComponent ? React.createElement(CustomFilterContainer, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText, customFilterComponent: this.props.customFilterComponent, results: this.props.results, currentResults: this.getCurrentResults() }) : React.createElement(GridFilter, { changeFilter: this.setFilter, placeholderText: this.props.filterPlaceholderText }) : ""; }, getSettings: function getSettings() { return this.props.showSettings ? React.createElement('button', { type: 'button', className: this.props.settingsToggleClassName, onClick: this.toggleColumnChooser, style: this.props.useGriddleStyles ? { background: "none", border: "none", padding: 0, margin: 0, fontSize: 14 } : null }, this.props.settingsText, this.props.settingsIconComponent) : ""; }, getTopSection: function getTopSection(filter, settings) { if (this.props.showFilter === false && this.props.showSettings === false) { return ""; } var filterStyles = null, settingsStyles = null, topContainerStyles = null; if (this.props.useGriddleStyles) { filterStyles = this.getFilterStyles(); settingsStyles = this.getSettingsStyles(); topContainerStyles = this.getClearFixStyles(); } return React.createElement('div', { className: 'top-section', style: topContainerStyles }, React.createElement('div', { className: 'griddle-filter', style: filterStyles }, filter), React.createElement('div', { className: 'griddle-settings-toggle', style: settingsStyles }, settings)); }, getPagingSection: function getPagingSection(currentPage, maxPage) { if ((this.props.showPager && !this.isInfiniteScrollEnabled() && !this.props.useCustomGridComponent) === false) { return undefined; } return React.createElement('div', { className: 'griddle-footer' }, this.props.useCustomPagerComponent ? React.createElement(CustomPaginationContainer, { next: this.nextPage, previous: this.previousPage, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText, customPagerComponent: this.props.customPagerComponent }) : React.createElement(GridPagination, { useGriddleStyles: this.props.useGriddleStyles, next: this.nextPage, previous: this.previousPage, nextClassName: this.props.nextClassName, nextIconComponent: this.props.nextIconComponent, previousClassName: this.props.previousClassName, previousIconComponent: this.props.previousIconComponent, currentPage: currentPage, maxPage: maxPage, setPage: this.setPage, nextText: this.props.nextText, previousText: this.props.previousText })); }, getColumnSelectorSection: function getColumnSelectorSection(keys, cols) { return this.state.showColumnChooser ? React.createElement(GridSettings, { columns: keys, selectedColumns: cols, setColumns: this.setColumns, settingsText: this.props.settingsText, settingsIconComponent: this.props.settingsIconComponent, maxRowsText: this.props.maxRowsText, setPageSize: this.setPageSize, showSetPageSize: !this.props.useCustomGridComponent, resultsPerPage: this.state.resultsPerPage, enableToggleCustom: this.props.enableToggleCustom, toggleCustomComponent: this.toggleCustomComponent, useCustomComponent: this.props.useCustomRowComponent || this.props.useCustomGridComponent, useGriddleStyles: this.props.useGriddleStyles, enableCustomFormatText: this.props.enableCustomFormatText, columnMetadata: this.props.columnMetadata }) : ""; }, getCustomGridSection: function getCustomGridSection() { return React.createElement(this.props.customGridComponent, _extends({ data: this.props.results, className: this.props.customGridComponentClassName }, this.props.gridMetadata)); }, getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent, globalData) { return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta, globalData: globalData, className: this.props.customRowComponentClassName, customComponent: this.props.customRowComponent, style: this.props.useGriddleStyles ? this.getClearFixStyles() : null }), this.props.showPager && pagingContent); }, getStandardGridSection: function getStandardGridSection(data, cols, meta, pagingContent, hasMorePages) { var sortProperties = this.getSortObject(); var multipleSelectionProperties = this.getMultipleSelectionObject(); // no data section var showNoData = this.shouldShowNoDataSection(data); var noDataSection = this.getNoDataSection(); return React.createElement('div', { className: 'griddle-body' }, React.createElement(GridTable, { useGriddleStyles: this.props.useGriddleStyles, noDataSection: noDataSection, showNoData: showNoData, columnSettings: this.columnSettings, rowSettings: this.rowSettings, sortSettings: sortProperties, multipleSelectionSettings: multipleSelectionProperties, filterByColumn: this.filterByColumn, isSubGriddle: this.props.isSubGriddle, useGriddleIcons: this.props.useGriddleIcons, useFixedLayout: this.props.useFixedLayout, showPager: this.props.showPager, pagingContent: pagingContent, data: data, className: this.props.tableClassName, enableInfiniteScroll: this.isInfiniteScrollEnabled(), nextPage: this.nextPage, showTableHeading: this.props.showTableHeading, useFixedHeader: this.props.useFixedHeader, parentRowCollapsedClassName: this.props.parentRowCollapsedClassName, parentRowExpandedClassName: this.props.parentRowExpandedClassName, parentRowCollapsedComponent: this.props.parentRowCollapsedComponent, parentRowExpandedComponent: this.props.parentRowExpandedComponent, bodyHeight: this.props.bodyHeight, paddingHeight: this.props.paddingHeight, rowHeight: this.props.rowHeight, infiniteScrollLoadTreshold: this.props.infiniteScrollLoadTreshold, externalLoadingComponent: this.props.externalLoadingComponent, externalIsLoading: this.props.externalIsLoading, hasMorePages: hasMorePages, onRowClick: this.props.onRowClick })); }, getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) { if (this.props.useCustomGridComponent && this.props.customGridComponent !== null) { return this.getCustomGridSection(); } else if (this.props.useCustomRowComponent) { return this.getCustomRowSection(data, cols, meta, pagingContent, globalData); } else { return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages); } }, getNoDataSection: function getNoDataSection() { if (this.props.customNoDataComponent != null) { return React.createElement('div', { className: this.props.noDataClassName }, React.createElement(this.props.customNoDataComponent, null)); } return React.createElement(GridNoData, { noDataMessage: this.props.noDataMessage }); }, shouldShowNoDataSection: function shouldShowNoDataSection(results) { return this.props.useExternal === false && (typeof results === 'undefined' || results.length === 0) || this.props.useExternal === true && this.props.externalIsLoading === false && results.length === 0; }, onKeyPress: function onKeyPress(data, e) { if (typeof this.props.onKeyPress === 'function') { this.props.onKeyPress(data, e.keyCode, e); } }, render: function render() { var that = this, results = this.getCurrentResults(); // Attempt to assign to the filtered results, if we have any. var headerTableClassName = this.props.tableClassName + " table-header"; //figure out if we want to show the filter section var filter = this.getFilter(); var settings = this.getSettings(); //if we have neither filter or settings don't need to render this stuff var topSection = this.getTopSection(filter, settings); var keys = []; var cols = this.columnSettings.getColumns(); //figure out which columns are displayed and show only those var data = this.getDataForRender(results, cols, true); var meta = this.columnSettings.getMetadataColumns(); // Grab the column keys from the first results keys = deep.keys(omit(results[0], meta)); // sort keys by order keys = this.columnSettings.orderColumns(keys); // Grab the current and max page values. var currentPage = this.getCurrentPage(); var maxPage = this.getCurrentMaxPage(); // Determine if we need to enable infinite scrolling on the table. var hasMorePages = currentPage + 1 < maxPage; // Grab the paging content if it's to be displayed var pagingContent = this.getPagingSection(currentPage, maxPage); var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData); var columnSelector = this.getColumnSelectorSection(keys, cols); var gridClassName = this.props.gridClassName.length > 0 ? "griddle " + this.props.gridClassName : "griddle"; //add custom to the class name so we can style it differently gridClassName += this.props.useCustomRowComponent ? " griddle-custom" : ""; return React.createElement('div', { className: gridClassName, tabIndex: '2', onKeyDown: this.onKeyPress.bind(this, data) }, topSection, columnSelector, React.createElement('div', { className: 'griddle-container', style: this.props.useGriddleStyles && !this.props.isSubGriddle ? { border: "1px solid #DDD" } : null }, resultContent)); } }); GridRowContainer.Griddle = module.exports = Griddle;
{ "content_hash": "895413c02d7e76ac5141d7dbc0d015a2", "timestamp": "", "source": "github", "line_count": 845, "max_line_length": 878, "avg_line_length": 44.514792899408285, "alnum_prop": 0.6346404359962781, "repo_name": "amorphousxd/griddle-ets", "id": "37e224d37b2aed011b570eeff343a20fc4212eb7", "size": "37866", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/griddle.jsx.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "981471" } ], "symlink_target": "" }
body { color: #525252; background: #6AA6D6 url(../img/devoops_pattern_b10.png) 0 0 repeat; } .body-expanded, .modal-open { overflow-y:hidden; margin-right: 15px; } .modal-open #content {z-index: inherit;} .body-expanded .expanded-panel, .fancybox-margin .expanded-panel, .modal-open .expanded-panel { margin-right: 15px; } .body-screensaver { overflow: hidden; } h1, .h1, h2, .h2, h3, .h3 { margin:0; } #logo { position:relative; background: #525252 url(../img/devoops_pattern_b10.png) 0 0 repeat; } #logo a { color: #fff; font-family: 'Righteous', cursive; display: block; font-size: 20px; line-height: 50px; background: url(../img/logo.png) right 42px no-repeat; -webkit-transition: 0.5s; -moz-transition: 0.5s; -o-transition: 0.5s; transition: 0.5s; } #logo a:hover { background-position: right 25px; text-decoration: none; } .navbar { margin: 0; border: 0; position: fixed; top:0; left: 0; width:100%; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; box-shadow: 0 1px 2px #272727; z-index: 2000; } .body-expanded .navbar { z-index: 9; } a.show-sidebar { float: left; color:#6d6d6d; outline: none; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } a.show-sidebar:hover { color:#000; } #sidebar-left { position:relative; z-index: inherit; padding-bottom: 3000px !important; margin-bottom: -3000px !important; background: #6AA6D6 url(../img/devoops_pattern_b10.png) 0 0 repeat; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } #content { position: relative; z-index: 10; background: #ebebeb; box-shadow: 0 0 6px #131313; padding-bottom: 3000px !important; margin-bottom: -2980px !important; overflow: hidden; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .full-content { overflow: hidden; padding: 0; margin: 0; } .nav.main-menu, .nav.msg-menu { margin:0 -15px; } .nav.main-menu > li > a, .nav.msg-menu > li > a { text-align: center; color:#f0f0f0; min-height: 40px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background:rgba(0, 0, 0, 0.1); } .nav.main-menu > li > a:hover, .nav.main-menu > li > a:focus, .nav.main-menu > li.active > a, .nav.main-menu .open > a, .nav.main-menu .open > a:hover, .nav.main-menu .open > a:focus, .dropdown-menu > li > a:focus, .dropdown-menu > li > a:hover, .dropdown-menu > li.active > a, .nav.msg-menu > li > a:hover, .nav.msg-menu > li > a:focus, .nav.msg-menu > li.active > a, .nav.msg-menu .open > a, .nav.msg-menu .open > a:hover, .nav.msg-menu .open > a:focus { background:rgba(0, 0, 0, 0.1); color:#f0f0f0; } .nav.main-menu a.active, .nav.msg-menu a.active { background:rgba(0, 0, 0, 0.2); } .nav.main-menu a.active:hover, .nav.msg-menu a.active:hover { background:rgba(0, 0, 0, 0.2); } .nav.main-menu a.active-parent, .nav.msg-menu a.active-parent { background: rgba(0, 0, 0, 0.3); } .nav.main-menu a.active-parent:hover, .nav.msg-menu a.active-parent:hover { background: rgba(0, 0, 0, 0.3); } .nav.main-menu > li > a > i, .nav.msg-menu > li > a > i { font-size: 18px; width: auto; display: block; text-align: center; vertical-align: middle; } .main-menu .dropdown-menu { position: absolute; z-index: 2001; left: 100%; top: 0; float: none; margin: 0; border: 0; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; padding: 0; background: #6AA6D6 url(../img/devoops_pattern_b10.png) 0 0 repeat; box-shadow: none; visibility:hidden; } .main-menu .active-parent:hover + .dropdown-menu { visibility:visible; } .main-menu .active-parent + .dropdown-menu:hover { visibility:visible; } .main-menu .dropdown-menu > li > a { padding:9px 15px 9px 40px; color:#f0f0f0; } .main-menu .dropdown-menu > li:first-child > a { -webkit-border-radius: 0 4px 0 0; -moz-border-radius: 0 4px 0 0; border-radius: 0 4px 0 0; } .main-menu .dropdown-menu > li:last-child > a { -webkit-border-radius: 0 0 4px 0; -moz-border-radius: 0 0 4px 0; border-radius: 0 0 4px 0; } #top-panel { line-height: 50px; height: 50px; background: #ebebeb; } #main { margin-top: 50px; min-height: 800px; overflow: hidden; } #search { position: relative; margin-left: 20px; } #search > input { width: 180%; background: #dfdfdf; border: 1px solid #C7C7C7; text-shadow:0 1px 1px #EEE; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; color: #686868; line-height: 1em; height: 30px; padding: 0 35px 0 10px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } #search > input + i { opacity:0; position: absolute; top: 18px; right: 10px; color: #fff; -webkit-transition: 0.4s; -moz-transition: 0.4s; -o-transition: 0.4s; transition: 0.4s; } #search > input:focus { width:100%; outline:none; } #search > input:focus + i { opacity:1; } .panel-menu { margin: 0; } .top-panel-right { padding-left: 0; } .panel-menu > li > a { padding: 0 5px 0 10px; line-height: 50px; } .panel-menu > li > a:hover { background: none; } .panel-menu a.account { height: 50px; padding: 5px 0 5px 10px; line-height: 18px; } .panel-menu i { margin-top: 8px; padding: 5px; font-size: 20px; color: #7BC5D3; line-height: 1em; vertical-align: top; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .panel-menu > li > a:hover > i { background: #f5f5f5; } .panel-menu i.pull-right { color: #000; border: 0; box-shadow: none; font-size: 16px; background: none !important; } .panel-menu .badge { margin-top: 3px; padding: 3px 6px; vertical-align: top; background: #CEA9A9; } .avatar { width: 40px; float: left; margin-right: 5px; } .avatar > img { width:40px; height:40px; border: 1px solid #F8F8F8; } .user-mini > span { display: block; font-size: 12px; color:#363636; margin-bottom: -4px; } .user-mini > span.welcome { font-weight: bold; margin-top: 2px; } .panel-menu .dropdown-menu { position: absolute !important; background: rgba(0, 0, 0, 0.7) !important; padding: 0; border: 0; right: 0; left: auto; min-width: 100%; } .panel-menu .dropdown-menu > li > a { padding:5px 10px !important; color:#f0f0f0; } .panel-menu .dropdown-menu > li > a > i { border: 0; padding: 0; margin: 0; font-size: 14px; width: 20px; display: inline-block; text-align: center; vertical-align: middle; } .well { padding:15px; } .box { display: block; z-index: 1999; position: relative; border: 1px solid #f8f8f8; box-shadow: 0 0 4px #D8D8D8; background: transparent; margin-bottom: 20px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } .full-content .box { border: 0; margin-bottom: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .box-header { -webkit-border-radius: 3px 3px 0 0; -moz-border-radius: 3px 3px 0 0; border-radius: 3px 3px 0 0; color: #363636; font-size: 16px; position:relative; overflow: hidden; background: #f5f5f5; border-bottom: 1px solid #E4E4E4; height: 28px; } .box-name, .modal-header-name { padding-left: 15px; line-height: 28px; } .box-name:hover { cursor: move; } .box-name > i { margin-right:5px; } .box-icons { position: absolute; top:0; right:0; z-index: 9; } .no-move { display: none; } .expanded .no-move { position: absolute; top:0; left: 0; width:100%; height: 100%; z-index: 1; display: block; } .box-content { position: relative; -webkit-border-radius: 0 0 3px 3px; -moz-border-radius: 0 0 3px 3px; border-radius: 0 0 3px 3px; padding: 15px; background: #FCFCFC; } .box-content.dropbox, .box-content.sortablebox { overflow: hidden; } .full-content .box-content { position: absolute; width: 100%; left: 0; top: 0; } .box-icons a { cursor: pointer; text-decoration: none !important; border-left: 1px solid #fafafa; height: 26px; line-height: 26px; width: 28px; display: block; float: left; text-align: center; color: #b8b8b8 !important; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .box-icons a.beauty-table-to-json { width: auto; padding: 0 10px; font-size: 14px; } .box-icons a:hover { box-shadow:inset 0 0 1px 0 #CECECE; } .expanded a.close-link { display:none; } #sidebar-left.col-xs-2 { opacity: 0; width: 0%; padding: 0; } .sidebar-show #sidebar-left.col-xs-2 { opacity: 1; width: 16.666666666666664%; padding: 0 15px; } .sidebar-show #content.col-xs-12 { opacity: 1; width: 100%; height: 100%; } .expanded { overflow-y:scroll; border: 0; z-index: 3000 !important; position: fixed; width: 100%; height: 100%; top: 0; left: 0; padding: 0px; background: rgba(0, 0, 0, 0.2); -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .expanded-padding { background: rgba(0, 0, 0, 0.7); padding:50px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .no-padding { padding:0 !important; } .padding-15 { padding:15px !important; } .no-padding .table-bordered { border:0; margin:0; } .no-padding .table-bordered thead tr th:first-child, .no-padding .table-bordered tbody tr th:first-child, .no-padding .table-bordered tfoot tr th:first-child, .no-padding .table-bordered thead tr td:first-child, .no-padding .table-bordered tbody tr td:first-child, .no-padding .table-bordered tfoot tr td:first-child { border-left: 0px !important; } .no-padding .table-bordered thead tr th:last-child, .no-padding .table-bordered tbody tr th:last-child, .no-padding .table-bordered tfoot tr th:last-child, .no-padding .table-bordered thead tr td:last-child, .no-padding .table-bordered tbody tr td:last-child, .no-padding .table-bordered tfoot tr td:last-child { border-right: 0px !important; } .table-heading thead tr { background-color: #f0f0f0; background-image: -webkit-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -moz-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -ms-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -o-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: linear-gradient(to bottom, #f0f0f0, #dfdfdf); } table.no-border-bottom tr:last-child td { border-bottom:0; } .dataTables_wrapper { overflow: hidden; } .dataTables_wrapper table.table { clear: both; max-width: inherit; margin-bottom: 0; } .table-datatable *, .table-datatable :after, .table-datatable :before { margin: 0; padding: 0; -webkit-box-sizing: content-box; box-sizing: content-box; -moz-box-sizing: content-box; } .table-datatable label { position: relative; display: block; font-weight: 400; } .table-datatable tbody td { vertical-align: middle !important; } .table-datatable img { margin-right: 10px; border: 1px solid #F8F8F8; width: 40px; } .table-datatable .sorting { background:url(../img/sort.png) right center no-repeat; padding-right:16px; cursor:pointer; } .table-datatable .sorting_asc { background:url(../img/sort-asc.png) right center no-repeat; padding-right: 16px; cursor:pointer; } .table-datatable .sorting_desc { background:url(../img/sort-desc.png) right center no-repeat; padding-right: 16px; cursor:pointer; } div.DTTT_collection_background { z-index: 2002; } div.DTTT .btn { color: #333 !important; font-size: 12px; } ul.DTTT_dropdown.dropdown-menu { z-index: 2003; background: rgba(0, 0, 0, 0.7) !important; padding: 0; border: 0; margin: 0; -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; min-width: 157px; } ul.DTTT_dropdown.dropdown-menu li { position: relative; } ul.DTTT_dropdown.dropdown-menu > li > a { position: relative; display: block; padding: 5px 10px !important; color: #f0f0f0 !important; } ul.DTTT_dropdown.dropdown-menu > li:first-child > a { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } ul.DTTT_dropdown.dropdown-menu > li:last-child > a { -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } ul.DTTT_dropdown.dropdown-menu > li:hover > a { background:rgba(0, 0, 0, 0.3); color:#f0f0f0; } .dataTables_wrapper input[type="text"] { display: block; width: 90%; height: 26px; padding: 2px 12px; font-size: 14px; line-height: 1.428571429; color: #555; background-color: #fff; background-image: none; border: 1px solid #ccc; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; box-sizing:border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -moz-appearance: none; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075); -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .dataTables_wrapper input[type="text"]:focus { border-color: #66afe9; outline: 0; -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, .6); } #breadcrumb { padding: 0; line-height: 40px; background: #525252; background: #5a8db6 url(../img/devoops_pattern_b10.png) 0 0 repeat; margin-bottom: 20px; } .breadcrumb { padding: 0 15px; background: none; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; margin: 0; } .breadcrumb > li > a { color:#d8d8d8; } .breadcrumb > li > a:hover, .breadcrumb > li:last-child > a { color:#f8f8f8; } .bs-callout { padding: 15px; border-left: 3px solid #525252; background: #dfdfdf; } .bs-callout h4 { margin-top: 0; margin-bottom: 5px; color: #525252; } .no-padding .bs-callout { border:0; } .page-header { margin: 0 0 10px; border-bottom: 1px solid #c7c7c7; } .box-content .page-header, legend, .full-calendar .page-header { margin: 0 0 10px; border-bottom: 1px dashed #B6B6B6; } .invoice-header { margin: 0 0 10px; border-bottom: 1px dashed #B6B6B6; display: inline-block; } .box-content .form-group, .devoops-modal-inner .form-group { margin-top:15px; margin-bottom:0px; } .show-grid [class^="col-"] { padding-top: 10px; padding-bottom: 10px; background-color: #525252; background-color: rgba(129, 199, 199, 0.2); border: 1px solid #ebebeb; } .show-grid [class^="col-"]:hover { padding-top: 10px; padding-bottom: 10px; background-color: rgba(107, 134, 182, 0.2); border: 1px solid #ebebeb; } .show-grid, .show-grid-forms { margin-bottom: 15px; } .show-grid-forms [class^="col-"] { padding-top: 10px; padding-bottom: 10px; } .table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th, td.beauty-hover { background-color: rgba(219, 219, 219, 0.3) !important; } .table-hover > tbody > tr:hover > td.beauty-hover:hover { background-color: rgba(219, 219, 219, 0.9) !important; } .DTTT.btn-group { position: absolute; top: -28px; right: 83px; border-right:1px solid #DBDBDB; } .DTTT.btn-group a { -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; line-height: 1em; font-size: 14px; font-weight: bold; outline: none; box-shadow: none !important; padding: 6px 12px; margin: 0; background: #F7F7F7; border: 0; } #screensaver { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 3000; background: #000; display: none; } #screensaver.show { display: block; } #canvas { position: relative; } #screensaver i { position: absolute; top: 50px; right: 50px; background: rgba(255, 255, 255, 0.5); line-height: 100px; width: 100px; height: 100px; text-align: center; font-size: 60px; color: rgba(0, 0, 0, 0.8); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .well pre { padding: 0; margin-top: 0; margin-bottom: 0; background-color: transparent; border: 0; white-space: nowrap; } .well pre code { white-space: normal; } .btn { border-width: 1px; border-style: solid; border-width: 1px; text-decoration: none; border-color: rgba(0, 0, 0, 0.3); cursor: pointer; outline: none; font-family: "Lucida Grande","Lucida Sans","Lucida Sans Unicode","Segoe UI",Verdana,sans-serif; display: inline-block; vertical-align: top; position: relative; font-size: 12px; font-weight: bold; text-align: center; background-color: #a2a2a2; background: #a2a2a2 -moz-linear-gradient(top, rgba(255,255,255,0.6), rgba(255,255,255,0)); background: #a2a2a2 -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255,255,255,0.6)), to(rgba(255,255,255,0))); line-height: 24px; margin: 0 0 10px 0; padding: 0 10px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; -moz-user-select: none; -webkit-user-select: none; outline: none !important; } .btn-label-left, .btn-label-right { padding: 0 10px; } .btn-label-left span { position: relative; left: -10px; display: inline-block; padding: 0px 8px; background: rgba(0, 0, 0, 0.1); } .btn-label-right span { position: relative; right: -10px; display: inline-block; padding: 0px 8px; background: rgba(0, 0, 0, 0.1); } .btn i { vertical-align: middle; } .btn-app { width: 80px; height: 80px; padding: 0; font-size: 16px; } .btn-app i { font-size: 36px; line-height: 78px; display: block; } .btn-app-sm { width: 50px; height: 50px; padding: 0; font-size: 12px; } .btn-app-sm i { font-size: 18px; line-height: 48px; display: block; } .btn-circle { -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.25); } .btn.active { background-image: none; outline: 0; -webkit-box-shadow: none; box-shadow: none; } .btn-default, .btn-default.disabled, .btn-default[disabled], fieldset[disabled] .btn-default, .btn-default.disabled:hover, .btn-default[disabled]:hover, fieldset[disabled] .btn-default:hover, .btn-default.disabled:focus, .btn-default[disabled]:focus, fieldset[disabled] .btn-default:focus, .btn-default.disabled:active, .btn-default[disabled]:active, fieldset[disabled] .btn-default:active, .btn-default.disabled.active, .btn-default[disabled].active, fieldset[disabled] .btn-default.active, .progress-bar { background-color: #D8D8D8; border-color: rgba(0, 0, 0, 0.3); color: #929292; } .btn-primary, .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active, .table > thead > tr > td.primary, .table > tbody > tr > td.primary, .table > tfoot > tr > td.primary, .table > thead > tr > th.primary, .table > tbody > tr > th.primary, .table > tfoot > tr > th.primary, .table > thead > tr.primary > td, .table > tbody > tr.primary > td, .table > tfoot > tr.primary > td, .table > thead > tr.primary > th, .table > tbody > tr.primary > th, .table > tfoot > tr.primary > th { background-color: #6AA6D6; border-color: rgba(0, 0, 0, 0.3); color: #f8f8f8; } .btn-success, .btn-success.disabled, .btn-success[disabled], fieldset[disabled] .btn-success, .btn-success.disabled:hover, .btn-success[disabled]:hover, fieldset[disabled] .btn-success:hover, .btn-success.disabled:focus, .btn-success[disabled]:focus, fieldset[disabled] .btn-success:focus, .btn-success.disabled:active, .btn-success[disabled]:active, fieldset[disabled] .btn-success:active, .btn-success.disabled.active, .btn-success[disabled].active, fieldset[disabled] .btn-success.active, .progress-bar-success, .table > thead > tr > td.success, .table > tbody > tr > td.success, .table > tfoot > tr > td.success, .table > thead > tr > th.success, .table > tbody > tr > th.success, .table > tfoot > tr > th.success, .table > thead > tr.success > td, .table > tbody > tr.success > td, .table > tfoot > tr.success > td, .table > thead > tr.success > th, .table > tbody > tr.success > th, .table > tfoot > tr.success > th { background-color: #63CC9E; border-color: rgba(0, 0, 0, 0.3); color: #f8f8f8; } .btn-info, .btn-info.disabled, .btn-info[disabled], fieldset[disabled] .btn-info, .btn-info.disabled:hover, .btn-info[disabled]:hover, fieldset[disabled] .btn-info:hover, .btn-info.disabled:focus, .btn-info[disabled]:focus, fieldset[disabled] .btn-info:focus, .btn-info.disabled:active, .btn-info[disabled]:active, fieldset[disabled] .btn-info:active, .btn-info.disabled.active, .btn-info[disabled].active, fieldset[disabled] .btn-info.active, .progress-bar-info, .table > thead > tr > td.info, .table > tbody > tr > td.info, .table > tfoot > tr > td.info, .table > thead > tr > th.info, .table > tbody > tr > th.info, .table > tfoot > tr > th.info, .table > thead > tr.info > td, .table > tbody > tr.info > td, .table > tfoot > tr.info > td, .table > thead > tr.info > th, .table > tbody > tr.info > th, .table > tfoot > tr.info > th { background-color: #7BC5D3; border-color: rgba(0, 0, 0, 0.3); color: #f8f8f8; } .btn-warning, .btn-warning.disabled, .btn-warning[disabled], fieldset[disabled] .btn-warning, .btn-warning.disabled:hover, .btn-warning[disabled]:hover, fieldset[disabled] .btn-warning:hover, .btn-warning.disabled:focus, .btn-warning[disabled]:focus, fieldset[disabled] .btn-warning:focus, .btn-warning.disabled:active, .btn-warning[disabled]:active, fieldset[disabled] .btn-warning:active, .btn-warning.disabled.active, .btn-warning[disabled].active, fieldset[disabled] .btn-warning.active, .progress-bar-warning, .table > thead > tr > td.warning, .table > tbody > tr > td.warning, .table > tfoot > tr > td.warning, .table > thead > tr > th.warning, .table > tbody > tr > th.warning, .table > tfoot > tr > th.warning, .table > thead > tr.warning > td, .table > tbody > tr.warning > td, .table > tfoot > tr.warning > td, .table > thead > tr.warning > th, .table > tbody > tr.warning > th, .table > tfoot > tr.warning > th { background-color: #DFD271; border-color: rgba(0, 0, 0, 0.3); color: #f8f8f8; } .btn-danger, .btn-danger.disabled, .btn-danger[disabled], fieldset[disabled] .btn-danger, .btn-danger.disabled:hover, .btn-danger[disabled]:hover, fieldset[disabled] .btn-danger:hover, .btn-danger.disabled:focus, .btn-danger[disabled]:focus, fieldset[disabled] .btn-danger:focus, .btn-danger.disabled:active, .btn-danger[disabled]:active, fieldset[disabled] .btn-danger:active, .btn-danger.disabled.active, .btn-danger[disabled].active, fieldset[disabled] .btn-danger.active, .progress-bar-danger, .table > thead > tr > td.danger, .table > tbody > tr > td.danger, .table > tfoot > tr > td.danger, .table > thead > tr > th.danger, .table > tbody > tr > th.danger, .table > tfoot > tr > th.danger, .table > thead > tr.danger > td, .table > tbody > tr.danger > td, .table > tfoot > tr.danger > td, .table > thead > tr.danger > th, .table > tbody > tr.danger > th, .table > tfoot > tr.danger > th { background-color: #D15E5E; border-color: rgba(0, 0, 0, 0.3); color: #f8f8f8; } .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .open .dropdown-toggle.btn-default { color: #525252; background-color: #b8b8b8; border-color: rgba(0, 0, 0, 0.3); } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary, .table-hover > tbody > tr > td.primary:hover, .table-hover > tbody > tr > th.primary:hover, .table-hover > tbody > tr.primary:hover > td, .table-hover > tbody > tr.primary:hover > th { color: #fff; background-color: #5a8db6; border-color: rgba(0, 0, 0, 0.3); } .btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success, .table-hover > tbody > tr > td.success:hover, .table-hover > tbody > tr > th.success:hover, .table-hover > tbody > tr.success:hover > td, .table-hover > tbody > tr.success:hover > th { color: #fff; background-color: #54ae86; border-color: rgba(0, 0, 0, 0.3); } .btn-info:hover, .btn-info:focus, .btn-info:active, .btn-info.active, .open .dropdown-toggle.btn-info, .table-hover > tbody > tr > td.info:hover, .table-hover > tbody > tr > th.info:hover, .table-hover > tbody > tr.info:hover > td, .table-hover > tbody > tr.info:hover > th { color: #fff; background-color: #69a8b4; border-color: rgba(0, 0, 0, 0.3); } .btn-warning:hover, .btn-warning:focus, .btn-warning:active, .btn-warning.active, .open .dropdown-toggle.btn-warning, .table-hover > tbody > tr > td.warning:hover, .table-hover > tbody > tr > th.warning:hover, .table-hover > tbody > tr.warning:hover > td, .table-hover > tbody > tr.warning:hover > th { color: #fff; background-color: #beb360; border-color: rgba(0, 0, 0, 0.3); } .btn-danger:hover, .btn-danger:focus, .btn-danger:active, .btn-danger.active, .open .dropdown-toggle.btn-danger, .table-hover > tbody > tr > td.danger:hover, .table-hover > tbody > tr > th.danger:hover, .table-hover > tbody > tr.danger:hover > td, .table-hover > tbody > tr.danger:hover > th { color: #fff; background-color: #b25050; border-color: rgba(0, 0, 0, 0.3); } .progress { overflow: visible; } .progress-ui { height: 10px; } .progress-bar { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .progress-bar.ui-widget-content { background: none; border: 0; height: 100%; position: relative; } .progress-bar .ui-state-default { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; height: 10px; width: 10px; top: 0; margin-left: -5px; cursor:pointer; border:0px solid #d3d3d3; outline:none !important; background-color: #f0f0f0; background-image: -webkit-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -moz-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -ms-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -o-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: linear-gradient(to bottom, #f0f0f0, #dfdfdf); } .progress-bar .ui-widget-header { background: #D8D8D8; } .progress-bar-primary .ui-widget-header { background: #6AA6D6; color:#f8f8f8; } .progress-bar-success .ui-widget-header { background: #63CC9E; color:#f8f8f8; } .progress-bar-info .ui-widget-header { background: #7BC5D3; color:#f8f8f8; } .progress-bar-warning .ui-widget-header { background: #DFD271; color:#f8f8f8; } .progress-bar-danger .ui-widget-header { background: #D15E5E; color:#f8f8f8; } .progress-bar .ui-state-default { background: #b8b8b8; } .progress-bar-primary .ui-state-default { background: #5a8db6; } .progress-bar-success .ui-state-default { background: #54ae86; } .progress-bar-info .ui-state-default { background: #69a8b4; } .progress-bar-warning .ui-state-default { background: #beb360; } .progress-bar-danger .ui-state-default { background: #b25050; } .slider-range-min-amount, .slider-range-max-amount, .slider-range-amount { border: 0; background: none; outline: none !important; } .progress-bar.ui-slider-vertical { width:20px; } .progress-bar.ui-slider-vertical .ui-state-default { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; height: 20px; width: 20px; top: auto; margin-left: 0px; left: 0; } #equalizer .progress { height:160px; display:inline-block; margin:15px; } .beauty-table { width:100%; border-collapse:separate; border-spacing:0; } .beauty-table input { border:1px solid transparent; background: none; font-size: 16px; text-align: center; padding:2px 15px !important; width:100%; outline:none; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .beauty-table input:focus { border:1px solid #dfdfdf; background: #fefefe; font-size: 16px; text-align: center; padding: 2px 15px !important; width:100%; outline:none; } .c { color: #999; display: block; } .nt { color: #2f6f9f; } .na { color: #4f9fcf; } .s { color: #d44950; } .radio, .checkbox, .radio-inline, .checkbox-inline { position: relative; } .radio label, .checkbox label, .radio-inline label, .checkbox-inline label { font-weight: normal; cursor: pointer; padding-left: 8px; -webkit-transition: 1s; -moz-transition: 1s; -o-transition: 1s; transition: 1s; } .radio + .radio, .checkbox + .checkbox { margin-top: 10px; } .checkbox input[type=checkbox], .checkbox-inline input[type=checkbox], .radio input[type=radio], .radio-inline input[type=radio] { position: absolute; clip: rect(0, 0, 0, 0); } .checkbox i, .checkbox-inline i, .radio i, .radio-inline i { cursor: pointer; position: absolute; left: 0; top: 0; font-size: 24px; -webkit-transition: 1s; -moz-transition: 1s; -o-transition: 1s; transition: 1s; } .checkbox i.small, .checkbox-inline i.small, .radio i.small, .radio-inline i.small { font-size: 18px; top:2px; } .checkbox input[type=checkbox]:checked + i:before, .checkbox-inline input[type=checkbox]:checked + i:before { content:"\f046"; } .radio input[type=radio]:checked + i:before, .radio-inline input[type=radio]:checked + i:before { content:"\f192"; } .toggle-switch { position: relative; width: 60px; } .toggle-switch input { display: none; } .toggle-switch label { display: block; overflow: hidden; cursor: pointer; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; } .toggle-switch-inner { width: 200%; margin-left: -100%; -webkit-transition: margin 0.3s ease-in 0s; -moz-transition: margin 0.3s ease-in 0s; -o-transition: margin 0.3s ease-in 0s; transition: margin 0.3s ease-in 0s; } .toggle-switch-inner:before, .toggle-switch-inner:after { float: left; width: 50%; height: 20px; padding: 0; line-height: 20px; font-size: 12px; text-shadow: 1px 1px 1px #FFFFFF; color:#929292; background-color: #F5F5F5; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .05); } .toggle-switch-inner:before { content: "ON"; padding-left: 15px; -webkit-border-radius: 20px 0 0 20px; -moz-border-radius: 20px 0 0 20px; border-radius: 20px 0 0 20px; } .toggle-switch-inner:after { content: "OFF"; padding-right: 15px; text-align: right; -webkit-border-radius: 0 20px 20px 0; -moz-border-radius: 0 20px 20px 0; border-radius: 0 20px 20px 0; } .toggle-switch-switch { width: 20px; margin: 0; border: 2px solid #d8d8d8; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; position: absolute; top: 0; bottom: 0; right: 40px; color: #f8f8f8; line-height: 1em; text-shadow: 0 0px 1px #ADADAD; text-align: center; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; background-color: #f0f0f0; background-image: -webkit-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -moz-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -ms-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: -o-linear-gradient(top, #f0f0f0, #dfdfdf); background-image: linear-gradient(to bottom, #f0f0f0, #dfdfdf); } .toggle-switch input:checked + .toggle-switch-inner { margin-left: 0; } .toggle-switch input:checked + .toggle-switch-inner + .toggle-switch-switch { right: 0px; } .toggle-switch-danger input:checked + .toggle-switch-inner + .toggle-switch-switch { border:2px solid #D15E5E; background: #D15E5E; } .toggle-switch-warning input:checked + .toggle-switch-inner + .toggle-switch-switch { border:2px solid #DFD271; background: #DFD271; } .toggle-switch-info input:checked + .toggle-switch-inner + .toggle-switch-switch { border:2px solid #7BC5D3; background: #7BC5D3; } .toggle-switch-success input:checked + .toggle-switch-inner + .toggle-switch-switch { border:2px solid #63CC9E; background: #63CC9E; } .toggle-switch-primary input:checked + .toggle-switch-inner + .toggle-switch-switch { border:2px solid #6AA6D6; background: #6AA6D6; } .select2-container { width: 100%; } .select2-container .select2-choice { height: 30px; } .knob-slider { position: relative; text-align: center; display: inline-block; width: 100%; margin-bottom: 5px; } .knob-slider > div { display: inline-block !important; } .knob-slider input { outline: none !important; } .ipod { background:#dedede; text-align: center; padding:50px 0; } .knob-clock { text-align: center; } .knob-clock > div { font-size:50px; text-align: center; color:#a2a2a2; } .knob { border:0; background: 0; } .box-pricing:hover { box-shadow: 0 0 5px #525252; -webkit-transition: 0.5s; -moz-transition: 0.5s; -o-transition: 0.5s; transition: 0.5s; } .box-pricing .row-fluid > div { padding: 18px 15px 8px; line-height: 1.428571429; vertical-align: top; } .box-pricing .row-fluid.centered > div { background-color: #f5f5f5; padding: 8px; text-align: center; } .box-pricing .row-fluid.centered > div:nth-child(odd) { background-color: #f9f9f9; } .box-pricing .box-header { height: 80px; padding: 10px 0; } .box-pricing .box-name { padding: 0 10px; text-align: center; } .box-pricing .box-name:hover { cursor: inherit; } #messages #breadcrumb { margin-bottom: 0; position: fixed; width: 100%; z-index: 2; } #messages-menu { position:fixed; top:90px; background:#a5a5a5; margin:0; height: 100%; z-index: 2; } #messages-list { margin-top: 40px; padding: 0; } .one-list-message { background: #F1F1F1; border-bottom: 1px solid #CCC; padding: 15px 15px 15px 25px; margin: 0; } .one-list-message .checkbox { margin: 0; overflow: hidden; white-space: nowrap; } .one-list-message .message-title { overflow: hidden; white-space: nowrap; width: 80%; } .one-list-message .message-date { overflow: hidden; white-space: nowrap; font-size: 11px; line-height: 20px; text-align: center; position: absolute; right: 10px; font-weight: bold; background: #D8D8D8; padding: 0; width: 50px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; color: #000; } .form-control { height: 16px; padding: 2px 6px; } .input-lg { height:39px; } .input-sm { height:18px; } .bg-default { background: #D8D8D8 !important; } .bg-primary { background: #6AA6D6 !important; color:#f8f8f8 !important; } .bg-success { background: #63CC9E !important; color:#f8f8f8 !important; } .bg-info { background: #7BC5D3 !important; color:#f8f8f8 !important; } .bg-warning { background: #DFD271 !important; color:#f8f8f8 !important; } .bg-danger { background: #D15E5E !important; color:#f8f8f8 !important; } .txt-default { color: #D8D8D8 !important; } .txt-primary { color: #6AA6D6 !important; } .txt-success, .has-success .help-block, .has-success .control-label, .has-success .radio, .has-success .checkbox, .has-success .radio-inline, .has-success .checkbox-inline { color: #63CC9E !important; } .txt-info { color: #7BC5D3 !important; } .txt-warning, .has-warning .help-block, .has-warning .control-label, .has-warning .radio, .has-warning .checkbox, .has-warning .radio-inline, .has-warning .checkbox-inline { color: #DFD271 !important; } .txt-danger, .has-error .help-block, .has-error .control-label, .has-error .radio, .has-error .checkbox, .has-error .radio-inline, .has-error .checkbox-inline { color: #D15E5E !important; } .has-success .form-control { border-color:#63CC9E; } .has-warning .form-control { border-color:#DFD271; } .has-error .form-control { border-color:#D15E5E; } .has-success .form-control:focus { border-color: #63CC9E; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #63CC9E; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #63CC9E; } .has-warning .form-control:focus { border-color: #DFD271; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #DFD271; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #DFD271; } .has-error .form-control:focus { border-color: #D15E5E; -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #D15E5E; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #D15E5E; } .select2-container-multi .select2-choices { min-height: 26px; display: block; height: 26px; padding: 0 0 0 8px; overflow: hidden; position: relative; border: 1px solid #aaa; white-space: nowrap; line-height: 26px; color: #444; text-decoration: none; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; background-clip: padding-box; -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; background-color: #fff; background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff)); background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%); background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0); background-image: linear-gradient(top, #fff 0%, #eee 50%); } .select2-container-multi .select2-choices .select2-search-field input { padding: 0; margin: 0; } .has-feedback .form-control-feedback { width: 26px; height: 26px; line-height: 26px; } .form-horizontal .radio, .form-horizontal .checkbox, .form-horizontal .radio-inline, .form-horizontal .checkbox-inline { padding-top: 0; } .form-horizontal .control-label { padding-top: 4px; height: 26px; } .input-group-addon { padding: 0px 6px; } .form-group .form-control, .form-group .input-group { margin-bottom: 2px; } .input-group .form-control { margin:0; } #ui-datepicker-div { background: rgba(0, 0, 0, 0.7) !important; border:0; } #ui-datepicker-div .ui-widget-header { background: rgba(0, 0, 0, 0.2); border: 0; border-bottom: 1px solid #686868; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; color: #f8f8f8; padding: 1px 0; } #ui-datepicker-div.ui-widget-content { color:#f8f8f8 !important; } #ui-datepicker-div .ui-state-default, #ui-datepicker-div .ui-widget-content .ui-state-default, #ui-datepicker-div .ui-widget-header .ui-state-default { background: none; border:0; color:#f8f8f8; text-align: center; } #ui-datepicker-div .ui-state-hover, #ui-datepicker-div.ui-widget-content .ui-state-hover, #ui-datepicker-div .ui-widget-header .ui-state-hover, #ui-datepicker-div .ui-state-focus, #ui-datepicker-div.ui-widget-content .ui-state-focus, #ui-datepicker-div .ui-widget-header .ui-state-focus, #ui-datepicker-div .ui-state-highlight, #ui-datepicker-div.ui-widget-content .ui-state-highlight, #ui-datepicker-div .ui-widget-header .ui-state-highlight { background: rgba(0, 0, 0, 0.3) !important; border:0; top:2px; } #ui-datepicker-div .ui-datepicker-group { border-left: 1px solid #686868; } #ui-datepicker-div .ui-datepicker-group:first-child { border-left:0; } #ui-datepicker-div .ui-datepicker-buttonpane { margin: 0; } #ui-datepicker-div .ui-datepicker-group table { margin:0 auto !important; } .ui-datepicker .ui-datepicker-prev { left: 2px !important; cursor: pointer; } .ui-datepicker .ui-datepicker-next { right: 2px !important; cursor: pointer; } .ui-icon-circle-triangle-w { background: url(../img/ui-left.png) 0 0 no-repeat !important; } .ui-icon-circle-triangle-e { background: url(../img/ui-right.png) 0 0 no-repeat !important; } .ui-icon-circle-arrow-s { background: url(../img/ui-accordion-down.png) 0 0 no-repeat !important; } .ui-icon-circle-arrow-e { background: url(../img/ui-accordion-right.png) 0 0 no-repeat !important; } #ui-datepicker-div .ui-slider-horizontal { background: rgba(0, 0, 0, 0.5); height: 4px; border: 0; } #ui-datepicker-div .ui-slider-horizontal .ui-slider-handle { background: #D8D8D8 !important; border: 1px solid #f8f8f8; height: 8px; width: 8px; top:-2px; margin-left: -4px; outline: none; cursor: pointer; } .ui-spinner-input { margin:0; } .ui-spinner .form-control { margin-bottom: 0; } #tabs.ui-widget-content, #tabs .ui-widget-header { border:0; background: none; padding: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } #tabs .ui-widget-header { border-bottom: 1px solid #d8d8d8; } #tabs .ui-state-default, #tabs.ui-widget-content .ui-state-default, #tabs .ui-widget-header .ui-state-default { border:0; margin: 0 0 -1px 0; background: none !important; } #tabs .ui-state-active, #tabs.ui-widget-content .ui-state-active, #tabs .ui-widget-header .ui-state-active { background: none !important; } .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, .ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { cursor: pointer; } .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin: 0; padding: 0; } .ui-tabs .ui-tabs-nav .ui-tabs-anchor { padding: 5px 15px; outline: none !important; } .ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { background:#fcfcfc; border:1px solid #d8d8d8; border-bottom: 0; } .ui-tabs .ui-tabs-nav { padding: 0; } .ui-tabs .ui-tabs-panel { padding: 1em 0; } .ui-widget { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .jqstooltip { -webkit-box-sizing: content-box; -moz-box-sizing: content-box; box-sizing: content-box; border:0!important; text-align:center !important; margin:0px!important; width:50px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding:0px; } .ui-accordion .ui-accordion-header { padding: 6px 12px; margin: 0; top:0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } .ui-accordion .ui-accordion-icons { padding-left:28px; } .ui-accordion-header.ui-state-default { background: #f5f5f5 !important; border: 1px solid #fcfcfc; border-left: 0; border-right: 0; } .ui-accordion-header.ui-state-hover, .ui-accordion-header.ui-state-focus { background: #ebebeb !important; } .ui-accordion-header.ui-state-active { background: #d8d8d8 !important; } .ui-accordion .ui-accordion-content { padding:10px 12px; background: none; border:1px solid #d8d8d8; border-top:0; border-bottom:0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; } #simple_gallery { text-align: center; } #simple_gallery a.fancybox { display: inline-block; padding: 5px; } #simple_gallery a.fancybox img { width: 100%; padding: 2px; border: 1px solid #979797; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; } #simple_gallery a.fancybox img:hover { box-shadow: 0 0 10px #C7C7C7; } .justifiedGallery { overflow: hidden; width: 100%; } .jg-row { position: relative; white-space: nowrap; } .justifiedGallery .jg-image { position: absolute; display: inline-block; vertical-align: top; margin-left: 0; } .justifiedGallery .jg-image a { text-decoration: none; } .justifiedGallery .jg-image img { border: none; } .justifiedGallery .jg-image-label { white-space: normal; font: normal 12px arial; background: #000; color: #fff; position: absolute; left: 0; right: 0; padding: 5px 5px 10px 8px; text-align: left; opacity: 0; } .ex-tooltip { position: absolute; display: none; z-index: 2000; } .morris-hover { position:absolute; z-index:1000; } .morris-hover.morris-default-style, .ex-tooltip { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding: 6px 20px; color: #525252; background: rgba(255, 255, 255, 0.8); font-size: 12px; text-align: center; } .morris-hover.morris-default-style .morris-hover-row-label{ font-weight:bold; margin:0.25em 0; } .morris-hover.morris-default-style .morris-hover-point{ white-space:nowrap; margin:0.1em 0; } #dashboard-header { margin-bottom:20px; } #dashboard_links { padding: 0; } #dashboard_links .nav { background:#3575A0 url(../img/devoops_pattern_b10.png) 0 0 repeat; -webkit-border-radius: 0 4px 4px 0; -moz-border-radius: 0 4px 4px 0; border-radius: 0 4px 4px 0; overflow: hidden; } #dashboard_links .nav-stacked > li { border-bottom: 1px solid rgba(0, 0, 0, 0.25); border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 12px; font-weight: 700; line-height: 15px; padding: 0; margin: 0; } #dashboard_links .nav-pills > li > a { color: #f8f8f8; display: block; padding: 20px 10px 20px 15px; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; outline:none; } #dashboard_links .nav-pills > li.active { border-top-color: rgba(0, 0, 0, 0.11); position: relative; margin: 0; } #dashboard_links .nav-pills > li.active > a, #dashboard_links .nav-pills > li.active > a:hover, #dashboard_links .nav-pills > li.active > a:focus, #dashboard_links .nav > li > a:hover, #dashboard_links .nav > li > a:focus { background:rgba(0, 0, 0, 0.1); } #dashboard_links .nav-pills > li.active > a:before { font-family: FontAwesome; content: "\f0da"; position: absolute; left: -2px; font-size: 30px; color: #f8f8f8; } #dashboard_tabs { background:#f8f8f8; -webkit-border-radius: 4px 0 0 4px; -moz-border-radius: 4px 0 0 4px; border-radius: 4px 0 0 4px; } #dashboard-overview { padding-bottom:15px; } .sparkline-dashboard { float: left; margin-right: 10px; text-align: center; } .sparkline-dashboard-info { float: left; display: block; text-align: center; } .sparkline-dashboard-info span { display: block; font-weight: bold; color: #b25050; } #ow-marketplace { margin-top: 20px; } .ow-server { padding-top: 8px; padding-bottom: 25px; } .ow-server:hover { background:#e7e7e7; } .ow-server .page-header { padding-bottom: 3px; } .ow-server h4 i { position: absolute; left: 15px; } .ow-server small { position: absolute; right: 15px; top: 51px; } .ow-server-bottom { margin-top:25px; } .ow-server-bottom .knob-slider { font-size: 11px; } #ow-server-footer { overflow: hidden; -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; } .ow-settings { position: absolute; top: 7px; left: 40px; display:none; } .ow-settings a { color:#525252; } .ow-server:hover .ow-settings { display: block; } #ow-server-footer a { display: block; padding:10px 0; border-left:1px solid #f8f8f8; text-decoration:none; } #ow-server-footer a:first-child { border-left:0; } #ow-server-footer span { display: block; } .m-table > thead > tr > th, .m-table > tbody > tr > th, .m-table > tfoot > tr > th, .m-table > thead > tr > td, .m-table > tbody > tr > td, .m-table > tfoot > tr > td { vertical-align: middle; padding: 2px 5px; } .m-ticker span { display: block; font-size: 0.8em; line-height: 1em; } .m-price { text-align: right; } .m-change .fa-angle-up { color:#54ae86; font-weight: bold; } .m-change .fa-angle-down { color:#b25050; font-weight: bold; } #ow-summary { font-size: 12px; } #ow-summary b { float:right; padding:1px 4px; margin:1px; border:1px solid #d8d8d8; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } #ow-donut { margin:0 0 20px; } #ow-donut > div { padding:0; } #ow-activity .row { margin: 0 0 0 -15px; font-size: 13px; } #ow-setting { border: 1px solid #C7C7C7; padding: 0; position: absolute; width: 158px; height: 28px; top: 1px; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; opacity: 0; right: -200px; -webkit-transition: 0.1s; -moz-transition: 0.1s; -o-transition: 0.1s; transition: 0.1s; } #ow-marketplace:hover #ow-setting { opacity:1; right:15px; } #ow-setting a { text-align: center; float: left; margin-left: 10px; color: #d8d8d8; font-size: 16px; display:block; line-height: 28px; width:20px; height:26px; -webkit-transition: 0.1s; -moz-transition: 0.1s; -o-transition: 0.1s; transition: 0.1s; } #ow-setting a:hover { font-size:16px; color:#222; line-height:24px; } #ow-licenced { margin:20px 0; } #ow-licenced .row { margin:0; } #ow-stat .row { margin: 0; } #dashboard-clients .one-list-message { background:none; padding:10px 15px; } #dashboard-clients .one-list-message:last-child { border-bottom: 0; } #dashboard-clients .one-list-message .message-date { position: relative; width: auto; right: auto; left: 15px; padding: 0 15px; } .btn + .dropdown-menu { margin-top: -10px; background: rgba(0, 0, 0, 0.7) !important; padding: 0; border: 0; right: 0; left: auto; min-width: 100%; } .btn + .dropdown-menu > li > a { padding: 5px 10px !important; color: #f0f0f0; } .v-txt { -moz-transform: rotate(-90deg); -webkit-transform: rotate(-90deg); -o-transform: rotate(-90deg); position: absolute; top: 60px; left: -20px; color: #d8d8d8; font-size: 8px; box-shadow: 0 0 10px #d8d8d8; padding: 0px 5px; } .full-calendar { padding: 25px 0; background: #FCFCFC; } .external-event { padding: 2px 6px; margin: 4px 0; background: #f5f5f5; } .external-event:hover { cursor: move; background: #6AA6D6; color:#f8f8f8; } #add-new-event { background: #EBEBEB; margin-bottom: 30px; padding: 10px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .modal-backdrop { z-index: 2000; } .modal { z-index: 2001; } .fc-event { border: 1px solid #6AA6D6; background-color: #6AA6D6; } .qq-upload-drop-area { position: absolute; background: #fcfcfc; width: 100%; height: 100%; } .qq-upload-button { float:right; margin:20px 15px 0 0; } .qq-upload-list { position: relative; z-index: 3; margin: 60px 15px 0; padding: 0; list-style: none; } .qq-upload-list li { position: relative; display: inline-block; padding: 15px; margin: 15px; border: 1px solid #E6E6E6; text-align: center; font-size: 12px; background: rgba(245, 245, 245, 0.9); } .qq-upload-settings { opacity: 0; visibility: hidden; bottom: 0; position: absolute; width: 100%; left: 0; padding: 7px 0; background: #FFF; -webkit-border-radius: 0 0 4px 4px; -moz-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; -webkit-transition: 0.2s; -moz-transition: 0.2s; -o-transition: 0.2s; transition: 0.2s; } .qq-upload-list li:hover .qq-upload-settings { opacity: 1; visibility: visible; } .qq-upload-list li img { border:1px solid #b4b4b4; margin-bottom: 5px; } .qq-upload-filename { display: block; overflow: hidden; } .qq-upload-file, .qq-upload-size, .qq-upload-status-text { display: block; } .qq-dropped-zone { position: absolute; top: 5%; left: 50%; margin-left: -71px; text-align: center; font-weight: bold; } .qq-dropped-zone i { font-size: 5em; display: block; color: #f5f5f5; text-shadow: 0 -1px 1px #d8d8d8; } #page-500 h1, .page-404 h1 { font-size: 5em; } .page-404 .form-inline { margin: 40px auto; width: 60%; padding: 15px; background: #FAFAFA; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .page-404 .input-group-btn:last-child > .btn, .page-404 .input-group-btn:last-child > .btn-group { margin-left: -1px; margin-bottom: 0; height: 39px; } #page-500 h3, .page-404 h3 { margin: 5px 0 20px; } .preloader { position: absolute; width: 100%; height: 100%; left: 0; background: #ebebeb; z-index: 2000; } .devoops-getdata { position: absolute; top: 25px; left: 15px; color:#ebebeb; } #page-500, #page-login { position: absolute; height: 100%; width: 100%; } #page-500 { background: #ebebeb; } #page-500 img { display: block; margin:30px auto; } #page-login .logo { position:absolute; } #page-login h3 { font-size:20px; font-family: 'Righteous', cursive; } #page-login .text-right { margin-top: 15px; } #page-login .box { margin-top:15%; } .one-result { margin-top:20px; } .one-result p { margin:0; } .large { font-size: 1.25em; } .nav-search > li.active > a { background: #F0F0F0; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #525252; border-bottom: 1px solid #CECECE; font-weight: bold; } .page-feed .avatar { width: 60px; float: left; margin: 10px 15px; text-align: center; overflow: hidden; } .page-feed .avatar img { width: 60px; height: 60px; border: 1px solid #F8F8F8; } .page-feed-content { position: relative; padding: 3px 15px 5px; background: #FCFCFC; margin-left:90px; min-height: 80px; } .page-feed-content small.time { font-style: italic; } .page-feed .page-feed-content:before { font-family: FontAwesome; content: "\f0d9"; position: absolute; left: -10px; top: 15px; font-size: 30px; color: #fcfcfc; } .likebox { overflow: hidden; } .likebox .navbar-nav { margin:0; } .likebox .navbar-nav li { margin-right: 15px; float: left; } .likebox .fa-thumbs-up { color:#6AA6D6; } .likebox .fa-thumbs-down { color:#D15E5E; } #modalbox { display:none; position: fixed; overflow: auto; overflow-x: hidden; top: 0; right: 0; bottom: 0; left: 0; z-index: 5000; background:rgba(0,0,0,0.8); } #modalbox .devoops-modal { position:absolute;top:90px;margin-left: -300px;left: 50%; border: 1px solid #f8f8f8; box-shadow: 0 0 20px #6AA6D6; background: transparent; margin-bottom: 20px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; width: 600px; z-index:6000; } #modalbox .devoops-modal-header { color: #363636; font-size: 16px; position:relative; overflow: hidden; background: #f5f5f5; border-bottom: 1px solid #E4E4E4; height: 28px; } #modalbox .devoops-modal-inner { position: relative; overflow: hidden; padding: 15px; background: #FCFCFC; } #modalbox .devoops-modal-bottom { position: relative; overflow: hidden; padding: 15px; background: #d8d8d8; } .pagination > li > a, .pagination > li > span { position: relative; float: left; padding: 4px 10px; margin-left: -1px; line-height: 1.428571429; color: #969696; text-decoration: none; background-color: #F5F5F5; border: 1px solid #D8D8D8; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { color: #8A8A8A; background-color: #eee; } .pagination > .disabled > span, .pagination > .disabled > span:hover, .pagination > .disabled > span:focus, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color: #979797; cursor: not-allowed; background-color: #FCFCFC; border-color: #D8D8D8; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index: 2; color: #fff; cursor: default; background-color: #6AA6D6; border-color: #6AA6D6; } .fancybox-nav { position: fixed; width: 50%; } .fancybox-close { position: fixed; top: 20px; right: 36px; background: url(../img/times.png) 0 0 no-repeat; } .fancybox-prev span { left: 21px; background: url(../img/chevron-left.png) 0 0 no-repeat; } .fancybox-next span { right: 36px; background: url(../img/chevron-right.png) 0 0 no-repeat; } #social a { margin: 10px 3px; color: #666; display: block; float: left; } #event_delete { margin-left:20px; } @media (min-width: 768px) { #sidebar-left.col-sm-2 { opacity: 1; width: 16.666666666666664%; padding: 0 15px; } .sidebar-show #sidebar-left.col-sm-2 { opacity: 0; width:0; padding:0; } .sidebar-show #content.col-sm-10 { opacity: 1; width:100%; } .page-404 .form-inline { width: 60%; } } @media (min-width: 992px) { .nav.main-menu > li > a, .nav.msg-menu > li > a { text-align: left; } .nav.main-menu > li > a > i, .nav.msg-menu > li > a > i { font-size:14px; width: 20px; display: inline-block; } .main-menu .dropdown-menu { position: relative; z-index: inherit; left:0; margin: 0; -webkit-border-radius: 0; -moz-border-radius: 0; border-radius: 0; background:rgba(0, 0, 0, 0.2); visibility: visible; } .main-menu .dropdown-menu > li > a { -webkit-border-radius: 0 !important; -moz-border-radius: 0 !important; border-radius: 0 !important; } .page-404 .form-inline { width: 40%; } } @media (max-width: 767px) { #main { margin-top: 100px; } #messages-menu { top:140px; } .page-404 .form-inline { width: 100%; } #dashboard_links .nav { -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } #dashboard_links .nav-stacked > li { float:left; } #dashboard_links .nav-pills > li > a { padding:15px; } #dashboard_links .nav-pills > li.active > a:before { bottom: 0; left: 50%; margin-left: -9px; } } @media (max-width: 620px) { .user-mini { display: none; } } @media (max-width: 400px) { .panel-menu a.account { padding: 5px 0px 5px 0; } .avatar { margin: 0; } .panel-menu i.pull-right { margin-left: 0; } .nav .open > a, .nav .open > a:hover, .nav .open > a:focus { background: none; } #dashboard_links .nav-stacked > li { float:none; } #dashboard_links .nav-pills > li.active > a:before { display: none; } } .gridStyle { border: 1px solid rgb(212,212,212); min-width: 100%; min-height: 100%; } .search-bar { height: 29px; background-color: #e1e1e1; -moz-border-radius: 100px; -webkit-border-radius: 100px; border-radius: 100px; position:relative; width:230px } .search-bar .searchbutton { position:absolute; top:3%; right:25px; } .modal { display: block; } a { cursor: pointer; } #input_container { position:relative; padding:0px; margin:0; } #input { height:26px; width:315px; margin:0; padding-left: 5px; } #input_img { bottom:8px; left:10px; width:10px; height:20px; } #metawidget { border: 1px solid #cccccc; width: 250px; border-radius: 10px; padding: 10px; margin: 50px auto; } .glossyBtn { background-image:url('http://www.spheretekk.com/bc/images/search-icon.gif'); background-repeat:no-repeat; background-position:right top; padding-left:15px; }
{ "content_hash": "ea136488fd3315398fee344209f38b51", "timestamp": "", "source": "github", "line_count": 2426, "max_line_length": 514, "avg_line_length": 24.60181368507832, "alnum_prop": 0.665370953689431, "repo_name": "SupriyaVenkatesh/meanjsnew", "id": "d6d5a0813df5460157d57360a57f408fbadedc54", "size": "59684", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/modules/accounts/css/overrides/style.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "523323" }, { "name": "JavaScript", "bytes": "1598551" } ], "symlink_target": "" }
namespace instrument { namespace transforms { // This class implements the transformation applied to each basic block. class AsanBasicBlockTransform : public block_graph::transforms::NamedBasicBlockSubGraphTransformImpl< AsanBasicBlockTransform>, public block_graph::Filterable { public: // Represent the different kind of access to the memory. enum MemoryAccessMode { kNoAccess, kReadAccess, kWriteAccess, kInstrAccess, kRepzAccess, kRepnzAccess, }; enum StackAccessMode { kUnsafeStackAccess, kSafeStackAccess, }; // Contains memory access information. struct MemoryAccessInfo { MemoryAccessMode mode; uint8_t size; uint16_t opcode; // True iff we need to save the flags for this access. bool save_flags; }; typedef block_graph::BlockGraph BlockGraph; typedef block_graph::BasicBlockSubGraph BasicBlockSubGraph; typedef block_graph::TransformPolicyInterface TransformPolicyInterface; typedef MemoryAccessInfo AsanHookMapEntryKey; // Map of hooks to Asan check access functions. typedef std::map<AsanHookMapEntryKey, BlockGraph::Reference> AsanHookMap; typedef std::map<MemoryAccessMode, BlockGraph::Reference> AsanDefaultHookMap; // Constructor. // @param check_access_hooks References to the various check access functions. // The hooks are assumed to be direct references for COFF images, and // indirect references for PE images. explicit AsanBasicBlockTransform(AsanHookMap* check_access_hooks) : check_access_hooks_(check_access_hooks), debug_friendly_(false), dry_run_(false), instrumentation_happened_(false), instrumentation_rate_(1.0), remove_redundant_checks_(false), use_liveness_analysis_(false) { DCHECK(check_access_hooks != NULL); } // @name Accessors and mutators. // @{ bool debug_friendly() const { return debug_friendly_; } void set_debug_friendly(bool flag) { debug_friendly_ = flag; } bool use_liveness_analysis() { return use_liveness_analysis_; } void set_use_liveness_analysis(bool use_liveness_analysis) { use_liveness_analysis_ = use_liveness_analysis; } bool remove_redundant_checks() const { return remove_redundant_checks_; } void set_remove_redundant_checks(bool remove_redundant_checks) { remove_redundant_checks_ = remove_redundant_checks; } // The instrumentation rate must be in the range [0, 1], inclusive. double instrumentation_rate() const { return instrumentation_rate_; } void set_instrumentation_rate(double instrumentation_rate); // Instead of instrumenting the basic blocks, in dry run mode the instrumenter // only signals if any instrumentation would have happened on the block. // @returns true iff the instrumenter is in dry run mode. bool dry_run() const { return dry_run_; } // Instead of instrumenting the basic blocks, in dry run mode the instrumenter // only signals if any instrumentation would have happened on the block. // @param dry_run true iff dry run mode is on. void set_dry_run(bool dry_run) { dry_run_ = dry_run; } // If at least one instrumentation happened during a transform, or would have // happened during a dry run transform, this returns true. // @returns true iff an instrumentation happened (or would have happened, in // case of a dry run). bool instrumentation_happened() const { return instrumentation_happened_; } // @} // The transform name. static const char kTransformName[]; // @name BasicBlockSubGraphTransformInterface method. virtual bool TransformBasicBlockSubGraph( const TransformPolicyInterface* policy, BlockGraph* block_graph, BasicBlockSubGraph* basic_block_subgraph) override; protected: // Instruments the memory accesses in a basic block. // @param basic_block The basic block to be instrumented. // @param stack_mode Give some assumptions to the transformation on stack // frame manipulations inside @p basic_block. The transformation assume a // standard calling convention, unless specified by this parameter. // (note: Unsafe blocks may be produced with the compiler flag // frame-pointer-omission). // @param image_format The format of the image being instrumented. The details // of how we invoke the hooks vary depending on this. // @returns true on success, false otherwise. bool InstrumentBasicBlock(block_graph::BasicCodeBlock* basic_block, StackAccessMode stack_mode, BlockGraph::ImageFormat image_format); private: // Liveness analysis and liveness information for this subgraph. block_graph::analysis::LivenessAnalysis liveness_; // Memory accesses value numbering. block_graph::analysis::MemoryAccessAnalysis memory_accesses_; // The references to the Asan access check import entries. AsanHookMap* check_access_hooks_; // Activate the overwriting of source range for created instructions. bool debug_friendly_; // Instead of instrumenting the basic blocks, run in dry run mode and just // signal whether there would be an instrumentation in the block. bool dry_run_; // Controls the rate at which reads/writes are instrumented. This is // implemented using random sampling. double instrumentation_rate_; // If any instrumentation happened during a transform, or would have happened // during a dry run transform, this member is set to true. bool instrumentation_happened_; // When activated, a redundancy elimination is performed to minimize the // memory checks added by this transform. bool remove_redundant_checks_; // Set iff we should use the liveness analysis to do smarter instrumentation. bool use_liveness_analysis_; DISALLOW_COPY_AND_ASSIGN(AsanBasicBlockTransform); }; // This runs Asan basic block transform in dry run mode and prepares the block // for hot patching if Asan would instrument it. Doing these two things in a // single basic block transform avoids running basic block decomposer twice. class HotPatchingAsanBasicBlockTransform : public block_graph::transforms::NamedBasicBlockSubGraphTransformImpl< AsanBasicBlockTransform>, public block_graph::Filterable { public: typedef block_graph::BlockGraph BlockGraph; typedef block_graph::BasicBlockSubGraph BasicBlockSubGraph; typedef block_graph::TransformPolicyInterface TransformPolicyInterface; // Construct a HotPatchingAsanBasicBlockTransform. // @param asan_bb_transform An Asan basic block transform that will be run // to check if an instrumentation would happen. // @pre the transform in the parameter must be in dry run mode. HotPatchingAsanBasicBlockTransform( AsanBasicBlockTransform* asan_bb_transform); // @name BasicBlockSubGraphTransformInterface method. virtual bool TransformBasicBlockSubGraph( const TransformPolicyInterface* policy, BlockGraph* block_graph, BasicBlockSubGraph* basic_block_subgraph) override; // Check if the block in the subgraph was prepared for hot patching during // the last run of TransformBasicBlockSubGraph. // @returns true if the prepared the block for hot patching, false if the // block needs no Asan instrumentation. bool prepared_for_hot_patching() { return prepared_for_hot_patching_; } private: AsanBasicBlockTransform* asan_bb_transform_; bool prepared_for_hot_patching_; DISALLOW_COPY_AND_ASSIGN(HotPatchingAsanBasicBlockTransform); }; class AsanTransform : public block_graph::transforms::IterativeTransformImpl<AsanTransform>, public block_graph::Filterable { public: typedef block_graph::BlockGraph BlockGraph; typedef block_graph::TransformPolicyInterface TransformPolicyInterface; typedef AsanBasicBlockTransform::MemoryAccessMode MemoryAccessMode; typedef std::set<BlockGraph::Block*, BlockGraph::BlockIdLess> BlockSet; // Initialize a new AsanTransform instance. AsanTransform(); ~AsanTransform(); // @name IterativeTransformImpl implementation. // @{ bool PreBlockGraphIteration(const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* header_block); bool OnBlock(const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* block); bool PostBlockGraphIteration(const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* header_block); // @} // @name Accessors and mutators. // @{ void set_instrument_dll_name(const base::StringPiece& instrument_dll_name) { instrument_dll_name.CopyToString(&asan_dll_name_); } // Name of the asan_rtl DLL we import. The |instrument_dll_name_| member is // empty by default, in that case |kSyzyAsanDll| will be returned if hot // patching mode is disabled and |kSyzyAsanHpDll| will be returned in hot // patching mode. // @returns the name of the runtime library of the instrumentation. base::StringPiece instrument_dll_name() const; bool debug_friendly() const { return debug_friendly_; } void set_debug_friendly(bool flag) { debug_friendly_ = flag; } bool use_interceptors() const { return use_interceptors_; } void set_use_interceptors(bool use_interceptors) { use_interceptors_ = use_interceptors; } bool use_liveness_analysis() const { return use_liveness_analysis_; } void set_use_liveness_analysis(bool use_liveness_analysis) { use_liveness_analysis_ = use_liveness_analysis; } bool remove_redundant_checks() const { return remove_redundant_checks_; } void set_remove_redundant_checks(bool remove_redundant_checks) { remove_redundant_checks_ = remove_redundant_checks; } // The instrumentation rate must be in the range [0, 1], inclusive. double instrumentation_rate() const { return instrumentation_rate_; } void set_instrumentation_rate(double instrumentation_rate); // Asan RTL parameters. const common::InflatedAsanParameters* asan_parameters() const { return asan_parameters_; } void set_asan_parameters( const common::InflatedAsanParameters* asan_parameters) { asan_parameters_ = asan_parameters; } // @} // Checks if the transform is in hot patching mode. // @returns true iff in hot patching mode. bool hot_patching() const { return hot_patching_; } // If this flag is true, running the transformation prepares the module to // be used by the hot patching Asan runtime. // @param hot_patching The new value of the flag. void set_hot_patching(bool hot_patching) { hot_patching_ = hot_patching; } // The name of the DLL that is imported by default if hot patching mode is // inactive. static const char kSyzyAsanDll[]; // The name of the DLL that is imported by default in hot patching mode. static const char kSyzyAsanHpDll[]; // The transform name. static const char kTransformName[]; // The hooks stub name. static const char kAsanHookStubName[]; protected: // PreBlockGraphIteration uses this to find the block of the _heap_init // function and the data block of _crtheap. This information is used by // PatchCRTHeapInitialization. Also, the block of _heap_init is skipped by // OnBlock. // Calling this initializes heap_init_block_ and crtheap_block_ members. // @param block_graph The block graph to be searched. // @pre Both heap_init_block_ and crtheap_block_ must be nullptr. // @note If either heap_init_block_ and crtheap_block_ is not found, both are // set to nullptr. void FindHeapInitAndCrtHeapBlocks(BlockGraph* block_graph); // Decides if we should skip a Block in OnBlock. A block is skipped if // either // - it is the block of _heap_init, // - it is in the static_intercepted_blocks_ set, // - it is not safe to BB-decompose. // @param policy The policy object that tells if a block is safe to // BB-decompose. // @param block The block to examine. // @returns true iff the block should be skipped. bool ShouldSkipBlock(const TransformPolicyInterface* policy, BlockGraph::Block* block); // @name PE-specific methods. // @{ // Finds statically linked functions that need to be intercepted. Called in // PreBlockGraphTransform. Fills the static_intercepted_blocks_ set. // Blocks in this set are skipped in OnBlock and intercepted in // PeInterceptFunctions. // @param intercepts The Asan intercepts. // @param block_graph The block graph to search in. void PeFindStaticallyLinkedFunctionsToIntercept( const AsanIntercept* intercepts, BlockGraph* block_graph); // Invoked when instrumenting a PE image. Intercepts all relevant import // and statically linked functions found in the image. The intercepts to be // used are exposed for unittesting. bool PeInterceptFunctions(const AsanIntercept* intercepts, const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* header_block); // Injects runtime parameters into the image. bool PeInjectAsanParameters(const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* header_block); // @} // @name COFF-specific methods. // @{ // Invoked when instrumenting a COFF image. Intercepts all relevant functions // via symbol renaming, redirecting to Asan instrumented versions. The // intercepts to be used are exposed for unittesting. bool CoffInterceptFunctions(const AsanIntercept* intercepts, const TransformPolicyInterface* policy, BlockGraph* block_graph, BlockGraph::Block* header_block); // @} // Name of the asan_rtl DLL we import. Do not access this directly, use the // instrument_dll_name() getter that provides default values. std::string asan_dll_name_; // Activate the overwriting of source range for created instructions. bool debug_friendly_; // Set iff we should use the liveness analysis to do smarter instrumentation. bool use_liveness_analysis_; // When activated, a redundancy elimination is performed to minimize the // memory checks added by this transform. bool remove_redundant_checks_; // Set iff we should use the functions interceptors. bool use_interceptors_; // Controls the rate at which reads/writes are instrumented. This is // implemented using random sampling. double instrumentation_rate_; // Asan RTL parameters that will be injected into the instrumented image. // These will be found by the RTL and used to control its behaviour. Allows // for setting parameters at instrumentation time that vary from the defaults. // These can still be overridden by configuring the RTL via an environment // variable. const common::InflatedAsanParameters* asan_parameters_; // References to the different Asan check access import entries. Valid after // successful PreBlockGraphIteration. AsanBasicBlockTransform::AsanHookMap check_access_hooks_ref_; // Block containing any injected runtime parameters. Valid in PE mode after // a successful PostBlockGraphIteration. This is a unittesting seam. block_graph::BlockGraph::Block* asan_parameters_block_; // Pointers to the heap initialization block and the block of the CRT heap // pointer. These are determined during PreBlockGraphIteration, and are either // both present or both nullptr. The heap initialization block is skipped // during OnBlock, then transformed in PostBlockGraphIteration // (via PatchCRTHeapInitialization). The block of the CRT heap pointer // is needed for this transformation. BlockGraph::Block* heap_init_block_; BlockGraph::Block* crtheap_block_; // Statically linked functions that need to be intercepted. Populated by // PeFindStaticallyLinkedFunctionsToIntercept. Block in this set are skipped // in OnBlock and intercepted in PeInterceptFunctions. // This is a set because OnBlock needs fast lookup. We sort by the BlockID // to have a consistent output in PeInterceptFunctions. BlockSet static_intercepted_blocks_; // If this flag is true, running the transformation prepares the module to // be used by the hot patching Asan runtime. bool hot_patching_; // In hot patching mode, this vector is used to collect the blocks prepared // for hot patching in the OnBlock method and insert them to the hot patching // metadata stream in the PostBlockGraphIteration. std::vector<BlockGraph::Block*> hot_patched_blocks_; private: DISALLOW_COPY_AND_ASSIGN(AsanTransform); }; bool operator<(const AsanBasicBlockTransform::MemoryAccessInfo& left, const AsanBasicBlockTransform::MemoryAccessInfo& right); } // namespace transforms } // namespace instrument #endif // SYZYGY_INSTRUMENT_TRANSFORMS_ASAN_TRANSFORM_H_
{ "content_hash": "61163f8f6159aa06569636ea8fdafe7a", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 80, "avg_line_length": 40.63095238095238, "alnum_prop": 0.7256372692645766, "repo_name": "wangming28/syzygy", "id": "beed21256b20d70f2adaf33855f440e648cd20e0", "size": "18453", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "syzygy/instrument/transforms/asan_transform.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "26942" }, { "name": "Batchfile", "bytes": "21191" }, { "name": "C", "bytes": "12371" }, { "name": "C++", "bytes": "8336297" }, { "name": "CSS", "bytes": "1333" }, { "name": "HTML", "bytes": "3182" }, { "name": "Protocol Buffer", "bytes": "9292" }, { "name": "Python", "bytes": "888571" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_26) on Mon Oct 07 06:41:31 UTC 2013 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class org.apache.hadoop.mapred.MultiFileInputFormat (Apache Hadoop Main 2.2.0 API) </TITLE> <META NAME="date" CONTENT="2013-10-07"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.hadoop.mapred.MultiFileInputFormat (Apache Hadoop Main 2.2.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/mapred/MultiFileInputFormat.html" title="class in org.apache.hadoop.mapred"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/mapred//class-useMultiFileInputFormat.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MultiFileInputFormat.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.apache.hadoop.mapred.MultiFileInputFormat</B></H2> </CENTER> No usage of org.apache.hadoop.mapred.MultiFileInputFormat <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/hadoop/mapred/MultiFileInputFormat.html" title="class in org.apache.hadoop.mapred"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/hadoop/mapred//class-useMultiFileInputFormat.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="MultiFileInputFormat.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2013 <a href="http://www.apache.org">Apache Software Foundation</a>. All Rights Reserved. </BODY> </HTML>
{ "content_hash": "289bf0890a3c78cc256ae91c846267b6", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 226, "avg_line_length": 42.827586206896555, "alnum_prop": 0.6231884057971014, "repo_name": "ashish-17/drift", "id": "08467c18d837875091215bd115b872cd5b9a2de8", "size": "6210", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "hadoop-2.2.0/share/doc/hadoop/api/org/apache/hadoop/mapred/class-use/MultiFileInputFormat.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "85328" }, { "name": "C", "bytes": "24796" }, { "name": "C++", "bytes": "16604" }, { "name": "CSS", "bytes": "394460" }, { "name": "Groff", "bytes": "25822" }, { "name": "HTML", "bytes": "58267561" }, { "name": "Java", "bytes": "78980" }, { "name": "JavaScript", "bytes": "13300" }, { "name": "Python", "bytes": "1038" }, { "name": "Shell", "bytes": "135543" }, { "name": "TeX", "bytes": "27734" }, { "name": "XSLT", "bytes": "20437" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="width=device-width, minimal-ui"> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../css/style.css"> <title>ENTER YOUR TITLE</title> </head> <body> <!-- Header w/ breadcrumb (Adjust breadcrumb links as needed) --> <header role="banner"> <nav role="navigation"> <a href="../index.html">Home</a> &gt; <a href="html_techniques.html">WCAG HTML Techniques</a> </nav> <hr> </header> <main role="main"> <h1>ENTER YOUR HEADING</h1> <!-- Component start --> <!-- DELETE THIS COMMENT & ENTER YOUR CODE SNIPPET HERE - LEAVE THE "COMPONENT START" AND "COMPONENT END" COMMENTS IN PLACE --> <!-- Component end --> </main> <footer role="contentinfo"> <!-- Enter references and testing results in this footer section --> <hr> <!-- Enter any references or sources using the format example below. If this is an original code sample you can just delete the Source: line below --> <p>Source: <a href="https://YOUR_SOURCE_URL" target="_blank">YOUR SOURCE</a></p> <!-- Enter testing results following examples below. Include: OS, Browser, AT used, and result --> <h3>Tested on:</h3> <div> <ul> <li>iOS 9.01, Safari, and VoiceOver <ul> <li>Result: Disabled checkbox does not receive focus and announces "unavailable" when reading the page content.</li> </ul> </li> <li>Windows 7, Firefox ESR 49.0.1, and JAWS 17 <ul> <li>Result: Disabled checkbox does not receive focus from the tab order and announces "unavailable" when reading the page content.</li> </ul> </li> </ul> </div> </footer> </body> </html>
{ "content_hash": "600180e003c1c6e4c1efe21d384ce7d6", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 159, "avg_line_length": 37.735849056603776, "alnum_prop": 0.5465, "repo_name": "IBMa/Va11yS", "id": "176a5b326814f7691f51b949da8e41126830f8dc", "size": "2000", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "WCAG_HTML/HTML-TEMPLATE.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14684" }, { "name": "HTML", "bytes": "797926" }, { "name": "JavaScript", "bytes": "47604" } ], "symlink_target": "" }
import random from nltk.tokenize import wordpunct_tokenize from collections import OrderedDict from trainbot import Trainbot import chatbot_brain brain_dict = OrderedDict({}) def add_func_to_dict(name=None): def wrapper(func): function_name = name if function_name is None: function_name = func.__name__ brain_dict[function_name] = func, func.__doc__ return func return wrapper @add_func_to_dict("Bigram Brain") def _create_bi_chains(chatbot_brain, seeds, size=200): u"""Return list of Markov-Chain generated strings where each word added onto the sentence is selected solely from the probability of it following the given last word in the training data.""" print "the seeds are: " + str(seeds) candidates = [] while len(candidates) < size: seed = str(chatbot_brain.i_filter_random(seeds)) candidate = [seed] done = False count = 0 while not done: count += 1 try: next_word = random.choice(chatbot_brain.bi_lexicon[seed]) candidate.append(next_word) seed = next_word except KeyError: candidates.append(" ".join(candidate)) done = True if next_word in chatbot_brain.stop_puncts: candidates.append(" ".join(candidate)) done = True if count > 75: done = True return candidates @add_func_to_dict("Trigram Brain") def _create_chains(chatbot_brain, seeds, size=200): u"""Return list of Markov-Chain generated strings where each word added onto the sentence is selected solely from the probability of it following the given last two words in the training data.""" print "the seeds are: " + str(seeds) candidates = [] while len(candidates) < size: seed = str(chatbot_brain.i_filter_random(seeds)) pair = str(chatbot_brain._pair_seed(seed)) w_1 = pair[0] w_2 = pair[1] next_word = "" word_1, word_2 = w_1, w_2 candidate = [word_1, word_2] pair = "{} {}".format(word_1, word_2) done = False while not done: try: next_word = random.choice(chatbot_brain.tri_lexicon[pair]) candidate.append(next_word) word_1, word_2 = word_2, next_word pair = "{} {}".format(word_1, word_2) except KeyError: candidates.append(" ".join(candidate)) done = True if next_word in chatbot_brain.stop_puncts: candidates.append(" ".join(candidate)) done = True return candidates
{ "content_hash": "13d0676e9d338ccec530fa00118fde77", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 74, "avg_line_length": 34.98717948717949, "alnum_prop": 0.5807988274093074, "repo_name": "corinnelhh/chatbot", "id": "39d2551041033acafebee866f435a29e18203272", "size": "2729", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "brains.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "2188" }, { "name": "JavaScript", "bytes": "2309" }, { "name": "Python", "bytes": "38094" } ], "symlink_target": "" }
module Sidekiq module Middleware module Client module Stats class ResqueLike include Sidekiq::ResqueStatus # Store information on the current enqueued job into redis def call(worker, msg, queue) enqueue_job(worker, msg, queue) yield end end end end end end
{ "content_hash": "b8316b0f36689f974311236fe8947ca5", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 68, "avg_line_length": 21.294117647058822, "alnum_prop": 0.5773480662983426, "repo_name": "ThomasAlxDmy/sidekiq-resque_status", "id": "96d7874052d58c295e5149c7029e65bb6302c129", "size": "362", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/sidekiq-resque_status/middleware/client/resque_like.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "15826" } ], "symlink_target": "" }
import React from 'react'; import utils from '../../core/utils'; export default (props) => { let $dateTime = props.date; return <div className="showTime"> <span className="date"> {$dateTime.getDate() < 10 ? '0' : ''}{$dateTime.getDate()} </span> <span className="monthAndYear"> {utils.returnMonthStringFormNumber($dateTime.getMonth() + 1)}月 &nbsp; {$dateTime.getFullYear()} </span> <span className="weekAndTime"> 星期{utils.returnWeekStringFormNumber($dateTime.getDay())} &nbsp;{$dateTime.getHours() < 10 ? '0' : ''}{$dateTime.getHours()}: {$dateTime.getMinutes() < 10 ? '0' : ''}{$dateTime.getMinutes()} </span> </div>; };
{ "content_hash": "19824c92ee22769d57ccee327043f32f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 94, "avg_line_length": 43.142857142857146, "alnum_prop": 0.46357615894039733, "repo_name": "yodfz/nblog", "id": "889c53a091992acb06c35b958af937b980dca3ca", "size": "912", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PC_client/components/Time/showTime.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "97274" }, { "name": "HTML", "bytes": "32619" }, { "name": "JavaScript", "bytes": "18952050" }, { "name": "Shell", "bytes": "596" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in Biblthca Lichenol. 77: 124 (2000) #### Original name Thrombium lecanorae Stein ### Remarks null
{ "content_hash": "d65dea46ecf708df48b5bc992fa00f9f", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 33, "avg_line_length": 12.23076923076923, "alnum_prop": 0.7169811320754716, "repo_name": "mdoering/backbone", "id": "c55ed5266c76e6a6b797b9b1b579045e42b8cfdb", "size": "238", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Eurotiomycetes/Pyrenulales/Xanthopyreniaceae/Zwackhiomyces/Zwackhiomyces lecanorae/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "3dccd8dd330c96bbf26c0579eac30cf9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "ffaab3bf505ea0d7fa24945333b9520fc00fdbbd", "size": "172", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Calyceraceae/Boopis/Boopis ameghinoi/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
from corehq.apps.reports.fields import ReportSelectField, SelectCaseOwnerField from django.utils.translation import ugettext_noop from corehq.apps.groups.models import Group from dimagi.utils.couch.database import get_db from django.utils.translation import ugettext as _ class SelectPNCStatusField(ReportSelectField): slug = "PNC_status" name = ugettext_noop("Status") cssId = "opened_closed" cssClasses = "span3" default_option = "Select PNC Status" options = [dict(val="On Time", text=ugettext_noop("On time")), dict(val="Late", text=ugettext_noop("Late"))] class SelectBlockField(ReportSelectField): slug = "block" name = ugettext_noop("Block") cssId = "opened_closed" cssClasses = "span3" def update_params(self): blocks = set(self.get_blocks(self.domain)) block = self.request.GET.get(self.slug, '') self.selected = block self.options = [dict(val=block_item, text="%s" % block_item) for block_item in blocks] self.default_option = _("Select Block") @classmethod def get_blocks(cls, domain): key = [domain] for r in get_db().view('crs_reports/field_block', startkey=key, endkey=key + [{}], group_level=3).all(): _, _, block_name = r['key'] if block_name: yield block_name class SelectSubCenterField(ReportSelectField): slug = "sub_center" name = ugettext_noop("Sub Center") cssId = "opened_closed" cssClasses = "span3" default_option = "Select Sub Center" options = [] class SelectASHAField(SelectCaseOwnerField): name = ugettext_noop("ASHA") default_option = ugettext_noop("Type ASHA name") def update_params(self): case_sharing_groups = Group.get_case_sharing_groups(self.domain) self.context["groups"] = [dict(group_id=group._id, name=group.name) for group in case_sharing_groups]
{ "content_hash": "ed4d1ac52d5c0a59b51ca7a1bb44a085", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 109, "avg_line_length": 33.59322033898305, "alnum_prop": 0.6392532795156408, "repo_name": "gmimano/commcaretest", "id": "861d3e1a3ac0fa6ecec7cd2828079706bab05e6e", "size": "1982", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "custom/apps/crs_reports/fields.py", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ActionScript", "bytes": "15950" }, { "name": "CSS", "bytes": "282577" }, { "name": "JavaScript", "bytes": "2731012" }, { "name": "Python", "bytes": "4738450" }, { "name": "Shell", "bytes": "22454" } ], "symlink_target": "" }
package com.flytxt.tp.processor.filefilter; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import javax.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.ConfigurationProperties; /** * For building the File filter chain, * @author shiju.john * */ @ConfigurationProperties(prefix = "filters") public class FilterChainBuilder { /** Filter Parameters configuration against each Filter class*/ @Autowired private FilterParameters filterParameters; /** Configured file filters from Application.yaml */ private Map<String,String> filterNameMap; /** filter chain Map . Contain multiple filter chains */ private Map<String,FilterChain> filterChainMap = null; /** Filter separator in apllication.yaml */ private final static String FILTER_CLASS_SEPARATOR ="," ; /** Logger */ private final Logger logger = LoggerFactory.getLogger(FilterChainBuilder.class); /** * For building the File filter chain * Build the Filter chain and kept inside the Map filterChainMap * The key will be the filter Name and value will be the constructed FilterChain object * */ @PostConstruct public void build(){ if(null!=getFilterNameMap() && getFilterNameMap().size()>0){ filterChainMap = new HashMap<>(getFilterNameMap().size()); Set<Entry<String, String>> entries = getFilterNameMap().entrySet(); for(Entry<String, String> entry : entries){ filterChainMap.put(entry.getKey(), getFilterChain(entry.getValue(),entry.getKey())); } } } /** * For creating the filterChain implementation class instance * * @param fileFilterClassName : FilterChain implementation Class name * @param filterName * @return instance of the given class name */ private FilterChain getFilterInstance(String fileFilterClassName, String filterName) { Filter filter = Filter.value(fileFilterClassName); if(null!=filter) { if(null!=filterParameters.getArgMap()){ return filter.getFilterInstance(filterParameters.getArgMap().get(filterName)); }else{ return filter.getInstance(); } }else{ logger.error("Unable to create the instance of the file filter : "+fileFilterClassName + " Please check the Filter ENUM is properlly implemented." ); return null; } } /** * COnvert the given filters to the corresponding filter class. * @param filterName * @return the first filterChain node */ private FilterChain getFilterChain(String fileFilters, String filterName) { FilterChain filterChain = null,firstNode = null; if(null!=fileFilters){ String [] fileFilterArray = fileFilters.split(FILTER_CLASS_SEPARATOR); for(String fileFilter:fileFilterArray){ if(null==filterChain){ filterChain = getFilterInstance(fileFilter,filterName); firstNode = filterChain; }else{ filterChain.nextLink = getFilterInstance(fileFilter,filterName); filterChain = filterChain.nextLink; } } } return firstNode; } /** * * @param filterName * @return */ public FilterChain getFilterChainByName(String filterName) { if(null!=filterChainMap&& filterChainMap.size()>0){ return filterChainMap.get(filterName); } return null; } /** * @return the filterNameMap */ public Map<String,String> getFilterNameMap() { return filterNameMap; } /** * @param filterNameMap the filterNameMap to set */ public void setFilterNameMap(Map<String,String> filterNameMap) { this.filterNameMap = filterNameMap; } }
{ "content_hash": "b4ec4551a392580c9d02c6284f0f1122", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 92, "avg_line_length": 28.57894736842105, "alnum_prop": 0.6971849513285977, "repo_name": "arunsoman/text-processor", "id": "8e80c72a6521d009f5f5022d6247e9b22f34e7de", "size": "3801", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "processor/src/main/java/com/flytxt/tp/processor/filefilter/FilterChainBuilder.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Gherkin", "bytes": "19062" }, { "name": "HTML", "bytes": "2307" }, { "name": "Java", "bytes": "284514" }, { "name": "JavaScript", "bytes": "36128" }, { "name": "Perl6", "bytes": "264" }, { "name": "Shell", "bytes": "739" } ], "symlink_target": "" }
set -x find albums/ -name \*thumbnail.JPG | xargs rm find albums/ -name \*meta\* | xargs rm
{ "content_hash": "aac584c88db679c8ec6f1ebf53bfa6fd", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 46, "avg_line_length": 23.75, "alnum_prop": 0.6526315789473685, "repo_name": "ae6rt/photo-albums", "id": "9af53fd1b9d13aaa42336266d4997cf647adae9b", "size": "105", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cleanthumbnails.sh", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "482" }, { "name": "Groovy", "bytes": "2102" }, { "name": "Java", "bytes": "19856" }, { "name": "JavaScript", "bytes": "5174" }, { "name": "Shell", "bytes": "105" } ], "symlink_target": "" }
/** * @file * This file defines block- and streaming-based interfaces for * base64 encoding and decoding. * */ #ifndef NLUTILITIES_NLBASE64_H #define NLUTILITIES_NLBASE64_H #include <stddef.h> #include <stdint.h> #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif extern uint16_t nl_base64_decode(const char *in, uint16_t inLen, uint8_t *out); extern uint16_t nl_base64_encode(const uint8_t *in, uint16_t inLen, char *out); /* Streaming Base64 encoder. Requires only 4 bytes on the stack rather * than an O(N) output buffer. */ typedef void (*nl_base64_stream_enc_putchar_t)(const uint8_t inByte, void *inContext); typedef struct { uint8_t encoded[3]; uint8_t num_encoded; uint16_t num_written; nl_base64_stream_enc_putchar_t putchar; void * context; } nl_base64_stream_enc_state_t; extern void nl_base64_stream_enc_start(nl_base64_stream_enc_state_t *state, nl_base64_stream_enc_putchar_t out_putchar, void *context); extern uint16_t nl_base64_stream_enc_more(const uint8_t *in, uint16_t inLen, nl_base64_stream_enc_state_t *state); extern uint16_t nl_base64_stream_enc_finish(bool pad, nl_base64_stream_enc_state_t *state); #ifdef __cplusplus } #endif #endif // NLUTILITIES_NLBASE64_H
{ "content_hash": "ce673c26c2956d145d3bb57dc1ece21b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 86, "avg_line_length": 30.32, "alnum_prop": 0.5897097625329816, "repo_name": "nestlabs/nlutilities", "id": "bdd94356f4af7348c49cdcbb737b4e85ae8a731f", "size": "2183", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/nlbase64.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "134810" }, { "name": "C++", "bytes": "44122" }, { "name": "M4", "bytes": "15867" }, { "name": "Makefile", "bytes": "182046" }, { "name": "Shell", "bytes": "1202" } ], "symlink_target": "" }
typedef struct { OBJECT_HEADER; Value selector; Value arguments; } RawMessage; OBJECT_HANDLE(Message); typedef struct { RawClass *classes[LOOKUP_CACHE_SIZE]; RawString *selectors[LOOKUP_CACHE_SIZE]; uint8_t *codes[LOOKUP_CACHE_SIZE]; } LookupTable; extern LookupTable LookupCache; NativeCodeEntry lookupNativeCode(RawClass *class, RawString *selector); NativeCode *getNativeCode(Class *class, CompiledMethod *method); static intptr_t lookupHash(intptr_t classHash, intptr_t selectorHash) { return (classHash ^ selectorHash) & LOOKUP_CACHE_SIZE - 1; } static void flushLookupCache(void) { memset(&LookupCache, 0, sizeof(LookupCache.classes) + sizeof(LookupCache.selectors)); } static NativeCodeEntry cachedLookupNativeCode(RawClass *class, RawString *selector) { intptr_t hash = lookupHash((intptr_t) class, (intptr_t) selector); if (LookupCache.classes[hash] == class && LookupCache.selectors[hash] == selector) { return (NativeCodeEntry) LookupCache.codes[hash]; } return lookupNativeCode(class, selector); } #endif
{ "content_hash": "b8c1cc4c26d67422b247f0e041a9b9f5", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 86, "avg_line_length": 25.390243902439025, "alnum_prop": 0.7665706051873199, "repo_name": "lm/yet-another-smalltalk-vm", "id": "d5495db86f4a9ae9f470916463a9bfb5f383c2a8", "size": "1197", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vm/Lookup.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "452337" }, { "name": "C++", "bytes": "36014" }, { "name": "CMake", "bytes": "1265" }, { "name": "HTML", "bytes": "166" }, { "name": "Objective-C", "bytes": "23907" }, { "name": "Shell", "bytes": "1038" }, { "name": "Smalltalk", "bytes": "146253" } ], "symlink_target": "" }
$(function () { // Initialize modal dialog attach modal-container bootstrap attributes to links with .modal-link class. // when a link is clicked with these attributes, bootstrap will display the href content in a modal dialog. $('body').on('click', '.modal-link', function (e) { e.preventDefault(); $(this).attr('data-target', '#modal-container'); $(this).attr('data-toggle', 'modal'); }); // Attach listener to .modal-close-btn's so that when the button is pressed the modal dialog disappears $('body').on('click', '.modal-close-btn', function () { $('#modal-container').modal('hide'); }); //clear modal cache, so that new content can be loaded $('body').on('hidden.bs.modal', '#modal-container', function() { $(this).removeData('bs.modal'); }); $('#cancelModal').on('click', function () { return false; }); $('body').on('click', '#ShowVariationsModal', function (e) { e.preventDefault(); $('#variation-modal-container').modal('show'); }); $('body').on('click', '#ShowJackpotsModal', function (e) { e.preventDefault(); $('#jackpots-modal-container').modal('show'); }); $('body').on('click', '#ShowKeyLayoutModal', function (e) { e.preventDefault(); $('#keylayout-modal-container').modal('show'); }); $('body').on('click', '#ShowBaseConfigurationModal', function (e) { e.preventDefault(); $('#baseconfiguration-modal-container').modal('show'); }); $('body').on('click', '#ShowConditionsModal', function (e) { e.preventDefault(); $('#conditions-modal-container').modal('show'); }); $('body').on('click', '#ShowInstallNotesModal', function (e) { e.preventDefault(); $('#installnotes-modal-container').modal('show'); }); });
{ "content_hash": "1dd1232866a32e101d52947f39d8e716", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 111, "avg_line_length": 33.57142857142857, "alnum_prop": 0.5787234042553191, "repo_name": "MitchThors/GovHack2015", "id": "19696678fbe397e3e19d28939d4596f27a48b96f", "size": "1882", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "GovHack2015/GovHack2015/Scripts/ModalWindow.js", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "73930" }, { "name": "CSS", "bytes": "8438" }, { "name": "HTML", "bytes": "5125" }, { "name": "JavaScript", "bytes": "47605" }, { "name": "PowerShell", "bytes": "10128" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "b7f1b6378eb0e0f533e0344c4cc177bc", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "7be9c0e5791fe182b5d24bc4d583ea0d59c3b050", "size": "173", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Sapindales/Sapindaceae/Acer/Acer miaotaiense/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
struct Node; struct Link { Node* node; unsigned int length; }; struct Node { std::vector<Link> links; unsigned int sum; std::vector<unsigned int> path; }; class Graph { public: Graph(); ~Graph(); Node* root(); Node* create_children(Node* parent, unsigned int length); void link(Node* n1, Node* n2, unsigned int length); private: Node m_root; }; #endif
{ "content_hash": "9150c098fd8f00c4d4c8d101400cc807", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 14.931034482758621, "alnum_prop": 0.5727482678983834, "repo_name": "lucas8/MPSI", "id": "435b07acf8fe996e03148cec69c0f6114fe1a8ed", "size": "490", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ipt/djikstra/graph.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C++", "bytes": "1515" }, { "name": "Haskell", "bytes": "10365" }, { "name": "Makefile", "bytes": "2228" }, { "name": "OCaml", "bytes": "26496" }, { "name": "Perl", "bytes": "8451" }, { "name": "Python", "bytes": "52246" }, { "name": "Shell", "bytes": "89" }, { "name": "TeX", "bytes": "157859" } ], "symlink_target": "" }
require 'chef' require 'cheffish/merged_config' require 'chef/provisioning/driver' require 'chef/provisioning/machine/windows_machine' require 'chef/provisioning/machine/unix_machine' require 'chef/provisioning/vsphere_driver/clone_spec_builder' require 'chef/provisioning/vsphere_driver/version' require 'chef/provisioning/vsphere_driver/vsphere_helpers' require 'chef/provisioning/vsphere_driver/vsphere_url' module ChefProvisioningVsphere # Provisions machines in vSphere. class VsphereDriver < Chef::Provisioning::Driver include Chef::Mixin::ShellOut def self.from_url(driver_url, config) VsphereDriver.new(driver_url, config) end # Create a new Vsphere provisioner. # # ## Parameters # connect_options - hash of options to be passed to RbVmomi::VIM.connect # :host - required - hostname of the vSphere API server # :port - optional - port on the vSphere API server (default: 443) # :path - optional - path on the vSphere API server (default: /sdk) # :use_ssl - optional - true to use ssl in connection to vSphere API server (default: true) # :insecure - optional - true to ignore ssl certificate validation errors in connection to vSphere API server (default: false) # :user - required - user name to use in connection to vSphere API server # :password - required - password to use in connection to vSphere API server def self.canonicalize_url(driver_url, config) config = symbolize_keys(config) [ driver_url || URI::VsphereUrl.from_config(config).to_s, config ] end def self.symbolize_keys(h) Hash === h ? Hash[ h.map do |k, v| [k.respond_to?(:to_sym) ? k.to_sym : k, symbolize_keys(v)] end ] : h end def initialize(driver_url, config) super(driver_url, config) uri = URI(driver_url) @connect_options = { provider: 'vsphere', host: uri.host, port: uri.port, use_ssl: uri.use_ssl, insecure: uri.insecure, path: uri.path } if driver_options @connect_options[:user] = driver_options[:user] @connect_options[:password] = driver_options[:password] end end attr_reader :connect_options # Acquire a machine, generally by provisioning it. Returns a Machine # object pointing at the machine, allowing useful actions like setup, # converge, execute, file and directory. The Machine object will have a # "node" property which must be saved to the server (if it is any # different from the original node object). # # ## Parameters # action_handler - the action_handler object that is calling this method; this # is generally a action_handler, but could be anything that can support the # ChefMetal::ActionHandler interface (i.e., in the case of the test # kitchen metal driver for acquiring and destroying VMs; see the base # class for what needs providing). # node - node object (deserialized json) representing this machine. If # the node has a provisioner_options hash in it, these will be used # instead of options provided by the provisioner. TODO compare and # fail if different? # node will have node['normal']['provisioner_options'] in it with any options. # It is a hash with this format: # # -- provisioner_url: vsphere://host:port?ssl=[true|false]&insecure=[true|false] # -- bootstrap_options: hash of options to pass to RbVmomi::VIM::VirtualMachine::CloneTask() # :datacenter # :resource_pool # :cluster # :datastore # :template_name # :template_folder # :vm_folder # :winrm {...} (not yet implemented) # :ssh {...} # # Example bootstrap_options for vSphere: # TODO: add other CloneTask params, e.g.: datastore, annotation, resource_pool, ... # 'bootstrap_options' => { # 'template_name' =>'centos6.small', # 'template_folder' =>'Templates', # 'vm_folder' => 'MyApp' # } # # node['normal']['provisioner_output'] will be populated with information # about the created machine. For vSphere, it is a hash with this # format: # # -- provisioner_url: vsphere:host:port?ssl=[true|false]&insecure=[true|false] # -- vm_folder: name of the vSphere folder containing the VM # def allocate_machine(action_handler, machine_spec, machine_options) merge_options! machine_options if machine_spec.location Chef::Log.warn( "Checking to see if #{machine_spec.location} has been created...") vm = vm_for(machine_spec) if vm Chef::Log.warn 'returning existing machine' return vm else Chef::Log.warn machine_msg( machine_spec.name, machine_spec.location['server_id'], 'no longer exists. Recreating ...' ) end end bootstrap_options = machine_options[:bootstrap_options] action_handler.report_progress full_description( machine_spec, bootstrap_options) vm = find_or_create_vm(bootstrap_options, machine_spec, action_handler) add_machine_spec_location(vm, machine_spec) action_handler.performed_action(machine_msg( machine_spec.name, vm.config.instanceUuid, 'created' )) vm end def merge_options!(machine_options) @config = { machine_options: machine_options } #@config = Cheffish::MergedConfig.new( # { machine_options: machine_options } #) #@config end def add_machine_spec_location(vm, machine_spec) machine_spec.location = { 'driver_url' => driver_url, 'driver_version' => VERSION, 'server_id' => vm.config.instanceUuid, 'is_windows' => is_windows?(vm), 'allocated_at' => Time.now.utc.to_s, 'ipaddress' => vm.guest.ipAddress } end def find_or_create_vm(bootstrap_options, machine_spec, action_handler) vm = vsphere_helper.find_vm( bootstrap_options[:vm_folder], machine_spec.name ) if vm Chef::Log.info machine_msg( machine_spec.name, vm.config.instanceUuid, 'already created' ) else vm = clone_vm( action_handler, bootstrap_options, machine_spec.name ) end vm end def full_description(machine_spec, bootstrap_options) description = [ "creating machine #{machine_spec.name} on #{driver_url}" ] bootstrap_options.to_hash.each_pair do |key,value| description << " #{key}: #{value.inspect}" end description end def machine_msg(name, id, action) "Machine - #{action} - #{name} (#{id} on #{driver_url})" end def ready_machine(action_handler, machine_spec, machine_options) merge_options! machine_options vm = start_machine(action_handler, machine_spec, machine_options) if vm.nil? raise "Machine #{machine_spec.name} does not have a server "\ 'associated with it, or server does not exist.' end bootstrap_options = machine_options[:bootstrap_options] transport_respond?( machine_options, vm, action_handler, machine_spec ) machine = machine_for(machine_spec,machine_options) setup_extra_nics(action_handler, bootstrap_options, vm, machine) if has_static_ip(bootstrap_options) && !is_windows?(vm) setup_ubuntu_dns(machine, bootstrap_options, machine_spec) end machine end def setup_extra_nics(action_handler, bootstrap_options, vm, machine) networks=bootstrap_options[:network_name] if networks.kind_of?(String) networks=[networks] end return if networks.nil? || networks.count < 2 new_nics = vsphere_helper.add_extra_nic( action_handler, vm_template_for(bootstrap_options), bootstrap_options, vm ) if is_windows?(vm) && !new_nics.nil? new_nics.each do |nic| nic_label = nic.device.deviceInfo.label machine.execute_always( "Disable-Netadapter -Name '#{nic_label}' -Confirm:$false") end end end def transport_respond?( machine_options, vm, action_handler, machine_spec ) bootstrap_options = machine_options[:bootstrap_options] # this waits for vmware tools to start and the vm to presebnt an ip # This may just be the ip of a newly cloned machine # Customization below may change this to a valid ip wait_until_ready(action_handler, machine_spec, machine_options, vm) if !machine_spec.location['ipaddress'] || !has_ip?(machine_spec.location['ipaddress'], vm) # find the ip we actually want # this will be the static ip to assign # or the ip reported back by the vm if using dhcp # it *may* be nil if just cloned vm_ip = ip_to_bootstrap(bootstrap_options, vm) transport = nil unless vm_ip.nil? transport = transport_for(machine_spec, bootstrap_options[:ssh], vm_ip) end unless !transport.nil? && transport.available? && has_ip?(vm_ip, vm) attempt_ip(machine_options, action_handler, vm, machine_spec) end machine_spec.location['ipaddress'] = vm.guest.ipAddress action_handler.report_progress( "IP address obtained: #{machine_spec.location['ipaddress']}") end wait_for_domain(bootstrap_options, vm, machine_spec, action_handler) begin wait_for_transport(action_handler, machine_spec, machine_options, vm) rescue Timeout::Error # Only ever reboot once, and only if it's been less than 10 minutes # since we stopped waiting if machine_spec.location['started_at'] || remaining_wait_time(machine_spec, machine_options) < -(10*60) raise else Chef::Log.warn(machine_msg( machine_spec.name, vm.config.instanceUuid, 'started but SSH did not come up. Rebooting...' )) restart_server(action_handler, machine_spec, machine_options) wait_until_ready(action_handler, machine_spec, machine_options, vm) wait_for_transport(action_handler, machine_spec, machine_options, vm) end end end def attempt_ip(machine_options, action_handler, vm, machine_spec) vm_ip = ip_to_bootstrap(machine_options[:bootstrap_options], vm) wait_for_ip(vm, machine_options, action_handler) unless has_ip?(vm_ip, vm) action_handler.report_progress "rebooting..." if vm.guest.toolsRunningStatus != "guestToolsRunning" msg = 'tools have stopped. current power state is ' msg << vm.runtime.powerState msg << ' and tools state is ' msg << vm.guest.toolsRunningStatus msg << '. powering up server...' action_handler.report_progress(msg.join) vsphere_helper.start_vm(vm) else restart_server(action_handler, machine_spec, machine_options) end wait_for_ip(vm, machine_options, action_handler) end end def wait_for_domain(bootstrap_options, vm, machine_spec, action_handler) return unless bootstrap_options[:customization_spec] return unless bootstrap_options[:customization_spec][:domain] domain = bootstrap_options[:customization_spec][:domain] if is_windows?(vm) && domain != 'local' start = Time.now.utc trimmed_name = machine_spec.name.byteslice(0,15) expected_name="#{trimmed_name}.#{domain}" action_handler.report_progress( "waiting to domain join and be named #{expected_name}") until (Time.now.utc - start) > 30 || (vm.guest.hostName == expected_name) do print '.' sleep 5 end end end def wait_for_ip(vm, machine_options, action_handler) bootstrap_options = machine_options[:bootstrap_options] vm_ip = ip_to_bootstrap(bootstrap_options, vm) ready_timeout = machine_options[:ready_timeout] || 300 msg = "waiting up to #{ready_timeout} seconds for customization" msg << " and find #{vm_ip}" unless vm_ip == vm.guest.ipAddress action_handler.report_progress msg start = Time.now.utc until (Time.now.utc - start) > ready_timeout || has_ip?(vm_ip, vm) do action_handler.report_progress( "IP addresses found: #{all_ips_for(vm)}") vm_ip ||= ip_to_bootstrap(bootstrap_options, vm) sleep 5 end end def all_ips_for(vm) vm.guest.net.map { |net| net.ipAddress}.flatten end def has_ip?(ip, vm) all_ips_for(vm).include?(ip) end # Connect to machine without acquiring it def connect_to_machine(machine_spec, machine_options) merge_options! machine_options machine_for(machine_spec, machine_options) end def destroy_machine(action_handler, machine_spec, machine_options) merge_options! machine_options vm = vm_for(machine_spec) if vm action_handler.perform_action "Delete VM [#{vm.parent.name}/#{vm.name}]" do begin vsphere_helper.stop_vm(vm, machine_options[:stop_timeout]) vm.Destroy_Task.wait_for_completion rescue RbVmomi::Fault => fault raise fault unless fault.fault.class.wsdl_name == "ManagedObjectNotFound" ensure machine_spec.location = nil end end end strategy = convergence_strategy_for(machine_spec, machine_options) strategy.cleanup_convergence(action_handler, machine_spec) end def stop_machine(action_handler, machine_spec, machine_options) merge_options! machine_options vm = vm_for(machine_spec) if vm action_handler.perform_action "Shutdown guest OS and power off VM [#{vm.parent.name}/#{vm.name}]" do vsphere_helper.stop_vm(vm, machine_options[:stop_timeout]) end end end def start_machine(action_handler, machine_spec, machine_options) merge_options! machine_options vm = vm_for(machine_spec) if vm action_handler.perform_action "Power on VM [#{vm.parent.name}/#{vm.name}]" do vsphere_helper.start_vm(vm, machine_options[:bootstrap_options][:ssh][:port]) end end vm end def restart_server(action_handler, machine_spec, machine_options) action_handler.perform_action "restart machine #{machine_spec.name} (#{driver_url})" do stop_machine(action_handler, machine_spec, machine_options) start_machine(action_handler, machine_spec, machine_options) machine_spec.location['started_at'] = Time.now.utc.to_s end end protected def setup_ubuntu_dns(machine, bootstrap_options, machine_spec) host_lookup = machine.execute_always('host google.com') if host_lookup.exitstatus != 0 if host_lookup.stdout.include?("setlocale: LC_ALL") machine.execute_always('locale-gen en_US && update-locale LANG=en_US') end distro = machine.execute_always("lsb_release -i | sed -e 's/Distributor ID://g'").stdout.strip Chef::Log.info "Found distro:#{distro}" if distro == 'Ubuntu' distro_version = (machine.execute_always("lsb_release -r | sed -e s/[^0-9.]//g")).stdout.strip.to_f Chef::Log.info "Found distro version:#{distro_version}" if distro_version>= 12.04 Chef::Log.info "Ubuntu version 12.04 or greater. Need to patch DNS." interfaces_file = "/etc/network/interfaces" nameservers = bootstrap_options[:customization_spec][:ipsettings][:dnsServerList].join(' ') machine.execute_always("if ! cat #{interfaces_file} | grep -q dns-search ; then echo 'dns-search #{bootstrap_options[:customization_spec][:domain]}' >> #{interfaces_file} ; fi") machine.execute_always("if ! cat #{interfaces_file} | grep -q dns-nameservers ; then echo 'dns-nameservers #{nameservers}' >> #{interfaces_file} ; fi") machine.execute_always('/etc/init.d/networking restart') machine.execute_always('apt-get -qq update') end end end end def has_static_ip(bootstrap_options) if bootstrap_options.has_key?(:customization_spec) bootstrap_options = bootstrap_options[:customization_spec] if bootstrap_options.has_key?(:ipsettings) bootstrap_options = bootstrap_options[:ipsettings] if bootstrap_options.has_key?(:ip) return true end end end false end def remaining_wait_time(machine_spec, machine_options) if machine_spec.location['started_at'] (machine_options[:start_timeout] || 600) - (Time.now.utc - Time.parse(machine_spec.location['started_at'])) else (machine_options[:create_timeout] || 600) - (Time.now.utc - Time.parse(machine_spec.location['allocated_at'])) end end def wait_until_ready(action_handler, machine_spec, machine_options, vm) if vm.guest.toolsRunningStatus != "guestToolsRunning" if action_handler.should_perform_actions action_handler.report_progress "waiting for #{machine_spec.name} (#{vm.config.instanceUuid} on #{driver_url}) to be ready ..." until remaining_wait_time(machine_spec, machine_options) < 0 || (vm.guest.toolsRunningStatus == "guestToolsRunning" && !vm.guest.ipAddress.nil? && vm.guest.ipAddress.length > 0) do print "." sleep 5 end action_handler.report_progress "#{machine_spec.name} is now ready" end end end def vm_for(machine_spec) if machine_spec.location vsphere_helper.find_vm_by_id(machine_spec.location['server_id']) else nil end end def clone_vm(action_handler, bootstrap_options, machine_name) vm_template = vm_template_for(bootstrap_options) spec_builder = CloneSpecBuilder.new(vsphere_helper, action_handler) clone_spec = spec_builder.build(vm_template, machine_name, bootstrap_options) Chef::Log.debug("Clone spec: #{clone_spec.pretty_inspect}") vm_folder = vsphere_helper.find_folder(bootstrap_options[:vm_folder]) vm_template.CloneVM_Task( name: machine_name, folder: vm_folder, spec: clone_spec ).wait_for_completion vm = vsphere_helper.find_vm(vm_folder, machine_name) additional_disk_size_gb = bootstrap_options[:additional_disk_size_gb] if !additional_disk_size_gb.is_a?(Array) additional_disk_size_gb = [additional_disk_size_gb] end additional_disk_size_gb.each do |size| size = size.to_i next if size == 0 if bootstrap_options[:datastore].to_s.empty? raise ':datastore must be specified when adding a disk to a cloned vm' end task = vm.ReconfigVM_Task( spec: RbVmomi::VIM.VirtualMachineConfigSpec( deviceChange: [ vsphere_helper.virtual_disk_for( vm, bootstrap_options[:datastore], size ) ] ) ) task.wait_for_completion end vm end def vsphere_helper # @vsphere_helper ||= VsphereHelper.new( @vsphere_helper = VsphereHelper.new( connect_options, config[:machine_options][:bootstrap_options][:datacenter] ) end def vm_template_for(bootstrap_options) template_folder = bootstrap_options[:template_folder] template_name = bootstrap_options[:template_name] vsphere_helper.find_vm(template_folder, template_name) || raise("vSphere VM Template not found [#{template_folder}/#{template_name}]") end def machine_for(machine_spec, machine_options) if machine_spec.location.nil? raise "Server for node #{machine_spec.name} has not been created!" end transport = transport_for( machine_spec, machine_options[:bootstrap_options][:ssh] ) strategy = convergence_strategy_for(machine_spec, machine_options) if machine_spec.location['is_windows'] Chef::Provisioning::Machine::WindowsMachine.new( machine_spec, transport, strategy) else Chef::Provisioning::Machine::UnixMachine.new( machine_spec, transport, strategy) end end def is_windows?(vm) return false if vm.nil? vm.config.guestId.start_with?('win') end def convergence_strategy_for(machine_spec, machine_options) require 'chef/provisioning/convergence_strategy/install_msi' require 'chef/provisioning/convergence_strategy/install_cached' require 'chef/provisioning/convergence_strategy/no_converge' mopts = machine_options[:convergence_options].to_hash.dup if mopts[:chef_server] mopts[:chef_server] = mopts[:chef_server].to_hash.dup mopts[:chef_server][:options] = mopts[:chef_server][:options].to_hash.dup if mopts[:chef_server][:options] end if !machine_spec.location return Chef::Provisioning::ConvergenceStrategy::NoConverge.new( mopts, config) end if machine_spec.location['is_windows'] Chef::Provisioning::ConvergenceStrategy::InstallMsi.new( mopts, config) else Chef::Provisioning::ConvergenceStrategy::InstallCached.new( mopts, config) end end def wait_for_transport(action_handler, machine_spec, machine_options, vm) transport = transport_for( machine_spec, machine_options[:bootstrap_options][:ssh] ) if !transport.available? if action_handler.should_perform_actions action_handler.report_progress "waiting for #{machine_spec.name} (#{vm.config.instanceUuid} on #{driver_url}) to be connectable (transport up and running) ..." until remaining_wait_time(machine_spec, machine_options) < 0 || transport.available? do print "." sleep 5 end action_handler.report_progress "#{machine_spec.name} is now connectable" end end end def transport_for( machine_spec, remoting_options, ip = machine_spec.location['ipaddress'] ) if machine_spec.location['is_windows'] create_winrm_transport(ip, remoting_options) else create_ssh_transport(ip, remoting_options) end end def create_winrm_transport(host, options) require 'chef/provisioning/transport/winrm' opt = options[:user].include?("\\") ? :disable_sspi : :basic_auth_only winrm_options = { user: "#{options[:user]}", pass: options[:password], opt => true } Chef::Provisioning::Transport::WinRM.new( "http://#{host}:5985/wsman", :plaintext, winrm_options, config ) end def create_ssh_transport(host, options) require 'chef/provisioning/transport/ssh' ssh_user = options[:user] Chef::Provisioning::Transport::SSH.new( host, ssh_user, options, @config[:machine_options][:sudo] ? {:prefix => 'sudo '} : {}, config ) end def ip_to_bootstrap(bootstrap_options, vm) if has_static_ip(bootstrap_options) bootstrap_options[:customization_spec][:ipsettings][:ip] else vm.guest.ipAddress end end end end
{ "content_hash": "285ab991a74cbf649d19594f679631d8", "timestamp": "", "source": "github", "line_count": 673, "max_line_length": 189, "avg_line_length": 35.841010401188704, "alnum_prop": 0.6177190000414576, "repo_name": "shaneramey/chef-provisioning-vsphere", "id": "a559201cc1edb631b62832253d2143452b361c90", "size": "24121", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/chef/provisioning/vsphere_driver/driver.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "69084" } ], "symlink_target": "" }
using BepuUtilities.Memory; using BepuPhysics; using BepuUtilities; using System.Numerics; namespace HeadlessTests23.StreamerStyle; public abstract class Scene : IDisposable { /// <summary> /// Gets the simulation created by the demo's Initialize call. /// </summary> public Simulation Simulation { get; protected set; } //Note that the buffer pool used by the simulation is not considered to be *owned* by the simulation. The simulation merely uses the pool. //Disposing the simulation will not dispose or clear the buffer pool. /// <summary> /// Gets the buffer pool used by the demo's simulation. /// </summary> public BufferPool BufferPool { get; private set; } /// <summary> /// Gets the thread dispatcher available for use by the simulation. /// </summary> public ThreadDispatcher ThreadDispatcher { get; protected set; } public abstract float TimestepDuration { get; } public abstract Vector3 Gravity { get; } public Scene() { BufferPool = new BufferPool(); } public abstract void Initialize(Random random, int threadCount); public BoundingBox RegionOfInterest { get; protected set; } protected void CreateRegionOfInterest() { var boundingBox = new BoundingBox { Min = new Vector3(float.MaxValue), Max = new Vector3(float.MinValue) }; for (int setIndex = 0; setIndex < Simulation.Bodies.Sets.Length; ++setIndex) { ref var set = ref Simulation.Bodies.Sets[setIndex]; if (set.Allocated) { for (int i = 0; i < set.Count; ++i) { BoundingBox.CreateMerged(boundingBox, Simulation.Bodies.GetBodyReference(set.IndexToHandle[i]).BoundingBox, out boundingBox); } } } if (boundingBox.Min == new Vector3(float.MaxValue) || boundingBox.Max == new Vector3(float.MinValue)) { boundingBox = default; } RegionOfInterest = boundingBox; } public abstract void Update(); bool disposed; public void Dispose() { if (!disposed) { disposed = true; Simulation.Dispose(); BufferPool.Clear(); ThreadDispatcher.Dispose(); } } }
{ "content_hash": "8071d22b84aab326e3cb90693d116370", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 145, "avg_line_length": 31.18918918918919, "alnum_prop": 0.6234835355285961, "repo_name": "RossNordby/scratchpad", "id": "cc5bf19ef135563ca1b3374fd95e35dc745736d5", "size": "2310", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "HeadlessTests24/HeadlessTests23/StreamerStyle/Scene.cs", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "776" }, { "name": "C#", "bytes": "4671527" }, { "name": "C++", "bytes": "121557" }, { "name": "HLSL", "bytes": "21611" } ], "symlink_target": "" }
<style> .roles-tab .form-horizontal .control-label { text-align: left; } .roles-tab .view-results-table { margin-top: 20px; } </style> <div class="container-fluid roles-tab"> <div class="row"> <div class="col-md-8"> <md-card class="oppia-page-card oppia-long-text"> <form class="form-horizontal" name="viewRoleForm" ng-submit="submitRoleViewForm(viewFormValues)"> <legend class="text-center">View User Roles</legend> <div class="form-group"> <label class="col-md-4 col-lg-4 col-sm-4 control-label pull-left" for="viewFormValues.method"> Select Method </label> <div class="col-md-8"> <select ng-model="viewFormValues.method" class="form-control"> <option value="role">By Role</option> <option value="username">By Username</option> </select> </div> </div> <div class="form-group" ng-if="viewFormValues.method==='role'"> <label class="col-md-4 col-lg-4 col-sm-4 control-label pull-left">Select Role</label> <div class="col-md-8 col-lg-8 col-sm-8"> <select ng-options="roleName as roleString for (roleName, roleString) in VIEWABLE_ROLES" ng-model="viewFormValues.role" class="form-control"> </select> </div> </div> <div class="form-group" ng-if="viewFormValues.method==='username'"> <label class="col-md-4 col-lg-4 col-sm-4 control-label">Enter Username</label> <div class="col-md-8 col-lg-8 col-sm-8"> <input type="text" name="username" placeholder="Enter username" ng-model="viewFormValues.username" class="form-control"> </div> </div> <button type="submit" class="btn btn-success" ng-disabled="(viewFormValues.method==='role' && !viewFormValues.role) || (viewFormValues.method==='username' && !viewFormValues.username)" value="view role"> View Role </button> </form> <div ng-show="resultRolesVisible"> <table class="table text-center view-results-table"> <thead> <tr> <td><strong>Username</strong></td> <td><strong>Role</strong></td> </tr> </thead> <tbody> <tr ng-repeat="(name, role) in result"> <td><[name]></td> <td><[role]></td> </tr> </tbody> </table> </div> </md-card> <md-card class="oppia-page-card oppia-long-text"> <form class="form-horizontal" name="updateRoleForm" ng-submit="submitUpdateRoleForm(updateFormValues)"> <legend class="text-center">Update Role</legend> <div class="form-group"> <label class="col-md-4 col-lg-4 col-sm-4 control-label">Enter Username</label> <div class="col-md-8 col-lg-8 col-sm-8"> <input type="text" placeholder="Enter username" ng-model="updateFormValues.username" class="form-control protractor-update-form-name"> </div> </div> <div class="form-group"> <label class="col-md-4 col-lg-4 col-sm-4 control-label pull-left">Select Role</label> <div class="col-md-8 col-lg-8 col-sm-8"> <select ng-options="roleName as roleString for (roleName, roleString) in UPDATABLE_ROLES" ng-model="updateFormValues.newRole" class="form-control protractor-update-form-role-select"> </select> </div> </div> <button type="submit" class="btn btn-success protractor-update-form-submit" ng-disabled="!updateFormValues.newRole || !updateFormValues.username" value="update role">Update Role</button> </form> </md-card> </div> <div class="col-md-4"> <md-card class="oppia-page-card oppia-long-text" style=""> <legend class="text-center">Role Hierarchy</legend> <role-graph graph-data="graphData" graph-data-loaded="graphDataLoaded"> </role-graph> </md-card> </div> </div> </div>
{ "content_hash": "2e08ab58516c07ad6ac2d3049e893975", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 196, "avg_line_length": 42.29, "alnum_prop": 0.5620714116812485, "repo_name": "MAKOSCAFEE/oppia", "id": "cd2c932f489bf6bfa6fa56c7d3692e6fd4fe2c41", "size": "4229", "binary": false, "copies": "3", "ref": "refs/heads/develop", "path": "core/templates/dev/head/pages/admin/roles_tab/roles_tab_directive.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "101321" }, { "name": "HTML", "bytes": "900382" }, { "name": "JavaScript", "bytes": "2922781" }, { "name": "Python", "bytes": "3701239" }, { "name": "Shell", "bytes": "47818" } ], "symlink_target": "" }
module Azure::ServiceBus::Mgmt::V2015_08_01 module Models # # The response to the List Subscriptions operation. # class SubscriptionListResult include MsRestAzure include MsRest::JSONable # @return [Array<SubscriptionResource>] Result of the List Subscriptions # operation. attr_accessor :value # @return [String] Link to the next set of results. Not empty if Value # contains incomplete list of subscriptions. attr_accessor :next_link # return [Proc] with next page method call. attr_accessor :next_method # # Gets the rest of the items for the request, enabling auto-pagination. # # @return [Array<SubscriptionResource>] operation results. # def get_all_items items = @value page = self while page.next_link != nil && !page.next_link.strip.empty? do page = page.get_next_page items.concat(page.value) end items end # # Gets the next page of results. # # @return [SubscriptionListResult] with next page content. # def get_next_page response = @next_method.call(@next_link).value! unless @next_method.nil? unless response.nil? @next_link = response.body.next_link @value = response.body.value self end end # # Mapper for SubscriptionListResult class as Ruby Hash. # This will be used for serialization/deserialization. # def self.mapper() { client_side_validation: true, required: false, serialized_name: 'SubscriptionListResult', type: { name: 'Composite', class_name: 'SubscriptionListResult', model_properties: { value: { client_side_validation: true, required: false, serialized_name: 'value', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'SubscriptionResourceElementType', type: { name: 'Composite', class_name: 'SubscriptionResource' } } } }, next_link: { client_side_validation: true, required: false, serialized_name: 'nextLink', type: { name: 'String' } } } } } end end end end
{ "content_hash": "b4c10dfd5097bceb81f2a4c8ca873569", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 80, "avg_line_length": 28.71578947368421, "alnum_prop": 0.5102639296187683, "repo_name": "Azure/azure-sdk-for-ruby", "id": "c8a472ee6cddf456ebb87ebbb656eb85266a1d70", "size": "2892", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "management/azure_mgmt_service_bus/lib/2015-08-01/generated/azure_mgmt_service_bus/models/subscription_list_result.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "345216400" }, { "name": "Shell", "bytes": "305" } ], "symlink_target": "" }
{% extends "tasks/base.html" %} {% load i18n %} {% load shorttimesince_tag %} {% load tasks_tags %} {% load pagination_tags %} {% load group_tags %} {% block head_title %}Tasks History{% endblock %} {% block body %} <h1>History for all Tasks</h1> <p>This page shows all changes on all tasks.</p> {% autopaginate task_history 50 %} {% paginate %} <table class="task_list"> <thead> <tr> <th>ID</th> <th>Modifier</th> <th>Modified</th> <th>Summary</th> <th>Assignee</th> <th>Tags</th> <th>State</th> </tr> </thead> <tbody> {% for change in task_history %} <!-- {% cycle odd,even as rowcolor %} --> <tr class="{{ rowcolor }}" style="padding-bottom:10px"> <td><a href="{% groupurl task_detail group id=change.task.id %}">{{ change.task.id }}</a></td> <td> {% if change.owner %} <a href="{% groupurl tasks_for_user group username=change.owner %}">{{ change.owner }}</a> {% endif %} {% if change.nudger %} <a href="{% groupurl tasks_for_user group username=change.nudger %}">{{ change.nudger }}</a> {% endif %} </td> <td>{{ change.modified|shorttimesince }}</td> <td> {{ change.summary }} {% if change.nudger %} nudged {% endif %} </td> <td> {% if change.nudger %} nudged {% else %} {% if change.assignee %} <a href="{% groupurl tasks_for_user group username=change.assignee %}">{{ change.assignee }}</a> {% else %} <span class="warning">unassigned</span> {% endif %} {% endif %} </td> <td>{% task_tags change group %}</td> <td> {{ change.get_state_display }} {% if change.get_resolution_display %} <br /><em>{{ change.get_resolution_display }}</em> {% endif %} </td> </tr> {% if change.status %} <tr class="{{ rowcolor }}"> <td><strong>Status</strong></td> <td colspan="6">{{ change.status }}</td> </tr> {% endif %} {% if change.comment %} <tr class="{{ rowcolor }}"> <td><strong>Comment</strong></td> <td colspan="6"> {{ change.comment|striptags|urlize }} </td> </tr> {% endif %} {% endfor %} </tbody> </table> {% paginate %} {% endblock %}
{ "content_hash": "71ed31e67fe80313d6159ed071e8bcb6", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 124, "avg_line_length": 36.91566265060241, "alnum_prop": 0.39033942558746737, "repo_name": "ericholscher/pinax", "id": "a4107a7d66994d434ee22c56d6ae63f53b0bf821", "size": "3064", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pinax/templates/default/tasks/tasks_history_list.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
<?php namespace Dotdigitalgroup\Email\Test\Unit\Model\AbandonedCart\ProgramEnrolment; use Dotdigitalgroup\Email\Helper\Config; use Dotdigitalgroup\Email\Helper\Data; use Dotdigitalgroup\Email\Logger\Logger; use Dotdigitalgroup\Email\Model\AbandonedCart\CartInsight\Data as CartInsight; use Dotdigitalgroup\Email\Model\AbandonedCart\ProgramEnrolment\Enroller; use Dotdigitalgroup\Email\Model\AbandonedCart\ProgramEnrolment\Interval; use Dotdigitalgroup\Email\Model\AbandonedCart\ProgramEnrolment\Rules; use Dotdigitalgroup\Email\Model\AbandonedCart\ProgramEnrolment\Saver; use Dotdigitalgroup\Email\Model\AbandonedCart\TimeLimit; use Dotdigitalgroup\Email\Model\ResourceModel\Automation\CollectionFactory as AutomationCollectionFactory; use Dotdigitalgroup\Email\Model\ResourceModel\Order\Collection; use Dotdigitalgroup\Email\Model\ResourceModel\Order\CollectionFactory; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; use PHPUnit\Framework\TestCase; class ProgramEnrolmentEnrollerTest extends TestCase { /** * @var CollectionFactory|\PHPUnit_Framework_MockObject_MockObject */ private $orderCollectionFactoryMock; /** * @var Collection|\PHPUnit_Framework_MockObject_MockObject */ private $orderCollectionMock; /** * @var Data|\PHPUnit_Framework_MockObject_MockObject */ private $dataHelperMock; /** * @var \Magento\Framework\App\Config\ScopeConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ private $scopeConfigModelMock; /** * @var Interval */ private $interval; /** * @var Saver */ private $saver; /** * @var Rules */ private $rules; /** * @var Enroller */ private $model; /** * @var CartInsight */ private $cartInsight; /** * @var ObjectManager */ protected $objectManager; /** * @var \PHPUnit\Framework\MockObject\MockObject */ private $automationCollectionFactoryMock; /** * @var \PHPUnit\Framework\MockObject\MockObject */ private $timeLimitMock; /** * @var \PHPUnit\Framework\MockObject\MockObject */ private $quoteMock; /** * @var Logger|\PHPUnit\Framework\MockObject\MockObject */ private $loggerMock; protected function setUp() :void { $this->orderCollectionFactoryMock = $this->getMockBuilder(CollectionFactory::class) ->setMethods(['create']) ->disableOriginalConstructor() ->getMock(); $this->dataHelperMock = $this->getMockBuilder(Data::class) ->disableOriginalConstructor() ->getMock(); $this->scopeConfigModelMock = $this->createMock(\Magento\Framework\App\Config\ScopeConfigInterface::class); $this->interval = $this->createMock(Interval::class); $this->saver = $this->createMock(Saver::class); $this->rules = $this->createMock(Rules::class); $this->cartInsight = $this->createMock(CartInsight::class); //We need to mock an Object to behave as a Collection (of Quote objects) in order to pass the tests $this->objectManager = new ObjectManager($this); $this->quoteMock = $this->createMock(\Magento\Quote\Model\Quote::class); $this->orderCollectionMock = $this->objectManager->getCollectionMock(Collection::class, [$this->quoteMock]); $this->automationCollectionFactoryMock = $this->getMockBuilder(AutomationCollectionFactory::class) ->disableOriginalConstructor() ->setMethods(['create','getAbandonedCartAutomationsForContactByInterval','getSize']) ->getMock(); $this->timeLimitMock = $this->createMock(TimeLimit::class); $this->loggerMock = $this->createMock(Logger::class); $this->prepare(); $this->model = new Enroller( $this->loggerMock, $this->orderCollectionFactoryMock, $this->dataHelperMock, $this->interval, $this->saver, $this->rules, $this->cartInsight, $this->automationCollectionFactoryMock, $this->timeLimitMock ); } public function testAutomationIsNotSavedIfQuoteHasNoItems() { $this->quoteMock->expects($this->atLeastOnce()) ->method('hasItems') ->willReturn(false); $this->saver->expects($this->never()) ->method('save'); $this->model->process(); } public function testAutomationIsSavedIfQuoteHasItemsAndNoAbandonedCartLimit() { $this->quoteMock->expects($this->atLeastOnce()) ->method('hasItems') ->willReturn(true); $this->timeLimitMock->expects($this->atLeastOnce()) ->method('getAbandonedCartTimeLimit') ->willReturn(null); $this->saver->expects($this->atLeastOnce()) ->method('save'); $this->model->process(); } public function testAutomationIsSavedIfQuoteHasItemsAndAbandonedCartLimitPasses() { $this->quoteMock->expects($this->atLeastOnce()) ->method('hasItems') ->willReturn(true); $this->timeLimitMock->expects($this->atLeastOnce()) ->method('getAbandonedCartTimeLimit') ->willReturn('6'); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('create') ->willReturn($this->automationCollectionFactoryMock); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('getAbandonedCartAutomationsForContactByInterval') ->willReturn($this->automationCollectionFactoryMock); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('getSize') ->willReturn(0); $this->saver->expects($this->atLeastOnce()) ->method('save'); $this->model->process(); } public function testAutomationIsNotSavedIfQuoteHasItemsAndAbandonedCartLimitFails() { $this->quoteMock->expects($this->atLeastOnce()) ->method('hasItems') ->willReturn(true); $this->timeLimitMock->expects($this->atLeastOnce()) ->method('getAbandonedCartTimeLimit') ->willReturn('6'); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('create') ->willReturn($this->automationCollectionFactoryMock); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('getAbandonedCartAutomationsForContactByInterval') ->willReturn($this->automationCollectionFactoryMock); $this->automationCollectionFactoryMock->expects($this->atLeastOnce()) ->method('getSize') ->willReturn(1); $this->saver->expects($this->never()) ->method('save'); $this->model->process(); } private function prepare() { $storeId = 1; $programId = "123456"; $updated = [ 'from' => '2019-01-01 12:00:00', 'to' => '2019-01-01 16:00:00', 'date' => true ]; // foreach ($this->helper->getStores() as $store) expects an array, // but it need only contain one mock for simplicity $storesArray = [ $this->createMock(\Magento\Store\Model\Store::class) ]; $this->dataHelperMock->expects($this->once()) ->method('getStores') ->willReturn($storesArray); $storesArray[0]->method('getId') ->willReturn($storeId); // Scope config $this->dataHelperMock ->method('getScopeConfig') ->willReturn($this->scopeConfigModelMock); $this->scopeConfigModelMock->expects($this->atLeastOnce()) ->method('getValue') ->withConsecutive( [\Dotdigitalgroup\Email\Helper\Config::XML_PATH_LOSTBASKET_ENROL_TO_PROGRAM_ID, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId], [Config::XML_PATH_CONNECTOR_SYNC_LIMIT, \Magento\Store\Model\ScopeInterface::SCOPE_STORE] ) ->willReturnOnConsecutiveCalls( $programId, 500 ); // Enrolment interval $this->interval ->method('getAbandonedCartProgramEnrolmentWindow') ->with($storeId) ->willReturn($updated); $this->orderCollectionFactoryMock->expects($this->atLeastOnce()) ->method('create') ->willReturn($this->orderCollectionMock); $this->orderCollectionMock->expects($this->atLeastOnce()) ->method('getStoreQuotesForAutomationEnrollmentGuestsAndCustomers') ->with( $storeId, $updated ) ->willReturn($this->orderCollectionMock); $this->orderCollectionMock->expects($this->atLeastOnce()) ->method('getSize') ->willReturn(1500); $this->orderCollectionMock->expects($this->atLeastOnce()) ->method('setPageSize') ->willReturn($this->orderCollectionMock); $this->orderCollectionMock->expects($this->atLeastOnce()) ->method('setCurPage') ->willReturn($this->orderCollectionMock); $this->dataHelperMock->expects($this->atLeastOnce()) ->method('getOrCreateContact') ->willReturn(true); $this->cartInsight->expects($this->atLeastOnce()) ->method('send'); $this->rules ->method('apply') ->with($this->orderCollectionMock, $storeId); } }
{ "content_hash": "c7088d478b056a96e9d6114e47702218", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 116, "avg_line_length": 32.52317880794702, "alnum_prop": 0.615047851761352, "repo_name": "dotmailer/dotmailer-magento2-extension", "id": "5e567a711027d0d178f7d201b85acdbfda65f89c", "size": "9822", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Test/Unit/Model/AbandonedCart/ProgramEnrolmentEnrollerTest.php", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "15248" }, { "name": "HTML", "bytes": "70485" }, { "name": "JavaScript", "bytes": "74450" }, { "name": "PHP", "bytes": "2401902" } ], "symlink_target": "" }
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "f1d79c6bd94130dd1ac5b71041a5d9ce", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.23076923076923, "alnum_prop": 0.6917293233082706, "repo_name": "mdoering/backbone", "id": "97c0087b97d37d1e1c3c7bdb1506ac39f403c8c0", "size": "180", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Chlorophyta/Zygnematophyceae/Zygnematales/Desmidiaceae/Cosmarium/Cosmarium humile/ Syn. Euastrum celatum/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<!-- Copyright 2014 Bhavyanshu Parasher 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. --> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/action_settings" android:orderInCategory="100" android:showAsAction="never" android:title="@string/action_settings"/> </menu>
{ "content_hash": "f5bd203b247f648d37259de4134fcaf9", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 74, "avg_line_length": 35.291666666666664, "alnum_prop": 0.7213695395513577, "repo_name": "bhavyanshu/CheckIt_Android", "id": "0f646c3cef467d24f600f17a691b58d3881f774c", "size": "847", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CheckItCloudCheckList/res/menu/main.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "47560" } ], "symlink_target": "" }
FROM balenalib/am571x-evm-ubuntu:focal-build # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.9.7 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.2.4 ENV SETUPTOOLS_VERSION 58.0.0 RUN set -x \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" \ && echo "74e8cf51dec30e45fbfdc9a7dc0f85091e310840bee8f88584ab8dd3c7253700 Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-armv7hf-libffi3.3.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install --no-cache-dir virtualenv ENV PYTHON_DBUS_VERSION 1.2.18 # install dbus-python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ libdbus-1-dev \ libdbus-glib-1-dev \ && rm -rf /var/lib/apt/lists/* \ && apt-get -y autoremove # install dbus-python RUN set -x \ && mkdir -p /usr/src/dbus-python \ && curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz" -o dbus-python.tar.gz \ && curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz.asc" -o dbus-python.tar.gz.asc \ && gpg --verify dbus-python.tar.gz.asc \ && tar -xzC /usr/src/dbus-python --strip-components=1 -f dbus-python.tar.gz \ && rm dbus-python.tar.gz* \ && cd /usr/src/dbus-python \ && PYTHON_VERSION=$(expr match "$PYTHON_VERSION" '\([0-9]*\.[0-9]*\)') ./configure \ && make -j$(nproc) \ && make install -j$(nproc) \ && cd / \ && rm -rf /usr/src/dbus-python # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu focal \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.9.7, Pip v21.2.4, Setuptools v58.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
{ "content_hash": "efdfd99e5ef58b8f7e652bbe91a23e08", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 709, "avg_line_length": 50.578947368421055, "alnum_prop": 0.7036420395421435, "repo_name": "resin-io-library/base-images", "id": "95a0ddc1b1b426725bc3de60289fd3fdbe807416", "size": "4826", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "balena-base-images/python/am571x-evm/ubuntu/focal/3.9.7/build/Dockerfile", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "71234697" }, { "name": "JavaScript", "bytes": "13096" }, { "name": "Shell", "bytes": "12051936" }, { "name": "Smarty", "bytes": "59789" } ], "symlink_target": "" }
var buster = require("buster-node"); var assert = buster.assert; var refute = buster.refute; var ramp = require("./../lib/ramp"); var http = require("http"); var rampResources = require("ramp-resources"); var th = require("./test-helper.js"); var when_pipeline = require("when/pipeline"); buster.testCase("Slave header", { setUp: function (done) { var self = this; var httpServer = http.createServer(function (req, res) { res.writeHead(418); res.end(); }) httpServer.listen(0, function () { self.httpServer = httpServer; self.httpServerPort = httpServer.address().port; var rs = rampResources.createResourceSet(); rs.addResource({ path: "/", content: 'Hello, World!' }); var rampServer = ramp.createServer({ header: { resourceSet: rs, height: 80 } }); rampServer.attach(httpServer); self.rampServer = rampServer; self.rc = ramp.createRampClient(self.httpServerPort); done(); }); }, tearDown: function (done) { this.rc.destroy(); this.httpServer.on("close", done); this.httpServer.close(); }, "should be present": function (done) { var self = this; var serverUrl = "http://localhost:" + this.httpServerPort; th.promiseSuccess( when_pipeline([ function () { return th.http("GET", serverUrl + "/capture") }, function (e) { assert.equals(e.res.statusCode, 302); return th.http("GET", serverUrl + e.res.headers.location); }, function (e) { assert.equals(e.res.statusCode, 200); assert.equals(e.body.match(/\<frame[^s]\s/ig).length, 2, "Should find two frame tags"); assert.match(e.body, /80px/); assert.match(e.body, /\/slave_header\//); }, function () { return th.http("GET", serverUrl + "/slave_header/"); }, function (e) { assert.equals(e.res.statusCode, 200); assert.match(e.body , /^Hello\, World\!/); } ]), done); } })
{ "content_hash": "b64ece2a82a211863c58058b0f2ba4a8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 107, "avg_line_length": 31.620253164556964, "alnum_prop": 0.47678142514011207, "repo_name": "ctesene/homepage", "id": "4e72b6d5a7bf481493df39b1a9b0150a336a776e", "size": "2498", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "node_modules/buster/node_modules/buster-test-cli/node_modules/ramp/test/slave-header-test.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1349180" }, { "name": "JavaScript", "bytes": "5072871" }, { "name": "PHP", "bytes": "6178" } ], "symlink_target": "" }
<?php namespace Google\AdsApi\AdManager\v202202; /** * This file was generated from WSDL. DO NOT EDIT. */ abstract class BaseAudioCreative extends \Google\AdsApi\AdManager\v202202\HasDestinationUrlCreative { /** * @var int $duration */ protected $duration = null; /** * @var boolean $allowDurationOverride */ protected $allowDurationOverride = null; /** * @var \Google\AdsApi\AdManager\v202202\ConversionEvent_TrackingUrlsMapEntry[] $trackingUrls */ protected $trackingUrls = null; /** * @var int[] $companionCreativeIds */ protected $companionCreativeIds = null; /** * @var string $customParameters */ protected $customParameters = null; /** * @var string $adId */ protected $adId = null; /** * @var string $adIdType */ protected $adIdType = null; /** * @var string $skippableAdType */ protected $skippableAdType = null; /** * @var string $vastPreviewUrl */ protected $vastPreviewUrl = null; /** * @var string $sslScanResult */ protected $sslScanResult = null; /** * @var string $sslManualOverride */ protected $sslManualOverride = null; /** * @param int $advertiserId * @param int $id * @param string $name * @param \Google\AdsApi\AdManager\v202202\Size $size * @param string $previewUrl * @param string[] $policyLabels * @param \Google\AdsApi\AdManager\v202202\AppliedLabel[] $appliedLabels * @param \Google\AdsApi\AdManager\v202202\DateTime $lastModifiedDateTime * @param \Google\AdsApi\AdManager\v202202\BaseCustomFieldValue[] $customFieldValues * @param \Google\AdsApi\AdManager\v202202\ThirdPartyDataDeclaration $thirdPartyDataDeclaration * @param string $destinationUrl * @param string $destinationUrlType * @param int $duration * @param boolean $allowDurationOverride * @param \Google\AdsApi\AdManager\v202202\ConversionEvent_TrackingUrlsMapEntry[] $trackingUrls * @param int[] $companionCreativeIds * @param string $customParameters * @param string $adId * @param string $adIdType * @param string $skippableAdType * @param string $vastPreviewUrl * @param string $sslScanResult * @param string $sslManualOverride */ public function __construct($advertiserId = null, $id = null, $name = null, $size = null, $previewUrl = null, array $policyLabels = null, array $appliedLabels = null, $lastModifiedDateTime = null, array $customFieldValues = null, $thirdPartyDataDeclaration = null, $destinationUrl = null, $destinationUrlType = null, $duration = null, $allowDurationOverride = null, array $trackingUrls = null, array $companionCreativeIds = null, $customParameters = null, $adId = null, $adIdType = null, $skippableAdType = null, $vastPreviewUrl = null, $sslScanResult = null, $sslManualOverride = null) { parent::__construct($advertiserId, $id, $name, $size, $previewUrl, $policyLabels, $appliedLabels, $lastModifiedDateTime, $customFieldValues, $thirdPartyDataDeclaration, $destinationUrl, $destinationUrlType); $this->duration = $duration; $this->allowDurationOverride = $allowDurationOverride; $this->trackingUrls = $trackingUrls; $this->companionCreativeIds = $companionCreativeIds; $this->customParameters = $customParameters; $this->adId = $adId; $this->adIdType = $adIdType; $this->skippableAdType = $skippableAdType; $this->vastPreviewUrl = $vastPreviewUrl; $this->sslScanResult = $sslScanResult; $this->sslManualOverride = $sslManualOverride; } /** * @return int */ public function getDuration() { return $this->duration; } /** * @param int $duration * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setDuration($duration) { $this->duration = $duration; return $this; } /** * @return boolean */ public function getAllowDurationOverride() { return $this->allowDurationOverride; } /** * @param boolean $allowDurationOverride * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setAllowDurationOverride($allowDurationOverride) { $this->allowDurationOverride = $allowDurationOverride; return $this; } /** * @return \Google\AdsApi\AdManager\v202202\ConversionEvent_TrackingUrlsMapEntry[] */ public function getTrackingUrls() { return $this->trackingUrls; } /** * @param \Google\AdsApi\AdManager\v202202\ConversionEvent_TrackingUrlsMapEntry[]|null $trackingUrls * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setTrackingUrls(array $trackingUrls = null) { $this->trackingUrls = $trackingUrls; return $this; } /** * @return int[] */ public function getCompanionCreativeIds() { return $this->companionCreativeIds; } /** * @param int[]|null $companionCreativeIds * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setCompanionCreativeIds(array $companionCreativeIds = null) { $this->companionCreativeIds = $companionCreativeIds; return $this; } /** * @return string */ public function getCustomParameters() { return $this->customParameters; } /** * @param string $customParameters * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setCustomParameters($customParameters) { $this->customParameters = $customParameters; return $this; } /** * @return string */ public function getAdId() { return $this->adId; } /** * @param string $adId * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setAdId($adId) { $this->adId = $adId; return $this; } /** * @return string */ public function getAdIdType() { return $this->adIdType; } /** * @param string $adIdType * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setAdIdType($adIdType) { $this->adIdType = $adIdType; return $this; } /** * @return string */ public function getSkippableAdType() { return $this->skippableAdType; } /** * @param string $skippableAdType * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setSkippableAdType($skippableAdType) { $this->skippableAdType = $skippableAdType; return $this; } /** * @return string */ public function getVastPreviewUrl() { return $this->vastPreviewUrl; } /** * @param string $vastPreviewUrl * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setVastPreviewUrl($vastPreviewUrl) { $this->vastPreviewUrl = $vastPreviewUrl; return $this; } /** * @return string */ public function getSslScanResult() { return $this->sslScanResult; } /** * @param string $sslScanResult * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setSslScanResult($sslScanResult) { $this->sslScanResult = $sslScanResult; return $this; } /** * @return string */ public function getSslManualOverride() { return $this->sslManualOverride; } /** * @param string $sslManualOverride * @return \Google\AdsApi\AdManager\v202202\BaseAudioCreative */ public function setSslManualOverride($sslManualOverride) { $this->sslManualOverride = $sslManualOverride; return $this; } }
{ "content_hash": "7abc7406ad9bb9eaac55f9b341e388d7", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 590, "avg_line_length": 26.137254901960784, "alnum_prop": 0.6372843210802701, "repo_name": "googleads/googleads-php-lib", "id": "59950a6ed212c3fba0756330fef7c88d583a55e0", "size": "7998", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "src/Google/AdsApi/AdManager/v202202/BaseAudioCreative.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "11415914" } ], "symlink_target": "" }
<?php use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request; use Illuminate\Routing\Redirector; use Illuminate\Routing\UrlGenerator; use Illuminate\Session\Store; use L4\Tests\BackwardCompatibleTestCase; use Mockery as m; use Symfony\Component\HttpFoundation\HeaderBag; class RoutingRedirectorTest extends BackwardCompatibleTestCase { protected $headers; protected $request; protected $url; protected $session; protected $redirect; protected function setUp(): void { $this->headers = m::mock(HeaderBag::class); $this->request = m::mock(Request::class); $this->request->headers = $this->headers; $this->url = m::mock(UrlGenerator::class); $this->url->shouldReceive('getRequest')->andReturn($this->request); $this->url->shouldReceive('to')->with('bar', [], null)->andReturn('http://foo.com/bar'); $this->url->shouldReceive('to')->with('bar', [], true)->andReturn('https://foo.com/bar'); $this->url->shouldReceive('to')->with('login', [], null)->andReturn('http://foo.com/login'); $this->url->shouldReceive('to')->with('http://foo.com/bar', [], null)->andReturn('http://foo.com/bar'); $this->url->shouldReceive('to')->with('/', [], null)->andReturn('http://foo.com/'); $this->session = m::mock(Store::class); $this->redirect = new Redirector($this->url); $this->redirect->setSession($this->session); } protected function tearDown(): void { m::close(); } public function testBasicRedirectTo() { $response = $this->redirect->to('bar'); $this->assertInstanceOf(RedirectResponse::class, $response); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); $this->assertEquals(302, $response->getStatusCode()); $this->assertEquals($this->session, $response->getSession()); } public function testComplexRedirectTo() { $response = $this->redirect->to('bar', 303, ['X-RateLimit-Limit' => 60, 'X-RateLimit-Remaining' => 59], true); $this->assertEquals('https://foo.com/bar', $response->getTargetUrl()); $this->assertEquals(303, $response->getStatusCode()); $this->assertEquals(60, $response->headers->get('X-RateLimit-Limit')); $this->assertEquals(59, $response->headers->get('X-RateLimit-Remaining')); } public function testGuestPutCurrentUrlInSession() { $this->url->shouldReceive('full')->andReturn('http://foo.com/bar'); $this->session->shouldReceive('put')->once()->with('url.intended', 'http://foo.com/bar'); $response = $this->redirect->guest('login'); $this->assertEquals('http://foo.com/login', $response->getTargetUrl()); } public function testIntendedRedirectToIntendedUrlInSession() { $this->session->shouldReceive('pull')->with('url.intended', '/')->andReturn('http://foo.com/bar'); $response = $this->redirect->intended(); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } public function testIntendedWithoutIntendedUrlInSession() { $this->session->shouldReceive('forget')->with('url.intended'); // without fallback url $this->session->shouldReceive('pull')->with('url.intended', '/')->andReturn('/'); $response = $this->redirect->intended(); $this->assertEquals('http://foo.com/', $response->getTargetUrl()); // with a fallback url $this->session->shouldReceive('pull')->with('url.intended', 'bar')->andReturn('bar'); $response = $this->redirect->intended('bar'); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } public function testRefreshRedirectToCurrentUrl() { $this->request->shouldReceive('path')->andReturn('http://foo.com/bar'); $response = $this->redirect->refresh(); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } public function testBackRedirectToHttpReferer() { $this->headers->shouldReceive('has')->with('referer')->andReturn(true); $this->headers->shouldReceive('get')->with('referer')->andReturn('http://foo.com/bar'); $response = $this->redirect->back(); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } public function testAwayDoesntValidateTheUrl() { $response = $this->redirect->away('bar'); $this->assertEquals('bar', $response->getTargetUrl()); } public function testSecureRedirectToHttpsUrl() { $response = $this->redirect->secure('bar'); $this->assertEquals('https://foo.com/bar', $response->getTargetUrl()); } public function testAction() { $this->url->shouldReceive('action')->with('bar@index', [])->andReturn('http://foo.com/bar'); $response = $this->redirect->action('bar@index'); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } public function testRoute() { $this->url->shouldReceive('route')->with('home')->andReturn('http://foo.com/bar'); $this->url->shouldReceive('route')->with('home', [])->andReturn('http://foo.com/bar'); $response = $this->redirect->route('home'); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); $response = $this->redirect->home(); $this->assertEquals('http://foo.com/bar', $response->getTargetUrl()); } }
{ "content_hash": "ed98a9c5c6527e7362150144c3fe53e6", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 112, "avg_line_length": 32.465408805031444, "alnum_prop": 0.6627276249515691, "repo_name": "keripix/laravel42x", "id": "ff03d0236b2e9195a1fabe8c9b6e6ca27619ae4e", "size": "5162", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/Routing/RoutingRedirectorTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "4390" }, { "name": "Hack", "bytes": "37" }, { "name": "PHP", "bytes": "2229333" }, { "name": "Shell", "bytes": "5546" } ], "symlink_target": "" }
/* * dgeev.h * ($Revision: 1 $) This file contains a wrapper around the LAPACK dgeev routine, used to calculate eigenvalues and associated eigenvectors for a square asymmetric matrix H. Since the matrix is asymmetrix, both real and imaginary components of the eigenvalues are returned. For real, symmetric matricies, the eigenvalues will be real, and hence the complex terms equal to zero. There are two function calls defined in this header, of the forms void dgeev(double **H, int n, double *Er, double *Ei) void dgeev(double **H, int n, double *Er, double *Ei, double **Evecs) H: the n by n matrix that we are solving. n: the order of the square matrix H. Er: an n-element array to hold the real parts of the eigenvalues. Ei: an n-element array to hold the imaginary parts of the eigenvalues. Evecs: an n by n matrix to hold the eigenvectors. */ #if HAVE_CONFIG_H # include <config.h> #endif #if HAVE_LIBLAPACK #ifndef DGEEV_H_ #define DGEEV_H_ #include <cmath> void dgeev(double **H, int n, double *Er, double *Ei); void dgeev(double **H, int n, double *Er, double *Ei, double **Evecs); double *dgeev_ctof(double **in, int rows, int cols); void dgeev_ftoc(double *in, double **out, int rows, int cols); void dgeev_sort(double *Er, double *Ei, int N); void dgeev_sort(double *Er, double *Ei, double **Evecs, int N); extern "C" void dgeev_(char *jobvl, char *jobvr, int *n, double *a, int *lda, double *wr, double *wi, double *vl, int *ldvl, double *vr, int *ldvr, double *work, int *lwork, int *info); #endif #endif
{ "content_hash": "62366c7a60f229cd54522c1d276d5aa4", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 74, "avg_line_length": 31.470588235294116, "alnum_prop": 0.6878504672897197, "repo_name": "benranco/SNPpipeline", "id": "b36a95888c61b155aba60e6f77dee9c681c7034c", "size": "1605", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "tools/vcftools/src/cpp/dgeev.h", "mode": "33261", "license": "mit", "language": [ { "name": "Ada", "bytes": "89080" }, { "name": "Assembly", "bytes": "151393" }, { "name": "Batchfile", "bytes": "178" }, { "name": "C", "bytes": "9385662" }, { "name": "C#", "bytes": "55626" }, { "name": "C++", "bytes": "10741151" }, { "name": "CLIPS", "bytes": "5291" }, { "name": "CMake", "bytes": "124571" }, { "name": "CSS", "bytes": "13046" }, { "name": "DIGITAL Command Language", "bytes": "27303" }, { "name": "Groovy", "bytes": "26577" }, { "name": "HTML", "bytes": "327400" }, { "name": "Java", "bytes": "21246" }, { "name": "Lua", "bytes": "28217" }, { "name": "M4", "bytes": "61241" }, { "name": "Makefile", "bytes": "1340828" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "Pascal", "bytes": "70297" }, { "name": "Perl", "bytes": "993679" }, { "name": "Python", "bytes": "525903" }, { "name": "R", "bytes": "135514" }, { "name": "Roff", "bytes": "1305999" }, { "name": "SAS", "bytes": "1847" }, { "name": "Shell", "bytes": "1080321" }, { "name": "TeX", "bytes": "122903" }, { "name": "XS", "bytes": "1031" }, { "name": "XSLT", "bytes": "1667" } ], "symlink_target": "" }
#include "web/WebSharedWorkerImpl.h" #include "core/dom/CrossThreadTask.h" #include "core/dom/Document.h" #include "core/events/MessageEvent.h" #include "core/html/HTMLFormElement.h" #include "core/inspector/ConsoleMessage.h" #include "core/inspector/InspectorInstrumentation.h" #include "core/inspector/WorkerDebuggerAgent.h" #include "core/inspector/WorkerInspectorController.h" #include "core/loader/FrameLoadRequest.h" #include "core/loader/FrameLoader.h" #include "core/page/Page.h" #include "core/workers/SharedWorkerGlobalScope.h" #include "core/workers/SharedWorkerThread.h" #include "core/workers/WorkerClients.h" #include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerInspectorProxy.h" #include "core/workers/WorkerLoaderProxy.h" #include "core/workers/WorkerScriptLoader.h" #include "core/workers/WorkerThreadStartupData.h" #include "platform/RuntimeEnabledFeatures.h" #include "platform/ThreadSafeFunctional.h" #include "platform/heap/Handle.h" #include "platform/network/ContentSecurityPolicyParsers.h" #include "platform/network/ResourceResponse.h" #include "platform/weborigin/KURL.h" #include "platform/weborigin/SecurityOrigin.h" #include "public/platform/WebFileError.h" #include "public/platform/WebMessagePortChannel.h" #include "public/platform/WebString.h" #include "public/platform/WebURL.h" #include "public/platform/WebURLRequest.h" #include "public/web/WebDevToolsAgent.h" #include "public/web/WebFrame.h" #include "public/web/WebSettings.h" #include "public/web/WebView.h" #include "public/web/WebWorkerContentSettingsClientProxy.h" #include "public/web/modules/serviceworker/WebServiceWorkerNetworkProvider.h" #include "web/LocalFileSystemClient.h" #include "web/WebDataSourceImpl.h" #include "web/WebLocalFrameImpl.h" #include "web/WorkerContentSettingsClient.h" #include "wtf/Functional.h" #include "wtf/MainThread.h" namespace blink { // TODO(toyoshim): Share implementation with WebEmbeddedWorkerImpl as much as // possible. WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client) : m_webView(nullptr) , m_mainFrame(nullptr) , m_askedToTerminate(false) , m_workerInspectorProxy(WorkerInspectorProxy::create()) , m_client(client) , m_pauseWorkerContextOnStart(false) , m_isPausedOnStart(false) , m_creationAddressSpace(WebAddressSpacePublic) { } WebSharedWorkerImpl::~WebSharedWorkerImpl() { ASSERT(m_webView); // Detach the client before closing the view to avoid getting called back. m_mainFrame->setClient(0); m_webView->close(); m_mainFrame->close(); if (m_loaderProxy) m_loaderProxy->detachProvider(this); } void WebSharedWorkerImpl::terminateWorkerThread() { if (m_askedToTerminate) return; m_askedToTerminate = true; if (m_mainScriptLoader) { m_mainScriptLoader->cancel(); m_mainScriptLoader.clear(); m_client->workerScriptLoadFailed(); delete this; return; } if (m_workerThread) m_workerThread->terminate(); m_workerInspectorProxy->workerThreadTerminated(); } void WebSharedWorkerImpl::initializeLoader() { // Create 'shadow page'. This page is never displayed, it is used to proxy the // loading requests from the worker context to the rest of WebKit and Chromium // infrastructure. ASSERT(!m_webView); m_webView = WebView::create(0); // FIXME: http://crbug.com/363843. This needs to find a better way to // not create graphics layers. m_webView->settings()->setAcceleratedCompositingEnabled(false); // FIXME: Settings information should be passed to the Worker process from Browser process when the worker // is created (similar to RenderThread::OnCreateNewView). m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Document, this)); m_webView->setMainFrame(m_mainFrame.get()); m_mainFrame->setDevToolsAgentClient(this); // If we were asked to pause worker context on start and wait for debugger then it is the good time to do that. m_client->workerReadyForInspection(); if (m_pauseWorkerContextOnStart) { m_isPausedOnStart = true; return; } loadShadowPage(); } WebApplicationCacheHost* WebSharedWorkerImpl::createApplicationCacheHost(WebApplicationCacheHostClient* appcacheHostClient) { return m_client->createApplicationCacheHost(appcacheHostClient); } void WebSharedWorkerImpl::loadShadowPage() { // Construct substitute data source for the 'shadow page'. We only need it // to have same origin as the worker so the loading checks work correctly. CString content(""); RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), content.length())); m_mainFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_url), SubstituteData(buffer, "text/html", "UTF-8", KURL()))); } void WebSharedWorkerImpl::willSendRequest( WebLocalFrame* frame, unsigned, WebURLRequest& request, const WebURLResponse& redirectResponse) { if (m_networkProvider) m_networkProvider->willSendRequest(frame->dataSource(), request); } void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame, bool) { ASSERT(!m_loadingDocument); ASSERT(!m_mainScriptLoader); m_networkProvider = adoptPtr(m_client->createServiceWorkerNetworkProvider(frame->dataSource())); m_mainScriptLoader = WorkerScriptLoader::create(); m_mainScriptLoader->setRequestContext(WebURLRequest::RequestContextSharedWorker); m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); m_mainScriptLoader->loadAsynchronously( *m_loadingDocument.get(), m_url, DenyCrossOriginRequests, m_creationAddressSpace, bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); // Do nothing here since onScriptLoaderFinished() might have been already // invoked and |this| might have been deleted at this point. } bool WebSharedWorkerImpl::isControlledByServiceWorker(WebDataSource& dataSource) { return m_networkProvider && m_networkProvider->isControlledByServiceWorker(dataSource); } int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) { if (!m_networkProvider) return -1; return m_networkProvider->serviceWorkerID(dataSource); } void WebSharedWorkerImpl::sendProtocolMessage(int sessionId, int callId, const WebString& message, const WebString& state) { m_client->sendDevToolsMessage(sessionId, callId, message, state); } void WebSharedWorkerImpl::resumeStartup() { bool isPausedOnStart = m_isPausedOnStart; m_isPausedOnStart = false; if (isPausedOnStart) loadShadowPage(); } // WorkerReportingProxy -------------------------------------------------------- void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, int exceptionId) { // Not suppported in SharedWorker. } void WebSharedWorkerImpl::reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) { // Not supported in SharedWorker. } void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) { m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createCrossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, this, message)); } void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& message) { WorkerInspectorProxy::PageInspector* pageInspector = m_workerInspectorProxy->pageInspector(); if (!pageInspector) return; pageInspector->dispatchMessageFromWorker(message); } void WebSharedWorkerImpl::workerGlobalScopeClosed() { Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread, AllowCrossThreadAccess(this))); } void WebSharedWorkerImpl::workerGlobalScopeClosedOnMainThread() { m_client->workerContextClosed(); terminateWorkerThread(); } void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope*) { } void WebSharedWorkerImpl::workerThreadTerminated() { Platform::current()->mainThread()->getWebTaskRunner()->postTask(BLINK_FROM_HERE, threadSafeBind(&WebSharedWorkerImpl::workerThreadTerminatedOnMainThread, AllowCrossThreadAccess(this))); } void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread() { m_client->workerContextDestroyed(); // The lifetime of this proxy is controlled by the worker context. delete this; } // WorkerLoaderProxyProvider ----------------------------------------------------------- void WebSharedWorkerImpl::postTaskToLoader(PassOwnPtr<ExecutionContextTask> task) { m_mainFrame->frame()->document()->postTask(BLINK_FROM_HERE, task); } bool WebSharedWorkerImpl::postTaskToWorkerGlobalScope(PassOwnPtr<ExecutionContextTask> task) { m_workerThread->postTask(BLINK_FROM_HERE, task); return true; } void WebSharedWorkerImpl::connect(WebMessagePortChannel* webChannel) { workerThread()->postTask( BLINK_FROM_HERE, createCrossThreadTask(&connectTask, adoptPtr(webChannel))); } void WebSharedWorkerImpl::connectTask(PassOwnPtr<WebMessagePortChannel> channel, ExecutionContext* context) { // Wrap the passed-in channel in a MessagePort, and send it off via a connect event. MessagePort* port = MessagePort::create(*context); port->entangle(channel); WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); ASSERT_WITH_SECURITY_IMPLICATION(workerGlobalScope->isSharedWorkerGlobalScope()); workerGlobalScope->dispatchEvent(createConnectEvent(port)); } void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString& name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType policyType, WebAddressSpace creationAddressSpace) { m_url = url; m_name = name; m_creationAddressSpace = creationAddressSpace; initializeLoader(); } void WebSharedWorkerImpl::didReceiveScriptLoaderResponse() { InspectorInstrumentation::didReceiveScriptResponse(m_loadingDocument.get(), m_mainScriptLoader->identifier()); m_client->selectAppCacheID(m_mainScriptLoader->appCacheID()); } void WebSharedWorkerImpl::onScriptLoaderFinished() { ASSERT(m_loadingDocument); ASSERT(m_mainScriptLoader); if (m_askedToTerminate) return; if (m_mainScriptLoader->failed()) { m_mainScriptLoader->cancel(); m_client->workerScriptLoadFailed(); // The SharedWorker was unable to load the initial script, so // shut it down right here. delete this; return; } Document* document = m_mainFrame->frame()->document(); // FIXME: this document's origin is pristine and without any extra privileges. (crbug.com/254993) SecurityOrigin* starterOrigin = document->getSecurityOrigin(); OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::create()); WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client->createWorkerContentSettingsClientProxy(webSecurityOrigin))); RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScriptLoader->releaseContentSecurityPolicy(); WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(document); OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::create( m_url, m_loadingDocument->userAgent(), m_mainScriptLoader->script(), nullptr, startMode, contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, starterOrigin, workerClients.release(), m_mainScriptLoader->responseAddressSpace()); m_loaderProxy = WorkerLoaderProxy::create(this); m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScriptLoader->identifier(), m_mainScriptLoader->script()); m_mainScriptLoader.clear(); workerThread()->start(startupData.release()); m_workerInspectorProxy->workerThreadCreated(m_loadingDocument.get(), workerThread(), m_url); m_client->workerScriptLoaded(); } void WebSharedWorkerImpl::terminateWorkerContext() { terminateWorkerThread(); } void WebSharedWorkerImpl::pauseWorkerContextOnStart() { m_pauseWorkerContextOnStart = true; } void WebSharedWorkerImpl::attachDevTools(const WebString& hostId, int sessionId) { WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); if (devtoolsAgent) devtoolsAgent->attach(hostId, sessionId); } void WebSharedWorkerImpl::reattachDevTools(const WebString& hostId, int sessionId, const WebString& savedState) { WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); if (devtoolsAgent) devtoolsAgent->reattach(hostId, sessionId, savedState); resumeStartup(); } void WebSharedWorkerImpl::detachDevTools() { WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); if (devtoolsAgent) devtoolsAgent->detach(); } void WebSharedWorkerImpl::dispatchDevToolsMessage(int sessionId, const WebString& message) { if (m_askedToTerminate) return; WebDevToolsAgent* devtoolsAgent = m_mainFrame->devToolsAgent(); if (devtoolsAgent) devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); } WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { return new WebSharedWorkerImpl(client); } } // namespace blink
{ "content_hash": "b42251f141448dbf826e7387dd06cd74", "timestamp": "", "source": "github", "line_count": 375, "max_line_length": 205, "avg_line_length": 36.656, "alnum_prop": 0.7528735632183908, "repo_name": "highweb-project/highweb-webcl-html5spec", "id": "0344fbc40e2d10223ebc84ec20e51940fc115a2f", "size": "15308", "binary": false, "copies": "1", "ref": "refs/heads/highweb-20160310", "path": "third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<?php namespace Skaphandrus\AppBundle\Controller; use Symfony\Component\HttpFoundation\Request; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Skaphandrus\AppBundle\Entity\SkPoints; use Skaphandrus\AppBundle\Form\SkPointsType; /** * SkPoints controller. * */ class SkPointsController extends Controller { /** * Lists all SkPoints entities. * */ public function indexAction() { $em = $this->getDoctrine()->getManager(); $fos_user = $this->get('security.token_storage')->getToken()->getUser(); $arr = $em->getRepository('SkaphandrusAppBundle:SkPoints')->generatePointsFromUser($fos_user); $entities = $em->getRepository('SkaphandrusAppBundle:SkPoints')->findBy(array('fosUser' => $fos_user->getId())); return $this->render('SkaphandrusAppBundle:SkPoints:index.html.twig', array( 'entities' => $entities, 'arr' => $arr, 'total_points' => $fos_user->getSettings()->getPoints() )); } /** * Creates a new SkPoints entity. * */ public function createAction(Request $request) { $entity = new SkPoints(); $form = $this->createCreateForm($entity); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $em->persist($entity); $em->flush(); return $this->redirect($this->generateUrl('points_admin_show', array('id' => $entity->getId()))); } return $this->render('SkaphandrusAppBundle:SkPoints:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); } /** * Creates a form to create a SkPoints entity. * * @param SkPoints $entity The entity * * @return \Symfony\Component\Form\Form The form */ private function createCreateForm(SkPoints $entity) { $form = $this->createForm(new SkPointsType(), $entity, array( 'action' => $this->generateUrl('points_admin_create'), 'method' => 'POST', )); $form->add('submit', 'submit', array('label' => 'Create')); return $form; } /** * Displays a form to create a new SkPoints entity. * */ public function newAction() { $entity = new SkPoints(); $form = $this->createCreateForm($entity); return $this->render('SkaphandrusAppBundle:SkPoints:new.html.twig', array( 'entity' => $entity, 'form' => $form->createView(), )); } /** * Finds and displays a SkPoints entity. * */ public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SkaphandrusAppBundle:SkPoints')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find SkPoints entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('SkaphandrusAppBundle:SkPoints:show.html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); } /** * Displays a form to edit an existing SkPoints entity. * */ public function editAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SkaphandrusAppBundle:SkPoints')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find SkPoints entity.'); } $editForm = $this->createEditForm($entity); $deleteForm = $this->createDeleteForm($id); return $this->render('SkaphandrusAppBundle:SkPoints:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); } /** * Creates a form to edit a SkPoints entity. * * @param SkPoints $entity The entity * * @return \Symfony\Component\Form\Form The form */ private function createEditForm(SkPoints $entity) { $form = $this->createForm(new SkPointsType(), $entity, array( 'action' => $this->generateUrl('points_admin_update', array('id' => $entity->getId())), 'method' => 'PUT', )); $form->add('submit', 'submit', array('label' => 'Update')); return $form; } /** * Edits an existing SkPoints entity. * */ public function updateAction(Request $request, $id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SkaphandrusAppBundle:SkPoints')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find SkPoints entity.'); } $deleteForm = $this->createDeleteForm($id); $editForm = $this->createEditForm($entity); $editForm->handleRequest($request); if ($editForm->isValid()) { $em->flush(); $this->get('session')->getFlashBag()->add('notice', 'form.common.message.changes_saved'); return $this->redirect($this->generateUrl('points_admin_edit', array('id' => $id))); } return $this->render('SkaphandrusAppBundle:SkPoints:edit.html.twig', array( 'entity' => $entity, 'edit_form' => $editForm->createView(), 'delete_form' => $deleteForm->createView(), )); } /** * Deletes a SkPoints entity. * */ public function deleteAction(Request $request, $id) { $form = $this->createDeleteForm($id); $form->handleRequest($request); if ($form->isValid()) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SkaphandrusAppBundle:SkPoints')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find SkPoints entity.'); } $em->remove($entity); $em->flush(); } return $this->redirect($this->generateUrl('points_admin')); } /** * Creates a form to delete a SkPoints entity by id. * * @param mixed $id The entity id * * @return \Symfony\Component\Form\Form The form */ private function createDeleteForm($id) { return $this->createFormBuilder() ->setAction($this->generateUrl('points_admin_delete', array('id' => $id))) ->setMethod('DELETE') ->add('submit', 'submit', array('label' => 'Delete')) ->getForm() ; } }
{ "content_hash": "068416bcd59786b379d3906272a0f87e", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 120, "avg_line_length": 30.765765765765767, "alnum_prop": 0.5469985358711567, "repo_name": "luismiguens/skaphandrus_v4", "id": "c6c81928ea9773ac75ff7ed3f92d1e1091ea3788", "size": "6830", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Skaphandrus/AppBundle/Controller/SkPointsController.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "809561" }, { "name": "HTML", "bytes": "1431581" }, { "name": "JavaScript", "bytes": "1803100" }, { "name": "Makefile", "bytes": "478" }, { "name": "PHP", "bytes": "1734070" }, { "name": "PLpgSQL", "bytes": "385266" }, { "name": "Shell", "bytes": "296" } ], "symlink_target": "" }
package docker_metadata_fetcher_test import ( "errors" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/cloudfoundry-incubator/ltc/docker_runner/docker_metadata_fetcher" "github.com/cloudfoundry-incubator/ltc/docker_runner/docker_metadata_fetcher/fake_docker_session" "github.com/docker/docker/registry" ) var _ = Describe("DockerMetaDataFetcher", func() { var ( fakeDockerSessionFactory *fake_docker_session.FakeDockerSessionFactory fakeDockerSession *fake_docker_session.FakeDockerSession dockerMetadataFetcher docker_metadata_fetcher.DockerMetadataFetcher ) BeforeEach(func() { fakeDockerSession = &fake_docker_session.FakeDockerSession{} fakeDockerSessionFactory = &fake_docker_session.FakeDockerSessionFactory{} dockerMetadataFetcher = docker_metadata_fetcher.New(fakeDockerSessionFactory) }) Describe("FetchMetadata", func() { Context("when fetching metadata from the docker hub registry", func() { It("returns the ImageMetadata with the WorkingDir, StartCommand, and PortConfig, and sets the monitored port to the lowest exposed tcp port", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"https://registry-1.docker.io/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) fakeDockerSession.GetRemoteImageJSONReturns( []byte(`{ "container_config":{ "ExposedPorts":{"28321/tcp":{}, "6923/udp":{}, "27017/tcp":{}} }, "config":{ "WorkingDir":"/home/app", "User":"the-meta-user", "Entrypoint":["/lattice-app"], "Cmd":["--enableAwesomeMode=true","iloveargs"], "Env":["A=1","B=2"] } }`), 0, nil) dockerPath := "cool_user123/sweetapp:latest" dockerImageNoTag := "cool_user123/sweetapp" imageMetadata, err := dockerMetadataFetcher.FetchMetadata(dockerPath) Expect(err).NotTo(HaveOccurred()) Expect(imageMetadata).NotTo(BeNil()) Expect(imageMetadata.User).To(Equal("the-meta-user")) Expect(imageMetadata.WorkingDir).To(Equal("/home/app")) Expect(imageMetadata.StartCommand).To(ConsistOf("/lattice-app", "--enableAwesomeMode=true", "iloveargs")) Expect(imageMetadata.ExposedPorts).To(Equal([]uint16{uint16(27017), uint16(28321)})) Expect(imageMetadata.Env).To(ConsistOf([]string{"A=1", "B=2"})) Expect(fakeDockerSessionFactory.MakeSessionCallCount()).To(Equal(1)) Expect(fakeDockerSessionFactory.MakeSessionArgsForCall(0)).To(Equal(dockerImageNoTag)) Expect(fakeDockerSession.GetRepositoryDataCallCount()).To(Equal(1)) Expect(fakeDockerSession.GetRepositoryDataArgsForCall(0)).To(Equal(dockerImageNoTag)) Expect(fakeDockerSession.GetRemoteTagsCallCount()).To(Equal(1)) registries, repo := fakeDockerSession.GetRemoteTagsArgsForCall(0) Expect(registries).To(ConsistOf("https://registry-1.docker.io/v1/")) Expect(repo).To(Equal("cool_user123/sweetapp")) Expect(fakeDockerSession.GetRemoteImageJSONCallCount()).To(Equal(1)) imgIDParam, remoteImageEndpointParam := fakeDockerSession.GetRemoteImageJSONArgsForCall(0) Expect(imgIDParam).To(Equal("29d531509fb")) Expect(remoteImageEndpointParam).To(Equal("https://registry-1.docker.io/v1/")) }) }) Context("when fetching metadata from a signed custom registry", func() { It("returns the image metadata", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"http://my.custom.registry:5000/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) fakeDockerSession.GetRemoteImageJSONReturns( []byte(`{ "container_config":{ "ExposedPorts":{"4444/tcp":{}, "5555/udp":{}, "3333/tcp":{}} }, "config":{ "WorkingDir":"/home/app", "User":"the-meta-user", "Entrypoint":["/savory-app"], "Cmd":["--pretzels=salty","cheesy"], "Env":["A=1","B=2"] } }`), 0, nil) dockerPath := "my.custom.registry:5000/savory-app" imageMetadata, err := dockerMetadataFetcher.FetchMetadata(dockerPath) Expect(err).NotTo(HaveOccurred()) Expect(imageMetadata).NotTo(BeNil()) Expect(imageMetadata.User).To(Equal("the-meta-user")) Expect(imageMetadata.WorkingDir).To(Equal("/home/app")) Expect(imageMetadata.StartCommand).To(ConsistOf("/savory-app", "--pretzels=salty", "cheesy")) Expect(imageMetadata.ExposedPorts).To(ConsistOf(uint16(3333), uint16(4444))) Expect(imageMetadata.Env).To(ConsistOf([]string{"A=1", "B=2"})) Expect(fakeDockerSessionFactory.MakeSessionCallCount()).To(Equal(1)) Expect(fakeDockerSessionFactory.MakeSessionArgsForCall(0)).To(Equal(dockerPath)) Expect(fakeDockerSession.GetRepositoryDataCallCount()).To(Equal(1)) Expect(fakeDockerSession.GetRepositoryDataArgsForCall(0)).To(Equal("savory-app")) Expect(fakeDockerSession.GetRemoteTagsCallCount()).To(Equal(1)) registries, repo := fakeDockerSession.GetRemoteTagsArgsForCall(0) Expect(registries).To(ConsistOf("http://my.custom.registry:5000/v1/")) Expect(repo).To(Equal("savory-app")) Expect(fakeDockerSession.GetRemoteImageJSONCallCount()).To(Equal(1)) imgIDParam, remoteImageEndpointParam := fakeDockerSession.GetRemoteImageJSONArgsForCall(0) Expect(imgIDParam).To(Equal("29d531509fb")) Expect(remoteImageEndpointParam).To(Equal("http://my.custom.registry:5000/v1/")) }) }) Context("when fetching metadata from a insecure custom registry", func() { It("retries after getting unknown CA error and returns the image metadata", func() { insecureRegistryErrorMessage := "If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.11.1:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.11.1:5000/ca.crt" fakeDockerSessionFactory.MakeSessionStub = func(reposName string, allowInsecure bool) (docker_metadata_fetcher.DockerSession, error) { if !allowInsecure { return fakeDockerSession, errors.New(insecureRegistryErrorMessage) } return fakeDockerSession, nil } imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"http://my.custom.registry:5000/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) fakeDockerSession.GetRemoteImageJSONReturns( []byte(`{ "container_config":{ "ExposedPorts":{"4444/tcp":{}, "5555/udp":{}, "3333/tcp":{}} }, "config":{ "WorkingDir":"/home/app", "User":"the-meta-user", "Entrypoint":["/savory-app"], "Cmd":["--pretzels=salty","cheesy"], "Env":["A=1","B=2"] } }`), 0, nil) dockerPath := "my.custom.registry:5000/savory-app" imageMetadata, err := dockerMetadataFetcher.FetchMetadata(dockerPath) Expect(err).NotTo(HaveOccurred()) Expect(imageMetadata).NotTo(BeNil()) Expect(imageMetadata.User).To(Equal("the-meta-user")) Expect(imageMetadata.WorkingDir).To(Equal("/home/app")) Expect(imageMetadata.StartCommand).To(ConsistOf("/savory-app", "--pretzels=salty", "cheesy")) Expect(imageMetadata.ExposedPorts).To(ConsistOf(uint16(3333), uint16(4444))) Expect(imageMetadata.Env).To(ConsistOf([]string{"A=1", "B=2"})) Expect(fakeDockerSessionFactory.MakeSessionCallCount()).To(Equal(2)) reposName, allowInsecure := fakeDockerSessionFactory.MakeSessionArgsForCall(0) Expect(reposName).To(Equal(dockerPath)) Expect(allowInsecure).To(BeFalse()) reposName, allowInsecure = fakeDockerSessionFactory.MakeSessionArgsForCall(1) Expect(reposName).To(Equal(dockerPath)) Expect(allowInsecure).To(BeTrue()) Expect(fakeDockerSession.GetRepositoryDataCallCount()).To(Equal(1)) Expect(fakeDockerSession.GetRepositoryDataArgsForCall(0)).To(Equal("savory-app")) Expect(fakeDockerSession.GetRemoteTagsCallCount()).To(Equal(1)) registries, repo := fakeDockerSession.GetRemoteTagsArgsForCall(0) Expect(registries).To(ConsistOf("http://my.custom.registry:5000/v1/")) Expect(repo).To(Equal("savory-app")) Expect(fakeDockerSession.GetRemoteImageJSONCallCount()).To(Equal(1)) imgIDParam, remoteImageEndpointParam := fakeDockerSession.GetRemoteImageJSONArgsForCall(0) Expect(imgIDParam).To(Equal("29d531509fb")) Expect(remoteImageEndpointParam).To(Equal("http://my.custom.registry:5000/v1/")) }) Context("when getting another error after retrying", func() { const insecureRegistryErrorMessage = "If this private registry supports only HTTP or HTTPS with an unknown CA certificate, please add `--insecure-registry 192.168.11.1:5000` to the daemon's arguments. In the case of HTTPS, if you have access to the registry's CA certificate, no need for the flag; simply place the CA certificate at /etc/docker/certs.d/192.168.11.1:5000/ca.crt" It("returns the error", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, errors.New(insecureRegistryErrorMessage)) dockerPath := "verybad/apple" _, err := dockerMetadataFetcher.FetchMetadata(dockerPath) Expect(err).To(MatchError(ContainSubstring("private registry supports only HTTP or HTTPS with an unknown CA certificate"))) Expect(fakeDockerSessionFactory.MakeSessionCallCount()).To(Equal(2)) reposName, allowInsecure := fakeDockerSessionFactory.MakeSessionArgsForCall(0) Expect(reposName).To(Equal(dockerPath)) Expect(allowInsecure).To(BeFalse()) reposName, allowInsecure = fakeDockerSessionFactory.MakeSessionArgsForCall(1) Expect(reposName).To(Equal(dockerPath)) Expect(allowInsecure).To(BeTrue()) }) }) }) Context("when exposed ports are null in the docker metadata", func() { It("doesn't blow up, and returns zero values", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"https://registry-1.docker.io/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) fakeDockerSession.GetRemoteImageJSONReturns( []byte(`{ "container_config":{ "ExposedPorts":null }, "config":{ "WorkingDir":"/home/app", "User":"the-meta-user", "Entrypoint":["/lattice-app"], "Cmd":["--enableAwesomeMode=true","iloveargs"], "Env":["A=1","B=2"] } }`), 0, nil) repoName := "cool_user123/sweetapp" imageMetadata, err := dockerMetadataFetcher.FetchMetadata(repoName) Expect(err).NotTo(HaveOccurred()) Expect(imageMetadata).NotTo(BeNil()) Expect(imageMetadata.ExposedPorts).To(BeEmpty()) }) }) Context("when there is an error parsing the docker image reference", func() { It("returns an error", func() { _, err := dockerMetadataFetcher.FetchMetadata("bad/appName") Expect(err).To(MatchError(ContainSubstring("repository name component must match"))) }) }) Context("when there is an error making the session", func() { It("returns an error", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, errors.New("Couldn't make a session.")) _, err := dockerMetadataFetcher.FetchMetadata("verybad/apple") Expect(err).To(MatchError("Couldn't make a session.")) }) }) Context("when there is an error getting the repository data", func() { It("returns an error", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) fakeDockerSession.GetRepositoryDataReturns(&registry.RepositoryData{}, errors.New("We floundered getting your repo data.")) _, err := dockerMetadataFetcher.FetchMetadata("cloud_flounder/fishy") Expect(err).To(MatchError("We floundered getting your repo data.")) }) }) Context("when there is an error getting remote tags", func() { It("returns an error", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: map[string]*registry.ImgData{}, }, nil) fakeDockerSession.GetRemoteTagsReturns(nil, errors.New("Can't get tags!")) _, err := dockerMetadataFetcher.FetchMetadata("tagless/inseattle") Expect(err).To(MatchError("Can't get tags!")) }) }) Context("When the requested tag does not exist", func() { It("returns an error", func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"https://registry-1.docker.io/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) _, err := dockerMetadataFetcher.FetchMetadata("wiggle/app:some-unknown-tag-v3245") Expect(err).To(MatchError("Unknown tag: wiggle/app:some-unknown-tag-v3245")) }) }) Describe("Handling image JSON errors", func() { BeforeEach(func() { fakeDockerSessionFactory.MakeSessionReturns(fakeDockerSession, nil) imageList := map[string]*registry.ImgData{ "29d531509fb": &registry.ImgData{ ID: "29d531509fb", Checksum: "dsflksdfjlkj", ChecksumPayload: "sdflksdjfkl", Tag: "latest", }, } fakeDockerSession.GetRepositoryDataReturns( &registry.RepositoryData{ ImgList: imageList, Endpoints: []string{"https://registry-1.docker.io/v1/"}, }, nil) fakeDockerSession.GetRemoteTagsReturns(map[string]string{"latest": "29d531509fb"}, nil) }) Context("when there is an error getting the remote image json", func() { It("returns an error", func() { fakeDockerSession.GetRemoteImageJSONReturns([]byte{}, 0, errors.New("JSON? What's that!???")) _, err := dockerMetadataFetcher.FetchMetadata("wiggle/app") Expect(err).To(MatchError("JSON? What's that!???")) }) }) Context("when there is an error parsing the remote image json", func() { It("returns an error", func() { fakeDockerSession.GetRemoteImageJSONReturns([]byte("i'm not valid json"), 0, nil) _, err := dockerMetadataFetcher.FetchMetadata("wiggle/app") Expect(err).To(MatchError("Error parsing remote image json for specified docker image:\ninvalid character 'i' looking for beginning of value")) }) }) Context("When Config is missing from the image Json", func() { It("returns an error", func() { fakeDockerSession.GetRemoteImageJSONReturns([]byte("{}"), 0, nil) _, err := dockerMetadataFetcher.FetchMetadata("wiggle/app") Expect(err).To(MatchError("Parsing start command failed")) }) }) }) }) })
{ "content_hash": "39f9cd7c6da69d18b7dc7c8563ac50dc", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 382, "avg_line_length": 41.954314720812185, "alnum_prop": 0.6913490623109498, "repo_name": "cloudfoundry-incubator/ltc", "id": "73467dd856f031ffa6f1fba0ddbe1c2906ed0ea1", "size": "16530", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docker_runner/docker_metadata_fetcher/docker_metadata_fetcher_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "988519" }, { "name": "Shell", "bytes": "777" } ], "symlink_target": "" }
layout: post title: BioVis Sessions and Papers at IEEE VIS 2017 date: 2017-10-03 event: ieee categories: ieee back_title: BioVis @ VIS back_url: /ieeevis author: Ana Crisan --- The BioVis challenge @ IEEE VIS 2017 is over, but there's still a lot of great biovis content at the infovis, VAST, and SciVis meetings. Here is a list of sessions to check out: #### Wednesday **[ VAST ] Text Analytics** - 10:30am-12:10am, Room: 207 LECTURE HALL - PhenoLines: Phenotype COmparison Visualizations for Disease Subtyping via Topic Models #### Thursday **[ SciVis ] Visualization in Biology and Medicine** - 8:30am-10:10am, Room: 207 LECTURE HALL - Instant Construction and Visualization of Crowded Biological Environments - Abstractocyte: A Visual Tool for Exploring Nanoscale Astroglial Cells - Decision Graph Embedding for High-Resolution Manometry Diagnosis - Visualization Multipipeline for Communicating Biology **[ VAST ] Interaction in the Analysis Process** - 2:00pm -3:40pm, Room: 301-C - Undestading the Relationships Between Interactive Optimisation and Visual Analytics in the Context of Prostate Brachytherapy #### Friday **[ SciVis ] Applications and visual analysis** - 8:30am-10:10am, Room: 106-ABC - BASTet: Shareable and reproducible analysis and visualization of mass spectrometry imaging data via OpenMSI - Multiscale Visualization and Scale-Adaptive Modification of DNA Nanostructures
{ "content_hash": "7a0f04f4cc8a77077d366902ee1d0e5e", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 136, "avg_line_length": 32.883720930232556, "alnum_prop": 0.7765205091937766, "repo_name": "biovis/2017", "id": "845f847da4fb063ab5563569c27095d2205a2b07", "size": "1418", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "_posts/2017-10-02-stuff_around_vis.md", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "CSS", "bytes": "10335" }, { "name": "HTML", "bytes": "14664" }, { "name": "JavaScript", "bytes": "3640" } ], "symlink_target": "" }
<?php namespace Mmi\Http; /** * Klasa pliku * * @property string $name nazwa pliku * @property string $tmpName tymczasowa ścieżka * @property integer $size rozmiar pliku * @property string $type mime type */ class RequestFile extends \Mmi\DataObject { /** * Konstruktor * @throws \Mmi\Http\HttpException * @param array $data */ public function __construct(array $data = []) { //brak nazwy if (!isset($data['name'])) { throw new HttpException('RequestFile: name not specified'); } //brak tmp_name if (!isset($data['tmp_name'])) { throw new HttpException('RequestFile: tmp_name not specified'); } //brak rozmiaru i samego pliku if (!isset($data['size']) && !file_exists($data['tmp_name'])) { throw new HttpException('RequestFile: file not found'); } parent::__construct([ 'name' => $data['name'], 'type' => \Mmi\FileSystem::mimeType($data['tmp_name']), 'tmpName' => $data['tmp_name'], 'size' => isset($data['size']) ? $data['size'] : filesize($data['tmp_name']) ]); } }
{ "content_hash": "b62b3688a613107cf045dc4d885d0da4", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 88, "avg_line_length": 27.6046511627907, "alnum_prop": 0.5492839090143218, "repo_name": "milejko/mmi", "id": "3e08f769a994a8a1ee103fd227b0bfc7750aa470", "size": "1454", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Mmi/Http/RequestFile.php", "mode": "33188", "license": "mit", "language": [ { "name": "Nix", "bytes": "711" }, { "name": "PHP", "bytes": "667407" }, { "name": "Smarty", "bytes": "8259" } ], "symlink_target": "" }
 #include <aws/inspector/model/RemoveAttributesFromFindingsRequest.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Inspector::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; RemoveAttributesFromFindingsRequest::RemoveAttributesFromFindingsRequest() : m_findingArnsHasBeenSet(false), m_attributeKeysHasBeenSet(false) { } Aws::String RemoveAttributesFromFindingsRequest::SerializePayload() const { JsonValue payload; if(m_findingArnsHasBeenSet) { Array<JsonValue> findingArnsJsonList(m_findingArns.size()); for(unsigned findingArnsIndex = 0; findingArnsIndex < findingArnsJsonList.GetLength(); ++findingArnsIndex) { findingArnsJsonList[findingArnsIndex].AsString(m_findingArns[findingArnsIndex]); } payload.WithArray("findingArns", std::move(findingArnsJsonList)); } if(m_attributeKeysHasBeenSet) { Array<JsonValue> attributeKeysJsonList(m_attributeKeys.size()); for(unsigned attributeKeysIndex = 0; attributeKeysIndex < attributeKeysJsonList.GetLength(); ++attributeKeysIndex) { attributeKeysJsonList[attributeKeysIndex].AsString(m_attributeKeys[attributeKeysIndex]); } payload.WithArray("attributeKeys", std::move(attributeKeysJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection RemoveAttributesFromFindingsRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "InspectorService.RemoveAttributesFromFindings")); return headers; }
{ "content_hash": "1db0076e4234455311177682224aede1", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 117, "avg_line_length": 28.228070175438596, "alnum_prop": 0.7793660658794282, "repo_name": "cedral/aws-sdk-cpp", "id": "22e2f19ac845a8d33a032da233d098b94a8de408", "size": "1728", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "aws-cpp-sdk-inspector/source/model/RemoveAttributesFromFindingsRequest.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "294220" }, { "name": "C++", "bytes": "428637022" }, { "name": "CMake", "bytes": "862025" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "7904" }, { "name": "Java", "bytes": "352201" }, { "name": "Python", "bytes": "106761" }, { "name": "Shell", "bytes": "10891" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Sabre\HTTP; interface ResponseInterface extends MessageInterface { /** * Returns the current HTTP status code. */ public function getStatus(): int; /** * Returns the human-readable status string. * * In the case of a 200, this may for example be 'OK'. */ public function getStatusText(): string; /** * Sets the HTTP status code. * * This can be either the full HTTP status code with human readable string, * for example: "403 I can't let you do that, Dave". * * Or just the code, in which case the appropriate default message will be * added. * * @param string|int $status * * @throws \InvalidArgumentException */ public function setStatus($status); }
{ "content_hash": "029182495d6919bfd27bfca65deea50c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 22.583333333333332, "alnum_prop": 0.6223862238622386, "repo_name": "fruux/sabre-http", "id": "9bd93f179ade2bf2133801ef49087c115bc53d19", "size": "1031", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "lib/ResponseInterface.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "158842" } ], "symlink_target": "" }
import os # Django settings for geonition project. # 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 # 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. ) # 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', ) # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.Loader', 'django.template.loaders.filesystem.Loader', # 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.gzip.GZipMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', # 'geonition_utils.middleware.PreventCacheMiddleware', #should be only for REST data api # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'geonition_utils.middleware.IEEdgeMiddleware', #should be only for ui html/css apps ) ROOT_URLCONF = 'mapita_ci.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'mapita_ci.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. ) # 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, }, } } #REQUIRED AND MODIFIED SESSION_EXPIRE_AT_BROWSER_CLOSE = True #CHANGE TEST RUNNER TO OUR OWN TO DISABLE MODELTRANSLATION TESTS TEST_RUNNER = 'mapita_ci.tests.GeonitionTestSuiteRunner' INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: 'django.contrib.admin', 'django.contrib.gis', #geonition apps # 'base_page', 'dashboard', # 'maps', # 'auth_page', # 'plan_proposals', # 'geonition_client', # 'gntauth', # 'gntimages', # 'geojson_rest', # 'geonition_utils', # 'geoforms', # third party apps # 'modeltranslation', ) TEMPLATE_CONTEXT_PROCESSORS = ( "django.contrib.auth.context_processors.auth", "django.core.context_processors.debug", "django.core.context_processors.i18n", "django.core.context_processors.media", "django.core.context_processors.static", "django.core.context_processors.tz", "django.contrib.messages.context_processors.messages", "django.core.context_processors.request", "base_page.context_processors.organization" ) #TEMPLATE_DIRS = (os.path.dirname(os.path.realpath(__file__)) + '/../statics/templates') JAVASCRIPT_CLIENT_TEMPLATES = [ 'geonition_auth.jquery.js', 'data_processing.jquery.js', 'opensocial_people.jquery.js', 'geonition_geojson.jquery.js', 'questionnaire.api.js' ] from django.core.urlresolvers import reverse_lazy LOGIN_REDIRECT_URL = reverse_lazy('dashboard') LOGIN_URL = reverse_lazy('login') LOGOUT_URL = reverse_lazy('logout') # Make this unique, and don't share it with anybody. SECRET_KEY = 'a[9lifg_(udnsh5w$=4@+kjyt93ys%c9wa8ck(=22_1d*w2gws' ADMINS = ( ('Mikko Johansson', 'mikko.johansson@mapita.fi'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'testdb', # Or path to database file if using sqlite3. 'USER': 'test_user', # Not used with sqlite3. 'PASSWORD': 'test_pw', # Not used with sqlite3. 'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '5432', # Set to empty string for default. Not used with sqlite3. } } MEDIA_ROOT = '/home/msjohans/geonition_test/media' #SPATIAL_REFERENCE_SYSTEM_ID = 3067 SPATIAL_REFERENCE_SYSTEM_ID = 3857 LANGUAGES = (('en', 'English'), ('fi', 'Suomi'),) # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = 'en' # 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. # On Unix systems, a value of None will cause Django to use the same # timezone as the operating system. # If running in a Windows environment this must be set to the same as your # system time zone. TIME_ZONE = 'Europe/Helsinki' SITE_ID = 1 DEBUG = True TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', ) TEMPLATE_DEBUG = DEBUG # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" 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: "/home/media/media.lawrence.com/static/" STATIC_ROOT = '/home/msjohans/geonition_test/static' # URL prefix for static files. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/' POSTGIS_VERSION = (1, 5, 3) POSTGIS_TEMPLATE = 'template_postgis' EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' ORGANIZATION_ADMIN_DEFAULT_MAP_SETTINGS = {'default_lon': 0, 'default_lat': 0, 'default_zoom': 4} #MODEL TRANSLATION #MODELTRANSLATION_TRANSLATION_REGISTRY = 'mapita_ci.translation' #MODELTRANSLATION_TRANSLATION_FILES = ('mapita_ci.translation',) # for django-jenkins INSTALLED_APPS += ('django_jenkins',) PROJECT_APPS = ('dashboard',) #INSTALLED_APPS += ('django_extensions',) #PROJECT_APPS = [appname for appname in INSTALLED_APPS if not (appname.startswith('django') or appname.startswith('modeltranslation'))] JENKINS_TEST_RUNNER = 'mapita_ci.tests.GeonitionJenkinsTestSuiteRunner' JENKINS_TASKS = ( 'django_jenkins.tasks.with_coverage', 'django_jenkins.tasks.run_pylint', 'django_jenkins.tasks.django_tests', # select one django or #'django_jenkins.tasks.dir_tests' # directory tests discovery 'django_jenkins.tasks.run_pep8', # 'django_jenkins.tasks.run_pyflakes', 'django_jenkins.tasks.run_jshint', 'django_jenkins.tasks.run_csslint', # 'django_jenkins.tasks.run_sloccount', # 'django_jenkins.tasks.run_graphmodels', # 'django_jenkins.tasks.lettuce_tests', )
{ "content_hash": "377881833b4e5aa0ed86248d659ce366", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 135, "avg_line_length": 33.3852140077821, "alnum_prop": 0.6892773892773892, "repo_name": "Mapita/mapita_ci", "id": "3e310dbf10a36cc558ba827923d4a0bbbb70d75a", "size": "8580", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mapita/mapita_ci/settings_dashboard.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "94833" }, { "name": "Shell", "bytes": "452" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_seq_packet_socket::shutdown_type</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../basic_seq_packet_socket.html" title="basic_seq_packet_socket"> <link rel="prev" href="shutdown/overload2.html" title="basic_seq_packet_socket::shutdown (2 of 2 overloads)"> <link rel="next" href="../basic_serial_port.html" title="basic_serial_port"> </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="shutdown/overload2.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_seq_packet_socket.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="../basic_serial_port.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.basic_seq_packet_socket.shutdown_type"></a><a class="link" href="shutdown_type.html" title="basic_seq_packet_socket::shutdown_type">basic_seq_packet_socket::shutdown_type</a> </h4></div></div></div> <p> <span class="emphasis"><em>Inherited from socket_base.</em></span> </p> <p> <a class="indexterm" name="id1068280"></a> Different ways a socket may be shutdown. </p> <pre class="programlisting"><span class="keyword">enum</span> <span class="identifier">shutdown_type</span> </pre> <p> <a class="indexterm" name="id1068310"></a> <a class="indexterm" name="id1068320"></a> <a class="indexterm" name="id1068329"></a> </p> <h6> <a name="boost_asio.reference.basic_seq_packet_socket.shutdown_type.h0"></a> <span><a name="boost_asio.reference.basic_seq_packet_socket.shutdown_type.values"></a></span><a class="link" href="shutdown_type.html#boost_asio.reference.basic_seq_packet_socket.shutdown_type.values">Values</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl> <dt><span class="term">shutdown_receive</span></dt> <dd><p> Shutdown the receive side of the socket. </p></dd> <dt><span class="term">shutdown_send</span></dt> <dd><p> Shutdown the send side of the socket. </p></dd> <dt><span class="term">shutdown_both</span></dt> <dd><p> Shutdown both send and receive on the socket. </p></dd> </dl> </div> </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 &#169; 2003-2012 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="shutdown/overload2.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_seq_packet_socket.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="../basic_serial_port.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "c54b775917c83483ac4bccd4f1d10aa4", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 459, "avg_line_length": 55.96153846153846, "alnum_prop": 0.6235967926689576, "repo_name": "djsedulous/namecoind", "id": "2ec6b1f2956a6f3d24cca48534602461b46f17a7", "size": "4365", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "libs/boost_1_50_0/doc/html/boost_asio/reference/basic_seq_packet_socket/shutdown_type.html", "mode": "33261", "license": "mit", "language": [ { "name": "Assembly", "bytes": "843598" }, { "name": "Awk", "bytes": "90447" }, { "name": "C", "bytes": "19896147" }, { "name": "C#", "bytes": "121901" }, { "name": "C++", "bytes": "132199970" }, { "name": "CSS", "bytes": "336528" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "IDL", "bytes": "11976" }, { "name": "Java", "bytes": "3955488" }, { "name": "JavaScript", "bytes": "22346" }, { "name": "Max", "bytes": "36857" }, { "name": "Objective-C", "bytes": "23505" }, { "name": "Objective-C++", "bytes": "2450" }, { "name": "PHP", "bytes": "55712" }, { "name": "Perl", "bytes": "4194947" }, { "name": "Python", "bytes": "761429" }, { "name": "R", "bytes": "4009" }, { "name": "Rebol", "bytes": "354" }, { "name": "Scheme", "bytes": "6073" }, { "name": "Shell", "bytes": "550004" }, { "name": "Tcl", "bytes": "2268735" }, { "name": "TeX", "bytes": "13404" }, { "name": "TypeScript", "bytes": "5318296" }, { "name": "XSLT", "bytes": "757548" }, { "name": "eC", "bytes": "5079" } ], "symlink_target": "" }
import r from 'restructure'; import Entity from '../entity'; import StringRef from '../string-ref'; export default Entity({ id: r.uint32le, name: StringRef, animationDataID: r.uint32le, flags: r.uint32le, unknowns: new r.Reserved(r.uint32le, 2), soundID: r.uint32le, });
{ "content_hash": "3b314139efe01e69523176484edd488a", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 42, "avg_line_length": 21.923076923076923, "alnum_prop": 0.6982456140350877, "repo_name": "timkurvers/blizzardry", "id": "483f39883286741e79e314e39540c31d17dc61e9", "size": "285", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/lib/dbc/entities/emotes.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "143066" } ], "symlink_target": "" }
using UnityEngine; using System.Collections; using UnityStandardAssets.ImageEffects; /// <summary> /// Add a Greyscale effect to the player vision. /// Increases the light range /// </summary> public class SpellEffectNightVision : SpellEffectLight { public static bool inUse; public Grayscale gs; public override void ApplyEffect () { if (inUse==false) { gs = Camera.main.gameObject.AddComponent<Grayscale>(); //gs.shader=Shader.Find ("Hidden/Grayscale Effect"); gs.shader=GameWorldController.instance.greyScale; } base.ApplyEffect (); } public override void Update () { if (Active) { inUse=true; } base.Update (); } public override void CancelEffect () { if (gs!=null) { Destroy (gs); } inUse=false; base.CancelEffect (); } }
{ "content_hash": "8699c584a82756ebcee2fe86c2f9bff2", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 58, "avg_line_length": 18.80952380952381, "alnum_prop": 0.6822784810126582, "repo_name": "hankmorgan/UnderworldExporter", "id": "df92410c474801c8ed09f75c61944a5d1a65b421", "size": "792", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "UnityScripts/scripts/Magic/SpellEffects/SpellEffectNightVision.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "47198" }, { "name": "C#", "bytes": "7333991" }, { "name": "C++", "bytes": "1187493" }, { "name": "Objective-C", "bytes": "2172" }, { "name": "ShaderLab", "bytes": "3333" }, { "name": "Smalltalk", "bytes": "57779" }, { "name": "VBA", "bytes": "23934" } ], "symlink_target": "" }
<?php namespace Screen\Injection\Scripts; use Screen\Injection\LocalPath; class FacebookHideSignUp extends LocalPath { public function __construct() { $path = __DIR__ . '/../../../scripts/facebook-hide-signup.js'; parent::__construct($path); } }
{ "content_hash": "c20190c899c21d9f96d208a34d59a6ad", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 70, "avg_line_length": 18.533333333333335, "alnum_prop": 0.6330935251798561, "repo_name": "microweber/screen", "id": "3c7251d958b76030df3540e4b3219a009d66ecbd", "size": "278", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/Injection/Scripts/FacebookHideSignUp.php", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "948" }, { "name": "PHP", "bytes": "27382" } ], "symlink_target": "" }
/* Package eventsouce provides a basic interface for serving server sent events (aka EventSource). It is patterned after the Go Websocket library: https://code.google.com/p/go/source/browse?repo=net#hg%2Fwebsocket For more destails about Server Sent Events see: http://html5doctor.com/server-sent-events/ http://www.html5rocks.com/en/tutorials/eventsource/basics/ http://cjihrig.com/blog/the-server-side-of-server-sent-events/ */ package eventsource import ( "net/http" ) type Conn struct { Req *http.Request writer http.ResponseWriter http.Flusher http.CloseNotifier } func (c Conn) Write(msg []byte) { c.writer.Write([]byte("data: ")) c.writer.Write(msg) c.writer.Write([]byte("\n\n")) c.Flush() } type Handler func(*Conn) func (h Handler) ServeHTTP(w http.ResponseWriter, req *http.Request) { f, f_ok := w.(http.Flusher) if !f_ok { panic("ResponseWriter is not a Flusher") } cn, cn_ok := w.(http.CloseNotifier) if !cn_ok { panic("ResponseWriter is not a CloseNotifier") } w.Header().Set("Content-Type", "text/event-stream") w.Header().Set("Cache-Control", "no-cache") w.Header().Set("Connection", "keep-alive") w.Header().Set("Transfer-Encoding", "chunked") w.Header().Set("Access-Control-Allow-Origin", "*") f.Flush() h(&Conn{req, w, f, cn}) }
{ "content_hash": "352445fdea1b2a4f28dd306f3d85d2b8", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 70, "avg_line_length": 22.25862068965517, "alnum_prop": 0.7017815646785438, "repo_name": "getlantern/eventsource", "id": "85990d0dca91b07894ea0efd399297f10b0db4da", "size": "1291", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "eventSource.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "6016" }, { "name": "Shell", "bytes": "14" } ], "symlink_target": "" }
package org.broadinstitute.hellbender.exceptions; import htsjdk.samtools.SAMRecord; import org.broadinstitute.hellbender.utils.read.GATKRead; /** * <p/> * Class GATKException. * <p/> * This exception is for errors that are beyond the user's control, such as internal pre/post condition failures * and "this should never happen" kinds of scenarios. */ public class GATKException extends RuntimeException { private static final long serialVersionUID = 0L; public GATKException( String msg ) { super(msg); } public GATKException( String message, Throwable throwable ) { super(message, throwable); } /* Subtypes of GATKException for common kinds of errors */ /** * <p/> * For wrapping errors that are believed to never be reachable */ public static class ShouldNeverReachHereException extends GATKException { private static final long serialVersionUID = 0L; public ShouldNeverReachHereException( final String s ) { super(s); } public ShouldNeverReachHereException( final String s, final Throwable throwable ) { super(s, throwable); } public ShouldNeverReachHereException( final Throwable throwable) {this("Should never reach here.", throwable);} } public static class MissingReadField extends GATKException { private static final long serialVersionUID = 0L; public MissingReadField( final String fieldName ) { super(String.format("Attempted to access field \"%s\" in read, but field is not present", fieldName)); } public MissingReadField( final String fieldName, final String message ) { super(String.format("Attempted to access field \"%s\" in read, but field is not present. %s", fieldName, message)); } public MissingReadField( final String fieldName, final GATKRead read ) { super(String.format("Attempted to access field \"%s\" in read %s, but field is not present", fieldName, read)); } } public static class ReadAttributeTypeMismatch extends GATKException { private static final long serialVersionUID = 0L; public ReadAttributeTypeMismatch( final String attributeName, final String targetType ) { super(String.format("Attribute %s not of (or convertible to) type %s", attributeName, targetType)); } public ReadAttributeTypeMismatch( final String attributeName, final String targetType, final Throwable throwable ) { super(String.format("Attribute %s not of (or convertible to) type %s", attributeName, targetType), throwable); } public ReadAttributeTypeMismatch( final SAMRecord read, final String attributeName, final String targetType) { super(String.format("In read %s @ %s attribute %s not of (or convertible to) type %s", read.getReadName(), "" + read.getContig() + ":" + read.getStart(), attributeName, targetType)); } public ReadAttributeTypeMismatch( final SAMRecord read, final String attributeName, final String targetType, final Object value) { super(String.format("In read %s @ %s attribute %s not of (or convertible to) type %s: class is '%s' and value is '%s'", read.getReadName(), "" + read.getContig() + ":" + read.getStart(), attributeName, targetType, value == null ? "null" : value.getClass(), "" + value)); } public ReadAttributeTypeMismatch( final SAMRecord read, final String attributeName, final String targetType, final Throwable ex) { super(String.format("In read %s @ %s attribute %s not of (or convertible to) type %s", read.getReadName(), "" + read.getContig() + ":" + read.getStart(), attributeName, targetType, ex)); } } }
{ "content_hash": "f5648e187f58b6bd325e032de10e0614", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 282, "avg_line_length": 45.083333333333336, "alnum_prop": 0.6762608925270662, "repo_name": "broadinstitute/hellbender", "id": "34c674888b9f858ae2f746490222e4b2d1e957f5", "size": "3787", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "src/main/java/org/broadinstitute/hellbender/exceptions/GATKException.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "1878" }, { "name": "C++", "bytes": "60687" }, { "name": "Java", "bytes": "7458782" }, { "name": "Python", "bytes": "10963" }, { "name": "R", "bytes": "27481" }, { "name": "Shell", "bytes": "11688" } ], "symlink_target": "" }
<div class="main-panel"> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-8"> <div class="card"> <div class="header"> <h4 class="title">Add Subject</h4> </div> <div class="content"> <form action="<?php echo base_url(); ?>subjectadd/createsubject" method="post" enctype="multipart/form-data" id="myformsub"> <div class="row"> <div class="col-md-5"> <div class="form-group"> <label>Subject Name</label> <input type="text" class="form-control" placeholder="" name="subjectname" id="subjectname" value=""> </div> </div> <div class="col-md-5"> <div class="form-group"> <label class="col-sm-2 control-label">Status</label> <select name="status" class="selectpicker form-control"> <option value="Active">Active</option> <option value="Deactive">DeActive</option> </select> </div> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label><input type="checkbox" name="is_preferred_lang" value="1" style="margin-right:10px;">Set as Preferred Language</label> </div> </div> </div> <button type="submit" class="btn btn-info btn-fill pull-left">Save</button> <div class="clearfix"></div> </form> </div> </div> </div> </div> </div> <?php if($this->session->flashdata('msg')): ?> <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert" aria-hidden="true"> ×</button> <?php echo $this->session->flashdata('msg'); ?> </div> <?php endif; ?> <div class="content"> <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="content"> <div class="fresh-datatables"> <table id="bootstrap-table" class="table"> <thead> <th>S.no</th> <th>Subjects</th> <th>Preferred Language</th> <th>Status</th> <th>Actions</th> </thead> <tbody> <?php $i=1; foreach ($result as $rows) { ?> <tr> <td><?php echo $i; ?></td> <td><?php echo $rows->subject_name; ?></td> <td><?php if($rows->is_preferred_lang) echo "<i class='fa fa-check'></i>"; ?></td> <td> <?php $sta=$rows->status; if($sta=='Active'){?> <button class="btn btn-success btn-fill btn-wd">Active</button> <?php }else{?> <button class="btn btn-danger btn-fill btn-wd">De Active</button> <?php } ?> </td> <td> <a href="<?php echo base_url(); ?>subjectadd/updatesubject/<?php echo $rows->subject_id; ?>" class="btn btn-simple btn-warning btn-icon edit"><i class="fa fa-edit"></i></a> </td> </tr> <?php $i++; } ?> </tbody> </table> </div> </div><!-- end content--> </div><!-- end card --> </div> <!-- end col-md-12 --> </div> <!-- end row --> </div> </div> </div> </div> <script type="text/javascript"> $(document).ready(function () { $('#mastersmenu').addClass('collapse in'); $('#master').addClass('active'); $('#masters4').addClass('active'); $('#myformsub').validate({ // initialize the plugin rules: { subjectname:{required:true }, }, messages: { subjectname: "Please Enter Subject Name" } }); }); var $table = $('#bootstrap-table'); $().ready(function(){ $table.bootstrapTable({ toolbar: ".toolbar", clickToSelect: true, showRefresh: true, search: true, showToggle: true, showColumns: true, pagination: true, searchAlign: 'left', pageSize: 8, clickToSelect: false, pageList: [8,10,25,50,100], formatShowingRows: function(pageFrom, pageTo, totalRows){ //do nothing here, we don't want to show the text "showing x of y from..." }, formatRecordsPerPage: function(pageNumber){ return pageNumber + " rows visible"; }, icons: { refresh: 'fa fa-refresh', toggle: 'fa fa-th-list', columns: 'fa fa-columns', detailOpen: 'fa fa-plus-circle', detailClose: 'fa fa-minus-circle' } }); //activate the tooltips after the data table is initialized $('[rel="tooltip"]').tooltip(); $(window).resize(function () { $table.bootstrapTable('resetView'); }); }); </script>
{ "content_hash": "5babfbbb836dcc6720baa9b26f28734d", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 211, "avg_line_length": 36.35675675675676, "alnum_prop": 0.3679750223015165, "repo_name": "kamalhappysanz/ensyfi", "id": "c91ca6f70c6c11178a6e68aa47042ef01c9a7bf9", "size": "6727", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/views/subject/add.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "276888" }, { "name": "HTML", "bytes": "8429593" }, { "name": "JavaScript", "bytes": "739198" }, { "name": "PHP", "bytes": "4627341" } ], "symlink_target": "" }
//------------------------------------------------------------------------------ // <copyright file="pch.h" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> //------------------------------------------------------------------------------ // // pch.h // Header for standard system include files. // #pragma once #include <collection.h> #include <ppltasks.h>
{ "content_hash": "99244ed1648fe9c66e289871150a4484", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 27.6, "alnum_prop": 0.41545893719806765, "repo_name": "k-m-j/Kinect", "id": "6b09e3da828a2aeb16af0c7fdc22b0fd1b31b071", "size": "416", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "KinectImageProcessor/pch.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "416" }, { "name": "C++", "bytes": "16262" }, { "name": "CSS", "bytes": "2624" }, { "name": "HTML", "bytes": "3024" }, { "name": "JavaScript", "bytes": "34215" } ], "symlink_target": "" }
<?php namespace Academe\Exceptions; class DataNotFoundException extends \Exception { }
{ "content_hash": "e32d8aae57c88c61d4b5641f416d26e1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 11.25, "alnum_prop": 0.7888888888888889, "repo_name": "AaronJan/Academe", "id": "35f415e36f7f5b0f9384d1035836585dfe4929a7", "size": "90", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Academe/Exceptions/DataNotFoundException.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "400927" } ], "symlink_target": "" }
Dalli Changelog ===================== 0.9.3 ----- - Rails 2.3 support (beanieboi) - Rails SessionStore support - Passenger integration - memcache-client upgrade docs, see Upgrade.md 0.9.2 ---- - Verify proper operation in Heroku. 0.9.1 ---- - Add fetch and cas operations (mperham) - Add incr and decr operations (mperham) - Initial support for SASL authentication via the MEMCACHE_{USERNAME,PASSWORD} environment variables, needed for Heroku (mperham) 0.9.0 ----- - Initial gem release.
{ "content_hash": "7e4c3d573fa599cb718c794fd0c5cb00", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 130, "avg_line_length": 18.035714285714285, "alnum_prop": 0.6831683168316832, "repo_name": "lomography/dalli", "id": "73ea9510842c270cbe6e45bd264c631bb298aeb8", "size": "505", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "History.md", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "55234" } ], "symlink_target": "" }
package com.sgrailways.giftidea.listeners; import android.content.DialogInterface; import javax.inject.Inject; public class DialogDismissListener implements DialogInterface.OnClickListener { @Inject public DialogDismissListener(){} public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }
{ "content_hash": "5214b85abadb7b65ec0575a36c73f4d2", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 22.666666666666668, "alnum_prop": 0.7617647058823529, "repo_name": "sgrailways/giftidea", "id": "1b282458c2cf06631a447da32c22b57748685e61", "size": "340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "android/src/main/java/com/sgrailways/giftidea/listeners/DialogDismissListener.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "82786" }, { "name": "Shell", "bytes": "463" } ], "symlink_target": "" }
title: "About Us" permalink: /about/ feature_row1: - image_path: /assets/images/members/james.jpg feature_row3: - image_path: /assets/images/members/Kuang-Li.jpg feature_row2: - image_path: /assets/images/members/cheng-xuan.jpg title: "Xuan Cheng" excerpt: "<p>Xuan learned to dance at age of five and started to receive medals in many major ballet competitions from 2004, including Shanghai and New York International Ballet Competitions. She was the Gold medalist at 2006 National Taoli Cup Dance Competition in China.</p><p>Xuan performed in over 20 countries throughout Europe, Asia and North America. She joined Oregon Ballet Theatre as its female principal dancer in 2011.</p><p>She co-founded <a href='http://oiballet.org/ac/'>Oregon International Ballet Academy</a>, where she shares her experience and passion to young dancers.</p>" - image_path: /assets/images/activities/talk_raymond_chong1.jpg title: "Raymond Chong" excerpt: "<p>Raymond is Senior Roadway Manager with the Oregon Department of Transportation at Portland in Oregon. He is responsible for preliminary engineering of transportation improvement projects in Portland metro region.</p><p>Born and raised in Los Angeles, Raymond is 6th generation Chinese American, with family roots in America extending back to California Gold Rush (1849 to 1855), Transcontinental Railroad (1865 to 1869), Boston Chinatown (1892 to 1926), Cambridge Imperial Restaurant (1923 to 1936), and Kubla Khan Theater Restaurant (1946 to 1950).</p>" - image_path: /assets/images/members/Min-Gao1.jpg title: "Jiamin Gao" excerpt: "<p>Jiamin is often called 'Tai Chi Goddess' and 'Tai Chi Queen' in sports magazines. From 1989 to 1998, she was awarded numerous titles including ‘World Wushu Championship’. She won a total of 32 gold medals during the period. She is the first grand slam in world series and so far no one has ever gone beyond what she had achieved.</p><p>In 2016, during 'the Second World Tai Chi Chuan' in Warsaw, Poland, Jiamin was the United States team coach and deputy leader.</p><p>She is running <a href='http://www.uswushu.com/'>U.S. Wushu Center</a> in NW Portland.</p>" - image_path: /assets/images/members/Neil-Lee.jpg title: "Neil Lee" excerpt: "<p>Born and raised in Portland Oregon, Mr. Lee represents the American born Chinese community. An Architect by profession, he owns and operates <a href='http://www.leekainc.com/'>LEEKA Architecture and Planning</a>. Mr. Lee is also very active in the Chinese Community. He is currently holding the leadership positions in various Chinese organizations including CCBA, Bing Kong Tong Association, and Lee's Association. Mr. Lee is committed to improving and uniting our Chinese community through collaboration and cooperation despite language, political, and geographic barriers.</p>" - image_path: /assets/images/members/andy-wong2.jpg title: "Andy Wong" excerpt: "<p>Andy is the founder of <a href='http://www.wongsking.com/'>Wong's King Seafood Restaurant</a> in Portland, Oregon. He has a very long list of titles, including World Master Chef, China’s Golden Chef, Honorable Chairman of International Chef Association in France, The Top Entrepreneurs in China, Visiting Professor in Fujian Chef College, and member of China’s All-Star Chefs.</p><p>The Restaurant received many awards over the years, in particular, named as “Top 100 Chinese Restaurant in the U.S.A” for 4 years in a row. It is one of the most popular places to host community events.</p>" - image_path: /assets/images/members/Ni-Xu3.jpg title: "Ni Xu" excerpt: "<p>Ni was a graduate from Beijing Film Academy, majoring in film script writing. He had an extensive experience in the film industry, working as a screenwriter, photographer, documentary and film director.</p><p>In 2012, Ni and his family came to the United States, eventually settled in Portland, hoping to do their part to record the revival of the Chinese community in Portland.</p><p>Ni’s wife, Faye, is a marketing guru, who was directly responsible for directing Portland Chinatown Saturday Performance series.</p>" --- ![]({{ site.url }}/assets/images/bbe6f25c77ca030fbcd56311dbff79de.jpg) ## Our Mission To serve Chinese community with a shared vision and resources. ## Our Vision To build a connected and united Chinese community that embraces diverse socioeconomic backgrounds, political beliefs, and religious and cultural traditions. #### Oregon Chinese Coalition is an IRS approved 501c(3) non-profit organization (TAX ID: 82-1027620). ## Board of Directors ### Hui Du Ms. Du holds a M.S. degree in Statistics from the University of Chicago. She also received a B.S. degree in Computer Science from Tsinghua University in 1996. She is passionate about education and giving back to her community, including working as volunteer Chinese language teacher for 10 years and hosting the first and largest social media group in northwest Portland to support the local Chinese community. She has two kids. Travel is her biggest hobby. ### Qusheng Jin Mr. Jin graduated from Nanjing University with BS degree in 1994 and then received his MS degree from Chinese Academy of Science and Ph.D. from UIUC. He has been a faculty in University of Oregon since 2005. As an Oregonian, biking is his biggest hobby. He and his wife have two sons, one enjoys swimming and the other is big fan of Youtube. ### Miaolian Wang Mrs. Wang earned Computer Science degrees from McMaster University (MS) and Central South University (BS). She has helped at CEC Chinese school as a teaching assistant, served at her children's school as a board member on the parent-teacher committee, and devoted her time in various community services. She and her husband moved to Oregon 14 years ago. She lives with her husband and two daughters in Beaverton. She likes traveling, and socializing with friends. ### Sophie Wang Ms. Wang received B.A. from Beijing Normal University, M.A. degrees from Peking University and Columbia University. Moving to Oregon in 2011, she received MBA from Oregon State University. In addition to her involvement with OCC, she volunteers in local NPOs and school district. ### Zhunquin Wang Mr. Wang graduated from Tsinghua University with a B.S and an M.S degree. He has been a software developer for Oracle since 1997. Meanwhile, he has been coaching world-class robotics teams for over a dozen years. He was also active in a local Boy Scout troop. His passion is to foster the holistic growth of future technology leaders. Zhunquin and his wife live in Portland with two boys. He loves camping, hiking, and coaching. ### Karen-Peng Wu Mrs. Wu has a BA in Genetics and an MBA. Utilizing her biotech background, she conducted research at Ceres, CalTech and OHSU. She works as an independent consultant last 8 years. Karen currently serves in a number of NPO’s in her community: Oregon Skating Council, Tech 4 Kids Club and USFSA, etc. Karen has been a Portlander for 14 years with her husband and two kids, she enjoys going on long walks and travelling. ### Hongcheng Zhao Mr. Zhao attended Peking University in China. He came to the States as a Visiting Scholar in Harvard University in 1989. He has been working in the healthcare industry for more than twenty years. He and his wife chose Portland to raise their family. They have three children who are all very passionate about community services and social justice. ## Board of Directors at Large ### Eric Shi Mr. Shi received his B.S. from Shanghai U. of Sci. & Tech. After he came to the U.S. in 1989, he has obtained his M.S. from Oregon State and attended OGI for management courses. He devotes his time to support and promote small/startup companies in product development and market penetration. Making himself a home in Oregon with his wife and two boys, he wishes to make use of his skillset and contribute to the good of the community. ### Jue Shi Mr. Shi graduated from Peking University with B.S. and M.S. degree, both in electrical engineering field. He was a senior electrical engineer, worked for 17 years in Maxim integrated products,inc. He loves technologies and organizes a tech solon for local engineers with weekly seminars on broad topics. He and his wife live in Portland, OR with two sons. ## Legal Counsel {% include feature_row id="feature_row1"%} ### James E. McCandlish Mr. McCandlish graduated with honors from Harvard College in 1967. He then worked in the Peace Corps in central Africa. He received his law degree at Northwestern School of Law (Lewis & Clark). He served as staff co-counsel for the Senate Judiciary Committee in Salem. He spent two years with the Metro Public Defender's office in Portland. He started [his own firm](http://griffinandmccandlish.com) in 1981, and joined forces with Mark Griffin in 1988. ## Advisor for Musical Performance and Affairs {% include feature_row id="feature_row3"%} ### Li Kuang Dr. Kuang holds a Doctor of Musical Arts degree from The University of Texas at Austin, two Master of Music degrees from The University of Michigan, Bachelor of Music degrees from Bowling Green State University, and Sichuan Conservatory of Music. Dr. Kuang is an internationally-award winning performing artist and sought-after adjudicator. Dr. Kuang judged many music competitions and contests. He is also a music theorist, theory teacher, piano instructor, and trombone professor. He currently serves as a Professor of Music at Portland State University and the director of PSU Trombone Choir. ## Featured Community Members {% include feature_row id="feature_row2"%} ![]({{ site.url }}/assets/images/logo/halloffame.png) Congratulations to following Chinese Americans who won national recognitions in recent years! ### Marshall Scholarship 2020 Isaac Cui ’20 at Pomona College, from Beaverton [News](https://www.pomona.edu/news/2019/12/09-isaac-cui-20-awarded-prestigious-marshall-scholarship-study-uk) ### Prudential Community Service Award National Honorees 2016 Alisha Zhao, Junior at Lincoln High School, from Portland [News](https://spirit.prudential.com/honoree/2016/or/alisha-zhao) ### Regeneron Science Talent Search (STS) Top 10 Winners 2020 Rupert Li, Senior at Jesuit High School, from Portland [News](https://www.societyforscience.org/press-release/virtual-regeneron-science-talent-search-2020-winners/) 2021 Wenjun Hou, Senior at Jesuit High School, from Portland [News](https://www.prnewswire.com/news-releases/teen-scientists-win-1-8-million-at-virtual-regeneron-science-talent-search-2021-for-remarkable-research-on-infinite-matching-algorithms-machine-learning-to-evaluate-new-medicines-and-water-filtration-301249747.html) ### Scholastic Art & Writing Awards National Winners 2022 Jenny Chen, Freshman at Lincoln High School, from Portland [News](https://newsroom.artandwriting.org/2022/05/31/best-of-the-best-meet-the-2022-best-in-grade-award-winners/) 2016 Sophia Mautz, Junior at Lincoln High School, from Portland [News](https://oomscholasticblog.com/post/scholastic-art-writing-awards-2016-national-winners-announced) *There is no implication of OCC affiliation or sponsorship for the Hall of Famers.*
{ "content_hash": "f2d4551589b88ee615618ef3711a00a4", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 607, "avg_line_length": 90.45967741935483, "alnum_prop": 0.7801551216902916, "repo_name": "PDXChinese/pdxchinese.github.io", "id": "8fd8927bec69604c5e911b53623361679f90b1bb", "size": "11239", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "_pages/about.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "73967" }, { "name": "JavaScript", "bytes": "53349" }, { "name": "Ruby", "bytes": "2105" }, { "name": "SCSS", "bytes": "68855" } ], "symlink_target": "" }
// Template Source: BaseEntity.java.tt // ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models; import com.microsoft.graph.serializer.ISerializer; import com.microsoft.graph.serializer.IJsonBackedObject; import com.microsoft.graph.serializer.AdditionalDataManager; import java.util.EnumSet; import com.microsoft.graph.models.IdentitySet; import com.microsoft.graph.models.Entity; import com.google.gson.JsonObject; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import javax.annotation.Nullable; import javax.annotation.Nonnull; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The class for the Request. */ public class Request extends Entity implements IJsonBackedObject { /** * The Approval Id. * The identifier of the approval of the request. */ @SerializedName(value = "approvalId", alternate = {"ApprovalId"}) @Expose @Nullable public String approvalId; /** * The Completed Date Time. * The request completion date time. */ @SerializedName(value = "completedDateTime", alternate = {"CompletedDateTime"}) @Expose @Nullable public java.time.OffsetDateTime completedDateTime; /** * The Created By. * The principal that created the request. */ @SerializedName(value = "createdBy", alternate = {"CreatedBy"}) @Expose @Nullable public IdentitySet createdBy; /** * The Created Date Time. * The request creation date time. */ @SerializedName(value = "createdDateTime", alternate = {"CreatedDateTime"}) @Expose @Nullable public java.time.OffsetDateTime createdDateTime; /** * The Custom Data. * Free text field to define any custom data for the request. Not used. */ @SerializedName(value = "customData", alternate = {"CustomData"}) @Expose @Nullable public String customData; /** * The Status. * The status of the request. Not nullable. The possible values are: Canceled, Denied, Failed, Granted, PendingAdminDecision, PendingApproval, PendingProvisioning, PendingScheduleCreation, Provisioned, Revoked, and ScheduleCreated. Not nullable. */ @SerializedName(value = "status", alternate = {"Status"}) @Expose @Nullable public String status; /** * Sets the raw JSON object * * @param serializer the serializer * @param json the JSON object to set this object to */ public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { } }
{ "content_hash": "5d758363a186a326c917152242e9a2ce", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 249, "avg_line_length": 31.161290322580644, "alnum_prop": 0.6649413388543823, "repo_name": "microsoftgraph/msgraph-sdk-java", "id": "2ec930d5c54d35d2e3e3ed9d3a2ac11a7802fa0c", "size": "2898", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/main/java/com/microsoft/graph/models/Request.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "27286837" }, { "name": "PowerShell", "bytes": "5635" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- Copyright 2003 - 2010 The eFaps Team 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. Author: The eFaps Team Revision: $Rev$ Last Changed: $Date$ Last Changed By: $Author$ --> <ui-command xmlns="http://www.efaps.org/xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.efaps.org/xsd http://www.efaps.org/xsd/eFaps_1.0.xsd"> <uuid>cc335d93-04fe-41e5-962d-090436e15071</uuid> <file-application>eFapsApp-Accounting</file-application> <file-revision>$Rev$</file-revision> <definition> <version-expression>(version==latest)</version-expression> <name>Accounting_ReportSubJournalTree_Transaction</name> <target> <menu>Accounting_ReportSubJournalTree_Transaction_Menu</menu> <table>Accounting_ReportSubJournal2TransactionTable</table> <evaluate program="org.efaps.esjp.common.uitable.MultiPrint"> <property name="Type01">Accounting_ReportSubJournal2Transaction</property> <property name="LinkFrom01">FromLink</property> </evaluate> </target> <!-- properties --> <property name="Target">content</property> <property name="TargetShowCheckBoxes">true</property> </definition> </ui-command>
{ "content_hash": "e179c24d56f56cb8dd56cb8affb3754a", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 98, "avg_line_length": 43, "alnum_prop": 0.6949702541914549, "repo_name": "eFaps/eFapsApp-Accounting", "id": "5e1b60a1ee124acfc51920d3f0828ec33c451463", "size": "1849", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/efaps/UserInterface/Report/Accounting_ReportSubJournalTree_Transaction.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1521592" } ], "symlink_target": "" }
<?php namespace JJ\WeddingBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\HttpFoundation\File\UploadedFile; use Doctrine\Common\Collections\ArrayCollection; /** * JJ\WeddingBundle\Entity\Document */ class Document { /** * @var integer $id */ private $id; /** * @var string $filename */ private $filename; /** * @var string $path */ private $path; /** * @var string $mimetype */ private $mimetype; /** * @var string $hash */ private $hash; /** * @var string */ private $title; /** * @var string */ private $description; /** * @var string */ private $galleryName; /** * @var integer */ private $orderInGallery; private $file; private $temp; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Default __toString. */ public function __toString() { return $this->getFilename(); } /** * Set filename * * @param string $filename * @return Document */ public function setFilename( $filename ) { $this->filename = $filename; return $this; } /** * Get filename * * @return string */ public function getFilename() { return $this->filename; } /** * Set path * * @param string $path * @return Document */ public function setPath( $path ) { $this->path = $path; return $this; } /** * Get path * * @return string */ public function getPath() { return $this->path; } public function getAbsolutePath() { return null === $this->path ? null : $this->getUploadRootDir().'/'.$this->path; } public function getWebPath() { return null === $this->path ? null : $this->getUploadDir().'/'.$this->path; } protected function getUploadRootDir() { // the absolute directory path where uploaded // documents should be saved return __DIR__.'/../../../../web/'.$this->getUploadDir(); } protected function getUploadDir() { // get rid of the __DIR__ so it doesn't screw up // when displaying uploaded doc/image in the view. return 'uploads/media'; } /** * Set mimetype * * @param string $mimetype * @return Document */ public function setMimetype( $mimetype ) { $this->mimetype = $mimetype; return $this; } /** * Get mimetype * * @return string */ public function getMimetype() { return $this->mimetype; } /** * Get hash * * @return string */ public function getHash() { return $this->hash; } /** * Set hash * * @param string $hash * @return DocumentedEntity */ public function setHash( $hash ) { $this->hash = $hash; return $this; } /** * Generate hash * * @param string $hash * @return DocumentedEntity */ public function generateHash( $data ) { $this->hash = hash( 'sha512', $data ); return $this; } /** * Generate hash * * @param string $filename * @return DocumentedEntity */ public function generateHashFromFile( $file ) { $this->hash = hash_file( 'sha512', $file ); return $this; } /** * Set title * * @param string $title * @return Document */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set description * * @param string $description * @return Document */ public function setDescription($description) { $this->description = $description; return $this; } /** * Get description * * @return string */ public function getDescription() { return $this->description; } /** * Set galleryName * * @param string $galleryName * @return Document */ public function setGalleryName($galleryName) { $this->galleryName = $galleryName; return $this; } /** * Get galleryName * * @return string */ public function getGalleryName() { return $this->galleryName; } /** * Set orderInGallery * * @param integer $orderInGallery * @return Document */ public function setOrderInGallery($orderInGallery) { $this->orderInGallery = $orderInGallery; return $this; } /** * Get orderInGallery * * @return integer */ public function getOrderInGallery() { return $this->orderInGallery; } /** * Sets file. * * @param UploadedFile $file */ public function setFile($file = null) { if('array' == gettype($file)){ // if there are multiple files uploaded foreach($file as $single){ $this->file = $single; // check if we have an old image path if (is_file($this->getAbsolutePath())) { // store the old name to delete after the update $this->temp = $this->getAbsolutePath(); } else { $this->path = 'initial'; } } } else{ // if there is only one file $this->file = $file; // check if we have an old image path if (is_file($this->getAbsolutePath())) { // store the old name to delete after the update $this->temp = $this->getAbsolutePath(); } else { $this->path = 'initial'; } } } /** * Get file. * * @return UploadedFile */ public function getFile() { return $this->file; } /** * life cycle cacllback: PrePersist/PreUpdate */ public function preUpload() { if(null !== $this->getFile()){ // generate a uniquename $this->generateHashFromFile($this->getFile()); // get filetype $this->mimetype = $this->getFile()->guessExtension(); $this->path = $this->getHash() . '.' . $this->getFile()->guessExtension(); } } /** * life cycle cacllback: PreRemove */ public function storeFilenameForRemove() { $this->temp = $this->getAbsolutePath(); } /** * life cycle cacllback: PostRemove */ public function removeUpload() { if ($file = $this->getAbsolutePath()) { unlink($file); } } /** * life cycle cacllback: PostPersist/PostUpdate */ public function upload() { if (null === $this->getFile()) { return; } // if there is an error when moving the file, an exception will // be automatically thrown by move(). This will properly prevent // the entity from being persisted to the database on error $this->getFile()->move( $this->getUploadRootDir(), $this->path ); // check if we have an old image if (isset($this->temp)) { // delete the old image unlink($this->getUploadRootDir().'/'.$this->temp); // clear the temp image path $this->temp = null; } $this->file = null; } // this function is intended for a symfony application-generated file. // not currently used /* public function write($data) { $this->path = $this->getDir(); $this->generateHash($data); if(!realpath($this->path)){ mkdir( $this->path, 0775, true ); } $this->path=realpath( $this->path ); file_put_contents($this->getFullName(), $data); } */ }
{ "content_hash": "e3be5b2ee66d76edceabb97fddf3ca88", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 86, "avg_line_length": 19.472093023255812, "alnum_prop": 0.4938492774393885, "repo_name": "curtisghanson/JJWedding", "id": "99074ea6f528a184005a623fd12e6dfe65758dff", "size": "8373", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/JJ/WeddingBundle/Entity/Document.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2647" }, { "name": "CSS", "bytes": "39806" }, { "name": "HTML", "bytes": "180942" }, { "name": "JavaScript", "bytes": "68828" }, { "name": "PHP", "bytes": "328431" } ], "symlink_target": "" }
package javax.naming.directory; import java.io.Serializable; import javax.naming.NamingEnumeration; /** * This is the interface to a collection of attributes associated with a * directory entry. * <p> * This interface defines the methods that are implemented by a collection of a * particular directory entry's attributes. * </p> * <p> * A directory entry can have zero or more attributes comprising its attributes * collection. The attributes are unordered within the collection. The * attributes can be identified by name. The names of attributes are either case * sensitive or case insensitive as indicated by the <code>isCaseIgnored</code> * method. Method names refer to attribute ID (identity) rather than name, for * brevity. * </p> * <p> * The attribute collection is created when the directory entry is created. * </p> */ public interface Attributes extends Cloneable, Serializable { /** * Returns a deep copy of this <code>Attributes</code> instance. The * attribute objects are not cloned. * * @return a deep copy of this <code>Attributes</code> instance */ Object clone(); /** * Returns the attribute with the specified name (ID). The name is case * insensitive if <code>isCaseIgnored()</code> is true. The return value * is <code>null</code> if no match is found. * * @param id * attribute name (ID) * @return the attribute with the specified name (ID) */ Attribute get(String id); /** * Returns an enumeration containing the zero or more attributes in the * collection. The behaviour of the enumeration is not specified if the * attribute collection is changed. * * @return an enumeration of all contained attributes * */ NamingEnumeration<? extends Attribute> getAll(); /** * Returns an enumeration containing the zero or more names (IDs) of the * attributes in the collection. The behaviour of the enumeration is not * specified if the attribute collection is changed. * * @return an enumeration of the IDs of all contained attributes */ NamingEnumeration<String> getIDs(); /** * Indicates whether case is ignored in the names of the attributes. * * @return true if case is ignored, otherwise false */ boolean isCaseIgnored(); /** * Places a non-null attribute in the attribute collection. If there is * already an attribute with the same ID as the new attribute, the old one * is removed from the collection and is returned by this method. If there * was no attribute with the same ID the return value is <code>null</code>. * * @param attribute * the attribute to be put * @return the old attribute with the same ID, if exists; otherwise * <code>null</code> */ Attribute put(Attribute attribute); /** * Places a new attribute with the supplied ID and value into the attribute * collection. If there is already an attribute with the same ID, the old * one is removed from the collection and is returned by this method. If * there was no attribute with the same ID the return value is * <code>null</code>. The case of the ID is ignored if * <code>isCaseIgnored()</code> is true. * * This method provides a mechanism to put an attribute with a * <code>null</code> value: the value of <code>obj</code> may be * <code>null</code>. * * @param id * the ID of the new attribute to be put * @param obj * the value of the new attribute to be put * @return the old attribute with the same ID, if exists; otherwise * <code>null</code> */ Attribute put(String id, Object obj); /** * Removes the attribute with the specified ID. The removed attribute is * returned by this method. If there is no attribute with the specified ID, * the return value is <code>null</code>. The case of the ID is ignored * if <code>isCaseIgnored()</code> is true. * * @param id * the ID of the attribute to be removed * @return the removed attribute, if exists; otherwise <code>null</code> */ Attribute remove(String id); /** * Returns the number of attributes. * * @return the number of attributes */ int size(); }
{ "content_hash": "baeea1ef15a2655938bf95d4aed5164d", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 80, "avg_line_length": 34.95275590551181, "alnum_prop": 0.6539761207479162, "repo_name": "nextopio/nextop-client", "id": "d81f8c58baf45417e3c3249454df9f1430e208f0", "size": "5243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "org.apache-jarjar/src/main/java/javax/naming/directory/Attributes.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "110" }, { "name": "GAP", "bytes": "25378" }, { "name": "HTML", "bytes": "3003" }, { "name": "Java", "bytes": "3279774" }, { "name": "JavaScript", "bytes": "14503" } ], "symlink_target": "" }
require([ 'base/js/namespace', 'jquery', 'notebook/js/notebook', 'contents', 'services/config', 'base/js/utils', 'base/js/page', 'base/js/events', 'auth/js/loginwidget', 'notebook/js/maintoolbar', 'notebook/js/pager', 'notebook/js/quickhelp', 'notebook/js/menubar', 'notebook/js/notificationarea', 'notebook/js/savewidget', 'notebook/js/actions', 'notebook/js/keyboardmanager', 'notebook/js/kernelselector', 'codemirror/lib/codemirror', 'notebook/js/about', 'typeahead', 'notebook/js/searchandreplace', 'custom', ], function( IPython, $, notebook, contents, configmod, utils, page, events, loginwidget, maintoolbar, pager, quickhelp, menubar, notificationarea, savewidget, actions, keyboardmanager, kernelselector, CodeMirror, about, typeahead, searchandreplace ) { "use strict"; // compat with old IPython, remove for IPython > 3.0 window.CodeMirror = CodeMirror; var common_options = { ws_url : utils.get_body_data("wsUrl"), base_url : utils.get_body_data("baseUrl"), notebook_path : utils.get_body_data("notebookPath"), notebook_name : utils.get_body_data('notebookName') }; var config_section = new configmod.ConfigSection('notebook', common_options); config_section.load(); var common_config = new configmod.ConfigSection('common', common_options); common_config.load(); var page = new page.Page(); var pager = new pager.Pager('div#pager', { events: events}); var acts = new actions.init(); var keyboard_manager = new keyboardmanager.KeyboardManager({ pager: pager, events: events, actions: acts }); var save_widget = new savewidget.SaveWidget('span#save_widget', { events: events, keyboard_manager: keyboard_manager}); acts.extend_env({save_widget:save_widget}); var contents = new contents.Contents({ base_url: common_options.base_url, common_config: common_config }); var notebook = new notebook.Notebook('div#notebook', $.extend({ events: events, keyboard_manager: keyboard_manager, save_widget: save_widget, contents: contents, config: config_section}, common_options)); var login_widget = new loginwidget.LoginWidget('span#login_widget', common_options); var toolbar = new maintoolbar.MainToolBar('#maintoolbar-container', { notebook: notebook, events: events, actions: acts}); var quick_help = new quickhelp.QuickHelp({ keyboard_manager: keyboard_manager, events: events, notebook: notebook}); keyboard_manager.set_notebook(notebook); keyboard_manager.set_quickhelp(quick_help); var menubar = new menubar.MenuBar('#menubar', $.extend({ notebook: notebook, contents: contents, events: events, save_widget: save_widget, quick_help: quick_help, actions: acts}, common_options)); var notification_area = new notificationarea.NotebookNotificationArea( '#notification_area', { events: events, save_widget: save_widget, notebook: notebook, keyboard_manager: keyboard_manager}); notification_area.init_notification_widgets(); var kernel_selector = new kernelselector.KernelSelector( '#kernel_logo_widget', notebook); searchandreplace.load(keyboard_manager); $('body').append('<div id="fonttest"><pre><span id="test1">x</span>'+ '<span id="test2" style="font-weight: bold;">x</span>'+ '<span id="test3" style="font-style: italic;">x</span></pre></div>'); var nh = $('#test1').innerHeight(); var bh = $('#test2').innerHeight(); var ih = $('#test3').innerHeight(); if(nh != bh || nh != ih) { $('head').append('<style>.CodeMirror span { vertical-align: bottom; }</style>'); } $('#fonttest').remove(); page.show(); events.one('notebook_loaded.Notebook', function () { var hash = document.location.hash; if (hash) { document.location.hash = ''; document.location.hash = hash; } notebook.set_autosave_interval(notebook.minimum_autosave_interval); }); IPython.page = page; IPython.notebook = notebook; IPython.contents = contents; IPython.pager = pager; IPython.quick_help = quick_help; IPython.login_widget = login_widget; IPython.menubar = menubar; IPython.toolbar = toolbar; IPython.notification_area = notification_area; IPython.keyboard_manager = keyboard_manager; IPython.save_widget = save_widget; IPython.tooltip = notebook.tooltip; try { events.trigger('app_initialized.NotebookApp'); } catch (e) { console.error("Error in app_initialized callback", e); } Object.defineProperty( IPython, 'actions', { get: function() { console.warn('accessing "actions" on the global IPython/Jupyter is not recommended. Pass it to your objects contructors at creation time'); return acts; }, enumerable: true, configurable: false }); // Now actually load nbextensions from config Promise.all([ utils.load_extensions_from_config(config_section), utils.load_extensions_from_config(common_config), ]) .catch(function(error) { console.error('Could not load nbextensions from user config files', error); }) // BEGIN HARDCODED WIDGETS HACK .then(function() { if (!utils.is_loaded('jupyter-js-widgets/extension')) { // Fallback to the ipywidgets extension utils.load_extension('widgets/notebook/js/extension').catch(function () { console.warn('Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0'); }); } }) .catch(function(error) { console.error('Could not load ipywidgets', error); }); // END HARDCODED WIDGETS HACK notebook.load_notebook(common_options.notebook_path); });
{ "content_hash": "27b5327d31541aa1dbbe2a174ed3cd04", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 149, "avg_line_length": 32.536458333333336, "alnum_prop": 0.619177205058428, "repo_name": "Edu-Glez/Bank_sentiment_analysis", "id": "fe7bc069caf4f5ebdef804b17bd2d3edc0ddc4d5", "size": "6351", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "env/lib/python3.6/site-packages/notebook/static/notebook/js/main.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Lex", "bytes": "101463" }, { "name": "Python", "bytes": "29876" }, { "name": "Shell", "bytes": "1509" } ], "symlink_target": "" }
<?php /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ class Admin extends CI_Controller { function __construct() { parent::__construct(); $this->load->database(); $this->load->helper(array('url', 'text', 'form', 'file')); $this->load->library(array('session', 'form_validation', 'ftp')); $this->load->database(); $this->load->model(array('article/m_article','m_session', 'general', "term/m_term", "global_function")); $this->template->set_template('admin'); // Set template } function index($page_no=1) { if (!($this->general->Checkpermission("view_contact"))) redirect(site_url("admin/not-permission")); $data=array(); $data['breadcrumb'] = '<a href="'.site_url("admin").'">Trang chủ</a><i class="fa fa-angle-right"></i> <a href="'.site_url("admin/contact").'">Quản lý liên hệ</a>'; $data['name_project']='Terrace resort'; $data['mod']='contact'; if(isset($_POST['delete'])){ $array=array_keys($this->input->post('checkall')); foreach ($array as $a){ //--------change parent------ $this->delete_more($a); } redirect( site_url('admin/contact/index/'.$page_no).'?messager=success' ); } $page_co=20; $start=($page_no-1)*$page_co; $count=$this->global_function->count_table(array('id !='=>0),'contact'); $data['page_no']=$page_no; $this->template->write('mod', 'contact'); $data['contact']=$this->general->show_list_contact_page($page_co,$start); $data['link']=$this->global_function->paging($page_co,$count,'admin/contact/index/',$page_no); //$this->print_arr($data['items']); $this->template->write_view('content', 'admin/index', $data, TRUE); $this->template->render(); } function Contact_Detail($page_no=1) { if (!($this->general->Checkpermission("view_contact"))) redirect(site_url("admin/not-permission")); $data=array(); $data['breadcrumb'] = '<a href="'.site_url("admin").'">Trang chủ</a><i class="fa fa-angle-right"></i> <a href="'.site_url("admin/contact").'">Quản lý liên hệ</a>'; $data['name_project']='Terrace resort'; $data['mod']='contact'; if(isset($_POST['delete_detail'])){ $array=array_keys($this->input->post('checkall')); foreach ($array as $a){ //--------change parent------ $this->delete_more_detail($a); } redirect( site_url('admin/contact/contact_detail/'.$page_no).'?messager=success' ); } $page_co=20; $start=($page_no-1)*$page_co; $count=$this->global_function->count_table(array('id !='=>0),'contact_detail'); $data['page_no']=$page_no; $this->template->write('mod', 'contact_detail'); $data['contact']=$this->general->show_list_contact_page_detail($page_co,$start); $data['link']=$this->global_function->paging($page_co,$count,'admin/contact/contact_detail/',$page_no); //$this->print_arr($data['items']); $this->template->write_view('content', 'admin/contact_detail', $data, TRUE); $this->template->render(); } function booking_flight($page_no=1) { if (!($this->general->Checkpermission("view_contact"))) redirect(site_url("admin/not-permission")); $data=array(); $data['breadcrumb'] = '<a href="'.site_url("admin").'">Trang chủ</a><i class="fa fa-angle-right"></i> <a href="'.site_url("admin/contact").'">Quản lý liên hệ</a>'; $data['name_project']='Terrace resort'; $data['mod']='contact'; if(isset($_POST['delete'])){ $array=array_keys($this->input->post('checkall')); foreach ($array as $a){ //--------change parent------ $this->delete_more($a); } redirect( site_url('admin/contact/index/'.$page_no).'?messager=success' ); } $page_co=20; $start=($page_no-1)*$page_co; $count=$this->global_function->count_table(array('id !='=>0),'booking_flight'); $data['page_no']=$page_no; $this->template->write('mod', 'booking_flight'); $data['contact']=$this->general->show_list_booking_flight_page($page_co,$start); $data['link']=$this->global_function->paging($page_co,$count,'admin/contact/index/',$page_no); //$this->print_arr($data['items']); $this->template->write_view('content', 'admin/booking_flight', $data, TRUE); $this->template->render(); } //============================================ function view($id){ if (!($this->general->Checkpermission("view_contact"))) redirect(site_url("admin/not-permission")); $data=array(); $data['name_project']=''; $this->template->write('mod', 'contact'); $data['breadcrumb'] = '<a href="'.site_url("admin").'">Trang chủ</a><i class="fa fa-angle-right"></i> <a href="'.site_url("admin/contact").'">Quản lý liên hệ</a>'; $sql = array( 'status'=>1 ); $this->db->where('id',$id); $this->db->update('contact' , $sql); $data['order']= $this->global_function->get_tableWhere(array('id'=>$id),'contact'); $this->template->write_view('content', 'admin/view', $data, TRUE); $this->template->render(); } //============================================\ function delete($id) { if (!($this->general->Checkpermission("delete_contact"))) redirect(site_url("admin/not-permission")); $where=array('id'=>$id); $this->db->delete('contact',$where); redirect( site_url('admin/contact/index').'?messager=success' ); } function delete_detail($id) { if (!($this->general->Checkpermission("delete_contact"))) redirect(site_url("admin/not-permission")); $where=array('id'=>$id); $this->db->delete('contact_detail',$where); redirect( site_url('admin/contact/contact_detail').'?messager=success' ); } function delete_booking($id) { $where=array('id'=>$id); $this->db->delete('booking_flight',$where); redirect( site_url('admin/contact/booking_flight').'?messager=success' ); } //============================================\ function delete_more($id) { if (!($this->general->Checkpermission("delete_contact"))) redirect(site_url("admin/not-permission")); if (!($this->general->Checkpermission("add"))) redirect(site_url("admin/not-permission")); $where=array('id'=>$id); $this->db->delete('contact',$where); return true; } function delete_more_detail($id) { $where=array('id'=>$id); $this->db->delete('contact_detail',$where); return true; } //============================================ function print_arr($array){ echo '<pre>'; print_r($array); echo '</pre>'; } //============================================ public function checkuser(){ if(!$this->m_session->userdata('admin_login')) redirect( site_url('admin/login')); $a=$this->m_session->userdata('admin_login')->per; $p = unserialize($a); return false; } //=================================== Email =============== function email($page_no=1) { if (!($this->general->Checkpermission("view_contact"))) redirect(site_url("admin/not-permission")); $data=array(); $data['breadcrumb'] = '<a href="'.site_url("admin").'">Trang chủ</a><i class="fa fa-angle-right"></i> <a href="'.site_url("admin/order").'">Quản lý email</a>'; if(isset($_POST['delete'])){ $array=array_keys($this->input->post('checkall')); foreach ($array as $a){ //--------change parent------ $this->email_delete_more($a); } redirect( site_url('admin/contact/email/'.$page_no).'?messager=success' ); } $page_co=20; $start=($page_no-1)*$page_co; $count=$this->model->count_where(array('select'=>'*','name_table'=>'email_letter')); $data['page_no']=$page_no; $data['contact']=$this->general->show_list_email_page($page_co,$start); $data['link']=$this->global_function->paging($page_co,$count,'admin/contact/index/',$page_no); //$this->print_arr($data['items']); $this->template->write('mod', 'email_list'); $this->template->write_view('content', 'admin/email_list', $data, TRUE); $this->template->render(); } function email_delete($id) { if (!($this->general->Checkpermission("delete_contact"))) redirect(site_url("admin/not-permission")); $where=array('id'=>$id); $this->db->delete('email_letter',$where); redirect( site_url('admin/contact/email').'?messager=success' ); } function email_delete_more($id) { if (!($this->general->Checkpermission("delete_contact"))) redirect(site_url("admin/not-permission")); $where=array('id'=>$id); $this->db->delete('email_letter',$where); return true; } function all_export() { $this->load->library('my_excel'); // Create new PHPExcel object $objPHPExcel = new PHPExcel(); // Set document properties $objPHPExcel->getProperties()->setCreator("Maarten Balliauw") ->setLastModifiedBy("Maarten Balliauw") ->setTitle("Office 2007 XLSX Test Document") ->setSubject("Office 2007 XLSX Test Document") ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.") ->setKeywords("office 2007 openxml php") ->setCategory("Test result file"); $objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . 1, 'STT'); $objPHPExcel->getActiveSheet(0)->setCellValue('B' . 1, 'Email'); $objPHPExcel->getActiveSheet(0)->setCellValue('C' . 1, 'Ngày gửi'); $item = $this->general->get_list_table("email_letter"); for ($i = 0; $i < count($item); $i++) { $objPHPExcel->setActiveSheetIndex(0)->setCellValue('A' . ($i + 2), $i+1); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('B' . ($i + 2), $item[$i]->email); $objPHPExcel->setActiveSheetIndex(0)->setCellValue('C' . ($i + 2), $item[$i]->create_date); } $date = "Danh sách email"; // Rename worksheet $objPHPExcel->getActiveSheet()->setTitle($date); // Set active sheet index to the first sheet, so Excel opens this as the first sheet $objPHPExcel->setActiveSheetIndex(0); // Redirect output to a client's web browser (Excel2007) header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="' . $date . '.xls"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); exit; } }
{ "content_hash": "7aaae31646340e04eac1ee26fb916665", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 112, "avg_line_length": 42.454198473282446, "alnum_prop": 0.5572237705654949, "repo_name": "itphamphong/viettoc", "id": "3ac093d2af8909360d3ab24c58af396aa8369e93", "size": "11164", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "application/modules/contact/controllers/Admin.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "814" }, { "name": "CSS", "bytes": "2310448" }, { "name": "Go", "bytes": "6808" }, { "name": "HTML", "bytes": "6686446" }, { "name": "Java", "bytes": "14870" }, { "name": "JavaScript", "bytes": "3790401" }, { "name": "Makefile", "bytes": "2678" }, { "name": "PHP", "bytes": "4400940" }, { "name": "Python", "bytes": "37920" }, { "name": "Ruby", "bytes": "6561" }, { "name": "Shell", "bytes": "2063" } ], "symlink_target": "" }
'use strict'; var Backbone = require('backbone'); var models = require('../src/models'); describe('models', function () { describe('Module', function () { it('should define a Module Model', function () { expect(models).to.have.property('Module'); }); describe('an instance', function () { beforeEach(function () { this.subject = new models.Module({name: 'lola'}); }); it('should be a Backbone.Model', function () { expect(this.subject).to.be.instanceOf(Backbone.Model); }); it('should use name as ID', function () { expect(this.subject.id).to.equal('lola'); }); it('should have default value for installed', function () { expect(this.subject.get('installed')).to.equal(true); }); it('should have an URL', function () { expect(this.subject.url()).to.equal('/installable/api/modules/lola'); }); }); }); describe('Modules', function () { it('should define a Modules Collection', function () { expect(models).to.have.property('Modules'); }); describe('an instance', function () { beforeEach(function () { this.subject = new models.Modules(); }); it('should be a Backbone.Collection', function () { expect(this.subject).to.be.instanceOf(Backbone.Collection); }); it('should have Module for Model', function () { expect(this.subject.model).to.equal(models.Module); }); it('should have an URL', function () { expect(this.subject.url).to.equal('/installable/api/modules'); }); }); }); describe('SearchModule', function () { it('should define a SearchModule Model', function () { expect(models).to.have.property('SearchModule'); }); describe('an instance', function () { beforeEach(function () { this.subject = new models.SearchModule(); }); it('should be a Module', function () { expect(this.subject).to.be.instanceOf(models.Module); }); it('should have default value for installed', function () { expect(this.subject.get('installed')).to.equal(false); }); }); }); describe('SearchModules', function () { it('should define a SearchModules Collection', function () { expect(models).to.have.property('SearchModules'); }); describe('an instance', function () { beforeEach(function () { this.subject = new models.SearchModules(); }); it('should be a Backbone.Collection', function () { expect(this.subject).to.be.instanceOf(Backbone.Collection); }); it('should have SearchModule for Model', function () { expect(this.subject.model).to.equal(models.SearchModule); }); it('should have an URL', function () { expect(this.subject.url).to.equal('/installable/api/modules/search'); }); }); }); });
{ "content_hash": "b4ec2341afd3eac07103d96aa6edbb77", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 85, "avg_line_length": 33.13861386138614, "alnum_prop": 0.514191813564386, "repo_name": "node-installable/installable-web-manager", "id": "75de1146b92d521b4615042b7aaa94e53b20684c", "size": "3347", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/models_spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1293" }, { "name": "JavaScript", "bytes": "33967" } ], "symlink_target": "" }
<?php namespace Bazaar\Component\Cart\Tests\Infrastructure\Persistence\Doctrine\Fixtures; use Bazaar\Component\Cart\Domain\Model\Cart as BaseCart; /** * Custom Cart. (for testing) * * @author Beau Simensen <beau@dflydev.com> */ class CustomCart extends BaseCart { }
{ "content_hash": "c8f84c56c55a5fda4b80f8d29161a07f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 83, "avg_line_length": 17.1875, "alnum_prop": 0.7490909090909091, "repo_name": "bazaar/bazaar", "id": "8819611738a9a5a5e8b087e85a40840db84542ff", "size": "482", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Bazaar/Component/Cart/Tests/Infrastructure/Persistence/Doctrine/Fixtures/CustomCart.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "52886" } ], "symlink_target": "" }
using UnityEngine; using System.Collections; using System.Collections.Generic; namespace RootMotion.FinalIK { /// <summary> /// Handles FBBIK interactions for a character. /// </summary> [AddComponentMenu("Scripts/RootMotion.FinalIK/Interaction System/Interaction System")] public class InteractionSystem : MonoBehaviour { // Open a video tutorial video [ContextMenu("TUTORIAL VIDEO (PART 1: BASICS)")] void OpenTutorial1() { Application.OpenURL("https://www.youtube.com/watch?v=r5jiZnsDH3M"); } // Open a video tutorial video [ContextMenu("TUTORIAL VIDEO (PART 2: PICKING UP...)")] void OpenTutorial2() { Application.OpenURL("https://www.youtube.com/watch?v=eP9-zycoHLk"); } #region Main Interface /// <summary> /// If not empty, only the targets with the specified tag will be used by this Interaction System. /// </summary> [Tooltip("If not empty, only the targets with the specified tag will be used by this Interaction System.")] public string targetTag = ""; /// <summary> /// The fade in time of the interaction. /// </summary> [Tooltip("The fade in time of the interaction.")] public float fadeInTime = 0.3f; /// <summary> /// The master speed for all interactions. /// </summary> [Tooltip("The master speed for all interactions.")] public float speed = 1f; /// <summary> /// If > 0, lerps all the FBBIK channels used by the Interaction System back to their default or initial values when not in interaction. /// </summary> [Tooltip("If > 0, lerps all the FBBIK channels used by the Interaction System back to their default or initial values when not in interaction.")] public float resetToDefaultsSpeed = 1f; [Header("Triggering")] /// <summary> /// The collider that registers OnTriggerEnter and OnTriggerExit events with InteractionTriggers. /// </summary> [Tooltip("The collider that registers OnTriggerEnter and OnTriggerExit events with InteractionTriggers.")] public new Collider collider; /// <summary> /// Will be used by Interaction Triggers that need the camera's position. Assign the first person view character camera. /// </summary> [Tooltip("Will be used by Interaction Triggers that need the camera's position. Assign the first person view character camera.")] public new Transform camera; /// <summary> /// The layers that will be raycasted from the camera (along camera.forward). All InteractionTrigger look at target colliders should be included. /// </summary> [Tooltip("The layers that will be raycasted from the camera (along camera.forward). All InteractionTrigger look at target colliders should be included.")] public LayerMask camRaycastLayers; /// <summary> /// Max distance of raycasting from the camera. /// </summary> [Tooltip("Max distance of raycasting from the camera.")] public float camRaycastDistance = 1f; /// <summary> /// Returns true if any of the effectors is in interaction and not paused. /// </summary> public bool inInteraction { get { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused) return true; } return false; } } /// <summary> /// Determines whether this effector is interaction and not paused /// </summary> public bool IsInInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].inInteraction && !interactionEffectors[i].isPaused; } } return false; } /// <summary> /// Determines whether this effector is paused /// </summary> public bool IsPaused(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].inInteraction && interactionEffectors[i].isPaused; } } return false; } /// <summary> /// Returns true if any of the effectors is paused /// </summary> public bool IsPaused() { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction && interactionEffectors[i].isPaused) return true; } return false; } /// <summary> /// Returns true if either all effectors in interaction are paused or none is. /// </summary> public bool IsInSync() { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].isPaused) { for (int n = 0; n < interactionEffectors.Length; n++) { if (n != i && interactionEffectors[n].inInteraction && !interactionEffectors[n].isPaused) return false; } } } return true; } /// <summary> /// Starts the interaction between an effector and an interaction object. /// </summary> public bool StartInteraction(FullBodyBipedEffector effectorType, InteractionObject interactionObject, bool interrupt) { if (!IsValid(true)) return false; if (interactionObject == null) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Start(interactionObject, targetTag, fadeInTime, interrupt); } } return false; } /// <summary> /// Pauses the interaction of an effector. /// </summary> public bool PauseInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Pause(); } } return false; } /// <summary> /// Resumes the paused interaction of an effector. /// </summary> public bool ResumeInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Resume(); } } return false; } /// <summary> /// Stops the interaction of an effector. /// </summary> public bool StopInteraction(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return false; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].Stop(); } } return false; } /// <summary> /// Pauses all the interaction effectors. /// </summary> public void PauseAll() { if (!IsValid(true)) return; for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].Pause(); } /// <summary> /// Resumes all the paused interaction effectors. /// </summary> public void ResumeAll() { if (!IsValid(true)) return; for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].Resume(); } /// <summary> /// Stops all interactions. /// </summary> public void StopAll() { for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].Stop(); } /// <summary> /// Gets the current interaction object of an effector. /// </summary> public InteractionObject GetInteractionObject(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return null; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].interactionObject; } } return null; } /// <summary> /// Gets the progress of any interaction with the specified effector. /// </summary> public float GetProgress(FullBodyBipedEffector effectorType) { if (!IsValid(true)) return 0f; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].effectorType == effectorType) { return interactionEffectors[i].progress; } } return 0f; } /// <summary> /// Gets the minimum progress of any active interaction /// </summary> public float GetMinActiveProgress() { if (!IsValid(true)) return 0f; float min = 1f; for (int i = 0; i < interactionEffectors.Length; i++) { if (interactionEffectors[i].inInteraction) { float p = interactionEffectors[i].progress; if (p > 0f && p < min) min = p; } } return min; } /// <summary> /// Triggers all interactions of an InteractionTrigger. Returns false if unsuccessful (maybe out of range). /// </summary> public bool TriggerInteraction(int index, bool interrupt) { if (!IsValid(true)) return false; if (!TriggerIndexIsValid(index)) return false; bool all = true; var range = triggersInRange[index].ranges[bestRangeIndexes[index]]; for (int i = 0; i < range.interactions.Length; i++) { for (int e = 0; e < range.interactions[i].effectors.Length; e++) { bool s = StartInteraction(range.interactions[i].effectors[e], range.interactions[i].interactionObject, interrupt); if (!s) all = false; } } return all; } /// <summary> /// Returns true if all effectors of a trigger are either not in interaction or paused /// </summary> public bool TriggerEffectorsReady(int index) { if (!IsValid(true)) return false; if (!TriggerIndexIsValid(index)) return false; for (int r = 0; r < triggersInRange[index].ranges.Length; r++) { var range = triggersInRange[index].ranges[r]; for (int i = 0; i < range.interactions.Length; i++) { for (int e = 0; e < range.interactions[i].effectors.Length; e++) { if (IsInInteraction(range.interactions[i].effectors[e])) return false; } } for (int i = 0; i < range.interactions.Length; i++) { for (int e = 0; e < range.interactions[i].effectors.Length; e++) { if (IsPaused(range.interactions[i].effectors[e])) { for (int n = 0; n < range.interactions[i].effectors.Length; n++) { if (n != e && !IsPaused(range.interactions[i].effectors[n])) return false; } } } } } return true; } /// <summary> /// Return the current most appropriate range of an InteractionTrigger listed in triggersInRange. /// </summary> public InteractionTrigger.Range GetTriggerRange(int index) { if (!IsValid(true)) return null; if (index < 0 || index >= bestRangeIndexes.Count) { Warning.Log("Index out of range.", transform); return null; } return triggersInRange[index].ranges[bestRangeIndexes[index]]; } /// <summary> /// Returns the InteractionTrigger that is in range and closest to the character. /// </summary> public int GetClosestTriggerIndex() { if (!IsValid(true)) return -1; if (triggersInRange.Count == 0) return -1; if (triggersInRange.Count == 1) return 0; int closest = -1; float closestSqrMag = Mathf.Infinity; for (int i = 0; i < triggersInRange.Count; i++) { if (triggersInRange[i] != null) { float sqrMag = Vector3.SqrMagnitude(triggersInRange[i].transform.position - transform.position); if (sqrMag < closestSqrMag) { closest = i; closestSqrMag = sqrMag; } } } return closest; } /// <summary> /// Gets the FullBodyBipedIK component. /// </summary> public FullBodyBipedIK ik { get { return fullBody; } } /// <summary> /// Gets the in contact. /// </summary> /// <value>The in contact.</value> public List<InteractionTrigger> triggersInRange { get; private set; } private List<InteractionTrigger> inContact = new List<InteractionTrigger>(); private List<int> bestRangeIndexes = new List<int>(); /// <summary> /// Interaction delegate /// </summary> public delegate void InteractionDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject); /// <summary> /// Interaction event delegate /// </summary> public delegate void InteractionEventDelegate(FullBodyBipedEffector effectorType, InteractionObject interactionObject, InteractionObject.InteractionEvent interactionEvent); /// <summary> /// Called when an InteractionEvent has been started /// </summary> public InteractionDelegate OnInteractionStart; /// <summary> /// Called when an Interaction has been paused /// </summary> public InteractionDelegate OnInteractionPause; /// <summary> /// Called when an InteractionObject has been picked up. /// </summary> public InteractionDelegate OnInteractionPickUp; /// <summary> /// Called when a paused Interaction has been resumed /// </summary> public InteractionDelegate OnInteractionResume; /// <summary> /// Called when an Interaction has been stopped /// </summary> public InteractionDelegate OnInteractionStop; /// <summary> /// Called when an interaction event occurs. /// </summary> public InteractionEventDelegate OnInteractionEvent; /// <summary> /// Gets the RaycastHit from trigger seeking. /// </summary> /// <value>The hit.</value> public RaycastHit raycastHit; #endregion Main Interface [Space(10)] [Tooltip("Reference to the FBBIK component.")] [SerializeField] FullBodyBipedIK fullBody; // Reference to the FBBIK component. /// <summary> /// Handles looking at the interactions. /// </summary> [Tooltip("Handles looking at the interactions.")] public InteractionLookAt lookAt = new InteractionLookAt(); // The array of Interaction Effectors private InteractionEffector[] interactionEffectors = new InteractionEffector[9] { new InteractionEffector(FullBodyBipedEffector.Body), new InteractionEffector(FullBodyBipedEffector.LeftFoot), new InteractionEffector(FullBodyBipedEffector.LeftHand), new InteractionEffector(FullBodyBipedEffector.LeftShoulder), new InteractionEffector(FullBodyBipedEffector.LeftThigh), new InteractionEffector(FullBodyBipedEffector.RightFoot), new InteractionEffector(FullBodyBipedEffector.RightHand), new InteractionEffector(FullBodyBipedEffector.RightShoulder), new InteractionEffector(FullBodyBipedEffector.RightThigh) }; private bool initiated; private Collider lastCollider, c; // Initiate protected virtual void Start() { if (fullBody == null) fullBody = GetComponent<FullBodyBipedIK>(); if (fullBody == null) { Warning.Log("InteractionSystem can not find a FullBodyBipedIK component", transform); return; } // Add to the FBBIK OnPostUpdate delegate to get a call when it has finished updating fullBody.solver.OnPreUpdate += OnPreFBBIK; fullBody.solver.OnPostUpdate += OnPostFBBIK; OnInteractionStart += LookAtInteraction; foreach (InteractionEffector e in interactionEffectors) e.Initiate(this, fullBody.solver); triggersInRange = new List<InteractionTrigger>(); c = GetComponent<Collider>(); UpdateTriggerEventBroadcasting(); initiated = true; } // Called by the delegate private void LookAtInteraction(FullBodyBipedEffector effector, InteractionObject interactionObject) { lookAt.Look(interactionObject.lookAtTarget, Time.time + (interactionObject.length * 0.5f)); } public void OnTriggerEnter(Collider c) { if (fullBody == null) return; var trigger = c.GetComponent<InteractionTrigger>(); if (inContact.Contains(trigger)) return; inContact.Add(trigger); } public void OnTriggerExit(Collider c) { if (fullBody == null) return; var trigger = c.GetComponent<InteractionTrigger>(); inContact.Remove(trigger); } // Is the InteractionObject trigger in range of any effectors? If the trigger collider is bigger than any effector ranges, then the object in contact is still unreachable. private bool ContactIsInRange(int index, out int bestRangeIndex) { bestRangeIndex = -1; if (!IsValid(true)) return false; if (index < 0 || index >= inContact.Count) { Warning.Log("Index out of range.", transform); return false; } if (inContact[index] == null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", transform); return false; } bestRangeIndex = inContact[index].GetBestRangeIndex(transform, camera, raycastHit); if (bestRangeIndex == -1) return false; return true; } // Using this to assign some default values in Editor void OnDrawGizmosSelected() { if (Application.isPlaying) return; if (fullBody == null) fullBody = GetComponent<FullBodyBipedIK>(); if (collider == null) collider = GetComponent<Collider>(); } void Update() { if (fullBody == null) return; UpdateTriggerEventBroadcasting(); Raycasting(); // Finding the triggers in contact and in range triggersInRange.Clear(); bestRangeIndexes.Clear(); for (int i = 0; i < inContact.Count; i++) { int bestRangeIndex = -1; if (inContact[i] != null && ContactIsInRange(i, out bestRangeIndex)) { triggersInRange.Add(inContact[i]); bestRangeIndexes.Add(bestRangeIndex); } } // Update LookAt lookAt.Update(); } // Finds triggers that need camera position and rotation private void Raycasting() { if (camRaycastLayers == -1) return; if (camera == null) return; Physics.Raycast(camera.position, camera.forward, out raycastHit, camRaycastDistance, camRaycastLayers); } // Update collider and TriggerEventBroadcaster private void UpdateTriggerEventBroadcasting() { if (collider == null) collider = c; if (collider != null && collider != c) { if (collider.GetComponent<TriggerEventBroadcaster>() == null) { var t = collider.gameObject.AddComponent<TriggerEventBroadcaster>(); t.target = gameObject; } if (lastCollider != null && lastCollider != c && lastCollider != collider) { var t = lastCollider.GetComponent<TriggerEventBroadcaster>(); if (t != null) Destroy(t); } } lastCollider = collider; } // Update the interaction void LateUpdate() { if (fullBody == null) return; for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].Update(transform, fullBody.solver, speed); // Interpolate to default pull, reach values for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].ResetToDefaults(fullBody.solver, resetToDefaultsSpeed * speed); } // Used for using LookAtIK to rotate the spine private void OnPreFBBIK() { if (!enabled) return; if (fullBody == null) return; lookAt.SolveSpine(); } // Used for rotating the hands after FBBIK has finished private void OnPostFBBIK() { if (!enabled) return; if (fullBody == null) return; for (int i = 0; i < interactionEffectors.Length; i++) interactionEffectors[i].OnPostFBBIK(fullBody.solver); // Update LookAtIK head lookAt.SolveHead(); } // Remove the delegates void OnDestroy() { if (fullBody == null) return; fullBody.solver.OnPreUpdate -= OnPreFBBIK; fullBody.solver.OnPostUpdate -= OnPostFBBIK; OnInteractionStart -= LookAtInteraction; } // Is this InteractionSystem valid and initiated private bool IsValid(bool log) { if (fullBody == null) { if (log) Warning.Log("FBBIK is null. Will not update the InteractionSystem", transform); return false; } if (!initiated) { if (log) Warning.Log("The InteractionSystem has not been initiated yet.", transform); return false; } return true; } // Is the index of triggersInRange valid? private bool TriggerIndexIsValid(int index) { if (index < 0 || index >= triggersInRange.Count) { Warning.Log("Index out of range.", transform); return false; } if (triggersInRange[index] == null) { Warning.Log("The InteractionTrigger in the list 'inContact' has been destroyed", transform); return false; } return true; } // Open the User Manual URL [ContextMenu("User Manual")] private void OpenUserManual() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/page10.html"); } // Open the Script Reference URL [ContextMenu("Scrpt Reference")] private void OpenScriptReference() { Application.OpenURL("http://www.root-motion.com/finalikdox/html/class_root_motion_1_1_final_i_k_1_1_interaction_system.html"); } } }
{ "content_hash": "9ca739f21bcc8ff600f1c3a2516cab57", "timestamp": "", "source": "github", "line_count": 658, "max_line_length": 174, "avg_line_length": 31.082066869300913, "alnum_prop": 0.6854097398787404, "repo_name": "mbottone/uga_hacks_2015", "id": "32f1171f35c255eb4e30ff1edadef1d453b4bcb0", "size": "20454", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "UGA Hacks 2015/Assets/Plugins/RootMotion/FinalIK/InteractionSystem/InteractionSystem.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "1593401" }, { "name": "GLSL", "bytes": "345719" } ], "symlink_target": "" }
package net.sourceforge.schemaspy.model; import java.sql.DatabaseMetaData; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; import java.util.logging.Logger; import java.util.regex.Pattern; import net.sourceforge.schemaspy.Config; import net.sourceforge.schemaspy.model.xml.ForeignKeyMeta; import net.sourceforge.schemaspy.model.xml.TableColumnMeta; import net.sourceforge.schemaspy.model.xml.TableMeta; import net.sourceforge.schemaspy.util.CaseInsensitiveMap; /** * A <code>Table</code> is one of the basic building blocks of SchemaSpy * that knows everything about the database table's metadata. * * @author John Currier */ public class Table implements Comparable<Table> { private final String schema; private final String name; protected final CaseInsensitiveMap<TableColumn> columns = new CaseInsensitiveMap<TableColumn>(); private final List<TableColumn> primaryKeys = new ArrayList<TableColumn>(); private final CaseInsensitiveMap<ForeignKeyConstraint> foreignKeys = new CaseInsensitiveMap<ForeignKeyConstraint>(); private final CaseInsensitiveMap<TableIndex> indexes = new CaseInsensitiveMap<TableIndex>(); private Object id; private final Map<String, String> checkConstraints = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER); private Long numRows; protected final Database db; protected final Properties properties; private String comments; private int maxChildren; private int maxParents; private final static Logger logger = Logger.getLogger(Table.class.getName()); /** * Construct a table that knows everything about the database table's metadata * * @param db * @param schema * @param name * @param comments * @param properties * @param excludeIndirectColumns * @param excludeColumns * @throws SQLException */ public Table(Database db, String schema, String name, String comments, Properties properties, Pattern excludeIndirectColumns, Pattern excludeColumns) throws SQLException { this.schema = schema; this.name = name; this.db = db; this.properties = properties; logger.fine("Creating " + getClass().getSimpleName().toLowerCase() + " " + schema == null ? name : (schema + '.' + name)); setComments(comments); initColumns(excludeIndirectColumns, excludeColumns); initIndexes(); initPrimaryKeys(db.getMetaData()); } /** * "Connect" all of this table's foreign keys to their referenced primary keys * (and, in some cases, do the reverse as well). * * @param tables * @param excludeIndirectColumns * @param excludeColumns * @throws SQLException */ public void connectForeignKeys(Map<String, Table> tables, Pattern excludeIndirectColumns, Pattern excludeColumns) throws SQLException { ResultSet rs = null; try { rs = db.getMetaData().getImportedKeys(null, getSchema(), getName()); while (rs.next()) { addForeignKey(rs.getString("FK_NAME"), rs.getString("FKCOLUMN_NAME"), rs.getString("PKTABLE_SCHEM"), rs.getString("PKTABLE_NAME"), rs.getString("PKCOLUMN_NAME"), rs.getInt("UPDATE_RULE"), rs.getInt("DELETE_RULE"), tables, excludeIndirectColumns, excludeColumns); } } finally { if (rs != null) rs.close(); } // also try to find all of the 'remote' tables in other schemas that // point to our primary keys (not necessary in the normal case // as we infer this from the opposite direction) if (getSchema() != null) { try { rs = db.getMetaData().getExportedKeys(null, getSchema(), getName()); while (rs.next()) { String otherSchema = rs.getString("FKTABLE_SCHEM"); if (!getSchema().equals(otherSchema)) db.addRemoteTable(otherSchema, rs.getString("FKTABLE_NAME"), getSchema(), properties, excludeIndirectColumns, excludeColumns); } } finally { if (rs != null) rs.close(); } } } /** * Get the foreign keys associated with this table * * @return */ public Collection<ForeignKeyConstraint> getForeignKeys() { return Collections.unmodifiableCollection(foreignKeys.values()); } /** * Add a check constraint to the table * (no real details, just name and textual representation) * * @param constraintName * @param text */ public void addCheckConstraint(String constraintName, String text) { checkConstraints.put(constraintName, text); } /** * @param rs ResultSet from {@link DatabaseMetaData#getImportedKeys(String, String, String)} * rs.getString("FK_NAME"); * rs.getString("FKCOLUMN_NAME"); * rs.getString("PKTABLE_SCHEM"); * rs.getString("PKTABLE_NAME"); * rs.getString("PKCOLUMN_NAME"); * @param tables Map * @param db * @throws SQLException */ protected void addForeignKey(String fkName, String fkColName, String pkTableSchema, String pkTableName, String pkColName, int updateRule, int deleteRule, Map<String, Table> tables, Pattern excludeIndirectColumns, Pattern excludeColumns) throws SQLException { if (fkName == null) return; ForeignKeyConstraint foreignKey = foreignKeys.get(fkName); if (foreignKey == null) { foreignKey = new ForeignKeyConstraint(this, fkName, updateRule, deleteRule); foreignKeys.put(fkName, foreignKey); } TableColumn childColumn = getColumn(fkColName); if (childColumn != null) { foreignKey.addChildColumn(childColumn); Table parentTable = tables.get(pkTableName); String parentSchema = pkTableSchema; String baseSchema = Config.getInstance().getSchema(); // if named table doesn't exist in this schema // or exists here but really referencing same named table in another schema if (parentTable == null || (baseSchema != null && parentSchema != null && !baseSchema.equals(parentSchema))) { parentTable = db.addRemoteTable(parentSchema, pkTableName, baseSchema, properties, excludeIndirectColumns, excludeColumns); } if (parentTable != null) { TableColumn parentColumn = parentTable.getColumn(pkColName); if (parentColumn != null) { foreignKey.addParentColumn(parentColumn); childColumn.addParent(parentColumn, foreignKey); parentColumn.addChild(childColumn, foreignKey); } else { logger.warning("Couldn't add FK '" + foreignKey.getName() + "' to table '" + this + "' - Column '" + pkColName + "' doesn't exist in table '" + parentTable + "'"); } } else { logger.warning("Couldn't add FK '" + foreignKey.getName() + "' to table '" + this + "' - Unknown Referenced Table '" + pkTableName + "'"); } } else { logger.warning("Couldn't add FK '" + foreignKey.getName() + "' to table '" + this + "' - Column '" + fkColName + "' doesn't exist"); } } /** * @param meta * @throws SQLException */ private void initPrimaryKeys(DatabaseMetaData meta) throws SQLException { if (properties == null) return; ResultSet rs = null; try { rs = meta.getPrimaryKeys(null, getSchema(), getName()); while (rs.next()) setPrimaryColumn(rs); } finally { if (rs != null) rs.close(); } } /** * @param rs * @throws SQLException */ private void setPrimaryColumn(ResultSet rs) throws SQLException { String pkName = rs.getString("PK_NAME"); if (pkName == null) return; TableIndex index = getIndex(pkName); if (index != null) { index.setIsPrimaryKey(true); } String columnName = rs.getString("COLUMN_NAME"); setPrimaryColumn(getColumn(columnName)); } /** * @param primaryColumn */ void setPrimaryColumn(TableColumn primaryColumn) { primaryKeys.add(primaryColumn); } /** * @param excludeIndirectColumns * @param excludeColumns * @throws SQLException */ private void initColumns(Pattern excludeIndirectColumns, Pattern excludeColumns) throws SQLException { ResultSet rs = null; synchronized (Table.class) { try { rs = db.getMetaData().getColumns(null, getSchema(), getName(), "%"); while (rs.next()) addColumn(rs, excludeIndirectColumns, excludeColumns); } catch (SQLException exc) { class ColumnInitializationFailure extends SQLException { private static final long serialVersionUID = 1L; public ColumnInitializationFailure(SQLException failure) { super("Failed to collect column details for " + (isView() ? "view" : "table") + " '" + getName() + "' in schema '" + getSchema() + "'"); initCause(failure); } } throw new ColumnInitializationFailure(exc); } finally { if (rs != null) rs.close(); } } if (!isView() && !isRemote()) initColumnAutoUpdate(false); } /** * @param forceQuotes * @throws SQLException */ private void initColumnAutoUpdate(boolean forceQuotes) throws SQLException { ResultSet rs = null; PreparedStatement stmt = null; // we've got to get a result set with all the columns in it // so we can ask if the columns are auto updated // Ugh!!! Should have been in DatabaseMetaData instead!!! StringBuilder sql = new StringBuilder("select * from "); if (getSchema() != null) { sql.append(getSchema()); sql.append('.'); } if (forceQuotes) { String quote = db.getMetaData().getIdentifierQuoteString().trim(); sql.append(quote + getName() + quote); } else sql.append(db.getQuotedIdentifier(getName())); sql.append(" where 0 = 1"); try { stmt = db.getMetaData().getConnection().prepareStatement(sql.toString()); rs = stmt.executeQuery(); ResultSetMetaData rsMeta = rs.getMetaData(); for (int i = rsMeta.getColumnCount(); i > 0; --i) { TableColumn column = getColumn(rsMeta.getColumnName(i)); column.setIsAutoUpdated(rsMeta.isAutoIncrement(i)); } } catch (SQLException exc) { if (forceQuotes) { // don't completely choke just because we couldn't do this.... logger.warning("Failed to determine auto increment status: " + exc); logger.warning("SQL: " + sql.toString()); } else { initColumnAutoUpdate(true); } } finally { if (rs != null) rs.close(); if (stmt != null) stmt.close(); } } /** * @param rs - from {@link DatabaseMetaData#getColumns(String, String, String, String)} * @param excludeIndirectColumns * @param excludeColumns * @throws SQLException */ protected void addColumn(ResultSet rs, Pattern excludeIndirectColumns, Pattern excludeColumns) throws SQLException { String columnName = rs.getString("COLUMN_NAME"); if (columnName == null) return; if (getColumn(columnName) == null) { TableColumn column = new TableColumn(this, rs, excludeIndirectColumns, excludeColumns); columns.put(column.getName(), column); } } /** * Add a column that's defined in xml metadata. * Assumes that a column named colMeta.getName() doesn't already exist in <code>columns</code>. * @param colMeta * @return */ protected TableColumn addColumn(TableColumnMeta colMeta) { TableColumn column = new TableColumn(this, colMeta); columns.put(column.getName(), column); return column; } /** * Initialize index information * * @throws SQLException */ private void initIndexes() throws SQLException { if (isView() || isRemote()) return; // first try to initialize using the index query spec'd in the .properties // do this first because some DB's (e.g. Oracle) do 'bad' things with getIndexInfo() // (they try to do a DDL analyze command that has some bad side-effects) if (initIndexes(properties.getProperty("selectIndexesSql"))) return; // couldn't, so try the old fashioned approach ResultSet rs = null; try { rs = db.getMetaData().getIndexInfo(null, getSchema(), getName(), false, true); while (rs.next()) { if (rs.getShort("TYPE") != DatabaseMetaData.tableIndexStatistic) addIndex(rs); } } catch (SQLException exc) { logger.warning("Unable to extract index info for table '" + getName() + "' in schema '" + getSchema() + "': " + exc); } finally { if (rs != null) rs.close(); } } /** * Try to initialize index information based on the specified SQL * * @return boolean <code>true</code> if it worked, otherwise <code>false</code> */ private boolean initIndexes(String selectIndexesSql) { if (selectIndexesSql == null) return false; PreparedStatement stmt = null; ResultSet rs = null; try { stmt = db.prepareStatement(selectIndexesSql, getName()); rs = stmt.executeQuery(); while (rs.next()) { if (rs.getShort("TYPE") != DatabaseMetaData.tableIndexStatistic) addIndex(rs); } } catch (SQLException sqlException) { logger.warning("Failed to query index information with SQL: " + selectIndexesSql); logger.warning(sqlException.toString()); return false; } finally { if (rs != null) { try { rs.close(); } catch (Exception exc) { exc.printStackTrace(); } } if (stmt != null) { try { stmt.close(); } catch (Exception exc) { exc.printStackTrace(); } } } return true; } /** * @param indexName * @return */ public TableIndex getIndex(String indexName) { return indexes.get(indexName); } /** * @param rs * @throws SQLException */ private void addIndex(ResultSet rs) throws SQLException { String indexName = rs.getString("INDEX_NAME"); if (indexName == null) return; TableIndex index = getIndex(indexName); if (index == null) { index = new TableIndex(rs); indexes.put(index.getName(), index); } index.addColumn(getColumn(rs.getString("COLUMN_NAME")), rs.getString("ASC_OR_DESC")); } /** * Returns the schema that the table belongs to * * @return */ public String getSchema() { return schema; } /** * Returns the name of the table * * @return */ public String getName() { return name; } /** * Object IDs are useful for tables such as DB/2 that many times * give error messages based on object ID and not name * * @param id */ public void setId(Object id) { this.id = id; } /** * @see #setId(Object) * * @return */ public Object getId() { return id; } /** * Returns the check constraints associated with this table * * @return */ public Map<String, String> getCheckConstraints() { return checkConstraints; } /** * Returns the indexes that are applied to this table * * @return */ public Set<TableIndex> getIndexes() { return new HashSet<TableIndex>(indexes.values()); } /** * Returns a collection of table columns that have been identified as "primary" * * @return */ public List<TableColumn> getPrimaryColumns() { return primaryKeys; } /** * @return Comments associated with this table, or <code>null</code> if none. */ public String getComments() { return comments; } /** * Sets the comments that are associated with this table * * @param comments */ public void setComments(String comments) { String cmts = (comments == null || comments.trim().length() == 0) ? null : comments.trim(); // MySQL's InnoDB engine does some insane crap of storing erroneous details in // with table comments. Here I attempt to strip the "crap" out without impacting // other databases. Ideally this should happen in selectColumnCommentsSql (and // therefore isolate it to MySQL), but it's a bit too complex to do cleanly. if (cmts != null) { int crapIndex = cmts.indexOf("; InnoDB free: "); if (crapIndex == -1) crapIndex = cmts.startsWith("InnoDB free: ") ? 0 : -1; if (crapIndex != -1) { cmts = cmts.substring(0, crapIndex).trim(); cmts = cmts.length() == 0 ? null : cmts; } } this.comments = cmts; } /** * Returns the {@link TableColumn} with the given name, or <code>null</code> * if it doesn't exist * * @param columnName * @return */ public TableColumn getColumn(String columnName) { return columns.get(columnName); } /** * Returns <code>List</code> of <code>TableColumn</code>s in ascending column number order. * * @return */ public List<TableColumn> getColumns() { Set<TableColumn> sorted = new TreeSet<TableColumn>(new ByColumnIdComparator()); sorted.addAll(columns.values()); return new ArrayList<TableColumn>(sorted); } /** * Returns <code>true</code> if this table references no other tables..<p/> * Used in dependency analysis. * @return */ public boolean isRoot() { for (TableColumn column : columns.values()) { if (column.isForeignKey()) { return false; } } return true; } /** * Returns <code>true</code> if this table is referenced by no other tables.<p/> * Used in dependency analysis. * @return */ public boolean isLeaf() { for (TableColumn column : columns.values()) { if (!column.getChildren().isEmpty()) { return false; } } return true; } /** * Returns the maximum number of parents that this table has had before * any had been removed during dependency analysis * * @return */ public int getMaxParents() { return maxParents; } /** * Notification that's called to indicate that a parent has been added to * this table */ public void addedParent() { maxParents++; } /** * "Unlink" all of the parent tables from this table */ public void unlinkParents() { for (TableColumn column : columns.values()) { column.unlinkParents(); } } /** * Returns the maximum number of children that this table has had before * any had been removed during dependency analysis * * @return */ public int getMaxChildren() { return maxChildren; } /** * Notification that's called to indicate that a child has been added to * this table */ public void addedChild() { maxChildren++; } /** * "Unlink" all of the child tables from this table */ public void unlinkChildren() { for (TableColumn column : columns.values()) { column.unlinkChildren(); } } /** * Remove a single self referencing constraint if one exists. * * @return */ public ForeignKeyConstraint removeSelfReferencingConstraint() { return remove(getSelfReferencingConstraint()); } /** * Remove the specified {@link ForeignKeyConstraint} from this table.<p> * * This is a more drastic removal solution that was proposed by Remke Rutgers * * @param constraint */ private ForeignKeyConstraint remove(ForeignKeyConstraint constraint) { if (constraint != null) { for (int i = 0; i < constraint.getChildColumns().size(); i++) { TableColumn childColumn = constraint.getChildColumns().get(i); TableColumn parentColumn = constraint.getParentColumns().get(i); childColumn.removeParent(parentColumn); parentColumn.removeChild(childColumn); } } return constraint; } /** * Return a self referencing constraint if one exists * * @return */ private ForeignKeyConstraint getSelfReferencingConstraint() { for (TableColumn column : columns.values()) { for (TableColumn parentColumn : column.getParents()) { if (compareTo(parentColumn.getTable()) == 0) { return column.getParentConstraint(parentColumn); } } } return null; } /** * Remove any non-real foreign keys * * @return */ public List<ForeignKeyConstraint> removeNonRealForeignKeys() { List<ForeignKeyConstraint> nonReals = new ArrayList<ForeignKeyConstraint>(); for (TableColumn column : columns.values()) { for (TableColumn parentColumn : column.getParents()) { ForeignKeyConstraint constraint = column.getParentConstraint(parentColumn); if (constraint != null && !constraint.isReal()) { nonReals.add(constraint); } } } // remove constraints outside of above loop to prevent // concurrent modification exceptions while iterating for (ForeignKeyConstraint constraint : nonReals) { remove(constraint); } return nonReals; } /** * Returns the number of tables that reference this table * * @return */ public int getNumChildren() { int numChildren = 0; for (TableColumn column : columns.values()) { numChildren += column.getChildren().size(); } return numChildren; } /** * Returns the number of non-implied children * @return */ public int getNumNonImpliedChildren() { int numChildren = 0; for (TableColumn column : columns.values()) { for (TableColumn childColumn : column.getChildren()) { if (!column.getChildConstraint(childColumn).isImplied()) ++numChildren; } } return numChildren; } /** * Returns the number of tables that are referenced by this table * * @return */ public int getNumParents() { int numParents = 0; for (TableColumn column : columns.values()) { numParents += column.getParents().size(); } return numParents; } /** * Returns the number of non-implied parents * * @return */ public int getNumNonImpliedParents() { int numParents = 0; for (TableColumn column : columns.values()) { for (TableColumn parentColumn : column.getParents()) { if (!column.getParentConstraint(parentColumn).isImplied()) ++numParents; } } return numParents; } /** * Remove one foreign key constraint. * * <p/>Used during dependency analysis phase. * * @return */ public ForeignKeyConstraint removeAForeignKeyConstraint() { @SuppressWarnings("hiding") final List<TableColumn> columns = getColumns(); int numParents = 0; int numChildren = 0; // remove either a child or parent, choosing which based on which has the // least number of foreign key associations (when either gets to zero then // the table can be pruned) for (TableColumn column : columns) { numParents += column.getParents().size(); numChildren += column.getChildren().size(); } for (TableColumn column : columns) { ForeignKeyConstraint constraint; if (numParents <= numChildren) constraint = column.removeAParentFKConstraint(); else constraint = column.removeAChildFKConstraint(); if (constraint != null) return constraint; } return null; } /** * Returns <code>true</code> if this is a view, <code>false</code> otherwise * * @return */ public boolean isView() { return false; } /** * Returns <code>true</code> if this table is remote (in another schema), <code>false</code> otherwise * @return */ public boolean isRemote() { return false; } /** * If this is a view it returns the SQL used to create the view (if it's available). * <code>null</code> if it's not a view or the SQL isn't available. * @return * @see #isView() */ public String getViewSql() { return null; } /** * Returns the number of rows contained in this table, or -1 if unable to determine * the number of rows. * * @return */ public long getNumRows() { if (numRows == null) { numRows = Config.getInstance().isNumRowsEnabled() ? fetchNumRows() : -1; } return numRows; } /** * Explicitly set the number of rows in this table * * @param numRows */ public void setNumRows(long numRows) { this.numRows = numRows; } /** * Fetch the number of rows contained in this table. * * returns -1 if unable to successfully fetch the row count * * @param db Database * @return long * @throws SQLException */ protected long fetchNumRows() { if (properties == null) // some "meta" tables don't have associated properties return 0; SQLException originalFailure = null; String sql = properties.getProperty("selectRowCountSql"); if (sql != null) { PreparedStatement stmt = null; ResultSet rs = null; try { stmt = db.prepareStatement(sql, getName()); rs = stmt.executeQuery(); while (rs.next()) { return rs.getLong("row_count"); } } catch (SQLException sqlException) { // don't die just because this failed originalFailure = sqlException; } finally { if (rs != null) { try { rs.close(); } catch (SQLException exc) {} } if (stmt != null) { try { stmt.close(); } catch (SQLException exc) {} } } } // if we get here then we either didn't have custom SQL or it didn't work try { // '*' should work best for the majority of cases return fetchNumRows("count(*)", false); } catch (SQLException try2Exception) { try { // except nested tables...try using '1' instead return fetchNumRows("count(1)", false); } catch (SQLException try3Exception) { logger.warning("Unable to extract the number of rows for table " + getName() + ", using '-1'"); if (originalFailure != null) logger.warning(originalFailure.toString()); logger.warning(try2Exception.toString()); logger.warning(try3Exception.toString()); return -1; } } } protected long fetchNumRows(String clause, boolean forceQuotes) throws SQLException { PreparedStatement stmt = null; ResultSet rs = null; StringBuilder sql = new StringBuilder("select "); sql.append(clause); sql.append(" from "); if (getSchema() != null) { sql.append(getSchema()); sql.append('.'); } if (forceQuotes) { String quote = db.getMetaData().getIdentifierQuoteString().trim(); sql.append(quote + getName() + quote); } else sql.append(db.getQuotedIdentifier(getName())); try { stmt = db.getConnection().prepareStatement(sql.toString()); rs = stmt.executeQuery(); while (rs.next()) { return rs.getLong(1); } return -1; } catch (SQLException exc) { if (forceQuotes) // we tried with and w/o quotes...fail this attempt throw exc; return fetchNumRows(clause, true); } finally { if (rs != null) rs.close(); if (stmt != null) stmt.close(); } } /** * Update the table with the specified XML-derived metadata * * @param tableMeta */ public void update(TableMeta tableMeta) { String newComments = tableMeta.getComments(); if (newComments != null) { comments = newComments; } for (TableColumnMeta colMeta : tableMeta.getColumns()) { TableColumn col = getColumn(colMeta.getName()); if (col == null) { if (tableMeta.getRemoteSchema() == null) { logger.warning("Unrecognized column '" + colMeta.getName() + "' for table '" + getName() + '\''); continue; } col = addColumn(colMeta); } // update the column with the changes col.update(colMeta); } } /** * Same as {@link #connectForeignKeys(Map, Database, Properties, Pattern, Pattern)}, * but uses XML-based metadata * * @param tableMeta * @param tables * @param remoteTables */ public void connect(TableMeta tableMeta, Map<String, Table> tables, Map<String, Table> remoteTables) { for (TableColumnMeta colMeta : tableMeta.getColumns()) { TableColumn col = getColumn(colMeta.getName()); // go thru the new foreign key defs and associate them with our columns for (ForeignKeyMeta fk : colMeta.getForeignKeys()) { Table parent = fk.getRemoteSchema() == null ? tables.get(fk.getTableName()) : remoteTables.get(fk.getRemoteSchema() + '.' + fk.getTableName()); if (parent != null) { TableColumn parentColumn = parent.getColumn(fk.getColumnName()); if (parentColumn == null) { logger.warning(parent.getName() + '.' + fk.getColumnName() + " doesn't exist"); } else { /** * Merely instantiating a foreign key constraint ties it * into its parent and child columns (& therefore their tables) */ new ForeignKeyConstraint(parentColumn, col) { @Override public String getName() { return "Defined in XML"; } }; } } else { logger.warning("Undefined table '" + fk.getTableName() + "' referenced by '" + getName() + '.' + col.getName() + '\''); } } } } @Override public String toString() { return getName(); } /** * Returns <code>true</code> if this table has no relationships * * @param withImpliedRelationships boolean * @return boolean */ public boolean isOrphan(boolean withImpliedRelationships) { if (withImpliedRelationships) return getMaxParents() == 0 && getMaxChildren() == 0; for (TableColumn column : columns.values()) { for (TableColumn parentColumn : column.getParents()) { if (!column.getParentConstraint(parentColumn).isImplied()) return false; } for (TableColumn childColumn : column.getChildren()) { if (!column.getChildConstraint(childColumn).isImplied()) return false; } } return true; } /** * Compare this table to another table. * Results are based on 1: identity, 2: table name, 3: schema name<p/> * * This implementation was put in place to deal with analyzing multiple * schemas that contain identically named tables. * * @see {@link Comparable#compareTo(Object)} */ public int compareTo(Table other) { if (other == this) // fast way out return 0; int rc = getName().compareToIgnoreCase(other.getName()); if (rc == 0) { // should only get here if we're dealing with cross-schema references (rare) String ours = getSchema(); String theirs = other.getSchema(); if (ours != null && theirs != null) rc = ours.compareToIgnoreCase(theirs); else if (ours == null) rc = -1; else rc = 1; } return rc; } /** * Implementation of {@link Comparator} that sorts {@link TableColumn}s * by {@link TableColumn#getId() ID} (ignored if <code>null</code>) * followed by {@link TableColumn#getName() Name}. */ private static class ByColumnIdComparator implements Comparator<TableColumn> { public int compare(TableColumn column1, TableColumn column2) { if (column1.getId() == null || column2.getId() == null) return column1.getName().compareToIgnoreCase(column2.getName()); if (column1.getId() instanceof Number) return ((Number)column1.getId()).intValue() - ((Number)column2.getId()).intValue(); return column1.getId().toString().compareToIgnoreCase(column2.getId().toString()); } } }
{ "content_hash": "b5b35af4c5cfb3c5445502d12a3d056d", "timestamp": "", "source": "github", "line_count": 1136, "max_line_length": 175, "avg_line_length": 32.98943661971831, "alnum_prop": 0.5387447966698687, "repo_name": "wakaleo/maven-schemaspy-plugin", "id": "66aebb14e6ed76c5dae6d8a7b95715757d7e05c8", "size": "38392", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/net/sourceforge/schemaspy/model/Table.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "8669" }, { "name": "Java", "bytes": "596167" }, { "name": "JavaScript", "bytes": "2697" } ], "symlink_target": "" }
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.security.prod.facerepo.add response. * * @author auto create * @since 1.0, 2016-06-30 08:29:39 */ public class AlipaySecurityProdFacerepoAddResponse extends AlipayResponse { private static final long serialVersionUID = 5581587686832315251L; /** * 扩展信息 */ @ApiField("ext_info") private String extInfo; /** * 对此次插入人脸库分组的人脸id标识 */ @ApiField("face_id") private String faceId; public void setExtInfo(String extInfo) { this.extInfo = extInfo; } public String getExtInfo( ) { return this.extInfo; } public void setFaceId(String faceId) { this.faceId = faceId; } public String getFaceId( ) { return this.faceId; } }
{ "content_hash": "c6b06658f3b53bf22152f65e45450e90", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 18.627906976744185, "alnum_prop": 0.7153558052434457, "repo_name": "wendal/alipay-sdk", "id": "a70c94a39a035965d45af4a9937224f49a76c3a9", "size": "839", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/alipay/api/response/AlipaySecurityProdFacerepoAddResponse.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5737833" }, { "name": "Python", "bytes": "368" } ], "symlink_target": "" }
import optparse import os import sys import time # The tables maintained by this script maintained_tables = [ {'tablename' : 'bvermeulen_sdx', 'id_column' : 'id'}, {'tablename' : 'msb_metrics', 'id_column' : 'id'}, {'tablename' : 'nriganikytopo2', 'id_column' : 'id'}, {'tablename' : 'starlight_metrics', 'id_column' : 'id'}, {'tablename' : 'nmetrics_cpu', 'id_column' : 'oml_tuple_id'}, {'tablename' : 'nmetrics_memory', 'id_column' : 'oml_tuple_id'}, {'tablename' : 'nmetrics_network', 'id_column' : 'oml_tuple_id'} ] class TableMaintainer(): def __init__(self): self._opts = self.parse_options() def add_parser_options(self, parser): parser.add_option("--dbname", help="Name of database", default="gec22") parser.add_option("--dbhost", help="host of database", default='localhost') parser.add_option("--dbuser", help="Database user", default="oml2") parser.add_option("--dbpass", help="Database password", default="0mlisg00d4u") parser.add_option("--dbport", help="Database port", default="5432") parser.add_option("--outfile", help="Database script filename") parser.add_option("--dumpdir", help="Database dump directory") parser.add_option('--frequency', help="How often to gather metrics in seconds", default="3600") parser.add_option("--window", help="Length of window of data maintained in tables", default="86400") # Check that all required parser arguments are provided def check_options(self, opts): required_missing_fields = [] if opts.outfile == None: required_missing_fields.append('outfile') if opts.dumpdir == None: required_missing_fields.append('dumpdir') if len(required_missing_fields) > 0: raise Exception("Missing required arguments: " + " ".join(required_missing_fields)) # Parse command line options def parse_options(self): argv = sys.argv[1:] parser = optparse.OptionParser() self.add_parser_options(parser) [opts, args] = parser.parse_args(argv) self.check_options(opts) return opts def dump_database(self, tablename, timestamp): dumpfile = "%s-%s.sql" % (tablename, timestamp) dumpfile = os.path.join(self._opts.dumpdir, dumpfile) cmd = "PGPASSWORD=%s /usr/bin/pg_dump -U %s -h %s -t %s -f %s %s" cmd = cmd % (self._opts.dbpass, self._opts.dbuser, self._opts.dbhost, tablename, dumpfile, self._opts.dbname) print "Dump command: %s" % (cmd) os.system(cmd) def run(self): timestamp = int(time.time()) print "Running TableMaintainer at %d" % (timestamp) sql_file = open(self._opts.outfile, 'wb') # Start a transaction sql_file.write('begin transaction;\n') # Loop over all maintained tables for table in maintained_tables: tablename = table['tablename'] id_column = table['id_column'] # archive_tablename = "%s_ARCHIVE" % tablename window = int(self._opts.window) print "Backing up table %s" % (tablename) self.dump_database(tablename, timestamp) print "Maintaining table %s" % tablename # Make sure there is an empty archive table (copy of table) # create_stmt = "create table if not exists %s (like %s)" % (archive_tablename, tablename) # sql_file.write(create_stmt + ";\n"); # Insert a record into table history insert_stmt = "insert into table_history (timestamp, max_id, tablename) " +\ "values (%d, (select max(%s) from %s), '%s')" % \ (timestamp, id_column, tablename, tablename); insert_stmt = "insert into table_history (timestamp, max_id, tablename) " +\ "values (%d, (select max(%s) from %s), '%s')" % \ (timestamp, id_column, tablename, tablename); print "INSERT = %s" % insert_stmt sql_file.write(insert_stmt + ";\n"); # Copy all rows with ID more than 24 hours old from data table into archive table # copy_template = "insert into %s select * from %s where %s < " +\ # "(select max(max_id) from table_history where tablename = '%s' " + \ # "and timestamp = (select max(timestamp) from table_history " + \ # "where tablename = '%s' and timestamp < %d))" # copy_stmt = copy_template % \ # (archive_tablename, tablename, id_column, tablename, tablename, (timestamp-window)) # sql_file.write(copy_stmt + ";\n"); # Delete all rows with ID more than 24 hours old from data table delete_template = "delete from %s where %s < (select max(max_id) from table_history " + \ "where tablename = '%s' and timestamp = (select max(timestamp) " + \ "from table_history where tablename = '%s' and timestamp < %d))" delete_stmt = delete_template % \ (tablename, id_column, tablename, tablename, (timestamp-window)) sql_file.write(delete_stmt + ";\n"); # Commit transaction sql_file.write("commit;\n"); sql_file.close() # Invoke SQL file sql_cmd = "PGPASSWORD=%s psql -U %s -h %s %s -f %s" % \ (self._opts.dbpass, self._opts.dbuser, self._opts.dbhost, self._opts.dbname, self._opts.outfile) print "INVOKING CMD = %s" % sql_cmd os.system(sql_cmd) def main(): tbl_maint = TableMaintainer(); while True: tbl_maint.run() frequency = int(tbl_maint._opts.frequency) time.sleep(frequency) if __name__ == "__main__": sys.exit(main())
{ "content_hash": "d958bc11e0f1244c0c9fad0f8acb903a", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 102, "avg_line_length": 42.83571428571429, "alnum_prop": 0.5652826413206603, "repo_name": "GENI-NSF/geni-demoviz", "id": "83c6636c6021086eaad78fc426164834f8291e7b", "size": "7313", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "table_maintenance.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "318" }, { "name": "HTML", "bytes": "10257" }, { "name": "JavaScript", "bytes": "78902" }, { "name": "PHP", "bytes": "55271" }, { "name": "PLpgSQL", "bytes": "190" }, { "name": "Python", "bytes": "73205" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project version="4"> <component name="ChangeListManager"> <list default="true" id="0a964b48-62a1-4819-95ee-2ff15311acd0" name="Default" comment="" /> <ignored path="What's Cooking.iws" /> <ignored path=".idea/workspace.xml" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="TRACKING_ENABLED" value="true" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="LAST_RESOLUTION" value="IGNORE" /> </component> <component name="ChangesViewManager" flattened_view="true" show_ignored="false" /> <component name="CreatePatchCommitExecutor"> <option name="PATCH_PATH" value="" /> </component> <component name="DaemonCodeAnalyzer"> <disable_hints /> </component> <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" /> <component name="FavoritesManager"> <favorites_list name="What's Cooking" /> </component> <component name="FileEditorManager"> <leaf> <file leaf-file-name="get_data.py" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="711" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> </file> <file leaf-file-name="get_data_2.py" pinned="false" current-in-tab="true"> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.3846154" vertical-offset="263" max-vertical-offset="952"> <caret line="29" column="69" selection-start-line="29" selection-start-column="69" selection-end-line="29" selection-end-column="69" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> </file> <file leaf-file-name="bernoulli_nb.py" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> </file> <file leaf-file-name="linear_svc.py" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> </file> <file leaf-file-name="logistic_regression.py" pinned="false" current-in-tab="false"> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="250" max-vertical-offset="748"> <caret line="20" column="70" selection-start-line="20" selection-start-column="70" selection-end-line="20" selection-end-column="70" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> </file> </leaf> </component> <component name="IdeDocumentHistory"> <option name="CHANGED_PATHS"> <list> <option value="$PROJECT_DIR$/visualize_data.py" /> <option value="$PROJECT_DIR$/get_data.py" /> <option value="$PROJECT_DIR$/logistic_regression.py" /> <option value="$PROJECT_DIR$/bernoulli_nb.py" /> <option value="$PROJECT_DIR$/linear_svc.py" /> <option value="$PROJECT_DIR$/Python-Neural-Networks-API/__init__.py" /> <option value="$PROJECT_DIR$/test.py" /> <option value="$PROJECT_DIR$/Python-Neural-Networks-API/NeuralNetwork/Neuron.py" /> <option value="$PROJECT_DIR$/Python-Neural-Networks-API/main.py" /> <option value="$PROJECT_DIR$/get_data_2.py" /> </list> </option> </component> <component name="ProjectFrameBounds"> <option name="x" value="-8" /> <option name="y" value="-8" /> <option name="width" value="1382" /> <option name="height" value="784" /> </component> <component name="ProjectLevelVcsManager" settingsEditedManually="false"> <OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Remove" /> <OptionsSetting value="true" id="Checkout" /> <OptionsSetting value="true" id="Update" /> <OptionsSetting value="true" id="Status" /> <OptionsSetting value="true" id="Edit" /> <ConfirmationsSetting value="0" id="Add" /> <ConfirmationsSetting value="0" id="Remove" /> </component> <component name="ProjectView"> <navigator currentView="ProjectPane" proportions="" version="1"> <flattenPackages /> <showMembers /> <showModules /> <showLibraryContents /> <hideEmptyPackages /> <abbreviatePackageNames /> <autoscrollToSource /> <autoscrollFromSource /> <sortByType /> </navigator> <panes> <pane id="Scope" /> <pane id="ProjectPane"> <subPane> <PATH> <PATH_ELEMENT> <option name="myItemId" value="What's Cooking" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> </PATH> <PATH> <PATH_ELEMENT> <option name="myItemId" value="What's Cooking" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" /> </PATH_ELEMENT> <PATH_ELEMENT> <option name="myItemId" value="What's Cooking" /> <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" /> </PATH_ELEMENT> </PATH> </subPane> </pane> </panes> </component> <component name="PropertiesComponent"> <property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="recentsLimit" value="5" /> <property name="FullScreen" value="false" /> </component> <component name="PyConsoleOptionsProvider"> <option name="myPythonConsoleState"> <console-settings /> </option> </component> <component name="RunManager" selected="Python.main"> <configuration default="false" name="logistic_regression" type="PythonConfigurationType" factoryName="Python" temporary="true"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/logistic_regression.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <RunnerSettings RunnerId="PythonRunner" /> <ConfigurationWrapper RunnerId="PythonRunner" /> <method /> </configuration> <configuration default="false" name="test" type="PythonConfigurationType" factoryName="Python" temporary="true"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/test.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <RunnerSettings RunnerId="PythonRunner" /> <ConfigurationWrapper RunnerId="PythonRunner" /> <method /> </configuration> <configuration default="false" name="bernoulli_nb" type="PythonConfigurationType" factoryName="Python" temporary="true"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/bernoulli_nb.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <RunnerSettings RunnerId="PythonRunner" /> <ConfigurationWrapper RunnerId="PythonRunner" /> <method /> </configuration> <configuration default="false" name="linear_svc" type="PythonConfigurationType" factoryName="Python" temporary="true"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/linear_svc.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <RunnerSettings RunnerId="PythonRunner" /> <ConfigurationWrapper RunnerId="PythonRunner" /> <method /> </configuration> <configuration default="false" name="main" type="PythonConfigurationType" factoryName="Python" temporary="true"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Python-Neural-Networks-API" /> <option name="IS_MODULE_SDK" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Python-Neural-Networks-API/main.py" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <RunnerSettings RunnerId="PythonRunner" /> <ConfigurationWrapper RunnerId="PythonRunner" /> <method /> </configuration> <configuration default="true" type="PythonConfigurationType" factoryName="Python"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs> <env name="PYTHONUNBUFFERED" value="1" /> </envs> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="PARAMETERS" value="" /> <option name="SHOW_COMMAND_LINE" value="false" /> <method /> </configuration> <configuration default="true" type="tests" factoryName="Unittests"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs /> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="METHOD_NAME" value="" /> <option name="FOLDER_NAME" value="" /> <option name="TEST_TYPE" value="TEST_SCRIPT" /> <option name="PATTERN" value="" /> <option name="USE_PATTERN" value="false" /> <option name="PUREUNITTEST" value="true" /> <option name="PARAMS" value="" /> <option name="USE_PARAM" value="false" /> <method /> </configuration> <configuration default="true" type="tests" factoryName="py.test"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs /> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="METHOD_NAME" value="" /> <option name="FOLDER_NAME" value="" /> <option name="TEST_TYPE" value="TEST_SCRIPT" /> <option name="PATTERN" value="" /> <option name="USE_PATTERN" value="false" /> <option name="testToRun" value="" /> <option name="keywords" value="" /> <option name="params" value="" /> <option name="USE_PARAM" value="false" /> <option name="USE_KEYWORD" value="false" /> <method /> </configuration> <configuration default="true" type="tests" factoryName="Attests"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs /> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="METHOD_NAME" value="" /> <option name="FOLDER_NAME" value="" /> <option name="TEST_TYPE" value="TEST_SCRIPT" /> <option name="PATTERN" value="" /> <option name="USE_PATTERN" value="false" /> <method /> </configuration> <configuration default="true" type="tests" factoryName="Doctests"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs /> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="METHOD_NAME" value="" /> <option name="FOLDER_NAME" value="" /> <option name="TEST_TYPE" value="TEST_SCRIPT" /> <option name="PATTERN" value="" /> <option name="USE_PATTERN" value="false" /> <method /> </configuration> <configuration default="true" type="tests" factoryName="Nosetests"> <option name="INTERPRETER_OPTIONS" value="" /> <option name="PARENT_ENVS" value="true" /> <envs /> <option name="SDK_HOME" value="" /> <option name="WORKING_DIRECTORY" value="" /> <option name="IS_MODULE_SDK" value="false" /> <option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" /> <module name="What's Cooking" /> <option name="SCRIPT_NAME" value="" /> <option name="CLASS_NAME" value="" /> <option name="METHOD_NAME" value="" /> <option name="FOLDER_NAME" value="" /> <option name="TEST_TYPE" value="TEST_SCRIPT" /> <option name="PATTERN" value="" /> <option name="USE_PATTERN" value="false" /> <option name="PARAMS" value="" /> <option name="USE_PARAM" value="false" /> <method /> </configuration> <list size="5"> <item index="0" class="java.lang.String" itemvalue="Python.logistic_regression" /> <item index="1" class="java.lang.String" itemvalue="Python.test" /> <item index="2" class="java.lang.String" itemvalue="Python.bernoulli_nb" /> <item index="3" class="java.lang.String" itemvalue="Python.linear_svc" /> <item index="4" class="java.lang.String" itemvalue="Python.main" /> </list> <recent_temporary> <list size="5"> <item index="0" class="java.lang.String" itemvalue="Python.main" /> <item index="1" class="java.lang.String" itemvalue="Python.linear_svc" /> <item index="2" class="java.lang.String" itemvalue="Python.bernoulli_nb" /> <item index="3" class="java.lang.String" itemvalue="Python.logistic_regression" /> <item index="4" class="java.lang.String" itemvalue="Python.test" /> </list> </recent_temporary> </component> <component name="ShelveChangesManager" show_recycled="false" /> <component name="SvnConfiguration"> <configuration /> </component> <component name="TaskManager"> <task active="true" id="Default" summary="Default task"> <changelist id="0a964b48-62a1-4819-95ee-2ff15311acd0" name="Default" comment="" /> <created>1449723405507</created> <option name="number" value="Default" /> <updated>1449723405507</updated> </task> <servers /> </component> <component name="TodoView" selected-index="0"> <todo-panel id="selected-file"> <are-packages-shown value="false" /> <are-modules-shown value="false" /> <flatten-packages value="false" /> <is-autoscroll-to-source value="false" /> </todo-panel> <todo-panel id="all"> <are-packages-shown value="false" /> <are-modules-shown value="false" /> <flatten-packages value="false" /> <is-autoscroll-to-source value="false" /> </todo-panel> <todo-panel id="default-changelist"> <are-packages-shown value="false" /> <are-modules-shown value="false" /> <flatten-packages value="false" /> <is-autoscroll-to-source value="false" /> </todo-panel> </component> <component name="ToolWindowManager"> <frame x="-8" y="-8" width="1382" height="784" extended-state="6" /> <editor active="true" /> <layout> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17336309" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.3290735" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.34504792" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.399361" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> </layout> <layout-to-restore> <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" /> <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="true" content_ui="tabs" /> <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.34504792" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="12" side_tool="false" content_ui="tabs" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.17336309" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.399361" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> </layout-to-restore> </component> <component name="Vcs.Log.UiProperties"> <option name="RECENTLY_FILTERED_USER_GROUPS"> <collection /> </option> <option name="RECENTLY_FILTERED_BRANCH_GROUPS"> <collection /> </option> </component> <component name="VcsContentAnnotationSettings"> <option name="myLimit" value="2678400000" /> </component> <component name="VcsManagerConfiguration"> <option name="myTodoPanelSettings"> <TodoPanelSettings /> </option> </component> <component name="XDebuggerManager"> <breakpoint-manager> <option name="time" value="2" /> </breakpoint-manager> <watches-manager /> </component> <component name="editorHistoryManager"> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="711" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="952"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="250" max-vertical-offset="748"> <caret line="20" column="70" selection-start-line="20" selection-start-column="70" selection-end-line="20" selection-end-column="70" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="862" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="611" max-vertical-offset="1241"> <caret line="63" column="38" selection-start-line="63" selection-start-column="38" selection-end-line="63" selection-end-column="38" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="250" max-vertical-offset="748"> <caret line="20" column="70" selection-start-line="20" selection-start-column="70" selection-end-line="20" selection-end-column="70" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="862" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="332" max-vertical-offset="1020"> <caret line="36" column="24" selection-start-line="36" selection-start-column="24" selection-end-line="36" selection-end-column="24" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="748"> <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="93" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="862" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="986"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="150" max-vertical-offset="748"> <caret line="14" column="0" selection-start-line="14" selection-start-column="0" selection-end-line="14" selection-end-column="93" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="862" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="986"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="340" max-vertical-offset="748"> <caret line="20" column="40" selection-start-line="20" selection-start-column="40" selection-end-line="20" selection-end-column="40" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="646" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="165" max-vertical-offset="1309"> <caret line="32" column="4" selection-start-line="32" selection-start-column="4" selection-end-line="33" selection-end-column="99" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="595"> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="12" max-vertical-offset="510"> <caret line="16" column="23" selection-start-line="16" selection-start-column="23" selection-end-line="16" selection-end-column="23" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://C:/Python27/Lib/site-packages/sklearn/linear_model/logistic.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.33255813" vertical-offset="18846" max-vertical-offset="28169"> <caret line="1141" column="0" selection-start-line="1141" selection-start-column="0" selection-end-line="1141" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/linear_svc.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="748"> <caret line="38" column="0" selection-start-line="38" selection-start-column="0" selection-end-line="38" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/bernoulli_nb.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="86" max-vertical-offset="748"> <caret line="18" column="0" selection-start-line="18" selection-start-column="0" selection-end-line="18" selection-end-column="0" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://C:/Python27/Lib/site-packages/scipy/sparse/dok.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.33333334" vertical-offset="2996" max-vertical-offset="8704"> <caret line="185" column="0" selection-start-line="185" selection-start-column="0" selection-end-line="185" selection-end-column="0" /> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/logistic_regression.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="250" max-vertical-offset="748"> <caret line="20" column="70" selection-start-line="20" selection-start-column="70" selection-end-line="20" selection-end-column="70" /> <folding> <element signature="e#35#87#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.0" vertical-offset="862" max-vertical-offset="1309"> <caret line="66" column="0" selection-start-line="66" selection-start-column="0" selection-end-line="66" selection-end-column="0" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> <entry file="file://$PROJECT_DIR$/get_data_2.py"> <provider selected="true" editor-type-id="text-editor"> <state vertical-scroll-proportion="0.3846154" vertical-offset="263" max-vertical-offset="952"> <caret line="29" column="69" selection-start-line="29" selection-start-column="69" selection-end-line="29" selection-end-column="69" /> <folding> <element signature="e#35#46#0" expanded="true" /> </folding> </state> </provider> </entry> </component> </project>
{ "content_hash": "257a169b787c8b7fd068955731fb8793", "timestamp": "", "source": "github", "line_count": 849, "max_line_length": 225, "avg_line_length": 54.9434628975265, "alnum_prop": 0.6240058310287907, "repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions", "id": "37bc12355f1e4323e6c02740158aa6c5ccb45177", "size": "46647", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Easy/What's Cooking/.idea/workspace.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Jupyter Notebook", "bytes": "139524" }, { "name": "Python", "bytes": "46606" } ], "symlink_target": "" }
resharper-gendarme ================== Gendarme plugin for ReSharper.
{ "content_hash": "7ad1f0d3ac00603c2c5cc3d66bf9633f", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 30, "avg_line_length": 17.5, "alnum_prop": 0.6142857142857143, "repo_name": "azhidkov/resharper-gendarme", "id": "0c3609bd5ede9ddbc529d8a58d8f77472136c065", "size": "70", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "826" }, { "name": "C#", "bytes": "304257" } ], "symlink_target": "" }
module Mongo module CRUD module Operation # Defines common behaviour for running CRUD read operation tests # on a collection. # # @since 2.0.0 class Read # Map of method names to test operation argument names. # # @since 2.0.0 ARGUMENT_MAP = { :sort => 'sort', :skip => 'skip', :batch_size => 'batchSize', :limit => 'limit' } # The operation name. # # @return [ String ] name The operation name. # # @since 2.0.0 attr_reader :name # Instantiate the operation. # # @return [ Hash ] spec The operation spec. # # @since 2.0.0 def initialize(spec) @spec = spec @name = spec['name'] end # Execute the operation. # # @example Execute the operation. # operation.execute # # @param [ Collection ] collection The collection to execute the operation on. # # @return [ Result, Array<Hash> ] The result of executing the operation. # # @since 2.0.0 def execute(collection) send(name.to_sym, collection) end # Whether the operation is expected to have restuls. # # @example Whether the operation is expected to have results. # operation.has_results? # # @return [ true, false ] If the operation is expected to have results. # # @since 2.0.0 def has_results? !(name == 'aggregate' && pipeline.find {|op| op.keys.include?('$out') }) end # Whether the operation requires server version >= 2.6 for its results to # match expected results. # # @example Whether the operation requires >= 2.6 for its results to match. # operation.requires_2_6?(collection) # # @param [ Collection ] collection The collection the operation is executed on. # # @return [ true, false ] If the operation requires 2.6 for its results to match. # # @since 2.0.0 def requires_2_6?(collection) name == 'aggregate' && pipeline.find {|op| op.keys.include?('$out') } end private def count(collection) options = ARGUMENT_MAP.reduce({}) do |opts, (key, value)| opts.merge!(key => arguments[value]) if arguments[value] opts end collection.count(filter, options) end def aggregate(collection) collection.aggregate(pipeline, options).to_a end def distinct(collection) collection.distinct(field_name, filter, options) end def find(collection) collection.find(filter, options.merge(modifiers: BSON::Document.new(modifiers) || {})).to_a end def options ARGUMENT_MAP.reduce({}) do |opts, (key, value)| arguments[value] ? opts.merge!(key => arguments[value]) : opts end end def batch_size arguments['batchSize'] end def filter arguments['filter'] end def pipeline arguments['pipeline'] end def modifiers arguments['modifiers'] end def field_name arguments['fieldName'] end def arguments @spec['arguments'] end end end end end
{ "content_hash": "d9cea7a90572e9b8bbcdb1b05fa92e73", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 101, "avg_line_length": 26.909774436090224, "alnum_prop": 0.5199776473875384, "repo_name": "wandenberg/mongo-ruby-driver", "id": "5a98219856d8d868e6126b16a232955ec9497fce", "size": "4164", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "spec/support/crud/read.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "1505185" } ], "symlink_target": "" }