code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
#include "Function.h"
#include "xc.h"
#include "pps.h"
#include <libpic30.h>
void Setup(void)
{
// setup internal clock for 72MHz/36MIPS
// 12/2=6*24=132/2=72
CLKDIVbits.PLLPRE=0; // PLLPRE (N2) 0=/2
PLLFBD=22; // pll multiplier (M) = +2
CLKDIVbits.PLLPOST=0; // PLLPOST (N1) 0=/2
while(!OSCCONbits.LOCK); // wait for PLL ready
PPSUnLock;
//PPSout (_U1TX,_RP23);
//PPSout (_U2TX,_RP7);
PPSout (_OC1,_RP37);
//PPSin (_U1RX,_RP22);
//PPSin (_U2RX,_RP6);
PPSLock;
PinSetMode();
PWM_Init();
}
void Delay(int wait)
{
int x;
for(x = 0;x<wait;x++)
{
delay_ms(1); //using predef fcn
}
}
void PinSetMode(void)
{
TRISEbits.TRISE13 = 0; //Set LED as output
TRISBbits.TRISB6 = 0; //Set Brake Light as OUTPUT
TRISBbits.TRISB5 = 0; //Set HORN PWM as OUTPUT
}
|
uazipsev/EV15
|
ECU.X/Function.c
|
C
|
mit
| 855
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (calc, node, precision) {
var str = stringify(node, precision);
if (node.type === "MathExpression") {
// if calc expression couldn't be resolved to a single value, re-wrap it as
// a calc()
str = calc + "(" + str + ")";
}
return str;
};
var order = {
"*": 0,
"/": 0,
"+": 1,
"-": 1
};
function round(value, prec) {
if (prec !== false) {
var precision = Math.pow(10, prec);
return Math.round(value * precision) / precision;
}
return value;
}
function stringify(node, prec) {
switch (node.type) {
case "MathExpression":
{
var left = node.left,
right = node.right,
op = node.operator;
var str = "";
if (left.type === 'MathExpression' && order[op] < order[left.operator]) str += "(" + stringify(left, prec) + ")";else str += stringify(left, prec);
str += " " + node.operator + " ";
if (right.type === 'MathExpression' && order[op] < order[right.operator]) str += "(" + stringify(right, prec) + ")";else str += stringify(right, prec);
return str;
}
case "Value":
return round(node.value, prec);
case 'CssVariable':
return node.value;
default:
return round(node.value, prec) + node.unit;
}
}
module.exports = exports["default"];
|
kumarrus/MuffinMan
|
node_modules/postcss-calc/node_modules/reduce-css-calc/dist/lib/stringifier.js
|
JavaScript
|
mit
| 1,404
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>random: 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.9.1 / random - 8.10.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
random
<small>
8.10.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-08-24 17:47:06 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-24 17:47:06 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.12 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-m4 1 Virtual package relying on m4
coq 8.9.1 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/random"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Random"]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
tags: [
"keyword: randomized algorithms"
"keyword: monads"
"keyword: probability"
"category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"
]
authors: [
"Christine Paulin"
]
bug-reports: "https://github.com/coq-contribs/random/issues"
dev-repo: "git+https://github.com/coq-contribs/random.git"
synopsis: "Interpretation of random programs"
description: """
This contribution is a modelisation of random programs
as measures in Coq. It started in 2004 in the context
of the AVERROES project (http://www-verimag.imag.fr/AVERROES/).
It is based on comon work with Philippe Audebaud (ENS Lyon).
It was last updated in february 2007.
It contains the following elements
- an axiomatisation of the interval [0,1] and derived properties
(files Ubase.v and Uprop.v);
- a definition of measures on a type A as functions of type
(A->[0,1])->[0,1] enjoying special stability properties (files
Monads.v and Probas.v); proofs that these constructions have a
monadic structure;
- an interpretation of programs of type A as measures, in particular
a fixpoint construction; the definition of an axiomatic semantic for
deriving judgements such as ``the probability of an expression e to
evaluate to a result satisfying property q belongs to an interval [p,q]''
(file Prog.v);
- Proof of probabilistic termination of a linear random walk (file
Iterflip.v);
- Proof of a program implementing a bernoulli distribution
(Proba(bernouilli(p)=true)=p) using a coin flip and the derived binomial
law (Proba(binomial p n=k)=C(n,k)p^k(1-p)^{n-k}) (file Bernoulli.v);
- Proof of estimation of the combination of two random executions
(file Choice.v)
- Proof of partial termination of parameterized random walk (file Ycart.v)
- Definition of a measure on traces from a mesure on transitions
steps (file Nelist.v, Transitions.v)
The document random.pdf contains a short introduction to the library
associated to the Gallina source code of the library."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/random/archive/v8.10.0.tar.gz"
checksum: "md5=e0d9709f1ed8622c07d9b28ca1330564"
}
</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-random.8.10.0 coq.8.9.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.9.1).
The following dependencies couldn't be met:
- coq-random -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-random.8.10.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.05.0-2.0.6/released/8.9.1/random/8.10.0.html
|
HTML
|
mit
| 8,464
|
<?php
namespace Gips\WebBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('gips_web');
// Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for
// more information on that topic.
return $treeBuilder;
}
}
|
gippy/gipsweb
|
src/Gips/WebBundle/DependencyInjection/Configuration.php
|
PHP
|
mit
| 871
|
<div class="master-list">
{{#each masters}}
{{#if text-help}}
<div class="master-list__cont-help"><p class="master-list__text-help">{{text-help}}</p></div>
{{/if}}
<div class="master-list__master-card">
<div class="master-list__avatar-cont">
{{#if is-avatar-exist}}
<img class="master-list__avatar" src="{{avatar.src}}" alt="{{avatar.alt}}">
{{/if}}
</div>
<p class="master-list__name">Мастер — {{name}}</p>
<p class="master-list__rubric"><span class="master-list__strong">Рубрика:</span> {{rubric-name}}</p>
<p class="master-list__tarif">Тариф: {{tarif-name}}</p><a class="master-list__change" href="{{tarif_link.url}}">cменить</a>
<p class="master-list__button-top">{{> button/link-button/link-button edit-button}}</p>
{{#if is-status}}
{{#if status-link}}
<p class="master-list__status master-list__status_moderate">
{{status-text}}
<br>
<a class="master-list__status-link" href="{{status-link.url}}">{{status-link.text}}</a>
</p>
{{else}}
<p class="master-list__status">{{status-text}}</p>
{{/if}}
{{else}}
<p class="master-list__button-bottom">{{> button/link-button/link-button publish-button}}</p>
{{/if}}
</div><!--master-card-->
{{#if moderate-comment}}
<p class="master-list__moderate-comment">Комментарии модератора: {{moderate-comment}}</p>
{{/if}}
{{/each}}
</div><!--master-list-->
|
dumperize/fm-lk
|
builds/stable/modules/master-block/master-list/master-list.html
|
HTML
|
mit
| 1,593
|
/*!
* OOUI v0.43.1
* https://www.mediawiki.org/wiki/OOUI
*
* Copyright 2011–2022 OOUI Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
* Date: 2022-02-10T15:03:52Z
*/.oo-ui-icon-indent{background-image:url(themes/wikimediaui/images/icons/indent-rtl.svg)}.oo-ui-icon-listBullet{background-image:url(themes/wikimediaui/images/icons/listBullet-rtl.svg)}.oo-ui-icon-listNumbered{background-image:url(themes/wikimediaui/images/icons/listNumbered-rtl.svg)}.oo-ui-icon-outdent{background-image:url(themes/wikimediaui/images/icons/outdent-rtl.svg)}
|
cdnjs/cdnjs
|
ajax/libs/oojs-ui/0.43.1/oojs-ui-apex-icons-editing-list.rtl.min.css
|
CSS
|
mit
| 596
|
package SMART
import Chisel._
// Implementing the XY Routing Unit
class RoutingUnit() extends Module {
val io = new Bundle {
val xHops = UInt(INPUT, width = X_HOP_WIDTH)
val yHops = UInt(INPUT, width = Y_HOP_WIDTH)
val xDir = UInt(INPUT, width = 1)
val yDir = UInt(INPUT, width = 1)
val outport = UInt(OUTPUT, width = NUM_OF_DIRS)
val xHopsNext = UInt(OUTPUT, width = X_HOP_WIDTH)
val yHopsNext = UInt(OUTPUT, width = Y_HOP_WIDTH)
val xDirNext = UInt(OUTPUT, width = 1)
val yDirNext = UInt(OUTPUT, width = 1)
}
when (io.xHops =/= UInt(0)) {
io.xHopsNext := io.xHops - UInt(1)
io.yHopsNext := io.yHops
when (io.xDir === UInt(1)) {
io.outport := EAST_OH
} .otherwise {
io.outport := WEST_OH
}
} .elsewhen (io.yHops =/= UInt(0)) {
io.xHopsNext := io.xHops
io.yHopsNext := io.yHops - UInt(1)
when (io.yDir === UInt(1)) {
io.outport := NORTH_OH
} .otherwise {
io.outport := SOUTH_OH
}
} .otherwise {
io.outport := LOCAL_OH
io.xHopsNext := io.xHops
io.yHopsNext := io.yHops
}
io.yDirNext := io.yDir
io.xDirNext := io.xDir
}
class RoutingUnitTests(c: RoutingUnit) extends Tester(c) {
poke(c.io.xHops, 3)
poke(c.io.yHops, 3)
poke(c.io.xDir, 0)
poke(c.io.yDir, 1)
expect(c.io.xHopsNext, 2)
expect(c.io.yHopsNext, 3)
expect(c.io.outport, WEST_OH.litValue())
step(1)
poke(c.io.xHops, 2)
poke(c.io.yHops, 2)
poke(c.io.xDir, 1)
poke(c.io.yDir, 1)
peek(c.io)
step(1)
poke(c.io.xHops, 0)
poke(c.io.yHops, 2)
poke(c.io.xDir, 1)
poke(c.io.yDir, 1)
peek(c.io)
step(1)
}
// class RoutingUnit() extends Module {
// val io = new Bundle {
// val curCoord = new Coordinate().asInput
// val destCoord = new Coordinate().asInput
// val outDir = UInt(dir = OUTPUT, width = NUM_OF_DIRS)
// }
// when (io.curCoord.x != io.destCoord.x) {
// when (io.curCoord.x > io.destCoord.x) {
// io.outDir := WEST_OH
// } .otherwise {
// io.outDir := EAST_OH
// }
// } .elsewhen (io.curCoord.y != io.destCoord.y) {
// when (io.curCoord.y > io.destCoord.y) {
// io.outDir := SOUTH_OH
// } .otherwise {
// io.outDir := NORTH_OH
// }
// } .otherwise {
// io.outDir := LOCAL_OH
// }
// }
// class RoutingUnitTests(c: RoutingUnit) extends Tester(c) {
// poke(c.io.curCoord.x, 0)
// poke(c.io.curCoord.y, 0)
// poke(c.io.destCoord.x, 0)
// poke(c.io.destCoord.y, 0)
// expect(c.io.outDir, 1)
// poke(c.io.curCoord.x, 0)
// poke(c.io.curCoord.y, 0)
// poke(c.io.destCoord.x, 0)
// poke(c.io.destCoord.y, 1)
// peek(c.io.outDir)
// poke(c.io.curCoord.x, 0)
// poke(c.io.curCoord.y, 0)
// poke(c.io.destCoord.x, 1)
// poke(c.io.destCoord.y, 0)
// peek(c.io.outDir)
// poke(c.io.curCoord.x, 0)
// poke(c.io.curCoord.y, 0)
// poke(c.io.destCoord.x, 1)
// poke(c.io.destCoord.y, 1)
// peek(c.io.outDir)
// poke(c.io.curCoord.x, 1)
// poke(c.io.curCoord.y, 1)
// poke(c.io.destCoord.x, 0)
// poke(c.io.destCoord.y, 0)
// peek(c.io.outDir)
// }
// }
|
hyoukjun/OpenSMART
|
Backend/Chisel/RoutingUnit.scala
|
Scala
|
mit
| 3,512
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cityhallmonitor', '0002_matter_attachments_obtained_at'),
]
operations = [
migrations.AddField(
model_name='matterattachment',
name='link_obtained_at',
field=models.DateTimeField(null=True),
),
]
|
NUKnightLab/cityhallmonitor
|
cityhallmonitor/migrations/0003_matterattachment_link_obtained_at.py
|
Python
|
mit
| 440
|
<!-- <time class="updated" datetime="<?= get_post_time('c', true); ?>"><?= get_the_date(); ?></time>
<p class="byline author vcard"><?= __('By', 'sage'); ?> <a href="<?= get_author_posts_url(get_the_author_meta('ID')); ?>" rel="author" class="fn"><?= get_the_author(); ?></a></p>
-->
|
smpetrey/leahconstantine.com
|
web/app/themes/l-theme/templates/entry-meta.php
|
PHP
|
mit
| 284
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>bdds: 1 m 27 s 🏆</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.7.1+1 / bdds - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
bdds
<small>
8.7.0
<span class="label label-success">1 m 27 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-05 11:27:21 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-05 11:27:21 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.7.1+1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/bdds"
license: "LGPL 2.1"
build: [make]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/BDDs"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
"coq-int-map" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: BDD"
"keyword: binary decision diagrams"
"keyword: classical logic"
"keyword: propositional logic"
"keyword: validity"
"keyword: satisfiability"
"keyword: model checking"
"keyword: reflection"
"category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"category: Miscellaneous/Extracted Programs/Decision procedures"
"date: May-July 1999"
]
authors: [ "Kumar Neeraj Verma" ]
bug-reports: "https://github.com/coq-contribs/bdds/issues"
dev-repo: "git+https://github.com/coq-contribs/bdds.git"
synopsis: "BDD algorithms and proofs in Coq, by reflection"
description: """
Provides BDD algorithms running under Coq.
(BDD are Binary Decision Diagrams.)
Allows one to do classical validity checking by
reflection in Coq using BDDs, can also be used
to get certified BDD algorithms by extraction.
First step towards actual symbolic model-checkers
in Coq. See file README for operation."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/bdds/archive/v8.7.0.tar.gz"
checksum: "md5=0e838b0ee3ee927f736b9c7baf8e95b7"
}
</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-bdds.8.7.0 coq.8.7.1+1</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-bdds.8.7.0 coq.8.7.1+1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>38 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-bdds.8.7.0 coq.8.7.1+1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 m 27 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 7 M</p>
<ul>
<li>680 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/d3.glob</code></li>
<li>619 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd3.glob</code></li>
<li>414 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd4.glob</code></li>
<li>368 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/d3.v</code></li>
<li>264 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_1.glob</code></li>
<li>241 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd1.glob</code></li>
<li>216 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul08.glob</code></li>
<li>199 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_2.glob</code></li>
<li>184 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd11.glob</code></li>
<li>181 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_2.glob</code></li>
<li>163 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul07.glob</code></li>
<li>150 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul08.vo</code></li>
<li>147 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_4.glob</code></li>
<li>146 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd2.glob</code></li>
<li>146 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_3.glob</code></li>
<li>140 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd10.glob</code></li>
<li>128 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/d3.vo</code></li>
<li>128 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd1.vo</code></li>
<li>126 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd11.vo</code></li>
<li>123 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul07.vo</code></li>
<li>116 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul06.glob</code></li>
<li>114 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd4.vo</code></li>
<li>108 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd3.vo</code></li>
<li>107 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd6.glob</code></li>
<li>106 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_1.vo</code></li>
<li>105 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd7.glob</code></li>
<li>100 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul06.vo</code></li>
<li>89 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd7.vo</code></li>
<li>88 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd2.vo</code></li>
<li>80 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd6.vo</code></li>
<li>78 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd11.v</code></li>
<li>78 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd10.vo</code></li>
<li>74 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_2.vo</code></li>
<li>71 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd9.vo</code></li>
<li>69 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_2.vo</code></li>
<li>67 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd3.v</code></li>
<li>66 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd2.v</code></li>
<li>65 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_4.vo</code></li>
<li>64 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_3.vo</code></li>
<li>59 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_2.v</code></li>
<li>53 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip08.vo</code></li>
<li>52 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd8.vo</code></li>
<li>49 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip06.vo</code></li>
<li>49 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd10.v</code></li>
<li>49 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDvar_ad_nat.vo</code></li>
<li>47 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip08.glob</code></li>
<li>44 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/werner.vo</code></li>
<li>42 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/pigtest.vo</code></li>
<li>41 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd8.glob</code></li>
<li>41 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd4.v</code></li>
<li>40 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_3.v</code></li>
<li>40 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul08.v</code></li>
<li>40 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDdummy_lemma_4.v</code></li>
<li>39 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/tauto.vo</code></li>
<li>39 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd1.v</code></li>
<li>38 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/imecaux.vo</code></li>
<li>36 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/u.vo</code></li>
<li>36 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd7.v</code></li>
<li>36 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip06.glob</code></li>
<li>33 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdds.vo</code></li>
<li>32 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/extract.vo</code></li>
<li>32 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_1.v</code></li>
<li>31 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd9.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul07.v</code></li>
<li>29 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDvar_ad_nat.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd6.v</code></li>
<li>28 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd5_2.v</code></li>
<li>22 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/mul06.v</code></li>
<li>21 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/werner.glob</code></li>
<li>13 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd8.v</code></li>
<li>12 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdd9.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/BDDvar_ad_nat.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/tauto.glob</code></li>
<li>8 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip08.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/pigtest.glob</code></li>
<li>6 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/rip06.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/imecaux.glob</code></li>
<li>4 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/werner.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/tauto.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/u.glob</code></li>
<li>3 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/pigtest.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/imecaux.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/u.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdds.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/extract.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/bdds.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.09.1/lib/coq/user-contrib/BDDs/extract.glob</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-bdds.8.7.0</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.09.1-2.0.6/released/8.7.1+1/bdds/8.7.0.html
|
HTML
|
mit
| 16,643
|
<?php if ( ! defined('BASEPATH')) exit ('No direct script access allowed');
class Login extends CI_Controller {
public function index() {
$data = array('title' => 'Login Administrator',
‘isi’ =>’admin/login_view’);
$this->load->view(‘admin/login_view’,$data);
}
}
/*fungsi untuk login admin*/
|
khoironi7887/SI-SELEBRITI
|
application/controllers/Login.php
|
PHP
|
mit
| 312
|
<?php
namespace Sandbox;
class StaticPageTest extends WebTestCase
{
public function testRedirectToHomepage()
{
$client = $this->createClient();
$client->request('GET', '/');
$this->assertEquals(301, $client->getResponse()->getStatusCode());
$client->followRedirect();
$this->assertEquals('http://localhost/en', $client->getRequest()->getUri());
}
/**
* @dataProvider contentDataProvider
*/
public function testContent($url, $title)
{
$client = $this->createClient();
$crawler = $client->request('GET', $url);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertCount(1, $crawler->filter(sprintf('h1:contains("%s")', $title)), 'Page does not contain an h1 tag with: '.$title);
}
public function contentDataProvider()
{
return array(
array('/en', 'Welcome to the CMF Standard Edition'),
array('/en/about', 'Some information about us'),
array('/en/contact', 'A contact page'),
array('/en/contact/map', 'A map of a location in the US'),
array('/de/contact/map', 'Eine Karte von einem Ort in Deutschland'),
array('/en/contact/team', 'A team page'),
);
}
}
|
rat4m3n/cmf-standard-fosuser
|
app/tests/StaticPageTest.php
|
PHP
|
mit
| 1,300
|
require 'sdbus/version'
require 'sdbus/type_parser'
require 'sdbus/native'
require 'sdbus/error'
require 'sdbus/bus'
require 'sdbus/reply'
require 'sdbus/message'
require 'sdbus/service'
require 'sdbus/object'
require 'sdbus/interface'
module Sdbus
class << self
# Returns a new instance of a {Sdbus::Bus} bound to the system bus.
# @return [Sdbus::Bus]
def system_bus
bus(:system)
end
# Returns a new instance of a {Sdbus::Bus} bound to the user (session) bus.
# @return [Sdbus::Bus]
def user_bus
bus(:user)
end
alias_method :session_bus, :user_bus
# @private
def bus(type)
ptr = FFI::MemoryPointer.new(:pointer)
rc = Native.send("sd_bus_default_#{type}", ptr)
raise BaseError, rc if rc < 0
Bus.new(ptr.read_pointer, type)
end
end
end
|
ledbettj/sdbus
|
lib/sdbus.rb
|
Ruby
|
mit
| 831
|
Class = require "lib.hump.class"
Enemy = require "entities.enemy"
vector = require "lib.hump.vector"
EnemyBullet = require "entities.enemyBullet"
EntityTypes = require "entities.types"
Tank = Class{__includes = Enemy,
init = function(self, x, y, dx, dy, state)
Enemy.init(self, x, y, state)
self.health = 80
self.velocity = vector(dx, dy)
self.bodyImage = love.graphics.newImage("data/img/enemy/tank/tankbody.png")
self.turretImage = love.graphics.newImage("data/img/enemy/tank/tankturret.png")
self.rotation = 0
self.hitbox = {
x1 = x - 40,
x2 = x + 40,
y1 = y - 20,
y2 = y + 20
}
self.groundEnemy = true
end,
burstCounter = 0,
burstRate = 2,
fireShots = 0,
fireCounter = 0,
fireRate = 0.2
}
function Tank:update(dt)
self.burstCounter = self.burstCounter + dt
self:move(self.velocity * dt)
while self.burstCounter > self.burstRate do
self.burstCounter = self.burstCounter - self.burstRate
self.fireShots = 8
end
if self.fireShots > 0 then
self.fireCounter = self.fireCounter + dt
while self.fireCounter > self.fireRate do
self.fireCounter = self.fireCounter - self.fireRate
self.fireShots = self.fireShots - 1
local x,y = self.position:unpack()
for i=-1,1,2 do
local newBullet1 = EnemyBullet(x+(10*i), y+20, 0, 150, self.state)
self.state.manager:addEntity(newBullet1, EntityTypes.ENEMY_BULLET)
end
end
end
end
function Tank:draw()
local x,y = self.position:unpack()
love.graphics.setColor(255, 255, 255)
love.graphics.draw(self.bodyImage, x, y, 0, 1, 1, 40, 22)
love.graphics.draw(self.turretImage, x, y, self.rotation, 1, 1, 14, 19)
Entity.draw(self)
end
return Tank
|
tinydanbo/Impoverished-Starfighter
|
game/enemies/tank.lua
|
Lua
|
mit
| 1,661
|
# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
module Azure::CognitiveServices::Customvisiontraining::V2_0
module Models
#
# Model object.
#
#
class PredictionQueryResult
include MsRestAzure
# @return [PredictionQueryToken]
attr_accessor :token
# @return [Array<StoredImagePrediction>]
attr_accessor :results
#
# Mapper for PredictionQueryResult class as Ruby Hash.
# This will be used for serialization/deserialization.
#
def self.mapper()
{
client_side_validation: true,
required: false,
serialized_name: 'PredictionQueryResult',
type: {
name: 'Composite',
class_name: 'PredictionQueryResult',
model_properties: {
token: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'token',
type: {
name: 'Composite',
class_name: 'PredictionQueryToken'
}
},
results: {
client_side_validation: true,
required: false,
read_only: true,
serialized_name: 'results',
type: {
name: 'Sequence',
element: {
client_side_validation: true,
required: false,
serialized_name: 'StoredImagePredictionElementType',
type: {
name: 'Composite',
class_name: 'StoredImagePrediction'
}
}
}
}
}
}
}
end
end
end
end
|
Azure/azure-sdk-for-ruby
|
data/azure_cognitiveservices_customvisiontraining/lib/2.0/generated/azure_cognitiveservices_customvisiontraining/models/prediction_query_result.rb
|
Ruby
|
mit
| 1,941
|
module Kiosk
module WordPress
class Images < Resource
end
end
end
|
nanowrimo/kiosk
|
lib/kiosk/word_press/images.rb
|
Ruby
|
mit
| 78
|
//
// ZHModel.h
// UIFengzhuang
//
// Created by Aaron on 15/12/26.
// Copyright (c) 2015年 叶无道. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
* 保存每一次对阵
*/
@class ZHSmallVideo;
@interface ZHMatchVS : NSObject
@property (nonatomic ,copy) NSString *team_A_id;
@property (nonatomic ,copy) NSString *team_A_name;
@property (nonatomic ,copy) NSString *team_B_id;
@property (nonatomic ,copy) NSString *team_B_name;
/**
* 联赛名字
*/
@property (nonatomic ,copy) NSString *name;
/**
* 全场A队得分
*/
@property (nonatomic ,copy) NSString *fs_A;
/**
* 全场B队得分
*/
@property (nonatomic ,copy) NSString *fs_B;
/**
* 比赛时间
*/
@property (nonatomic ,copy) NSString *time_utc;
/**
* 比赛日期
*/
@property (nonatomic ,copy) NSString *date_utc;
/**
* 比赛集锦
*/
@property (nonatomic,strong) ZHSmallVideo *recommend_video;
@end
|
AppriaTT/zuqiukong
|
足球控(DIY)/Matches/Model/ZHMatchVS.h
|
C
|
mit
| 906
|
<?php namespace Ordercloud\Requests\Organisations\Criteria;
/**
* @deprecated See Ordercloud\Requests\Connections\Criteria\AdvancedConnectionCriteria
*
* Class AdvancedConnectionCriteria
*
* @package Ordercloud\Requests\Organisations\Criteria
*/
class AdvancedConnectionCriteria extends ExtendedConnectionCriteria
{
/**
* @var array|int[]
*/
private $statuses;
/**
* @var int
*/
private $radius;
/**
* @var string
*/
private $lat;
/**
* @var string
*/
private $lon;
/**
* @var array|int[]
*/
private $industries;
/**
* @return array|int[]
*/
public function getStatuses()
{
return $this->statuses;
}
/**
* @param array|int[] $statuses
*
* @return static
*/
public function setStatuses(array $statuses)
{
$this->statuses = $statuses;
return $this;
}
/**
* @return int
*/
public function getRadius()
{
return $this->radius;
}
/**
* @param int $radius
*
* @return static
*/
public function setRadius($radius)
{
$this->radius = $radius;
return $this;
}
/**
* @return string
*/
public function getLat()
{
return $this->lat;
}
/**
* @param string $lat
*
* @return static
*/
public function setLat($lat)
{
$this->lat = $lat;
return $this;
}
/**
* @return string
*/
public function getLon()
{
return $this->lon;
}
/**
* @param string $lon
*
* @return static
*/
public function setLon($lon)
{
$this->lon = $lon;
return $this;
}
/**
* @return array|int[]
*/
public function getIndustries()
{
return $this->industries;
}
/**
* @param array|int[] $industries
*
* @return static
*/
public function setIndustries($industries)
{
$this->industries = $industries;
return $this;
}
}
|
ordercloud/ordercloud-php
|
src/Requests/Organisations/Criteria/AdvancedConnectionCriteria.php
|
PHP
|
mit
| 2,107
|
import { assert, expect } from 'chai';
import 'angular';
import 'angular-mocks/angular-mocks';
import '../src/component';
describe('User factory', ()=>{
var Client;
beforeEach(angular.mock.module('component'));
beforeEach(angular.mock.inject(function(_client_) {
Client = _client_;
}));
it('sould return "default" when calling loggedUser ', ()=> {
expect(Client.loggedUser()).to.be.equal('default');
});
});
|
DanH91/Js-Seeds
|
ANGULARJS-JSPM-KARMA-MOCHA/test/userSpec.js
|
JavaScript
|
mit
| 440
|
export const flatTree = (tree, getBody = node => node.body) => {
let flatList = [];
[].concat(tree).forEach(node => {
const body = getBody(node);
if (body && body.length) {
flatList = flatList.concat(node, flatTree(body, getBody));
} else {
flatList.push(node);
}
});
return flatList;
};
|
Bogdan-Lyashenko/js-code-to-svg-flowchart
|
src/shared/utils/flatten.js
|
JavaScript
|
mit
| 363
|
---
layout: post
title: VIJOS1755 - [NOIP2009]靶形数独
date: 2016-10-18 21:45:00
categories: OI
tags: [搜索]
---
一道很吼的搜索,有人推荐做。主要是状态的表示。
> (条件编译大法好!
## 题目描述
> 小城和小华都是热爱数学的好学生,最近,他们不约而同地迷上了数独游戏,好胜的他们想用数独来一比高低。但普通的数独对他们来说都过于简单了,于是他们向 Z博士请教,Z 博士拿出了他最近发明的“靶形数独” ,作为这两个孩子比试的题目。 靶形数独的方格同普通数独一样,在 9 格宽×9 格高的大九宫格中有 9 个 3 格宽×3 格高的小九宫格(用粗黑色线隔开的) 。在这个大九宫格中,有一些数字是已知的,根据这些数字,利用逻辑推理,在其他的空格上填入 1到 9 的数字。每个数字在每个小九宫格内不能重复出现,每个数字在每行、每列也不能重复出现。但靶形数独有一点和普通数独不同,即每一个方格都有一个分值,而且如同一个靶子一样,离中心越近则分值越高。
> 由于求胜心切,小城找到了善于编程的你,让你帮他求出,对于给定的靶形数独,能够得到的最高分数。
## 代码
```cpp
#include <bits/stdc++.h>
using namespace std;
#define matt(x, y) (((x)-1)/3*3+((y)-1)/3+1) // 蜜汁压位
#define searchnext(x,y) y == 9 ? search(x+1, 1) : search(x, y+1)
#ifndef LCYTEST
# define release(_x) { _x }
#else
# define release(_x) ;
#endif
bool r[10][10], l[10][10], s[10][10];
int mata[10][10], b[10][10];
int ans = -1, score;
int getscore(int x, int y, int k) {
if(x == 5 && y == 5) { return 10*k; }
else if(x >= 4 && x <= 6 && y >= 4 && y <= 6) { return 9*k; }
else if(x >= 3 && x <= 7 && y >= 3 && y <= 7) { return 8*k; }
else if(x >= 2 && x <= 8 && y >= 2 && y <= 8) { return 7*k; }
else { return 6*k; }
}
bool fill(int x, int y, int k) {
if(r[x][k]) return 0;
if(l[y][k]) return 0;
if(s[matt(x, y)][k]) return 0;
b[x][y] = k;
r[x][k] = l[y][k] = s[matt(x, y)][k] = 1;
score += getscore(x, y, k);
return 1;
}
void del(int x, int y, int k) {
b[x][y] = 0; r[x][k] = l[y][k] = s[matt(x, y)][k] = 0;
}
void search(int x, int y) {
release({ if(clock() > 900) return; })
if(x == 10 && y == 1) { ans = max(ans, score); return; }
if(b[x][y]) searchnext(x,y);
else
for(int i=1;i<=9;i++) {
int t=score;
if(fill(x, y, i)) {
searchnext(x, y);
del(x, y, i);
score=t;
}
}
}
int main() {
release({ ios::sync_with_stdio(false); cin.tie(nullptr); })
for(int i=9;i>0;i--)
for(int j=9;j>0;j--) {
cin >> mata[i][j];
if(mata[i][j]) fill(i, j, mata[i][j]);
}
search(1, 1);
cout << ans << endl;
}
```
|
monkey2000/mky.moe
|
content/posts/2016-10-19-vijos1755.md
|
Markdown
|
mit
| 2,941
|
<?php
/*
Unsafe sample
input : get the field UserData from the variable $_POST
sanitize : regular expression accepts everything
construction : interpretation with simple quote
*/
/*Copyright 2015 Bertrand STIVALET
Permission is hereby granted, without written agreement or royalty fee, to
use, copy, modify, and distribute this software and its documentation for
any purpose, provided that the above copyright notice and the following
three paragraphs appear in all copies of this software.
IN NO EVENT SHALL AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT,
INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES INCLUDING, BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
THE SOFTWARE IS PROVIDED ON AN "AS-IS" BASIS AND AUTHORS HAVE NO
OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
MODIFICATIONS.*/
$tainted = $_POST['UserData'];
$re = "/^.*$/";
if(preg_match($re, $tainted) == 1){
$tainted = $tainted;
}
else{
$tainted = "";
}
$query = "echo $'$tainted';";
//flaw
$res = eval($query);
?>
|
stivalet/PHP-Vulnerability-test-suite
|
Injection/CWE_95/unsafe/CWE_95__POST__func_preg_match-no_filtering__echo-interpretation_simple_quote.php
|
PHP
|
mit
| 1,288
|
from __future__ import absolute_import, division, print_function
import hashlib
import linecache
import sys
import warnings
from operator import itemgetter
from . import _config
from ._compat import PY2, isclass, iteritems, metadata_proxy, set_closure_cell
from .exceptions import (
DefaultAlreadySetError, FrozenInstanceError, NotAnAttrsClassError,
UnannotatedAttributeError
)
# This is used at least twice, so cache it here.
_obj_setattr = object.__setattr__
_init_converter_pat = "__attr_converter_{}"
_init_factory_pat = "__attr_factory_{}"
_tuple_property_pat = " {attr_name} = property(itemgetter({index}))"
_empty_metadata_singleton = metadata_proxy({})
class _Nothing(object):
"""
Sentinel class to indicate the lack of a value when ``None`` is ambiguous.
All instances of `_Nothing` are equal.
"""
def __copy__(self):
return self
def __deepcopy__(self, _):
return self
def __eq__(self, other):
return other.__class__ == _Nothing
def __ne__(self, other):
return not self == other
def __repr__(self):
return "NOTHING"
def __hash__(self):
return 0xdeadbeef
NOTHING = _Nothing()
"""
Sentinel to indicate the lack of a value when ``None`` is ambiguous.
"""
def attrib(default=NOTHING, validator=None,
repr=True, cmp=True, hash=None, init=True,
convert=None, metadata=None, type=None, converter=None):
"""
Create a new attribute on a class.
.. warning::
Does *not* do anything unless the class is also decorated with
:func:`attr.s`!
:param default: A value that is used if an ``attrs``-generated ``__init__``
is used and no value is passed while instantiating or the attribute is
excluded using ``init=False``.
If the value is an instance of :class:`Factory`, its callable will be
used to construct a new value (useful for mutable data types like lists
or dicts).
If a default is not set (or set manually to ``attr.NOTHING``), a value
*must* be supplied when instantiating; otherwise a :exc:`TypeError`
will be raised.
The default can also be set using decorator notation as shown below.
:type default: Any value.
:param validator: :func:`callable` that is called by ``attrs``-generated
``__init__`` methods after the instance has been initialized. They
receive the initialized instance, the :class:`Attribute`, and the
passed value.
The return value is *not* inspected so the validator has to throw an
exception itself.
If a ``list`` is passed, its items are treated as validators and must
all pass.
Validators can be globally disabled and re-enabled using
:func:`get_run_validators`.
The validator can also be set using decorator notation as shown below.
:type validator: ``callable`` or a ``list`` of ``callable``\ s.
:param bool repr: Include this attribute in the generated ``__repr__``
method.
:param bool cmp: Include this attribute in the generated comparison methods
(``__eq__`` et al).
:param hash: Include this attribute in the generated ``__hash__``
method. If ``None`` (default), mirror *cmp*'s value. This is the
correct behavior according the Python spec. Setting this value to
anything else than ``None`` is *discouraged*.
:type hash: ``bool`` or ``None``
:param bool init: Include this attribute in the generated ``__init__``
method. It is possible to set this to ``False`` and set a default
value. In that case this attributed is unconditionally initialized
with the specified default value or factory.
:param callable converter: :func:`callable` that is called by
``attrs``-generated ``__init__`` methods to converter attribute's value
to the desired format. It is given the passed-in value, and the
returned value will be used as the new value of the attribute. The
value is converted before being passed to the validator, if any.
:param metadata: An arbitrary mapping, to be used by third-party
components. See :ref:`extending_metadata`.
:param type: The type of the attribute. In Python 3.6 or greater, the
preferred method to specify the type is using a variable annotation
(see `PEP 526 <https://www.python.org/dev/peps/pep-0526/>`_).
This argument is provided for backward compatibility.
Regardless of the approach used, the type will be stored on
``Attribute.type``.
.. versionadded:: 15.2.0 *convert*
.. versionadded:: 16.3.0 *metadata*
.. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
.. versionchanged:: 17.1.0
*hash* is ``None`` and therefore mirrors *cmp* by default.
.. versionadded:: 17.3.0 *type*
.. deprecated:: 17.4.0 *convert*
.. versionadded:: 17.4.0 *converter* as a replacement for the deprecated
*convert* to achieve consistency with other noun-based arguments.
"""
if hash is not None and hash is not True and hash is not False:
raise TypeError(
"Invalid value for hash. Must be True, False, or None."
)
if convert is not None:
if converter is not None:
raise RuntimeError(
"Can't pass both `convert` and `converter`. "
"Please use `converter` only."
)
warnings.warn(
"The `convert` argument is deprecated in favor of `converter`. "
"It will be removed after 2019/01.",
DeprecationWarning, stacklevel=2
)
converter = convert
if metadata is None:
metadata = {}
return _CountingAttr(
default=default,
validator=validator,
repr=repr,
cmp=cmp,
hash=hash,
init=init,
converter=converter,
metadata=metadata,
type=type,
)
def _make_attr_tuple_class(cls_name, attr_names):
"""
Create a tuple subclass to hold `Attribute`s for an `attrs` class.
The subclass is a bare tuple with properties for names.
class MyClassAttributes(tuple):
__slots__ = ()
x = property(itemgetter(0))
"""
attr_class_name = "{}Attributes".format(cls_name)
attr_class_template = [
"class {}(tuple):".format(attr_class_name),
" __slots__ = ()",
]
if attr_names:
for i, attr_name in enumerate(attr_names):
attr_class_template.append(_tuple_property_pat.format(
index=i,
attr_name=attr_name,
))
else:
attr_class_template.append(" pass")
globs = {"itemgetter": itemgetter}
eval(compile("\n".join(attr_class_template), "", "exec"), globs)
return globs[attr_class_name]
# Tuple class for extracted attributes from a class definition.
# `super_attrs` is a subset of `attrs`.
_Attributes = _make_attr_tuple_class("_Attributes", [
"attrs", # all attributes to build dunder methods for
"super_attrs", # attributes that have been inherited from super classes
])
def _is_class_var(annot):
"""
Check whether *annot* is a typing.ClassVar.
The implementation is gross but importing `typing` is slow and there are
discussions to remove it from the stdlib alltogether.
"""
return str(annot).startswith("typing.ClassVar")
def _get_annotations(cls):
"""
Get annotations for *cls*.
"""
anns = getattr(cls, "__annotations__", None)
if anns is None:
return {}
# Verify that the annotations aren't merely inherited.
for super_cls in cls.__mro__[1:]:
if anns is getattr(super_cls, "__annotations__", None):
return {}
return anns
def _transform_attrs(cls, these, auto_attribs):
"""
Transform all `_CountingAttr`s on a class into `Attribute`s.
If *these* is passed, use that and don't look for them on the class.
Return an `_Attributes`.
"""
cd = cls.__dict__
anns = _get_annotations(cls)
if these is not None:
ca_list = sorted((
(name, ca)
for name, ca
in iteritems(these)
), key=lambda e: e[1].counter)
elif auto_attribs is True:
ca_names = {
name
for name, attr
in cd.items()
if isinstance(attr, _CountingAttr)
}
ca_list = []
annot_names = set()
for attr_name, type in anns.items():
if _is_class_var(type):
continue
annot_names.add(attr_name)
a = cd.get(attr_name, NOTHING)
if not isinstance(a, _CountingAttr):
if a is NOTHING:
a = attrib()
else:
a = attrib(default=a)
ca_list.append((attr_name, a))
unannotated = ca_names - annot_names
if len(unannotated) > 0:
raise UnannotatedAttributeError(
"The following `attr.ib`s lack a type annotation: " +
", ".join(sorted(
unannotated,
key=lambda n: cd.get(n).counter
)) + "."
)
else:
ca_list = sorted((
(name, attr)
for name, attr
in cd.items()
if isinstance(attr, _CountingAttr)
), key=lambda e: e[1].counter)
own_attrs = [
Attribute.from_counting_attr(
name=attr_name,
ca=ca,
type=anns.get(attr_name),
)
for attr_name, ca
in ca_list
]
super_attrs = []
taken_attr_names = {a.name: a for a in own_attrs}
# Traverse the MRO and collect attributes.
for super_cls in cls.__mro__[1:-1]:
sub_attrs = getattr(super_cls, "__attrs_attrs__", None)
if sub_attrs is not None:
for a in sub_attrs:
prev_a = taken_attr_names.get(a.name)
# Only add an attribute if it hasn't been defined before. This
# allows for overwriting attribute definitions by subclassing.
if prev_a is None:
super_attrs.append(a)
taken_attr_names[a.name] = a
attr_names = [a.name for a in super_attrs + own_attrs]
AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
attrs = AttrsClass(
super_attrs + [
Attribute.from_counting_attr(
name=attr_name,
ca=ca,
type=anns.get(attr_name)
)
for attr_name, ca
in ca_list
]
)
had_default = False
for a in attrs:
if had_default is True and a.default is NOTHING and a.init is True:
raise ValueError(
"No mandatory attributes allowed after an attribute with a "
"default value or factory. Attribute in question: {a!r}"
.format(a=a)
)
elif had_default is False and \
a.default is not NOTHING and \
a.init is not False:
had_default = True
return _Attributes((attrs, super_attrs))
def _frozen_setattrs(self, name, value):
"""
Attached to frozen classes as __setattr__.
"""
raise FrozenInstanceError()
def _frozen_delattrs(self, name):
"""
Attached to frozen classes as __delattr__.
"""
raise FrozenInstanceError()
class _ClassBuilder(object):
"""
Iteratively build *one* class.
"""
__slots__ = (
"_cls", "_cls_dict", "_attrs", "_super_names", "_attr_names", "_slots",
"_frozen", "_has_post_init",
)
def __init__(self, cls, these, slots, frozen, auto_attribs):
attrs, super_attrs = _transform_attrs(cls, these, auto_attribs)
self._cls = cls
self._cls_dict = dict(cls.__dict__) if slots else {}
self._attrs = attrs
self._super_names = set(a.name for a in super_attrs)
self._attr_names = tuple(a.name for a in attrs)
self._slots = slots
self._frozen = frozen or _has_frozen_superclass(cls)
self._has_post_init = bool(getattr(cls, "__attrs_post_init__", False))
self._cls_dict["__attrs_attrs__"] = self._attrs
if frozen:
self._cls_dict["__setattr__"] = _frozen_setattrs
self._cls_dict["__delattr__"] = _frozen_delattrs
def __repr__(self):
return "<_ClassBuilder(cls={cls})>".format(cls=self._cls.__name__)
def build_class(self):
"""
Finalize class based on the accumulated configuration.
Builder cannot be used anymore after calling this method.
"""
if self._slots is True:
return self._create_slots_class()
else:
return self._patch_original_class()
def _patch_original_class(self):
"""
Apply accumulated methods and return the class.
"""
cls = self._cls
super_names = self._super_names
# Clean class of attribute definitions (`attr.ib()`s).
for name in self._attr_names:
if name not in super_names and \
getattr(cls, name, None) is not None:
delattr(cls, name)
# Attach our dunder methods.
for name, value in self._cls_dict.items():
setattr(cls, name, value)
return cls
def _create_slots_class(self):
"""
Build and return a new class with a `__slots__` attribute.
"""
super_names = self._super_names
cd = {
k: v
for k, v in iteritems(self._cls_dict)
if k not in tuple(self._attr_names) + ("__dict__",)
}
# We only add the names of attributes that aren't inherited.
# Settings __slots__ to inherited attributes wastes memory.
cd["__slots__"] = tuple(
name
for name in self._attr_names
if name not in super_names
)
qualname = getattr(self._cls, "__qualname__", None)
if qualname is not None:
cd["__qualname__"] = qualname
attr_names = tuple(self._attr_names)
def slots_getstate(self):
"""
Automatically created by attrs.
"""
return tuple(getattr(self, name) for name in attr_names)
def slots_setstate(self, state):
"""
Automatically created by attrs.
"""
__bound_setattr = _obj_setattr.__get__(self, Attribute)
for name, value in zip(attr_names, state):
__bound_setattr(name, value)
# slots and frozen require __getstate__/__setstate__ to work
cd["__getstate__"] = slots_getstate
cd["__setstate__"] = slots_setstate
# Create new class based on old class and our methods.
cls = type(self._cls)(
self._cls.__name__,
self._cls.__bases__,
cd,
)
# The following is a fix for
# https://github.com/python-attrs/attrs/issues/102. On Python 3,
# if a method mentions `__class__` or uses the no-arg super(), the
# compiler will bake a reference to the class in the method itself
# as `method.__closure__`. Since we replace the class with a
# clone, we rewrite these references so it keeps working.
for item in cls.__dict__.values():
if isinstance(item, (classmethod, staticmethod)):
# Class- and staticmethods hide their functions inside.
# These might need to be rewritten as well.
closure_cells = getattr(item.__func__, "__closure__", None)
else:
closure_cells = getattr(item, "__closure__", None)
if not closure_cells: # Catch None or the empty list.
continue
for cell in closure_cells:
if cell.cell_contents is self._cls:
set_closure_cell(cell, cls)
return cls
def add_repr(self, ns):
self._cls_dict["__repr__"] = self._add_method_dunders(
_make_repr(self._attrs, ns=ns)
)
return self
def add_str(self):
repr = self._cls_dict.get("__repr__")
if repr is None:
raise ValueError(
"__str__ can only be generated if a __repr__ exists."
)
def __str__(self):
return self.__repr__()
self._cls_dict["__str__"] = self._add_method_dunders(__str__)
return self
def make_unhashable(self):
self._cls_dict["__hash__"] = None
return self
def add_hash(self):
self._cls_dict["__hash__"] = self._add_method_dunders(
_make_hash(self._attrs)
)
return self
def add_init(self):
self._cls_dict["__init__"] = self._add_method_dunders(
_make_init(
self._attrs,
self._has_post_init,
self._frozen,
)
)
return self
def add_cmp(self):
cd = self._cls_dict
cd["__eq__"], cd["__ne__"], cd["__lt__"], cd["__le__"], cd["__gt__"], \
cd["__ge__"] = (
self._add_method_dunders(meth)
for meth in _make_cmp(self._attrs)
)
return self
def _add_method_dunders(self, method):
"""
Add __module__ and __qualname__ to a *method* if possible.
"""
try:
method.__module__ = self._cls.__module__
except AttributeError:
pass
try:
method.__qualname__ = ".".join(
(self._cls.__qualname__, method.__name__,)
)
except AttributeError:
pass
return method
def attrs(maybe_cls=None, these=None, repr_ns=None,
repr=True, cmp=True, hash=None, init=True,
slots=False, frozen=False, str=False, auto_attribs=False):
r"""
A class decorator that adds `dunder
<https://wiki.python.org/moin/DunderAlias>`_\ -methods according to the
specified attributes using :func:`attr.ib` or the *these* argument.
:param these: A dictionary of name to :func:`attr.ib` mappings. This is
useful to avoid the definition of your attributes within the class body
because you can't (e.g. if you want to add ``__repr__`` methods to
Django models) or don't want to.
If *these* is not ``None``, ``attrs`` will *not* search the class body
for attributes.
:type these: :class:`dict` of :class:`str` to :func:`attr.ib`
:param str repr_ns: When using nested classes, there's no way in Python 2
to automatically detect that. Therefore it's possible to set the
namespace explicitly for a more meaningful ``repr`` output.
:param bool repr: Create a ``__repr__`` method with a human readable
representation of ``attrs`` attributes..
:param bool str: Create a ``__str__`` method that is identical to
``__repr__``. This is usually not necessary except for
:class:`Exception`\ s.
:param bool cmp: Create ``__eq__``, ``__ne__``, ``__lt__``, ``__le__``,
``__gt__``, and ``__ge__`` methods that compare the class as if it were
a tuple of its ``attrs`` attributes. But the attributes are *only*
compared, if the type of both classes is *identical*!
:param hash: If ``None`` (default), the ``__hash__`` method is generated
according how *cmp* and *frozen* are set.
1. If *both* are True, ``attrs`` will generate a ``__hash__`` for you.
2. If *cmp* is True and *frozen* is False, ``__hash__`` will be set to
None, marking it unhashable (which it is).
3. If *cmp* is False, ``__hash__`` will be left untouched meaning the
``__hash__`` method of the superclass will be used (if superclass is
``object``, this means it will fall back to id-based hashing.).
Although not recommended, you can decide for yourself and force
``attrs`` to create one (e.g. if the class is immutable even though you
didn't freeze it programmatically) by passing ``True`` or not. Both of
these cases are rather special and should be used carefully.
See the `Python documentation \
<https://docs.python.org/3/reference/datamodel.html#object.__hash__>`_
and the `GitHub issue that led to the default behavior \
<https://github.com/python-attrs/attrs/issues/136>`_ for more details.
:type hash: ``bool`` or ``None``
:param bool init: Create a ``__init__`` method that initializes the
``attrs`` attributes. Leading underscores are stripped for the
argument name. If a ``__attrs_post_init__`` method exists on the
class, it will be called after the class is fully initialized.
:param bool slots: Create a slots_-style class that's more
memory-efficient. See :ref:`slots` for further ramifications.
:param bool frozen: Make instances immutable after initialization. If
someone attempts to modify a frozen instance,
:exc:`attr.exceptions.FrozenInstanceError` is raised.
Please note:
1. This is achieved by installing a custom ``__setattr__`` method
on your class so you can't implement an own one.
2. True immutability is impossible in Python.
3. This *does* have a minor a runtime performance :ref:`impact
<how-frozen>` when initializing new instances. In other words:
``__init__`` is slightly slower with ``frozen=True``.
4. If a class is frozen, you cannot modify ``self`` in
``__attrs_post_init__`` or a self-written ``__init__``. You can
circumvent that limitation by using
``object.__setattr__(self, "attribute_name", value)``.
.. _slots: https://docs.python.org/3/reference/datamodel.html#slots
:param bool auto_attribs: If True, collect `PEP 526`_-annotated attributes
(Python 3.6 and later only) from the class body.
In this case, you **must** annotate every field. If ``attrs``
encounters a field that is set to an :func:`attr.ib` but lacks a type
annotation, an :exc:`attr.exceptions.UnannotatedAttributeError` is
raised. Use ``field_name: typing.Any = attr.ib(...)`` if you don't
want to set a type.
If you assign a value to those attributes (e.g. ``x: int = 42``), that
value becomes the default value like if it were passed using
``attr.ib(default=42)``. Passing an instance of :class:`Factory` also
works as expected.
Attributes annotated as :data:`typing.ClassVar` are **ignored**.
.. _`PEP 526`: https://www.python.org/dev/peps/pep-0526/
.. versionadded:: 16.0.0 *slots*
.. versionadded:: 16.1.0 *frozen*
.. versionadded:: 16.3.0 *str*, and support for ``__attrs_post_init__``.
.. versionchanged::
17.1.0 *hash* supports ``None`` as value which is also the default
now.
.. versionadded:: 17.3.0 *auto_attribs*
"""
def wrap(cls):
if getattr(cls, "__class__", None) is None:
raise TypeError("attrs only works with new-style classes.")
builder = _ClassBuilder(cls, these, slots, frozen, auto_attribs)
if repr is True:
builder.add_repr(repr_ns)
if str is True:
builder.add_str()
if cmp is True:
builder.add_cmp()
if hash is not True and hash is not False and hash is not None:
# Can't use `hash in` because 1 == True for example.
raise TypeError(
"Invalid value for hash. Must be True, False, or None."
)
elif hash is False or (hash is None and cmp is False):
pass
elif hash is True or (hash is None and cmp is True and frozen is True):
builder.add_hash()
else:
builder.make_unhashable()
if init is True:
builder.add_init()
return builder.build_class()
# maybe_cls's type depends on the usage of the decorator. It's a class
# if it's used as `@attrs` but ``None`` if used as `@attrs()`.
if maybe_cls is None:
return wrap
else:
return wrap(maybe_cls)
_attrs = attrs
"""
Internal alias so we can use it in functions that take an argument called
*attrs*.
"""
if PY2:
def _has_frozen_superclass(cls):
"""
Check whether *cls* has a frozen ancestor by looking at its
__setattr__.
"""
return (
getattr(
cls.__setattr__, "__module__", None
) == _frozen_setattrs.__module__ and
cls.__setattr__.__name__ == _frozen_setattrs.__name__
)
else:
def _has_frozen_superclass(cls):
"""
Check whether *cls* has a frozen ancestor by looking at its
__setattr__.
"""
return cls.__setattr__ == _frozen_setattrs
def _attrs_to_tuple(obj, attrs):
"""
Create a tuple of all values of *obj*'s *attrs*.
"""
return tuple(getattr(obj, a.name) for a in attrs)
def _make_hash(attrs):
attrs = tuple(
a
for a in attrs
if a.hash is True or (a.hash is None and a.cmp is True)
)
# We cache the generated hash methods for the same kinds of attributes.
sha1 = hashlib.sha1()
sha1.update(repr(attrs).encode("utf-8"))
unique_filename = "<attrs generated hash %s>" % (sha1.hexdigest(),)
type_hash = hash(unique_filename)
lines = [
"def __hash__(self):",
" return hash((",
" %d," % (type_hash,),
]
for a in attrs:
lines.append(" self.%s," % (a.name))
lines.append(" ))")
script = "\n".join(lines)
globs = {}
locs = {}
bytecode = compile(script, unique_filename, "exec")
eval(bytecode, globs, locs)
# In order of debuggers like PDB being able to step through the code,
# we add a fake linecache entry.
linecache.cache[unique_filename] = (
len(script),
None,
script.splitlines(True),
unique_filename,
)
return locs["__hash__"]
def _add_hash(cls, attrs):
"""
Add a hash method to *cls*.
"""
cls.__hash__ = _make_hash(attrs)
return cls
def __ne__(self, other):
"""
Check equality and either forward a NotImplemented or return the result
negated.
"""
result = self.__eq__(other)
if result is NotImplemented:
return NotImplemented
return not result
def _make_cmp(attrs):
attrs = [a for a in attrs if a.cmp]
# We cache the generated eq methods for the same kinds of attributes.
sha1 = hashlib.sha1()
sha1.update(repr(attrs).encode("utf-8"))
unique_filename = "<attrs generated eq %s>" % (sha1.hexdigest(),)
lines = [
"def __eq__(self, other):",
" if other.__class__ is not self.__class__:",
" return NotImplemented",
]
# We can't just do a big self.x = other.x and... clause due to
# irregularities like nan == nan is false but (nan,) == (nan,) is true.
if attrs:
lines.append(" return (")
others = [
" ) == (",
]
for a in attrs:
lines.append(" self.%s," % (a.name,))
others.append(" other.%s," % (a.name,))
lines += others + [" )"]
else:
lines.append(" return True")
script = "\n".join(lines)
globs = {}
locs = {}
bytecode = compile(script, unique_filename, "exec")
eval(bytecode, globs, locs)
# In order of debuggers like PDB being able to step through the code,
# we add a fake linecache entry.
linecache.cache[unique_filename] = (
len(script),
None,
script.splitlines(True),
unique_filename,
)
eq = locs["__eq__"]
ne = __ne__
def attrs_to_tuple(obj):
"""
Save us some typing.
"""
return _attrs_to_tuple(obj, attrs)
def __lt__(self, other):
"""
Automatically created by attrs.
"""
if isinstance(other, self.__class__):
return attrs_to_tuple(self) < attrs_to_tuple(other)
else:
return NotImplemented
def __le__(self, other):
"""
Automatically created by attrs.
"""
if isinstance(other, self.__class__):
return attrs_to_tuple(self) <= attrs_to_tuple(other)
else:
return NotImplemented
def __gt__(self, other):
"""
Automatically created by attrs.
"""
if isinstance(other, self.__class__):
return attrs_to_tuple(self) > attrs_to_tuple(other)
else:
return NotImplemented
def __ge__(self, other):
"""
Automatically created by attrs.
"""
if isinstance(other, self.__class__):
return attrs_to_tuple(self) >= attrs_to_tuple(other)
else:
return NotImplemented
return eq, ne, __lt__, __le__, __gt__, __ge__
def _add_cmp(cls, attrs=None):
"""
Add comparison methods to *cls*.
"""
if attrs is None:
attrs = cls.__attrs_attrs__
cls.__eq__, cls.__ne__, cls.__lt__, cls.__le__, cls.__gt__, cls.__ge__ = \
_make_cmp(attrs)
return cls
def _make_repr(attrs, ns):
"""
Make a repr method for *attr_names* adding *ns* to the full name.
"""
attr_names = tuple(
a.name
for a in attrs
if a.repr
)
def __repr__(self):
"""
Automatically created by attrs.
"""
real_cls = self.__class__
if ns is None:
qualname = getattr(real_cls, "__qualname__", None)
if qualname is not None:
class_name = qualname.rsplit(">.", 1)[-1]
else:
class_name = real_cls.__name__
else:
class_name = ns + "." + real_cls.__name__
return "{0}({1})".format(
class_name,
", ".join(
name + "=" + repr(getattr(self, name, NOTHING))
for name in attr_names
)
)
return __repr__
def _add_repr(cls, ns=None, attrs=None):
"""
Add a repr method to *cls*.
"""
if attrs is None:
attrs = cls.__attrs_attrs__
cls.__repr__ = _make_repr(attrs, ns)
return cls
def _make_init(attrs, post_init, frozen):
attrs = [
a
for a in attrs
if a.init or a.default is not NOTHING
]
# We cache the generated init methods for the same kinds of attributes.
sha1 = hashlib.sha1()
sha1.update(repr(attrs).encode("utf-8"))
unique_filename = "<attrs generated init {0}>".format(
sha1.hexdigest()
)
script, globs = _attrs_to_init_script(
attrs,
frozen,
post_init,
)
locs = {}
bytecode = compile(script, unique_filename, "exec")
attr_dict = dict((a.name, a) for a in attrs)
globs.update({
"NOTHING": NOTHING,
"attr_dict": attr_dict,
})
if frozen is True:
# Save the lookup overhead in __init__ if we need to circumvent
# immutability.
globs["_cached_setattr"] = _obj_setattr
eval(bytecode, globs, locs)
# In order of debuggers like PDB being able to step through the code,
# we add a fake linecache entry.
linecache.cache[unique_filename] = (
len(script),
None,
script.splitlines(True),
unique_filename,
)
return locs["__init__"]
def _add_init(cls, frozen):
"""
Add a __init__ method to *cls*. If *frozen* is True, make it immutable.
"""
cls.__init__ = _make_init(
cls.__attrs_attrs__,
getattr(cls, "__attrs_post_init__", False),
frozen,
)
return cls
def fields(cls):
"""
Returns the tuple of ``attrs`` attributes for a class.
The tuple also allows accessing the fields by their names (see below for
examples).
:param type cls: Class to introspect.
:raise TypeError: If *cls* is not a class.
:raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
class.
:rtype: tuple (with name accessors) of :class:`attr.Attribute`
.. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
by name.
"""
if not isclass(cls):
raise TypeError("Passed object must be a class.")
attrs = getattr(cls, "__attrs_attrs__", None)
if attrs is None:
raise NotAnAttrsClassError(
"{cls!r} is not an attrs-decorated class.".format(cls=cls)
)
return attrs
def validate(inst):
"""
Validate all attributes on *inst* that have a validator.
Leaves all exceptions through.
:param inst: Instance of a class with ``attrs`` attributes.
"""
if _config._run_validators is False:
return
for a in fields(inst.__class__):
v = a.validator
if v is not None:
v(inst, a, getattr(inst, a.name))
def _attrs_to_init_script(attrs, frozen, post_init):
"""
Return a script of an initializer for *attrs* and a dict of globals.
The globals are expected by the generated script.
If *frozen* is True, we cannot set the attributes directly so we use
a cached ``object.__setattr__``.
"""
lines = []
if frozen is True:
lines.append(
# Circumvent the __setattr__ descriptor to save one lookup per
# assignment.
"_setattr = _cached_setattr.__get__(self, self.__class__)"
)
def fmt_setter(attr_name, value_var):
return "_setattr('%(attr_name)s', %(value_var)s)" % {
"attr_name": attr_name,
"value_var": value_var,
}
def fmt_setter_with_converter(attr_name, value_var):
conv_name = _init_converter_pat.format(attr_name)
return "_setattr('%(attr_name)s', %(conv)s(%(value_var)s))" % {
"attr_name": attr_name,
"value_var": value_var,
"conv": conv_name,
}
else:
def fmt_setter(attr_name, value):
return "self.%(attr_name)s = %(value)s" % {
"attr_name": attr_name,
"value": value,
}
def fmt_setter_with_converter(attr_name, value_var):
conv_name = _init_converter_pat.format(attr_name)
return "self.%(attr_name)s = %(conv)s(%(value_var)s)" % {
"attr_name": attr_name,
"value_var": value_var,
"conv": conv_name,
}
args = []
attrs_to_validate = []
# This is a dictionary of names to validator and converter callables.
# Injecting this into __init__ globals lets us avoid lookups.
names_for_globals = {}
for a in attrs:
if a.validator:
attrs_to_validate.append(a)
attr_name = a.name
arg_name = a.name.lstrip("_")
has_factory = isinstance(a.default, Factory)
if has_factory and a.default.takes_self:
maybe_self = "self"
else:
maybe_self = ""
if a.init is False:
if has_factory:
init_factory_name = _init_factory_pat.format(a.name)
if a.converter is not None:
lines.append(fmt_setter_with_converter(
attr_name,
init_factory_name + "({0})".format(maybe_self)))
conv_name = _init_converter_pat.format(a.name)
names_for_globals[conv_name] = a.converter
else:
lines.append(fmt_setter(
attr_name,
init_factory_name + "({0})".format(maybe_self)
))
names_for_globals[init_factory_name] = a.default.factory
else:
if a.converter is not None:
lines.append(fmt_setter_with_converter(
attr_name,
"attr_dict['{attr_name}'].default"
.format(attr_name=attr_name)
))
conv_name = _init_converter_pat.format(a.name)
names_for_globals[conv_name] = a.converter
else:
lines.append(fmt_setter(
attr_name,
"attr_dict['{attr_name}'].default"
.format(attr_name=attr_name)
))
elif a.default is not NOTHING and not has_factory:
args.append(
"{arg_name}=attr_dict['{attr_name}'].default".format(
arg_name=arg_name,
attr_name=attr_name,
)
)
if a.converter is not None:
lines.append(fmt_setter_with_converter(attr_name, arg_name))
names_for_globals[_init_converter_pat.format(a.name)] = (
a.converter
)
else:
lines.append(fmt_setter(attr_name, arg_name))
elif has_factory:
args.append("{arg_name}=NOTHING".format(arg_name=arg_name))
lines.append("if {arg_name} is not NOTHING:"
.format(arg_name=arg_name))
init_factory_name = _init_factory_pat.format(a.name)
if a.converter is not None:
lines.append(" " + fmt_setter_with_converter(
attr_name, arg_name
))
lines.append("else:")
lines.append(" " + fmt_setter_with_converter(
attr_name,
init_factory_name + "({0})".format(maybe_self)
))
names_for_globals[_init_converter_pat.format(a.name)] = (
a.converter
)
else:
lines.append(" " + fmt_setter(attr_name, arg_name))
lines.append("else:")
lines.append(" " + fmt_setter(
attr_name,
init_factory_name + "({0})".format(maybe_self)
))
names_for_globals[init_factory_name] = a.default.factory
else:
args.append(arg_name)
if a.converter is not None:
lines.append(fmt_setter_with_converter(attr_name, arg_name))
names_for_globals[_init_converter_pat.format(a.name)] = (
a.converter
)
else:
lines.append(fmt_setter(attr_name, arg_name))
if attrs_to_validate: # we can skip this if there are no validators.
names_for_globals["_config"] = _config
lines.append("if _config._run_validators is True:")
for a in attrs_to_validate:
val_name = "__attr_validator_{}".format(a.name)
attr_name = "__attr_{}".format(a.name)
lines.append(" {}(self, {}, self.{})".format(
val_name, attr_name, a.name))
names_for_globals[val_name] = a.validator
names_for_globals[attr_name] = a
if post_init:
lines.append("self.__attrs_post_init__()")
return """\
def __init__(self, {args}):
{lines}
""".format(
args=", ".join(args),
lines="\n ".join(lines) if lines else "pass",
), names_for_globals
class Attribute(object):
"""
*Read-only* representation of an attribute.
:attribute name: The name of the attribute.
Plus *all* arguments of :func:`attr.ib`.
For the version history of the fields, see :func:`attr.ib`.
"""
__slots__ = (
"name", "default", "validator", "repr", "cmp", "hash", "init",
"metadata", "type", "converter",
)
def __init__(self, name, default, validator, repr, cmp, hash, init,
convert=None, metadata=None, type=None, converter=None):
# Cache this descriptor here to speed things up later.
bound_setattr = _obj_setattr.__get__(self, Attribute)
# Despite the big red warning, people *do* instantiate `Attribute`
# themselves.
if convert is not None:
if converter is not None:
raise RuntimeError(
"Can't pass both `convert` and `converter`. "
"Please use `converter` only."
)
warnings.warn(
"The `convert` argument is deprecated in favor of `converter`."
" It will be removed after 2019/01.",
DeprecationWarning, stacklevel=2
)
converter = convert
bound_setattr("name", name)
bound_setattr("default", default)
bound_setattr("validator", validator)
bound_setattr("repr", repr)
bound_setattr("cmp", cmp)
bound_setattr("hash", hash)
bound_setattr("init", init)
bound_setattr("converter", converter)
bound_setattr("metadata", (
metadata_proxy(metadata) if metadata
else _empty_metadata_singleton
))
bound_setattr("type", type)
def __setattr__(self, name, value):
raise FrozenInstanceError()
@property
def convert(self):
warnings.warn(
"The `convert` attribute is deprecated in favor of `converter`. "
"It will be removed after 2019/01.",
DeprecationWarning, stacklevel=2,
)
return self.converter
@classmethod
def from_counting_attr(cls, name, ca, type=None):
# type holds the annotated value. deal with conflicts:
if type is None:
type = ca.type
elif ca.type is not None:
raise ValueError(
"Type annotation and type argument cannot both be present"
)
inst_dict = {
k: getattr(ca, k)
for k
in Attribute.__slots__
if k not in (
"name", "validator", "default", "type", "convert",
) # exclude methods and deprecated alias
}
return cls(
name=name, validator=ca._validator, default=ca._default, type=type,
**inst_dict
)
# Don't use _add_pickle since fields(Attribute) doesn't work
def __getstate__(self):
"""
Play nice with pickle.
"""
return tuple(getattr(self, name) if name != "metadata"
else dict(self.metadata)
for name in self.__slots__)
def __setstate__(self, state):
"""
Play nice with pickle.
"""
bound_setattr = _obj_setattr.__get__(self, Attribute)
for name, value in zip(self.__slots__, state):
if name != "metadata":
bound_setattr(name, value)
else:
bound_setattr(name, metadata_proxy(value) if value else
_empty_metadata_singleton)
_a = [
Attribute(name=name, default=NOTHING, validator=None,
repr=True, cmp=True, hash=(name != "metadata"), init=True)
for name in Attribute.__slots__
if name != "convert" # XXX: remove once `convert` is gone
]
Attribute = _add_hash(
_add_cmp(_add_repr(Attribute, attrs=_a), attrs=_a),
attrs=[a for a in _a if a.hash]
)
class _CountingAttr(object):
"""
Intermediate representation of attributes that uses a counter to preserve
the order in which the attributes have been defined.
*Internal* data structure of the attrs library. Running into is most
likely the result of a bug like a forgotten `@attr.s` decorator.
"""
__slots__ = ("counter", "_default", "repr", "cmp", "hash", "init",
"metadata", "_validator", "converter", "type")
__attrs_attrs__ = tuple(
Attribute(name=name, default=NOTHING, validator=None,
repr=True, cmp=True, hash=True, init=True)
for name
in ("counter", "_default", "repr", "cmp", "hash", "init",)
) + (
Attribute(name="metadata", default=None, validator=None,
repr=True, cmp=True, hash=False, init=True),
)
cls_counter = 0
def __init__(self, default, validator, repr, cmp, hash, init, converter,
metadata, type):
_CountingAttr.cls_counter += 1
self.counter = _CountingAttr.cls_counter
self._default = default
# If validator is a list/tuple, wrap it using helper validator.
if validator and isinstance(validator, (list, tuple)):
self._validator = and_(*validator)
else:
self._validator = validator
self.repr = repr
self.cmp = cmp
self.hash = hash
self.init = init
self.converter = converter
self.metadata = metadata
self.type = type
def validator(self, meth):
"""
Decorator that adds *meth* to the list of validators.
Returns *meth* unchanged.
.. versionadded:: 17.1.0
"""
if self._validator is None:
self._validator = meth
else:
self._validator = and_(self._validator, meth)
return meth
def default(self, meth):
"""
Decorator that allows to set the default for an attribute.
Returns *meth* unchanged.
:raises DefaultAlreadySetError: If default has been set before.
.. versionadded:: 17.1.0
"""
if self._default is not NOTHING:
raise DefaultAlreadySetError()
self._default = Factory(meth, takes_self=True)
return meth
_CountingAttr = _add_cmp(_add_repr(_CountingAttr))
@attrs(slots=True, init=False, hash=True)
class Factory(object):
"""
Stores a factory callable.
If passed as the default value to :func:`attr.ib`, the factory is used to
generate a new value.
:param callable factory: A callable that takes either none or exactly one
mandatory positional argument depending on *takes_self*.
:param bool takes_self: Pass the partially initialized instance that is
being initialized as a positional argument.
.. versionadded:: 17.1.0 *takes_self*
"""
factory = attrib()
takes_self = attrib()
def __init__(self, factory, takes_self=False):
"""
`Factory` is part of the default machinery so if we want a default
value here, we have to implement it ourselves.
"""
self.factory = factory
self.takes_self = takes_self
def make_class(name, attrs, bases=(object,), **attributes_arguments):
"""
A quick way to create a new class called *name* with *attrs*.
:param name: The name for the new class.
:type name: str
:param attrs: A list of names or a dictionary of mappings of names to
attributes.
:type attrs: :class:`list` or :class:`dict`
:param tuple bases: Classes that the new class will subclass.
:param attributes_arguments: Passed unmodified to :func:`attr.s`.
:return: A new class with *attrs*.
:rtype: type
.. versionadded:: 17.1.0 *bases*
"""
if isinstance(attrs, dict):
cls_dict = attrs
elif isinstance(attrs, (list, tuple)):
cls_dict = dict((a, attrib()) for a in attrs)
else:
raise TypeError("attrs argument must be a dict or a list.")
post_init = cls_dict.pop("__attrs_post_init__", None)
type_ = type(
name,
bases,
{} if post_init is None else {"__attrs_post_init__": post_init}
)
# For pickling to work, the __module__ variable needs to be set to the
# frame where the class is created. Bypass this step in environments where
# sys._getframe is not defined (Jython for example) or sys._getframe is not
# defined for arguments greater than 0 (IronPython).
try:
type_.__module__ = sys._getframe(1).f_globals.get(
"__name__", "__main__",
)
except (AttributeError, ValueError):
pass
return _attrs(these=cls_dict, **attributes_arguments)(type_)
# These are required by within this module so we define them here and merely
# import into .validators.
@attrs(slots=True, hash=True)
class _AndValidator(object):
"""
Compose many validators to a single one.
"""
_validators = attrib()
def __call__(self, inst, attr, value):
for v in self._validators:
v(inst, attr, value)
def and_(*validators):
"""
A validator that composes multiple validators into one.
When called on a value, it runs all wrapped validators.
:param validators: Arbitrary number of validators.
:type validators: callables
.. versionadded:: 17.1.0
"""
vals = []
for validator in validators:
vals.extend(
validator._validators if isinstance(validator, _AndValidator)
else [validator]
)
return _AndValidator(tuple(vals))
|
nparley/mylatitude
|
lib/attr/_make.py
|
Python
|
mit
| 49,291
|
var People = function(names) {
this.allNames = [];
names.forEach(function(name) {
name = name.charAt(0).toUpperCase() + name.slice(1);
this.allNames.push(name);
}.bind(this));
};
People.prototype.getNames = function() {
return this.allNames;
};
People.prototype.sort = function() {
this.allNames.sort();
return this.getNames();
};
|
litterbox-sf-fall/peeps
|
src/nameSort.js
|
JavaScript
|
mit
| 352
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zfc: 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.12.1 / zfc - 8.8.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zfc
<small>
8.8.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-11-05 05:36:06 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-05 05:36:06 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
coq 8.12.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
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
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/zfc"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZFC"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [
"keyword: set theory"
"keyword: Zermelo-Fraenkel"
"keyword: Calculus of Inductive Constructions"
"category: Mathematics/Logic/Set theory"
]
authors: [ "Benjamin Werner" ]
bug-reports: "https://github.com/coq-contribs/zfc/issues"
dev-repo: "git+https://github.com/coq-contribs/zfc.git"
synopsis: "An encoding of Zermelo-Fraenkel Set Theory in Coq"
description: """
The encoding of Zermelo-Fraenkel Set Theory is largely inspired by
Peter Aczel's work dating back to the eighties. A type Ens is defined,
which represents sets. Two predicates IN and EQ stand for membership
and extensional equality between sets. The axioms of ZFC are then
proved and thus appear as theorems in the development.
A main motivation for this work is the comparison of the respective
expressive power of Coq and ZFC.
A non-computational type-theoretical axiom of choice is necessary to
prove the replacement schemata and the set-theoretical AC.
The main difference between this work and Peter Aczel's is that
propositions are defined on the impredicative level Prop. Since the
definition of Ens is, however, still unchanged, I also added most of
Peter Aczel's definition. The main advantage of Aczel's approach is a
more constructive vision of the existential quantifier (which gives
the set-theoretical axiom of choice for free)."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/zfc/archive/v8.8.0.tar.gz"
checksum: "md5=69691e2c36cf1059f8655ec7ba029d90"
}
</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-zfc.8.8.0 coq.8.12.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.1).
The following dependencies couldn't be met:
- coq-zfc -> coq < 8.9~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-zfc.8.8.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.07.1-2.0.6/released/8.12.1/zfc/8.8.0.html
|
HTML
|
mit
| 7,669
|
module AuthenticatedSystem
# empty placeholder so that we can still use rails generators, etc. without complaints.
# This will normally be provided by the containing rails app.
end
|
concord-consortium/smartgraphs-connector
|
lib/authenticated_system.rb
|
Ruby
|
mit
| 185
|
raywaster
=========
C# raycasting renderer
|
r2d2rigo/raywaster
|
README.md
|
Markdown
|
mit
| 44
|
package exam1;
/**
*
* @author Eddie Gurnee
* @version 10/07/13
* @see AClass
* @see BClass
*
*/
import java.util.Scanner;
public class TestingAandBClass {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
System.out.print("Please Enter x value for object A: ");
int xA = kb.nextInt();
System.out.print("Please Enter y value for object A: ");
int yA = kb.nextInt();
System.out.print("Please Enter x value for object B: ");
int xB = kb.nextInt();
System.out.print("Please Enter y value for object B: ");
int yB = kb.nextInt();
System.out.print("Please Enter z value for object B: ");
int zB = kb.nextInt();
AClass aObj = new AClass(xA, yA);
BClass bObj = new BClass(xB, yB, zB);
aObj.changeEm();
System.out.println(aObj.toString());
System.out.println(bObj.addEm());
System.out.println(bObj.toString());
kb.close();
}
}
|
pegurnee/2013-03-211
|
workspace/Exam1/src/exam1/TestingAandBClass.java
|
Java
|
mit
| 901
|
# poolball-physics
|
baiIey/poolball-physics
|
README.md
|
Markdown
|
mit
| 19
|
<div>
<form-field-wrapper>
<div slot="FormFieldInput" v-el:form-field-input>
<autocomplete-input :val.sync="subjects" :options="field.suggestions"></autocomplete-input>
</div>
<div slot="HelpButton">
<help-initiator-button></help-initiator-button>
</div>
</form-field-wrapper>
</div>
|
libris/swepubanalys
|
src/main/resources/client/components/SubjectInput/SubjectInput.html
|
HTML
|
mit
| 299
|
var Watcher = require('./watcher')
var middleware = require('./middleware')
var http = require('http')
var connect = require('connect')
exports.serve = serve
function serve (builder, options) {
options = options || {}
console.log('Serving on http://' + options.host + ':' + options.port + '\n')
var watcher = options.watcher || new Watcher(builder, {verbose: true})
var app = connect().use(middleware(watcher))
var server = http.createServer(app)
// We register these so the 'exit' handler removing temp dirs is called
function cleanupAndExit() {
builder.cleanup().catch(function(err) {
console.error('Cleanup error:')
console.error(err && err.stack ? err.stack : err)
}).finally(function() {
process.exit(1)
})
}
process.on('SIGINT', cleanupAndExit)
process.on('SIGTERM', cleanupAndExit)
watcher.on('change', function(results) {
console.log('Built - ' + Math.round(results.totalTime / 1e6) + ' ms @ ' + new Date().toString())
})
watcher.on('error', function(err) {
console.log('Built with error:')
// Should also show file and line/col if present; see cli.js
if (err.file) {
console.log('File: ' + err.file)
}
console.log(err.stack)
console.log('')
})
server.listen(parseInt(options.port, 10), options.host)
}
|
osxi/broccoli
|
lib/server.js
|
JavaScript
|
mit
| 1,315
|
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
const Router = EmberRouter.extend({
location: config.locationType,
rootURL: config.rootURL
});
Router.map(function() {
this.route('home', { path: '/' });
this.route('apple');
this.route('banana');
this.route('coconut');
this.route('durian');
this.route('elderberry');
this.route('fig');
this.route('grape');
this.route('honeydew');
});
export default Router;
|
queertangocollective/ui
|
tests/dummy/app/router.js
|
JavaScript
|
mit
| 476
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>paco: 1 m 34 s 🏆</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.12.0 / paco - 4.1.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
paco
<small>
4.1.0
<span class="label label-success">1 m 34 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-02 09:40:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-02 09:40:27 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
coq 8.12.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.05.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.05.0 Official 4.05.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "minki.cho@sf.snu.ac.kr"
synopsis: "Coq library implementing parameterized coinduction"
homepage: "https://github.com/snu-sf/paco/"
dev-repo: "git+https://github.com/snu-sf/paco.git"
bug-reports: "https://github.com/snu-sf/paco/issues/"
authors: [
"Chung-Kil Hur <gil.hur@sf.snu.ac.kr>"
"Georg Neis <neis@mpi-sws.org>"
"Derek Dreyer <dreyer@mpi-sws.org>"
"Viktor Vafeiadis <viktor@mpi-sws.org>"
"Minki Cho <minki.cho@sf.snu.ac.kr>"
]
license: "BSD-3-Clause"
build: [make "-C" "src" "all" "-j%{jobs}%"]
install: [make "-C" "src" "-f" "Makefile.coq" "install"]
depends: [
"coq" {>= "8.9" & < "8.14~"}
]
tags: [
"date:2021-03-16"
"category:Computer Science/Programming Languages/Formal Definitions and Theory"
"category:Mathematics/Logic"
"keyword:co-induction"
"keyword:simulation"
"keyword:parameterized greatest fixed point"
"logpath:Paco"
]
url {
http: "https://github.com/snu-sf/paco/archive/v4.1.0.tar.gz"
checksum: "83ac51189c7f0224355e18478208c307"
}
</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-paco.4.1.0 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>0</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>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-paco.4.1.0 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>10 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-paco.4.1.0 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>1 m 34 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 9 M</p>
<ul>
<li>742 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac_internal.vo</code></li>
<li>548 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac_internal.glob</code></li>
<li>512 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco14.vo</code></li>
<li>469 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco13.vo</code></li>
<li>429 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco12.vo</code></li>
<li>390 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco11.vo</code></li>
<li>353 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco10.vo</code></li>
<li>318 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco9.vo</code></li>
<li>285 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco8.vo</code></li>
<li>253 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco7.vo</code></li>
<li>222 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco6.vo</code></li>
<li>193 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco5.vo</code></li>
<li>167 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco4.vo</code></li>
<li>142 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco3.vo</code></li>
<li>121 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac_internal.v</code></li>
<li>119 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/examples.vo</code></li>
<li>118 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco2.vo</code></li>
<li>117 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation.glob</code></li>
<li>115 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco14.glob</code></li>
<li>115 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco14.vo</code></li>
<li>110 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco13.glob</code></li>
<li>106 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco12.glob</code></li>
<li>104 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco13.vo</code></li>
<li>102 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco11.glob</code></li>
<li>100 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation_internal.vo</code></li>
<li>98 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco10.glob</code></li>
<li>96 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco1.vo</code></li>
<li>95 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco12.vo</code></li>
<li>92 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco9.glob</code></li>
<li>90 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco8.glob</code></li>
<li>87 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco7.glob</code></li>
<li>85 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco11.vo</code></li>
<li>85 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco6.glob</code></li>
<li>83 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco5.glob</code></li>
<li>82 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco4.glob</code></li>
<li>81 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco3.glob</code></li>
<li>79 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco2.glob</code></li>
<li>78 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco1.glob</code></li>
<li>77 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco0.glob</code></li>
<li>77 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco10.vo</code></li>
<li>75 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation.vo</code></li>
<li>74 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco0.vo</code></li>
<li>68 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco9.vo</code></li>
<li>68 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/tutorial.vo</code></li>
<li>67 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco14.glob</code></li>
<li>64 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacotac.vo</code></li>
<li>62 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco13.glob</code></li>
<li>61 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco8.vo</code></li>
<li>58 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation_internal.glob</code></li>
<li>56 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco12.glob</code></li>
<li>53 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco7.vo</code></li>
<li>52 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco11.glob</code></li>
<li>47 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco10.glob</code></li>
<li>46 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco6.vo</code></li>
<li>44 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac.vo</code></li>
<li>42 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco9.glob</code></li>
<li>40 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco5.vo</code></li>
<li>38 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco8.glob</code></li>
<li>35 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco7.glob</code></li>
<li>34 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco4.vo</code></li>
<li>32 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco6.glob</code></li>
<li>30 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco5.glob</code></li>
<li>29 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco3.vo</code></li>
<li>29 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco14.v</code></li>
<li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco13.v</code></li>
<li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacotac.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/tutorial.glob</code></li>
<li>28 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco12.v</code></li>
<li>27 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco4.glob</code></li>
<li>27 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco11.v</code></li>
<li>27 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco10.v</code></li>
<li>26 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco9.v</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco8.v</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco7.v</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco3.glob</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco6.v</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco2.vo</code></li>
<li>25 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco5.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco4.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/tutorial.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco3.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco2.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco1.v</code></li>
<li>24 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpaco0.v</code></li>
<li>23 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco2.glob</code></li>
<li>23 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/examples.glob</code></li>
<li>21 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco1.glob</code></li>
<li>21 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco1.vo</code></li>
<li>19 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacotac.v</code></li>
<li>19 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco0.glob</code></li>
<li>18 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco_internal.vo</code></li>
<li>16 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco0.vo</code></li>
<li>15 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation.v</code></li>
<li>14 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco_internal.glob</code></li>
<li>13 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/hpattern.vo</code></li>
<li>10 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco14.v</code></li>
<li>10 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco13.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco12.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paconotation_internal.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco11.v</code></li>
<li>9 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/examples.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco10.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco9.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco8.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco7.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco6.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco5.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacotac.glob</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco4.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco3.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco2.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco1.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco0.v</code></li>
<li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacoall.vo</code></li>
<li>5 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco.vo</code></li>
<li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/hpattern.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco_internal.v</code></li>
<li>4 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacoall.vo</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/hpattern.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacoall.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacoall.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/gpacoall.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/pacoall.v</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/Paco/paco.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-paco.4.1.0</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.05.0-2.0.1/released/8.12.0/paco/4.1.0.html
|
HTML
|
mit
| 20,466
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>coqprime: 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.7.1+2 / coqprime - 1.0.5</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
coqprime
<small>
1.0.5
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-11-21 02:02:39 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-21 02:02:39 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.7.1+2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "thery@sophia.inria.fr"
homepage: "https://github.com/thery/coqprime"
bug-reports: "https://github.com/thery/coqprime/issues"
dev-repo: "git+https://github.com/thery/coqprime.git"
license: "LGPL-2.1-only"
authors: ["Laurent Théry"]
build: [
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"ocaml"
"coq" {>= "8.10~" & < "8.12"}
"coq-bignums"
]
synopsis: "Certifying prime numbers in Coq"
url {
src: "https://github.com/thery/coqprime/archive/v8.10b.zip"
checksum: "sha512=8debbad953f083137c5ab73be0615983af42188c34852bfca3eb7cc92f13432bcbeadc4b464ef1c389d354c68bac013fdfc400d1dd49fc370ff8ac5cff612343"
}
</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-coqprime.1.0.5 coq.8.7.1+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.7.1+2).
The following dependencies couldn't be met:
- coq-coqprime -> coq >= 8.10~
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-coqprime.1.0.5</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1+2/coqprime/1.0.5.html
|
HTML
|
mit
| 6,548
|
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Injector, RenderComponentType, RootRenderer, Sanitizer, SecurityContext, ViewEncapsulation, getDebugNode} from '@angular/core';
import {DebugContext, NodeDef, NodeFlags, RootData, Services, ViewData, ViewDefinition, ViewFlags, ViewHandleEventFn, ViewUpdateFn, anchorDef, asElementData, elementDef, rootRenderNodes, textDef, viewDef} from '@angular/core/src/view/index';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {createRootView, isBrowser} from './helper';
export function main() {
describe(`View Anchor`, () => {
function compViewDef(
nodes: NodeDef[], updateDirectives?: ViewUpdateFn, updateRenderer?: ViewUpdateFn,
handleEvent?: ViewHandleEventFn): ViewDefinition {
return viewDef(ViewFlags.None, nodes, updateDirectives, updateRenderer, handleEvent);
}
function createAndGetRootNodes(
viewDef: ViewDefinition, ctx?: any): {rootNodes: any[], view: ViewData} {
const view = createRootView(viewDef, ctx);
const rootNodes = rootRenderNodes(view);
return {rootNodes, view};
}
describe('create', () => {
it('should create anchor nodes without parents', () => {
const rootNodes = createAndGetRootNodes(compViewDef([
anchorDef(NodeFlags.None, null, null, 0)
])).rootNodes;
expect(rootNodes.length).toBe(1);
});
it('should create views with multiple root anchor nodes', () => {
const rootNodes =
createAndGetRootNodes(compViewDef([
anchorDef(NodeFlags.None, null, null, 0), anchorDef(NodeFlags.None, null, null, 0)
])).rootNodes;
expect(rootNodes.length).toBe(2);
});
it('should create anchor nodes with parents', () => {
const rootNodes = createAndGetRootNodes(compViewDef([
elementDef(NodeFlags.None, null, null, 1, 'div'),
anchorDef(NodeFlags.None, null, null, 0),
])).rootNodes;
expect(getDOM().childNodes(rootNodes[0]).length).toBe(1);
});
it('should add debug information to the renderer', () => {
const someContext = new Object();
const {view, rootNodes} = createAndGetRootNodes(
compViewDef([anchorDef(NodeFlags.None, null, null, 0)]), someContext);
expect(getDebugNode(rootNodes[0]).nativeNode).toBe(asElementData(view, 0).renderElement);
});
});
});
}
|
tolemac/angular
|
modules/@angular/core/test/view/anchor_spec.ts
|
TypeScript
|
mit
| 2,693
|
// Copyright (c) 2011-2013 The CoinsBazar developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef SIGNVERIFYMESSAGEDIALOG_H
#define SIGNVERIFYMESSAGEDIALOG_H
#include <QDialog>
class WalletModel;
namespace Ui {
class SignVerifyMessageDialog;
}
class SignVerifyMessageDialog : public QDialog
{
Q_OBJECT
public:
explicit SignVerifyMessageDialog(QWidget *parent);
~SignVerifyMessageDialog();
void setModel(WalletModel *model);
void setAddress_SM(const QString &address);
void setAddress_VM(const QString &address);
void showTab_SM(bool fShow);
void showTab_VM(bool fShow);
protected:
bool eventFilter(QObject *object, QEvent *event);
private:
Ui::SignVerifyMessageDialog *ui;
WalletModel *model;
private slots:
/* sign message */
void on_addressBookButton_SM_clicked();
void on_pasteButton_SM_clicked();
void on_signMessageButton_SM_clicked();
void on_copySignatureButton_SM_clicked();
void on_clearButton_SM_clicked();
/* verify message */
void on_addressBookButton_VM_clicked();
void on_verifyMessageButton_VM_clicked();
void on_clearButton_VM_clicked();
};
#endif // SIGNVERIFYMESSAGEDIALOG_H
|
aqavi-paracha/coinsbazar
|
src/qt/signverifymessagedialog.h
|
C
|
mit
| 1,299
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Web.WebPages.OAuth;
using AngularSignal.Models;
namespace AngularSignal
{
public static class AuthConfig
{
public static void RegisterAuth()
{
// To let users of this site log in using their accounts from other sites such as Microsoft, Facebook, and Twitter,
// you must update this site. For more information visit http://go.microsoft.com/fwlink/?LinkID=252166
//OAuthWebSecurity.RegisterMicrosoftClient(
// clientId: "",
// clientSecret: "");
//OAuthWebSecurity.RegisterTwitterClient(
// consumerKey: "",
// consumerSecret: "");
//OAuthWebSecurity.RegisterFacebookClient(
// appId: "",
// appSecret: "");
//OAuthWebSecurity.RegisterGoogleClient();
}
}
}
|
danielfoord/ngSignalR-demo
|
ngSignalR/App_Start/AuthConfig.cs
|
C#
|
mit
| 964
|
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio.TaskRouter;
class Example
{
static void Main(string[] args)
{
// Find your Account Sid and Auth Token at twilio.com/user/account
string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
string AuthToken = "your_auth_token";
string WorkspaceSid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
string TaskSid = "WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
string ReservationSid = "WRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
var client = new TaskRouterClient(AccountSid, AuthToken);
Reservation reservation = client.GetReservation(WorkspaceSid, TaskSid, ReservationSid);
Console.WriteLine(reservation.ReservationStatus);
Console.WriteLine(reservation.WorkerName);
}
}
|
teoreteetik/api-snippets
|
rest/taskrouter/reservations/instance/get/example-1/example-1.4.x.cs
|
C#
|
mit
| 794
|
/*************************************************************************
*
* Copyright (c) 2008-2009 Kohei Yoshida
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
************************************************************************/
#include "nodecontainer.hxx"
#include <cassert>
using ::std::map;
using ::std::vector;
namespace mdds {
NodeContainer2D::NodeContainer2D()
{
}
NodeContainer2D::~NodeContainer2D()
{
}
void NodeContainer2D::add(const Node& node)
{
// Check if the x value already exists.
XYNodeMap::iterator posX = mNodeMap.find(node.x);
{
XYNodeMap::iterator itrEnd = mNodeMap.end();
if (posX == itrEnd)
{
// This x value does not exist yet. Insert a new map for it.
if (!mNodeMap.insert(XYNodeMap::value_type(node.x, YNodeMap())).second)
// insertion failed.
return;
posX = mNodeMap.find(node.x);
assert(posX != itrEnd);
}
}
// Now, check if a map for this y value already exists. If not, create one.
YNodeMap& ymap = posX->second;
YNodeMap::iterator posY = ymap.find(node.y);
{
YNodeMap::iterator itrEnd = ymap.end();
if (posY == itrEnd)
{
if (!ymap.insert(YNodeMap::value_type(node.y, NodeList())).second)
// insertion failed.
return;
posY = ymap.find(node.y);
assert(posY != itrEnd);
}
}
NodeList& nodelist = posY->second;
nodelist.push_back(node);
}
void NodeContainer2D::getAllNodes(vector<Node>& nodes) const
{
XYNodeMap::const_iterator itrX = mNodeMap.begin(), itrXEnd = mNodeMap.end();
for (; itrX != itrXEnd; ++itrX)
{
YNodeMap::const_iterator itrY = itrX->second.begin(), itrYEnd = itrX->second.end();
for (; itrY != itrYEnd; ++itrY)
copy(itrY->second.begin(), itrY->second.end(), back_inserter(nodes));
}
}
void NodeContainer2D::clear()
{
mNodeMap.clear();
}
}
|
Distrotech/mdds
|
obsolete/nodecontainer.cpp
|
C++
|
mit
| 3,066
|
<?php namespace timestr;
function testOne()
{
$i = 0;
ob_start();
while ($i < 100000) {
$a = "something";
echo "SSSSSAAAAAAAAAYyyyyyyy " . $a;
$i++;
}
ob_end_clean();
unset($a, $i);
}
function testTwo()
{
$i = 0;
ob_start();
while ($i < 100000) {
$a = 'something';
echo 'SSSSSAAAAAAAAAYyyyyyyy ' . $a;
$i++;
}
ob_end_clean();
unset($a, $i);
}
function main()
{
$t1_total = 0.0;
$t2_total = 0.0;
for ($i = 0; $i < 10; $i++) {
$t1_start = microtime(1);
testOne();
$t1_end = microtime(1);
$t2_start = microtime(1);
testTwo();
$t2_end = microtime(1);
$t1_total += $t1_end - $t1_start;
$t2_total += $t2_end - $t2_start;
}
fwrite(STDOUT, " Double Quote: $t1_total" . PHP_EOL);
fwrite(STDOUT, " Single Quote: $t2_total" . PHP_EOL);
}
main();
|
thcipriani/phpbench
|
MicroOps/single_quote_vs_double_quote/test_time.php
|
PHP
|
mit
| 934
|
<!DOCTYPE html>
<!-- build:[manifest]:prod manifest.appcache -->
<html>
<!-- /build -->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<!-- build:template
<title><%= name %></title>
/build -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css">
<!-- build:[href]:prod styles/app.min.css -->
<link rel="stylesheet" href="styles/app.css">
<!-- /build -->
</head>
<body>
<!--[if lt IE 10]>
<p class="browsehappy">
You are using an <strong>outdated</strong> browser.
Please <a href="http://browsehappy.com">upgrade your browser</a> to improve your experience.
</p>
<hr/>
<![endif]-->
<div id="content"></div>
<script>
<!-- Some build time properties -->
<!-- build:template
var appTitle = "<%= name %>",
appVersion = "<%= version %>",
appBuildTimestamp = "<%= timestamp %>",
appBuildConfiguration = "production",
eslintErrors = "<%= eslintErrors %>",
eslintWarnings = "<%= eslintWarnings %>",
scsslintWarnings = "<%= scsslintWarnings %>",
upgradeMessage = "A newer version of <%= name %> is available! Load it?";
/build -->
<!-- build:remove:prod -->
appBuildConfiguration = "development";
<!-- /build -->
</script>
<!-- build:[src]:prod scripts/app.min.js -->
<script src="scripts/app.js"></script>
<!-- /build -->
<!-- build:remove:prod -->
<!-- Automatic reload of page, default URL for 'grunt-contrib-watch' reload server -->
<script src="//localhost:35729/livereload.js"></script>
<!-- /build -->
</body>
</html>
|
eirikt/default-webapp-heroku
|
client/index.html
|
HTML
|
mit
| 1,770
|
using Microsoft.Xna.Framework;
using SkidiKit.Core.NodeAction.Common;
namespace SkidiKit.Core.NodeAction.Intervals
{
public class RotateBy: FinateTimeAction
{
public float Angle { get; }
public RotateBy(float duration, float angle): base(duration)
{
Angle = angle;
}
public override FinateTimeAction Reverse()
{
return new RotateBy(Duration, -Angle);
}
public override NodeActionState StartAction(Drawable target)
{
return new RotateByActionState(target, this);
}
}
internal class RotateByActionState: FinateTimeActionState
{
private float StartRotation { get; }
private float Rotation { get; }
public RotateByActionState(Drawable target, RotateBy action) : base(target, action)
{
StartRotation = target.Rotation;
Rotation = MathHelper.ToRadians(action.Angle);
}
public override void Update(float time)
{
if (Target != null)
Target.Rotation = StartRotation + Rotation*time;
}
}
}
|
nikita-sky/SkidiKit
|
SkidiKit/Core/NodeAction/Intervals/RotateBy.cs
|
C#
|
mit
| 1,145
|
# 053. Maximum Subarray
# The simple O(n) solution.
import unittest
class Solution(object):
def maxSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
ret = nums[0]
pre = nums[0]
for i in nums[1:]:
if ret < i and ret < 0:
ret = pre = i
continue
cur = pre + i
if ret < cur:
ret = pre = cur
continue
if cur >= 0:
pre = cur
continue
# if cur < 0: # Better start over.
pre = 0
return ret
class SolutionUnitTest(unittest.TestCase):
def setup(self):
pass
def tearDown(self):
pass
def testMaxSubArray(self):
s = Solution()
self.assertEqual(s.maxSubArray([-2,1,-3,4,-1,2,1,-5,4]), 6)
self.assertEqual(s.maxSubArray([-2,1]), 1)
self.assertEqual(s.maxSubArray([-1]), -1)
if __name__ == '__main__':
unittest.main()
|
hanlin-he/UTD
|
leetcode/py/053.py
|
Python
|
mit
| 1,020
|
var backgrounds = [
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/google_hq_azlr3e.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/apple_hq_bmqqhh.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/microsoft_hq_c88f8g.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/facebook_hq_bb66i0.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/twitter_hq_cshigs.jpg')",
"url('http://res.cloudinary.com/dklyjqkxa/image/upload/v1476149119/facebook_hq2_q3fuww.jpg')"
// "img/hq/google_hq.jpg",
// "img/hq/apple_hq.jpg",
// "img/hq/microsoft_hq.jpg",
// "img/hq/facebook_hq.jpg",
// "img/hq/twitter_hq.jpg",
// "img/hq/facebook_hq2.jpg"
];
// var images = [];
//
// function preload(){
// for (var i=0; i<backgrounds.length; i++){
// images[i] = new Image();
// images[i].src = backgrounds[i];
// }
// }
var check = true;
var slideIndex =-1;
// preload();
auto();
function auto() {
if (check) {
slideIndex+=1;
carousel();
setTimeout(auto, 8000);
}
}
function currentDiv(n) {
if (check) {
slideIndex = n;
carousel();
}
}
function carousel() {
var i;
check = false;
var x = document.getElementsByClassName("imageselect");
if (slideIndex>=backgrounds.length){slideIndex=0}
for (i=0; i< x.length; i++) {
x[i].className = x[i].className.replace(" whitehover", "");
}
x[slideIndex].className += " whitehover";
document.getElementsByClassName("header")[0].style.background = backgrounds[slideIndex];
document.getElementsByClassName("header")[0].style.backgroundSize = "cover";
document.getElementsByClassName("header")[0].style.backgroundPosition = "center";
setTimeout(function(){
check = true;
}, 500);
}
|
sameesiddiqui/ballertechjobs
|
js/main.js
|
JavaScript
|
mit
| 1,801
|
require 'rgeo'
require 'mongoid/geospatial/ext/rgeo_spherical_point_impl'
module Mongoid
#
# Wrappers for RGeo
# https://github.com/rgeo/rgeo
#
module Geospatial
# Wrapper to Rgeo's Point
Point.class_eval do
#
# With RGeo support
#
# @return (RGeo::SphericalFactory::Point)
def to_rgeo
RGeo::Geographic.spherical_factory.point x, y
end
#
# Distance with RGeo
#
# @return (Float)
def rgeo_distance(other)
to_rgeo.distance other.to_rgeo
end
end
# Rgeo's GeometryField concept
GeometryField.class_eval do
def points
map do |pair|
RGeo::Geographic.spherical_factory.point(*pair)
end
end
end
# Wrapper to Rgeo's LineString
LineString.class_eval do
def to_rgeo
RGeo::Geographic.spherical_factory.line_string(points)
end
end
# Wrapper to Rgeo's Polygon
Polygon.class_eval do
def to_rgeo
ring = RGeo::Geographic.spherical_factory.linear_ring(points)
RGeo::Geographic.spherical_factory.polygon(ring)
end
end
end
end
|
nofxx/mongoid-geospatial
|
lib/mongoid/geospatial/wrappers/rgeo.rb
|
Ruby
|
mit
| 1,146
|
search_result['1024']=["topic_0000000000000254.html","SystemManagementController.UpdateBadge Method",""];
|
asiboro/asiboro.github.io
|
vsdoc/search--/s_1024.js
|
JavaScript
|
mit
| 105
|
/* ------- FONTS ------- */
/* ------- BORDERS ------- */
/* ------- BACKGROUNDS ------- */
/* ------- COLORS ------- */
/* ------- Indents ------- */
/* ------- Product Elements ------- */
/* ------- Buttons ------- */
/* ------- Buttons +/- ------ */
/* ------- Button Small ------- */
/* ------- Button exclusive-medium ------- */
/* ------- My Account List bg ------- */
/* ------- Product Listing ------- */
/* ------- Grid/List vars ------- */
/* ------- Pagination vars ------- */
/* ------- Product Info ------- */
/* ------- Cart Steps ------- */
/* ------- sub heading (h2,h3) define ------- */
/* ------- Image vars ------- */
.shop-phone {
float: left;
padding: 5px 0 10px; }
@media (max-width: 767px) {
.shop-phone {
display: none; } }
.shop-phone i {
font-size: 21px;
line-height: 21px;
color: white;
padding-right: 7px; }
.shop-phone strong {
color: white; }
#contact-link {
float: right;
border-left: 1px solid #515151; }
@media (max-width: 479px) {
#contact-link {
width: 25%;
text-align: center; } }
#contact-link a {
display: block;
color: white;
font-weight: bold;
padding: 8px 10px 11px 10px;
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
cursor: pointer; }
@media (max-width: 479px) {
#contact-link a {
font-size: 11px;
padding-left: 5px;
padding-right: 5px; } }
#contact-link a:hover, #contact-link a.active {
background: #2b2b2b; }
@media (max-width: 767px) {
#contact_block {
margin-bottom: 20px; } }
#contact_block .label {
display: none; }
#contact_block .block_content {
color: #888888; }
#contact_block p {
margin-bottom: 4px; }
#contact_block p.tel {
font: 400 17px/21px Arial, Helvetica, sans-serif;
color: #333333;
margin-bottom: 6px; }
#contact_block p.tel i {
font-size: 25px;
vertical-align: -2px;
padding-right: 10px; }
|
rachitsakhidas/Grocerry-e-commenrce
|
css/grocery/blockcontact.css
|
CSS
|
mit
| 1,917
|
#!/usr/bin/perl
#
# Convert erlang source into markdown
#
# 1/ non-comment lines become quoted blocks (github)
# 2/ comment lines are treated as straight markdown
#
# Pipe-only, usage:
# emdoc.pl < foo.erl > foo.erl.md
#
# The markdown can then be converted by other tools
# [Might be nice if we could do syntax coloring of the source.]
#
# UNFINISHED
# - accept some options to improve script usage
# - improve output, see below
use strict;
use warnings;
## Convert the lines in a straightforward fashion.
## NB: Tested by pasting into dillinger.io.
##
## When we switch text <-> code block, we insert an
## empty line. This seems to fix the formatting hijinks.
## 1 if emitting codeblock, 0 otherwise
## used to emit blank separation lines
my $code_mode = 0;
while (my $line = <>) {
if ($line =~ m{^%}) {
## Comment line, drop leading comment chars and an optional space
## (the result is processed as markdown)
##
## Emit extra blank line if previously emitting code block
if ($code_mode) {
print "\n";
}
$code_mode = 0; ## (or do it in the if)
$line =~ s{^%+\s?}{};
print $line;
} elsif ($line =~ m{^\s*$}) {
## Blank lines left untreated
print $line;
} else {
## Code line, put in verbatim block (= prepend 4 spaces)
##
## Emit extra blank line if previously emitting text
if (!$code_mode) {
print "\n";
}
$code_mode = 1; ## (or do it in the if)
print " ".$line;
}
}
|
thomasl/emdoc
|
bin/emdoc.pl
|
Perl
|
mit
| 1,435
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mini-compiler: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.10.0 / mini-compiler - 8.5.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mini-compiler
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-31 19:49:08 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-31 19:49:08 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
coq 8.10.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.1 Official release 4.09.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "matej.kosik@inria.fr"
homepage: "https://github.com/coq-contribs/mini-compiler"
license: "LGPL 2"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/MiniCompiler"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:compilation" "keyword:correctness" "keyword:arithmetic" "category:Computer Science/Semantics and Compilation/Compilation" "date:2003" ]
authors: [ "Jean-Christophe Filliâtre <>" ]
bug-reports: "https://github.com/coq-contribs/mini-compiler/issues"
dev-repo: "git+https://github.com/coq-contribs/mini-compiler.git"
synopsis: "Correctness of a tiny compiler for arithmetic expressions"
description: """
Tutorial correctness proof of a tiny compiler from
simple arithmetic expressions (constants, variables and additions) to
simple assembly-like code (one accumulator, infinitly many registers and
addition)"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/mini-compiler/archive/v8.5.0.tar.gz"
checksum: "md5=27b1414ce51c9cfe014d5777e9d47b2e"
}
</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-mini-compiler.8.5.0 coq.8.10.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.10.0).
The following dependencies couldn't be met:
- coq-mini-compiler -> coq < 8.6~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-mini-compiler.8.5.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.09.1-2.0.6/released/8.10.0/mini-compiler/8.5.0.html
|
HTML
|
mit
| 6,953
|
# -*- coding: utf-8 -*-
require 'spec_helper'
shared_examples_for "a file binder" do
describe ".pathnames" do
it do
expect(@dummy.pathnames).to be_a_kind_of Array
end
it do
expect(@dummy.pathnames.first).to be_a_kind_of Pathname
end
end
describe ".files" do
it do
expect(@dummy.files).to be_a_kind_of Array
end
end
describe ".directories" do
it do
expect(@dummy.directories).to be_a_kind_of Array
end
end
describe ".entries" do
it do
expect(@dummy.entries).to be_a_kind_of Array
end
end
end
shared_examples_for "a binding directory" do
describe ".files" do
it do
expect(@dummy.files).to have(3 + 3).items
end
end
describe ".directories" do
it do
expect(@dummy.directories).to have(1).items
end
end
describe ".entries" do
it do
expect(@dummy.entries).to have(7).items
end
end
end
describe FileBinder do
context "when default" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
end
end
it_behaves_like "a file binder"
describe ".files" do
it do
expect(@dummy.files).to have(3).items
end
end
describe ".directories" do
it do
expect(@dummy.directories).to have(1).items
end
end
describe ".entries" do
it do
expect(@dummy.entries).to have(4).items
end
end
end
context "when recursive" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
recursive true
end
end
it_behaves_like "a file binder"
it_behaves_like "a binding directory"
end
context "when specify extensions" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
extensions :jpg, :avi
end
end
it_behaves_like "a file binder"
describe ".files" do
it do
expect(@dummy.files).to have(2).items
end
end
describe ".directories" do
it do
expect(@dummy.directories).to have(1).items
end
end
describe ".entries" do
it do
expect(@dummy.entries).to have(3).items
end
end
end
context "when specify pattern" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
pattern /\.txt\z/
end
end
it_behaves_like "a file binder"
describe ".files" do
it do
expect(@dummy.files).to have(1).items
end
end
describe ".directories" do
it do
expect(@dummy.directories).to have(0).items
end
end
describe ".entries" do
it do
expect(@dummy.entries).to have(1).items
end
end
end
context "when specify command" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
command :large, ->(entries) do
entries.select{ |entry| !entry.directory? and entry.size > 0 }
end
end
end
it do
expect(@dummy.large).to be_a_kind_of Array
end
it do
expect(@dummy.large).to have(1).items
end
end
context "when specify bad name command" do
it do
expect{
Class.new(FileBinder) do
bind "spec/dummy"
command :entries, ->(entries){}
end
}.to raise_error
end
end
context "when specify listen callback" do
it do
callback = Proc.new do |changes|
changes
end
expect_any_instance_of(Listen::Listener).to receive(:start).once
Class.new(FileBinder) do
bind "spec/dummy"
modified_on &callback
end
end
end
describe ".save" do
let(:filename) do
"spec/tmp"
end
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
end
end
it do
expect{ @dummy.save(filename) }.to change{ File.exist?(filename) }.from(false).to(true)
end
after do
FileUtils.rm(filename)
end
end
describe ".load" do
let(:filename) do
"spec/tmp"
end
before do
dummy = Class.new(FileBinder) do
bind "spec/dummy"
end
# cache
dummy.entries
dummy.save(filename)
@dummy = Class.new(FileBinder) do
bind "spec/dummy"
recursive true
end
@from = @dummy.entries
@to = dummy.entries
end
it do
expect{ @dummy.load(filename) }.to change{ @dummy.entries }.from(@from).to(@to)
end
after do
FileUtils.rm(filename)
end
end
describe "when specify multiple binds" do
before do
@dummy = Class.new(FileBinder) do
bind "spec/dummy", "spec/dummy/directory"
end
end
it_behaves_like "a file binder"
it_behaves_like "a binding directory"
end
end
|
Manbo-/file_binder
|
spec/lib/file_binder_spec.rb
|
Ruby
|
mit
| 4,806
|
# UI Extensions SDK reference
Moved to [UI Extensions SDK reference](https://www.contentful.com/developers/docs/extensibility/ui-extensions/sdk-reference/).
|
contentful/widget-sdk
|
docs/ui-extensions-sdk-frontend.md
|
Markdown
|
mit
| 158
|
<?php
/**
* Este archivo contiene los datos de un fixture para los casos de prueba.
*
* PHP versions 5
*
* @filesource
* @copyright Copyright 2007-2009, Pragmatia
* @link http://www.pragmatia.com
* @package pragtico
* @subpackage app.tests.fixtures
* @since Pragtico v 1.0.0
* @version $Revision: 319 $
* @modifiedby $LastChangedBy: mradosta $
* @lastmodified $Date: 2009-02-24 13:57:32 -0200 (mar 24 de feb de 2009) $
* @author Martin Radosta <mradosta@pragmatia.com>
*/
/**
* La clase para un fixture para un caso de prueba.
*
* @package app.tests
* @subpackage app.tests.fixtures
*/
class EmpleadoresRubroFixture extends CakeTestFixture {
/**
* El nombre de este Fixture.
*
* @var array
* @access public
*/
var $name = 'EmpleadoresRubro';
/**
* La definicion de la tabla.
*
* @var array
* @access public
*/
var $fields = array(
'id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'primary'),
'empleador_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
'rubro_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
'created' => array('type' => 'datetime', 'null' => false),
'modified' => array('type' => 'datetime', 'null' => false),
'user_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
'role_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
'group_id' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
'permissions' => array('type' => 'integer', 'null' => false, 'default' => '', 'length' => '11', 'key' => 'index'),
);
/**
* Los registros.
*
* @var array
* @access public
*/
var $records = array(
);
}
?>
|
alyssa-labs/pragtico
|
app/tests/fixtures/empleadores_rubro_fixture.php
|
PHP
|
mit
| 2,022
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using HaloSharp.Extension;
using HaloSharp.Model.Halo5.Metadata;
using HaloSharp.Query.Halo5.Metadata;
using HaloSharp.Test.Config;
using HaloSharp.Test.Utility;
using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
using NUnit.Framework;
namespace HaloSharp.Test.Query.Halo5.Metadata
{
[TestFixture]
public class GetSeasonsTests
{
private IHaloSession _mockSession;
private List<Season> _seasons;
[SetUp]
public void Setup()
{
_seasons = JsonConvert.DeserializeObject<List<Season>>(File.ReadAllText(Halo5Config.SeasonsJsonPath));
var mock = new Mock<IHaloSession>();
mock.Setup(m => m.Get<List<Season>>(It.IsAny<string>()))
.ReturnsAsync(_seasons);
_mockSession = mock.Object;
}
[Test]
public void Uri_MatchesExpected()
{
var query = new GetSeasons();
Assert.AreEqual("https://www.haloapi.com/metadata/h5/metadata/seasons", query.Uri);
}
[Test]
public async Task Query_DoesNotThrow()
{
var query = new GetSeasons()
.SkipCache();
var result = await _mockSession.Query(query);
Assert.IsInstanceOf(typeof (List<Season>), result);
Assert.AreEqual(_seasons, result);
}
[Test]
public async Task GetSeasons_DoesNotThrow()
{
var query = new GetSeasons()
.SkipCache();
var result = await Global.Session.Query(query);
Assert.IsInstanceOf(typeof(List<Season>), result);
}
[Test]
public async Task GetSeasons_SchemaIsValid()
{
var seasonsSchema = JSchema.Parse(File.ReadAllText(Halo5Config.SeasonsJsonSchemaPath), new JSchemaReaderSettings
{
Resolver = new JSchemaUrlResolver(),
BaseUri = new Uri(Path.GetFullPath(Halo5Config.SeasonsJsonSchemaPath))
});
var query = new GetSeasons()
.SkipCache();
var jArray = await Global.Session.Get<JArray>(query.Uri);
SchemaUtility.AssertSchemaIsValid(seasonsSchema, jArray);
}
[Test]
public async Task GetSeasons_ModelMatchesSchema()
{
var schema = JSchema.Parse(File.ReadAllText(Halo5Config.SeasonsJsonSchemaPath), new JSchemaReaderSettings
{
Resolver = new JSchemaUrlResolver(),
BaseUri = new Uri(Path.GetFullPath(Halo5Config.SeasonsJsonSchemaPath))
});
var query = new GetSeasons()
.SkipCache();
var result = await Global.Session.Query(query);
var json = JsonConvert.SerializeObject(result);
var jContainer = JsonConvert.DeserializeObject<JContainer>(json);
SchemaUtility.AssertSchemaIsValid(schema, jContainer);
}
[Test]
public async Task GetSeasons_IsSerializable()
{
var query = new GetSeasons()
.SkipCache();
var result = await Global.Session.Query(query);
SerializationUtility<List<Season>>.AssertRoundTripSerializationIsPossible(result);
}
}
}
|
gitFurious/HaloSharp
|
Source/HaloSharp.Test/Query/Halo5/Metadata/GetSeasonsTests.cs
|
C#
|
mit
| 3,425
|
"""
Transactional workflow control for Django models.
"""
|
oblalex/django-workflow
|
src/workflow/__init__.py
|
Python
|
mit
| 58
|
import React from 'react';
import styles from './button.css';
let Button = React.createClass({
render() {
return (
<div className={styles.container}>
<button className={styles.button}>Click me!</button>
</div>
);
}
});
React.render(<Button />, document.getElementById('content'));
|
kwangkim/css-in-js
|
css-loader/button.js
|
JavaScript
|
mit
| 315
|
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using QuickDALTests.TestCaseClasses;
namespace QuickDALTests
{
[TestClass]
public class DataObjectTests : ScopedTestClass
{
public static void AssertFullMatch(SimpleDataObject a, SimpleDataObject b)
{
var dict_a = a.ToDictionary();
var dict_b = b.ToDictionary();
Assert.AreEqual(dict_a.Count, dict_b.Count);
foreach (var k in dict_a.Keys)
{
Assert.AreEqual(dict_a[k], dict_b[k]);
}
}
[TestMethod]
public void DataObject_CanSerializeStrings()
{
var o = new SimpleDataObject()
{
StringValue = "a string"
};
var d = o.ToDictionary();
Assert.AreEqual("a string", d["StringValue"]);
}
[TestMethod]
public void DataObject_CanSerializeInt32s()
{
var o = new SimpleDataObject()
{
Int32Value = 32
};
var d = o.ToDictionary();
Assert.AreEqual("32", d["Int32Value"]);
}
[TestMethod]
public void DataObject_CanSerializeDoubles()
{
var o = new SimpleDataObject()
{
DoubleValue = 3.2
};
var d = o.ToDictionary();
Assert.AreEqual("3.2", d["DoubleValue"]);
}
[TestMethod]
public void DataObject_DoesNotSerializeBooleansByDefault()
{
var ot = new SimpleDataObject()
{
BooleanValue = true
};
var dt = ot.ToDictionary();
Assert.IsFalse(dt.ContainsKey("BooleanValue"));
}
[TestMethod]
public void DataObject_CanSerializeBooleans()
{
var ot = new SimpleDataObject()
{
BooleanValue = true
};
var dt = ot.ToDictionary(true);
Assert.AreEqual("1", dt["BooleanValue"]);
var of = new SimpleDataObject()
{
BooleanValue = false
};
var df = of.ToDictionary(true);
Assert.AreEqual("0", df["BooleanValue"]);
}
[TestMethod]
public void DataObject_CanSerializeGuids()
{
var guidstring = "CA37A611-B7F4-4EE8-AE2F-D32FB2D0D151";
var guid = new Guid(guidstring);
var o = new SimpleDataObject()
{
GuidValue = guid
};
var d = o.ToDictionary();
Assert.AreEqual(guidstring.ToLower(), d["GuidValue"]);
}
[TestMethod]
public void DataObject_CanBeSavedAndRetrievedById()
{
var guid = new Guid("AA37A611-B7F4-4EE8-AE2F-D32FB2D0D151");
var distractorguid = new Guid("00000000-B7F4-4EE8-AE2F-D32FB2D0D151");
var o = new SimpleDataObject()
{
BooleanValue = true,
DoubleValue = 32,
Int32Value = 64,
GuidValue = guid,
StringValue = "a string"
};
o.Save();
var distractor = new SimpleDataObject()
{
GuidValue = distractorguid
};
distractor.Save();
var test = SimpleDataObject.Get(guid);
AssertFullMatch(o, test);
}
[TestMethod]
public void DataObject_CanBeRetrievedByString()
{
var guid = new Guid("AB37A611-B7F4-4EE8-AE2F-D32FB2D0D151");
var distractorguid = new Guid("00000000-B7F4-4EE8-AE2F-D32FB2D0D151");
var str = "retrieval string";
var o = new SimpleDataObject()
{
BooleanValue = true,
DoubleValue = 12,
Int32Value = 24,
GuidValue = guid,
StringValue = str
};
o.Save();
var distractor = new SimpleDataObject()
{
GuidValue = distractorguid
};
distractor.Save();
var test = SimpleDataObject.Get(new SimpleDataObject() { StringValue = str });
Assert.AreEqual(1, test.Count);
AssertFullMatch(o, test[0]);
}
}
}
|
svidgen/QuickDAL
|
QuickDALTests/DataObjectTests.cs
|
C#
|
mit
| 4,581
|
---
layout: post
title: Our Lamp
---
<p> At this stage we have decided to keep the stucture of the lamp simplistic and modern looking as possible.</p>
<p> Having too many parts makes the lamp look more messy instead of a clean look.</p>
<p>Though we like the panel and iris structures, timewise we would like to focus on one aspect and make it look and work exactly how we want.</p>
|
FabLabWgtn/Wavy
|
_posts/2016-02-12-Concept point.md
|
Markdown
|
mit
| 383
|
/**
* Copyright (c) 2010 Zef Hemel <zef@zef.me>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
if (typeof exports !== 'undefined') {
exports.createPersistence = function() {
return initPersistence({})
}
var singleton;
exports.__defineGetter__("persistence", function () {
if (!singleton)
singleton = exports.createPersistence();
return singleton;
});
}
else {
window = window || {};
window.persistence = initPersistence(window.persistence || {});
}
function initPersistence(persistence) {
if (persistence.isImmutable) // already initialized
return persistence;
/**
* Check for immutable fields
*/
persistence.isImmutable = function(fieldName) {
return (fieldName == "id");
};
/**
* Default implementation for entity-property
*/
persistence.defineProp = function(scope, field, setterCallback, getterCallback) {
scope.__defineSetter__(field, function (value) {
setterCallback(value);
});
scope.__defineGetter__(field, function () {
return getterCallback();
});
};
/**
* Default implementation for entity-property setter
*/
persistence.set = function(scope, fieldName, value) {
if (persistence.isImmutable(fieldName)) throw new Error("immutable field: "+fieldName);
scope[fieldName] = value;
};
/**
* Default implementation for entity-property getter
*/
persistence.get = function(arg1, arg2) {
return (arguments.length == 1) ? arg1 : arg1[arg2];
};
(function () {
var entityMeta = {};
var entityClassCache = {};
persistence.getEntityMeta = function() { return entityMeta; }
// Per-session data
persistence.trackedObjects = {};
persistence.objectsToRemove = {};
persistence.objectsRemoved = []; // {id: ..., type: ...}
persistence.globalPropertyListeners = {}; // EntityType__prop -> QueryColleciton obj
persistence.queryCollectionCache = {}; // entityName -> uniqueString -> QueryCollection
persistence.getObjectsToRemove = function() { return this.objectsToRemove; };
persistence.getTrackedObjects = function() { return this.trackedObjects; };
// Public Extension hooks
persistence.entityDecoratorHooks = [];
persistence.flushHooks = [];
persistence.schemaSyncHooks = [];
// Enable debugging (display queries using console.log etc)
persistence.debug = true;
persistence.subscribeToGlobalPropertyListener = function(coll, entityName, property) {
var key = entityName + '__' + property;
if(key in this.globalPropertyListeners) {
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
if(listeners[i] === coll) {
return;
}
}
this.globalPropertyListeners[key].push(coll);
} else {
this.globalPropertyListeners[key] = [coll];
}
}
persistence.unsubscribeFromGlobalPropertyListener = function(coll, entityName, property) {
var key = entityName + '__' + property;
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
if(listeners[i] === coll) {
listeners.splice(i, 1);
return;
}
}
}
persistence.propertyChanged = function(obj, property, oldValue, newValue) {
if(!this.trackedObjects[obj.id]) return; // not yet added, ignore for now
var entityName = obj._type;
var key = entityName + '__' + property;
if(key in this.globalPropertyListeners) {
var listeners = this.globalPropertyListeners[key];
for(var i = 0; i < listeners.length; i++) {
var coll = listeners[i];
var dummyObj = obj._data;
dummyObj[property] = oldValue;
var matchedBefore = coll._filter.match(dummyObj);
dummyObj[property] = newValue;
var matchedAfter = coll._filter.match(dummyObj);
if(matchedBefore != matchedAfter) {
coll.triggerEvent('change', coll, obj);
}
}
}
}
persistence.objectRemoved = function(obj) {
var entityName = obj._type;
if(this.queryCollectionCache[entityName]) {
var colls = this.queryCollectionCache[entityName];
for(var key in colls) {
if(colls.hasOwnProperty(key)) {
var coll = colls[key];
if(coll._filter.match(obj)) { // matched the filter -> was part of collection
coll.triggerEvent('change', coll, obj);
}
}
}
}
}
/**
* Retrieves metadata about entity, mostly for internal use
*/
function getMeta(entityName) {
return entityMeta[entityName];
}
persistence.getMeta = getMeta;
/**
* A database session
*/
function Session(conn) {
this.trackedObjects = {};
this.objectsToRemove = {};
this.objectsRemoved = [];
this.globalPropertyListeners = {}; // EntityType__prop -> QueryColleciton obj
this.queryCollectionCache = {}; // entityName -> uniqueString -> QueryCollection
this.conn = conn;
}
Session.prototype = persistence; // Inherit everything from the root persistence object
persistence.Session = Session;
/**
* Define an entity
*
* @param entityName
* the name of the entity (also the table name in the database)
* @param fields
* an object with property names as keys and SQLite types as
* values, e.g. {name: "TEXT", age: "INT"}
* @return the entity's constructor
*/
persistence.define = function (entityName, fields) {
if (entityMeta[entityName]) { // Already defined, ignore
return getEntity(entityName);
}
var meta = {
name: entityName,
fields: fields,
isMixin: false,
indexes: [],
hasMany: {},
hasOne: {}
};
entityMeta[entityName] = meta;
return getEntity(entityName);
};
/**
* Checks whether an entity exists
*
* @param entityName
* the name of the entity (also the table name in the database)
* @return `true` if the entity exists, otherwise `false`
*/
persistence.isDefined = function (entityName) {
return !!entityMeta[entityName];
}
/**
* Define a mixin
*
* @param mixinName
* the name of the mixin
* @param fields
* an object with property names as keys and SQLite types as
* values, e.g. {name: "TEXT", age: "INT"}
* @return the entity's constructor
*/
persistence.defineMixin = function (mixinName, fields) {
var Entity = this.define(mixinName, fields);
Entity.meta.isMixin = true;
return Entity;
};
persistence.isTransaction = function(obj) {
return !obj || (obj && obj.executeSql);
};
persistence.isSession = function(obj) {
return !obj || (obj && obj.schemaSync);
};
/**
* Adds the object to tracked entities to be persisted
*
* @param obj
* the object to be tracked
*/
persistence.add = function (obj) {
if(!obj) return;
//if (!this.trackedObjects[obj.id]) {
this.trackedObjects[obj.id] = obj;
if(obj._new) {
for(var p in obj._data) {
if(obj._data.hasOwnProperty(p)) {
this.propertyChanged(obj, p, undefined, obj._data[p]);
}
}
}
//}
return this;
};
/**
* Marks the object to be removed (on next flush)
* @param obj object to be removed
*/
persistence.remove = function(obj) {
if (!this.objectsToRemove[obj.id]) {
this.objectsToRemove[obj.id] = obj;
}
this.objectsRemoved.push({id: obj.id, entity: obj._type});
this.objectRemoved(obj);
return this;
};
/**
* Clean the persistence context of cached entities and such.
*/
persistence.clean = function () {
this.trackedObjects = {};
this.objectsToRemove = {};
this.objectsRemoved = [];
this.globalPropertyListeners = {};
this.queryCollectionCache = {};
};
/**
* asynchronous sequential version of Array.prototype.forEach
* @param array the array to iterate over
* @param fn the function to apply to each item in the array, function
* has two argument, the first is the item value, the second a
* callback function
* @param callback the function to call when the forEach has ended
*/
persistence.asyncForEach = function(array, fn, callback) {
array = array.slice(0); // Just to be sure
function processOne() {
var item = array.pop();
fn(item, function(result, err) {
if(array.length > 0) {
processOne();
} else {
callback(result, err);
}
});
}
if(array.length > 0) {
processOne();
} else {
callback();
}
};
/**
* asynchronous parallel version of Array.prototype.forEach
* @param array the array to iterate over
* @param fn the function to apply to each item in the array, function
* has two argument, the first is the item value, the second a
* callback function
* @param callback the function to call when the forEach has ended
*/
persistence.asyncParForEach = function(array, fn, callback) {
var completed = 0;
var arLength = array.length;
if(arLength === 0) {
callback();
}
for(var i = 0; i < arLength; i++) {
fn(array[i], function(result, err) {
completed++;
if(completed === arLength) {
callback(result, err);
}
});
}
};
/**
* Retrieves or creates an entity constructor function for a given
* entity name
* @return the entity constructor function to be invoked with `new fn()`
*/
function getEntity(entityName) {
if (entityClassCache[entityName]) {
return entityClassCache[entityName];
}
var meta = entityMeta[entityName];
/**
* @constructor
*/
function Entity (session, obj, noEvents) {
var args = argspec.getArgs(arguments, [
{ name: "session", optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: "obj", optional: true, check: function(obj) { return obj; }, defaultValue: {} }
]);
if (meta.isMixin)
throw new Error("Cannot instantiate mixin");
session = args.session;
obj = args.obj;
var that = this;
this.id = obj.id || persistence.createUUID();
this._new = true;
this._type = entityName;
this._dirtyProperties = {};
this._data = {};
this._data_obj = {}; // references to objects
this._session = session || persistence;
this.subscribers = {}; // observable
for ( var field in meta.fields) {
(function () {
if (meta.fields.hasOwnProperty(field)) {
var f = field; // Javascript scopes/closures SUCK
persistence.defineProp(that, f, function(val) {
// setterCallback
var oldValue = that._data[f];
if(oldValue !== val || (oldValue && val && oldValue.getTime && val.getTime)) { // Don't mark properties as dirty and trigger events unnecessarily
that._data[f] = val;
that._dirtyProperties[f] = oldValue;
that.triggerEvent('set', that, f, val);
that.triggerEvent('change', that, f, val);
session.propertyChanged(that, f, oldValue, val);
}
}, function() {
// getterCallback
return that._data[f];
});
that._data[field] = defaultValue(meta.fields[field]);
}
}());
}
for ( var it in meta.hasOne) {
if (meta.hasOne.hasOwnProperty(it)) {
(function () {
var ref = it;
var mixinClass = meta.hasOne[it].type.meta.isMixin ? ref + '_class' : null;
persistence.defineProp(that, ref, function(val) {
// setterCallback
var oldValue = that._data[ref];
var oldValueObj = that._data_obj[ref] || session.trackedObjects[that._data[ref]];
if (val == null) {
that._data[ref] = null;
that._data_obj[ref] = undefined;
if (mixinClass)
that[mixinClass] = '';
} else if (val.id) {
that._data[ref] = val.id;
that._data_obj[ref] = val;
if (mixinClass)
that[mixinClass] = val._type;
session.add(val);
session.add(that);
} else { // let's assume it's an id
that._data[ref] = val;
}
that._dirtyProperties[ref] = oldValue;
that.triggerEvent('set', that, ref, val);
that.triggerEvent('change', that, ref, val);
// Inverse
if(meta.hasOne[ref].inverseProperty) {
var newVal = that[ref];
if(newVal) {
var inverse = newVal[meta.hasOne[ref].inverseProperty];
if(inverse.list && inverse._filter) {
inverse.triggerEvent('change', that, ref, val);
}
}
if(oldValueObj) {
console.log("OldValue", oldValueObj);
var inverse = oldValueObj[meta.hasOne[ref].inverseProperty];
if(inverse.list && inverse._filter) {
inverse.triggerEvent('change', that, ref, val);
}
}
}
}, function() {
// getterCallback
if (!that._data[ref]) {
return null;
} else if(that._data_obj[ref] !== undefined) {
return that._data_obj[ref];
} else if(that._data[ref] && session.trackedObjects[that._data[ref]]) {
that._data_obj[ref] = session.trackedObjects[that._data[ref]];
return that._data_obj[ref];
} else {
//throw new Error("Property '" + ref + "' of '" + meta.name + "' with id: " + that._data[ref] + " not fetched, either prefetch it or fetch it manually.");
}
});
}());
}
}
for ( var it in meta.hasMany) {
if (meta.hasMany.hasOwnProperty(it)) {
(function () {
var coll = it;
if (meta.hasMany[coll].manyToMany) {
persistence.defineProp(that, coll, function(val) {
// setterCallback
if(val && val._items) {
// Local query collection, just add each item
// TODO: this is technically not correct, should clear out existing items too
var items = val._items;
for(var i = 0; i < items.length; i++) {
persistence.get(that, coll).add(items[i]);
}
} else {
throw new Error("Not yet supported.");
}
}, function() {
// getterCallback
if (that._data[coll]) {
return that._data[coll];
} else {
var rel = meta.hasMany[coll];
var inverseMeta = rel.type.meta;
var inv = inverseMeta.hasMany[rel.inverseProperty];
var direct = rel.mixin ? rel.mixin.meta.name : meta.name;
var inverse = inv.mixin ? inv.mixin.meta.name : inverseMeta.name;
var queryColl = new persistence.ManyToManyDbQueryCollection(session, inverseMeta.name);
queryColl.initManyToMany(that, coll);
queryColl._manyToManyFetch = {
table: rel.tableName,
prop: direct + '_' + coll,
inverseProp: inverse + '_' + rel.inverseProperty,
id: that.id
};
that._data[coll] = queryColl;
return session.uniqueQueryCollection(queryColl);
}
});
} else { // one to many
persistence.defineProp(that, coll, function(val) {
// setterCallback
if(val && val._items) {
// Local query collection, just add each item
// TODO: this is technically not correct, should clear out existing items too
var items = val._items;
for(var i = 0; i < items.length; i++) {
persistence.get(that, coll).add(items[i]);
}
} else {
//throw new Error("Not yet supported.");
}
}, function() {
// getterCallback
if (that._data[coll]) {
return that._data[coll];
} else {
var queryColl = session.uniqueQueryCollection(new persistence.DbQueryCollection(session, meta.hasMany[coll].type.meta.name).filter(meta.hasMany[coll].inverseProperty, '=', that));
that._data[coll] = queryColl;
return queryColl;
}
});
}
}());
}
}
if(this.initialize) {
this.initialize();
}
for ( var f in obj) {
if (obj.hasOwnProperty(f)) {
if(f !== 'id') {
persistence.set(that, f, obj[f]);
}
}
}
} // Entity
Entity.prototype = new Observable();
Entity.meta = meta;
Entity.prototype.equals = function(other) {
return this.id == other.id;
};
Entity.prototype.toJSON = function() {
var json = {id: this.id};
for(var p in this._data) {
if(this._data.hasOwnProperty(p)) {
if (typeof this._data[p] == "object" && this._data[p] != null) {
if (this._data[p].toJSON != undefined) {
json[p] = this._data[p].toJSON();
}
} else {
json[p] = this._data[p];
}
}
}
return json;
};
/**
* Select a subset of data as a JSON structure (Javascript object)
*
* A property specification is passed that selects the
* properties to be part of the resulting JSON object. Examples:
* ['id', 'name'] -> Will return an object with the id and name property of this entity
* ['*'] -> Will return an object with all the properties of this entity, not recursive
* ['project.name'] -> will return an object with a project property which has a name
* property containing the project name (hasOne relationship)
* ['project.[id, name]'] -> will return an object with a project property which has an
* id and name property containing the project name
* (hasOne relationship)
* ['tags.name'] -> will return an object with an array `tags` property containing
* objects each with a single property: name
*
* @param tx database transaction to use, leave out to start a new one
* @param props a property specification
* @param callback(result)
*/
Entity.prototype.selectJSON = function(tx, props, callback) {
var that = this;
var args = argspec.getArgs(arguments, [
{ name: "tx", optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: "props", optional: false },
{ name: "callback", optional: false }
]);
tx = args.tx;
props = args.props;
callback = args.callback;
if(!tx) {
this._session.transaction(function(tx) {
that.selectJSON(tx, props, callback);
});
return;
}
var includeProperties = {};
props.forEach(function(prop) {
var current = includeProperties;
var parts = prop.split('.');
for(var i = 0; i < parts.length; i++) {
var part = parts[i];
if(i === parts.length-1) {
if(part === '*') {
current.id = true;
for(var p in meta.fields) {
if(meta.fields.hasOwnProperty(p)) {
current[p] = true;
}
}
for(var p in meta.hasOne) {
if(meta.hasOne.hasOwnProperty(p)) {
current[p] = true;
}
}
for(var p in meta.hasMany) {
if(meta.hasMany.hasOwnProperty(p)) {
current[p] = true;
}
}
} else if(part[0] === '[') {
part = part.substring(1, part.length-1);
var propList = part.split(/,\s*/);
propList.forEach(function(prop) {
current[prop] = true;
});
} else {
current[part] = true;
}
} else {
current[part] = current[part] || {};
current = current[part];
}
}
});
buildJSON(this, tx, includeProperties, callback);
};
function buildJSON(that, tx, includeProperties, callback) {
var session = that._session;
var properties = [];
var meta = getMeta(that._type);
var fieldSpec = meta.fields;
for(var p in includeProperties) {
if(includeProperties.hasOwnProperty(p)) {
properties.push(p);
}
}
var cheapProperties = [];
var expensiveProperties = [];
properties.forEach(function(p) {
if(includeProperties[p] === true && !meta.hasMany[p]) { // simple, loaded field
cheapProperties.push(p);
} else {
expensiveProperties.push(p);
}
});
var itemData = that._data;
var item = {};
cheapProperties.forEach(function(p) {
if(p === 'id') {
item.id = that.id;
} else if(meta.hasOne[p]) {
item[p] = itemData[p] ? {id: itemData[p]} : null;
} else {
item[p] = persistence.entityValToJson(itemData[p], fieldSpec[p]);
}
});
properties = expensiveProperties.slice();
persistence.asyncForEach(properties, function(p, callback) {
if(meta.hasOne[p]) {
that.fetch(tx, p, function(obj) {
if(obj) {
buildJSON(obj, tx, includeProperties[p], function(result) {
item[p] = result;
callback();
});
} else {
item[p] = null;
callback();
}
});
} else if(meta.hasMany[p]) {
persistence.get(that, p).list(function(objs) {
item[p] = [];
persistence.asyncForEach(objs, function(obj, callback) {
var obj = objs.pop();
if(includeProperties[p] === true) {
item[p].push({id: obj.id});
callback();
} else {
buildJSON(obj, tx, includeProperties[p], function(result) {
item[p].push(result);
callback();
});
}
}, callback);
});
}
}, function() {
callback(item);
});
}; // End of buildJson
Entity.prototype.fetch = function(tx, rel, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'rel', optional: false, check: argspec.hasType('string') },
{ name: 'callback', optional: false, check: argspec.isCallback() }
]);
tx = args.tx;
rel = args.rel;
callback = args.callback;
var that = this;
var session = this._session;
if(!tx) {
session.transaction(function(tx) {
that.fetch(tx, rel, callback);
});
return;
}
if(!this._data[rel]) { // null
if(callback) {
callback(null);
}
} else if(this._data_obj[rel]) { // already loaded
if(callback) {
callback(this._data_obj[rel]);
}
} else {
var type = meta.hasOne[rel].type;
if (type.meta.isMixin) {
type = getEntity(this._data[rel + '_class']);
}
type.load(session, tx, this._data[rel], function(obj) {
that._data_obj[rel] = obj;
if(callback) {
callback(obj);
}
});
}
};
/**
* Currently this is only required when changing JSON properties
*/
Entity.prototype.markDirty = function(prop) {
this._dirtyProperties[prop] = true;
};
/**
* Returns a QueryCollection implementation matching all instances
* of this entity in the database
*/
Entity.all = function(session) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence }
]);
session = args.session;
return session.uniqueQueryCollection(new AllDbQueryCollection(session, entityName));
};
Entity.fromSelectJSON = function(session, tx, jsonObj, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'jsonObj', optional: false },
{ name: 'callback', optional: false, check: argspec.isCallback() }
]);
session = args.session;
tx = args.tx;
jsonObj = args.jsonObj;
callback = args.callback;
if(!tx) {
session.transaction(function(tx) {
Entity.fromSelectJSON(session, tx, jsonObj, callback);
});
return;
}
if(typeof jsonObj === 'string') {
jsonObj = JSON.parse(jsonObj);
}
if(!jsonObj) {
callback(null);
return;
}
function loadedObj(obj) {
if(!obj) {
obj = new Entity(session);
if(jsonObj.id) {
obj.id = jsonObj.id;
}
}
session.add(obj);
var expensiveProperties = [];
for(var p in jsonObj) {
if(jsonObj.hasOwnProperty(p)) {
if(p === 'id') {
continue;
} else if(meta.fields[p]) { // regular field
persistence.set(obj, p, persistence.jsonToEntityVal(jsonObj[p], meta.fields[p]));
} else if(meta.hasOne[p] || meta.hasMany[p]){
expensiveProperties.push(p);
}
}
}
persistence.asyncForEach(expensiveProperties, function(p, callback) {
if(meta.hasOne[p]) {
meta.hasOne[p].type.fromSelectJSON(session, tx, jsonObj[p], function(result) {
persistence.set(obj, p, result);
callback();
});
} else if(meta.hasMany[p]) {
var coll = persistence.get(obj, p);
var ar = jsonObj[p].slice(0);
var PropertyEntity = meta.hasMany[p].type;
// get all current items
coll.list(tx, function(currentItems) {
persistence.asyncForEach(ar, function(item, callback) {
PropertyEntity.fromSelectJSON(session, tx, item, function(result) {
// Check if not already in collection
for(var i = 0; i < currentItems.length; i++) {
if(currentItems[i].id === result.id) {
callback();
return;
}
}
coll.add(result);
callback();
});
}, function() {
callback();
});
});
}
}, function() {
callback(obj);
});
}
if(jsonObj.id) {
Entity.load(session, tx, jsonObj.id, loadedObj);
} else {
loadedObj(new Entity(session));
}
};
Entity.load = function(session, tx, id, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'id', optional: false, check: argspec.hasType('string') },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
Entity.findBy(args.session, args.tx, "id", args.id, args.callback);
};
Entity.findBy = function(session, tx, property, value, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'session', optional: true, check: persistence.isSession, defaultValue: persistence },
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'property', optional: false, check: argspec.hasType('string') },
{ name: 'value', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
session = args.session;
tx = args.tx;
property = args.property;
value = args.value;
callback = args.callback;
if(property === 'id' && value in session.trackedObjects) {
callback(session.trackedObjects[value]);
return;
}
if(!tx) {
session.transaction(function(tx) {
Entity.findBy(session, tx, property, value, callback);
});
return;
}
Entity.all(session).filter(property, "=", value).one(tx, function(obj) {
callback(obj);
});
}
Entity.index = function(cols,options) {
var opts = options || {};
if (typeof cols=="string") {
cols = [cols];
}
opts.columns = cols;
meta.indexes.push(opts);
};
/**
* Declares a one-to-many or many-to-many relationship to another entity
* Whether 1:N or N:M is chosed depends on the inverse declaration
* @param collName the name of the collection (becomes a property of
* Entity instances
* @param otherEntity the constructor function of the entity to define
* the relation to
* @param inverseRel the name of the inverse property (to be) defined on otherEntity
*/
Entity.hasMany = function (collName, otherEntity, invRel) {
var otherMeta = otherEntity.meta;
if (otherMeta.hasMany[invRel]) {
// other side has declared it as a one-to-many relation too -> it's in
// fact many-to-many
var tableName = meta.name + "_" + collName + "_" + otherMeta.name;
var inverseTableName = otherMeta.name + '_' + invRel + '_' + meta.name;
if (tableName > inverseTableName) {
// Some arbitrary way to deterministically decide which table to generate
tableName = inverseTableName;
}
meta.hasMany[collName] = {
type: otherEntity,
inverseProperty: invRel,
manyToMany: true,
tableName: tableName
};
otherMeta.hasMany[invRel] = {
type: Entity,
inverseProperty: collName,
manyToMany: true,
tableName: tableName
};
delete meta.hasOne[collName];
delete meta.fields[collName + "_class"]; // in case it existed
} else {
meta.hasMany[collName] = {
type: otherEntity,
inverseProperty: invRel
};
otherMeta.hasOne[invRel] = {
type: Entity,
inverseProperty: collName
};
if (meta.isMixin)
otherMeta.fields[invRel + "_class"] = persistence.typeMapper ? persistence.typeMapper.classNameType : "TEXT";
}
}
Entity.hasOne = function (refName, otherEntity, inverseProperty) {
meta.hasOne[refName] = {
type: otherEntity,
inverseProperty: inverseProperty
};
if (otherEntity.meta.isMixin)
meta.fields[refName + "_class"] = persistence.typeMapper ? persistence.typeMapper.classNameType : "TEXT";
};
Entity.is = function(mixin){
var mixinMeta = mixin.meta;
if (!mixinMeta.isMixin)
throw new Error("not a mixin: " + mixin);
mixin.meta.mixedIns = mixin.meta.mixedIns || [];
mixin.meta.mixedIns.push(meta);
for (var field in mixinMeta.fields) {
if (mixinMeta.fields.hasOwnProperty(field))
meta.fields[field] = mixinMeta.fields[field];
}
for (var it in mixinMeta.hasOne) {
if (mixinMeta.hasOne.hasOwnProperty(it))
meta.hasOne[it] = mixinMeta.hasOne[it];
}
for (var it in mixinMeta.hasMany) {
if (mixinMeta.hasMany.hasOwnProperty(it)) {
mixinMeta.hasMany[it].mixin = mixin;
meta.hasMany[it] = mixinMeta.hasMany[it];
}
}
}
// Allow decorator functions to add more stuff
var fns = persistence.entityDecoratorHooks;
for(var i = 0; i < fns.length; i++) {
fns[i](Entity);
}
entityClassCache[entityName] = Entity;
return Entity;
}
persistence.jsonToEntityVal = function(value, type) {
if(type) {
switch(type) {
case 'DATE':
if(typeof value === 'number') {
if (value > 1000000000000) {
// it's in milliseconds
return new Date(value);
} else {
return new Date(value * 1000);
}
} else {
return null;
}
break;
default:
return value;
}
} else {
return value;
}
};
persistence.entityValToJson = function(value, type) {
if(type) {
switch(type) {
case 'DATE':
if(value) {
value = new Date(value);
return Math.round(value.getTime() / 1000);
} else {
return null;
}
break;
default:
return value;
}
} else {
return value;
}
};
/**
* Dumps the entire database into an object (that can be serialized to JSON for instance)
* @param tx transaction to use, use `null` to start a new one
* @param entities a list of entity constructor functions to serialize, use `null` for all
* @param callback (object) the callback function called with the results.
*/
persistence.dump = function(tx, entities, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'entities', optional: true, check: function(obj) { return !obj || (obj && obj.length && !obj.apply); }, defaultValue: null },
{ name: 'callback', optional: false, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
entities = args.entities;
callback = args.callback;
if(!entities) { // Default: all entity types
entities = [];
for(var e in entityClassCache) {
if(entityClassCache.hasOwnProperty(e)) {
entities.push(entityClassCache[e]);
}
}
}
var result = {};
persistence.asyncParForEach(entities, function(Entity, callback) {
Entity.all().list(tx, function(all) {
var items = [];
persistence.asyncParForEach(all, function(e, callback) {
var rec = {};
var fields = Entity.meta.fields;
for(var f in fields) {
if(fields.hasOwnProperty(f)) {
rec[f] = persistence.entityValToJson(e._data[f], fields[f]);
}
}
var refs = Entity.meta.hasOne;
for(var r in refs) {
if(refs.hasOwnProperty(r)) {
rec[r] = e._data[r];
}
}
var colls = Entity.meta.hasMany;
var collArray = [];
for(var coll in colls) {
if(colls.hasOwnProperty(coll)) {
collArray.push(coll);
}
}
persistence.asyncParForEach(collArray, function(collP, callback) {
var coll = persistence.get(e, collP);
coll.list(tx, function(results) {
rec[collP] = results.map(function(r) { return r.id; });
callback();
});
}, function() {
rec.id = e.id;
items.push(rec);
callback();
});
}, function() {
result[Entity.meta.name] = items;
callback();
});
});
}, function() {
callback(result);
});
};
/**
* Loads a set of entities from a dump object
* @param tx transaction to use, use `null` to start a new one
* @param dump the dump object
* @param callback the callback function called when done.
*/
persistence.load = function(tx, dump, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'dump', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
dump = args.dump;
callback = args.callback;
var finishedCount = 0;
var collItemsToAdd = [];
var session = this;
for(var entityName in dump) {
if(dump.hasOwnProperty(entityName)) {
var Entity = getEntity(entityName);
var fields = Entity.meta.fields;
var instances = dump[entityName];
for(var i = 0; i < instances.length; i++) {
var instance = instances[i];
var ent = new Entity();
ent.id = instance.id;
for(var p in instance) {
if(instance.hasOwnProperty(p)) {
if (persistence.isImmutable(p)) {
ent[p] = instance[p];
} else if(Entity.meta.hasMany[p]) { // collection
var many = Entity.meta.hasMany[p];
if(many.manyToMany && Entity.meta.name < many.type.meta.name) { // Arbitrary way to avoid double adding
continue;
}
var coll = persistence.get(ent, p);
if(instance[p].length > 0) {
instance[p].forEach(function(it) {
collItemsToAdd.push({Entity: Entity, coll: coll, id: it});
});
}
} else {
persistence.set(ent, p, persistence.jsonToEntityVal(instance[p], fields[p]));
}
}
}
this.add(ent);
}
}
}
session.flush(tx, function() {
persistence.asyncForEach(collItemsToAdd, function(collItem, callback) {
collItem.Entity.load(session, tx, collItem.id, function(obj) {
collItem.coll.add(obj);
callback();
});
}, function() {
session.flush(tx, callback);
});
});
};
/**
* Dumps the entire database to a JSON string
* @param tx transaction to use, use `null` to start a new one
* @param entities a list of entity constructor functions to serialize, use `null` for all
* @param callback (jsonDump) the callback function called with the results.
*/
persistence.dumpToJson = function(tx, entities, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'entities', optional: true, check: function(obj) { return obj && obj.length && !obj.apply; }, defaultValue: null },
{ name: 'callback', optional: false, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
entities = args.entities;
callback = args.callback;
this.dump(tx, entities, function(obj) {
callback(JSON.stringify(obj));
});
};
/**
* Loads data from a JSON string (as dumped by `dumpToJson`)
* @param tx transaction to use, use `null` to start a new one
* @param jsonDump JSON string
* @param callback the callback function called when done.
*/
persistence.loadFromJson = function(tx, jsonDump, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'jsonDump', optional: false },
{ name: 'callback', optional: true, check: argspec.isCallback(), defaultValue: function(){} }
]);
tx = args.tx;
jsonDump = args.jsonDump;
callback = args.callback;
this.load(tx, JSON.parse(jsonDump), callback);
};
/**
* Generates a UUID according to http://www.ietf.org/rfc/rfc4122.txt
*/
function createUUID () {
if(persistence.typeMapper && persistence.typeMapper.newUuid) {
return persistence.typeMapper.newUuid();
}
var s = [];
var hexDigits = "0123456789ABCDEF";
for ( var i = 0; i < 32; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
}
s[12] = "4";
s[16] = hexDigits.substr((s[16] & 0x3) | 0x8, 1);
var uuid = s.join("");
return uuid;
}
persistence.createUUID = createUUID;
function defaultValue(type) {
if(persistence.typeMapper && persistence.typeMapper.defaultValue) {
return persistence.typeMapper.defaultValue(type);
}
switch(type) {
case "TEXT": return "";
case "BOOL": return false;
default:
if(type.indexOf("INT") !== -1) {
return 0;
} else if(type.indexOf("CHAR") !== -1) {
return "";
} else {
return null;
}
}
}
function arrayContains(ar, item) {
var l = ar.length;
for(var i = 0; i < l; i++) {
var el = ar[i];
if(el.equals && el.equals(item)) {
return true;
} else if(el === item) {
return true;
}
}
return false;
}
function arrayRemove(ar, item) {
var l = ar.length;
for(var i = 0; i < l; i++) {
var el = ar[i];
if(el.equals && el.equals(item)) {
ar.splice(i, 1);
return;
} else if(el === item) {
ar.splice(i, 1);
return;
}
}
}
////////////////// QUERY COLLECTIONS \\\\\\\\\\\\\\\\\\\\\\\
function Subscription(obj, eventType, fn) {
this.obj = obj;
this.eventType = eventType;
this.fn = fn;
}
Subscription.prototype.unsubscribe = function() {
this.obj.removeEventListener(this.eventType, this.fn);
};
/**
* Simple observable function constructor
* @constructor
*/
function Observable() {
this.subscribers = {};
}
Observable.prototype.addEventListener = function (eventType, fn) {
if (!this.subscribers[eventType]) {
this.subscribers[eventType] = [];
}
this.subscribers[eventType].push(fn);
return new Subscription(this, eventType, fn);
};
Observable.prototype.removeEventListener = function(eventType, fn) {
var subscribers = this.subscribers[eventType];
for ( var i = 0; i < subscribers.length; i++) {
if(subscribers[i] == fn) {
this.subscribers[eventType].splice(i, 1);
return true;
}
}
return false;
};
Observable.prototype.triggerEvent = function (eventType) {
if (!this.subscribers[eventType]) { // No subscribers to this event type
return;
}
var subscribers = this.subscribers[eventType].slice(0);
for(var i = 0; i < subscribers.length; i++) {
subscribers[i].apply(null, arguments);
}
};
/*
* Each filter has 4 methods:
* - sql(prefix, values) -- returns a SQL representation of this filter,
* possibly pushing additional query arguments to `values` if ?'s are used
* in the query
* - match(o) -- returns whether the filter matches the object o.
* - makeFit(o) -- attempts to adapt the object o in such a way that it matches
* this filter.
* - makeNotFit(o) -- the oppositive of makeFit, makes the object o NOT match
* this filter
*/
/**
* Default filter that does not filter on anything
* currently it generates a 1=1 SQL query, which is kind of ugly
*/
function NullFilter () {
}
NullFilter.prototype.match = function (o) {
return true;
};
NullFilter.prototype.makeFit = function(o) {
};
NullFilter.prototype.makeNotFit = function(o) {
};
NullFilter.prototype.toUniqueString = function() {
return "NULL";
};
NullFilter.prototype.subscribeGlobally = function() { };
NullFilter.prototype.unsubscribeGlobally = function() { };
/**
* Filter that makes sure that both its left and right filter match
* @param left left-hand filter object
* @param right right-hand filter object
*/
function AndFilter (left, right) {
this.left = left;
this.right = right;
}
AndFilter.prototype.match = function (o) {
return this.left.match(o) && this.right.match(o);
};
AndFilter.prototype.makeFit = function(o) {
this.left.makeFit(o);
this.right.makeFit(o);
};
AndFilter.prototype.makeNotFit = function(o) {
this.left.makeNotFit(o);
this.right.makeNotFit(o);
};
AndFilter.prototype.toUniqueString = function() {
return this.left.toUniqueString() + " AND " + this.right.toUniqueString();
};
AndFilter.prototype.subscribeGlobally = function(coll, entityName) {
this.left.subscribeGlobally(coll, entityName);
this.right.subscribeGlobally(coll, entityName);
};
AndFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
this.left.unsubscribeGlobally(coll, entityName);
this.right.unsubscribeGlobally(coll, entityName);
};
/**
* Filter that makes sure that either its left and right filter match
* @param left left-hand filter object
* @param right right-hand filter object
*/
function OrFilter (left, right) {
this.left = left;
this.right = right;
}
OrFilter.prototype.match = function (o) {
return this.left.match(o) || this.right.match(o);
};
OrFilter.prototype.makeFit = function(o) {
this.left.makeFit(o);
this.right.makeFit(o);
};
OrFilter.prototype.makeNotFit = function(o) {
this.left.makeNotFit(o);
this.right.makeNotFit(o);
};
OrFilter.prototype.toUniqueString = function() {
return this.left.toUniqueString() + " OR " + this.right.toUniqueString();
};
OrFilter.prototype.subscribeGlobally = function(coll, entityName) {
this.left.subscribeGlobally(coll, entityName);
this.right.subscribeGlobally(coll, entityName);
};
OrFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
this.left.unsubscribeGlobally(coll, entityName);
this.right.unsubscribeGlobally(coll, entityName);
};
/**
* Filter that checks whether a certain property matches some value, based on an
* operator. Supported operators are '=', '!=', '<', '<=', '>' and '>='.
* @param property the property name
* @param operator the operator to compare with
* @param value the literal value to compare to
*/
function PropertyFilter (property, operator, value) {
this.property = property;
this.operator = operator.toLowerCase();
this.value = value;
}
PropertyFilter.prototype.match = function (o) {
var value = this.value;
var propValue = persistence.get(o, this.property);
if(value && value.getTime) { // DATE
// TODO: Deal with arrays of dates for 'in' and 'not in'
value = Math.round(value.getTime() / 1000) * 1000; // Deal with precision
if(propValue && propValue.getTime) { // DATE
propValue = Math.round(propValue.getTime() / 1000) * 1000; // Deal with precision
}
}
switch (this.operator) {
case '=':
return propValue === value;
break;
case '!=':
return propValue !== value;
break;
case '<':
return propValue < value;
break;
case '<=':
return propValue <= value;
break;
case '>':
return propValue > value;
break;
case '>=':
return propValue >= value;
break;
case 'in':
return arrayContains(value, propValue);
break;
case 'not in':
return !arrayContains(value, propValue);
break;
}
};
PropertyFilter.prototype.makeFit = function(o) {
if(this.operator === '=') {
persistence.set(o, this.property, this.value);
} else {
throw new Error("Sorry, can't perform makeFit for other filters than =");
}
};
PropertyFilter.prototype.makeNotFit = function(o) {
if(this.operator === '=') {
persistence.set(o, this.property, null);
} else {
throw new Error("Sorry, can't perform makeNotFit for other filters than =");
}
};
PropertyFilter.prototype.subscribeGlobally = function(coll, entityName) {
persistence.subscribeToGlobalPropertyListener(coll, entityName, this.property);
};
PropertyFilter.prototype.unsubscribeGlobally = function(coll, entityName) {
persistence.unsubscribeFromGlobalPropertyListener(coll, entityName, this.property);
};
PropertyFilter.prototype.toUniqueString = function() {
var val = this.value;
if(val && val._type) {
val = val.id;
}
return this.property + this.operator + val;
};
persistence.NullFilter = NullFilter;
persistence.AndFilter = AndFilter;
persistence.OrFilter = OrFilter;
persistence.PropertyFilter = PropertyFilter;
/**
* Ensure global uniqueness of query collection object
*/
persistence.uniqueQueryCollection = function(coll) {
var entityName = coll._entityName;
if(coll._items) { // LocalQueryCollection
return coll;
}
if(!this.queryCollectionCache[entityName]) {
this.queryCollectionCache[entityName] = {};
}
var uniqueString = coll.toUniqueString();
if(!this.queryCollectionCache[entityName][uniqueString]) {
this.queryCollectionCache[entityName][uniqueString] = coll;
}
return this.queryCollectionCache[entityName][uniqueString];
}
/**
* The constructor function of the _abstract_ QueryCollection
* DO NOT INSTANTIATE THIS
* @constructor
*/
function QueryCollection () {
}
QueryCollection.prototype = new Observable();
QueryCollection.prototype.oldAddEventListener = QueryCollection.prototype.addEventListener;
QueryCollection.prototype.setupSubscriptions = function() {
this._filter.subscribeGlobally(this, this._entityName);
};
QueryCollection.prototype.teardownSubscriptions = function() {
this._filter.unsubscribeGlobally(this, this._entityName);
};
QueryCollection.prototype.addEventListener = function(eventType, fn) {
var that = this;
var subscription = this.oldAddEventListener(eventType, fn);
if(this.subscribers[eventType].length === 1) { // first subscriber
this.setupSubscriptions();
}
subscription.oldUnsubscribe = subscription.unsubscribe;
subscription.unsubscribe = function() {
this.oldUnsubscribe();
if(that.subscribers[eventType].length === 0) { // last subscriber
that.teardownSubscriptions();
}
};
return subscription;
};
/**
* Function called when session is flushed, returns list of SQL queries to execute
* (as [query, arg] tuples)
*/
QueryCollection.prototype.persistQueries = function() { return []; };
/**
* Invoked by sub-classes to initialize the query collection
*/
QueryCollection.prototype.init = function (session, entityName, constructor) {
this._filter = new NullFilter();
this._orderColumns = []; // tuples of [column, ascending]
this._prefetchFields = [];
this._entityName = entityName;
this._constructor = constructor;
this._limit = -1;
this._skip = 0;
this._reverse = false;
this._session = session || persistence;
// For observable
this.subscribers = {};
}
QueryCollection.prototype.toUniqueString = function() {
var s = this._constructor.name + ": " + this._entityName;
s += '|Filter:';
var values = [];
s += this._filter.toUniqueString();
s += '|Values:';
for(var i = 0; i < values.length; i++) {
s += values + "|^|";
}
s += '|Order:';
for(var i = 0; i < this._orderColumns.length; i++) {
var col = this._orderColumns[i];
s += col[0] + ", " + col[1] + ", " + col[2];
}
s += '|Prefetch:';
for(var i = 0; i < this._prefetchFields.length; i++) {
s += this._prefetchFields[i];
}
s += '|Limit:';
s += this._limit;
s += '|Skip:';
s += this._skip;
s += '|Reverse:';
s += this._reverse;
return s;
};
/**
* Creates a clone of this query collection
* @return a clone of the collection
*/
QueryCollection.prototype.clone = function (cloneSubscribers) {
var c = new (this._constructor)(this._session, this._entityName);
c._filter = this._filter;
c._prefetchFields = this._prefetchFields.slice(0); // clone
c._orderColumns = this._orderColumns.slice(0);
c._limit = this._limit;
c._skip = this._skip;
c._reverse = this._reverse;
if(cloneSubscribers) {
var subscribers = {};
for(var eventType in this.subscribers) {
if(this.subscribers.hasOwnProperty(eventType)) {
subscribers[eventType] = this.subscribers[eventType].slice(0);
}
}
c.subscribers = subscribers; //this.subscribers;
} else {
c.subscribers = this.subscribers;
}
return c;
};
/**
* Returns a new query collection with a property filter condition added
* @param property the property to filter on
* @param operator the operator to use
* @param value the literal value that the property should match
* @return the query collection with the filter added
*/
QueryCollection.prototype.filter = function (property, operator, value) {
var c = this.clone(true);
c._filter = new AndFilter(this._filter, new PropertyFilter(property,
operator, value));
// Add global listener (TODO: memory leak waiting to happen!)
var session = this._session;
c = session.uniqueQueryCollection(c);
//session.subscribeToGlobalPropertyListener(c, this._entityName, property);
return session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an OR condition between the
* current filter and the filter specified as argument
* @param filter the other filter
* @return the new query collection
*/
QueryCollection.prototype.or = function (filter) {
var c = this.clone(true);
c._filter = new OrFilter(this._filter, filter);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an AND condition between the
* current filter and the filter specified as argument
* @param filter the other filter
* @return the new query collection
*/
QueryCollection.prototype.and = function (filter) {
var c = this.clone(true);
c._filter = new AndFilter(this._filter, filter);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection with an ordering imposed on the collection
* @param property the property to sort on
* @param ascending should the order be ascending (= true) or descending (= false)
* @param caseSensitive should the order be case sensitive (= true) or case insensitive (= false)
* note: using case insensitive ordering for anything other than TEXT fields yields
* undefinded behavior
* @return the query collection with imposed ordering
*/
QueryCollection.prototype.order = function (property, ascending, caseSensitive) {
ascending = ascending === undefined ? true : ascending;
caseSensitive = caseSensitive === undefined ? true : caseSensitive;
var c = this.clone();
c._orderColumns.push( [ property, ascending, caseSensitive ]);
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection will limit its size to n items
* @param n the number of items to limit it to
* @return the limited query collection
*/
QueryCollection.prototype.limit = function(n) {
var c = this.clone();
c._limit = n;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which will skip the first n results
* @param n the number of results to skip
* @return the query collection that will skip n items
*/
QueryCollection.prototype.skip = function(n) {
var c = this.clone();
c._skip = n;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which reverse the order of the result set
* @return the query collection that will reverse its items
*/
QueryCollection.prototype.reverse = function() {
var c = this.clone();
c._reverse = true;
return this._session.uniqueQueryCollection(c);
};
/**
* Returns a new query collection which will prefetch a certain object relationship.
* Only works with 1:1 and N:1 relations.
* Relation must target an entity, not a mix-in.
* @param rel the relation name of the relation to prefetch
* @return the query collection prefetching `rel`
*/
QueryCollection.prototype.prefetch = function (rel) {
var c = this.clone();
c._prefetchFields.push(rel);
return this._session.uniqueQueryCollection(c);
};
/**
* Select a subset of data, represented by this query collection as a JSON
* structure (Javascript object)
*
* @param tx database transaction to use, leave out to start a new one
* @param props a property specification
* @param callback(result)
*/
QueryCollection.prototype.selectJSON = function(tx, props, callback) {
var args = argspec.getArgs(arguments, [
{ name: "tx", optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: "props", optional: false },
{ name: "callback", optional: false }
]);
var session = this._session;
var that = this;
tx = args.tx;
props = args.props;
callback = args.callback;
if(!tx) {
session.transaction(function(tx) {
that.selectJSON(tx, props, callback);
});
return;
}
var Entity = getEntity(this._entityName);
// TODO: This could do some clever prefetching to make it more efficient
this.list(function(items) {
var resultArray = [];
persistence.asyncForEach(items, function(item, callback) {
item.selectJSON(tx, props, function(obj) {
resultArray.push(obj);
callback();
});
}, function() {
callback(resultArray);
});
});
};
/**
* Adds an object to a collection
* @param obj the object to add
*/
QueryCollection.prototype.add = function(obj) {
if(!obj.id || !obj._type) {
throw new Error("Cannot add object of non-entity type onto collection.");
}
this._session.add(obj);
this._filter.makeFit(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
/**
* Adds an an array of objects to a collection
* @param obj the object to add
*/
QueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
this._session.add(obj);
this._filter.makeFit(obj);
this.triggerEvent('add', this, obj);
}
this.triggerEvent('change', this);
}
/**
* Removes an object from a collection
* @param obj the object to remove from the collection
*/
QueryCollection.prototype.remove = function(obj) {
if(!obj.id || !obj._type) {
throw new Error("Cannot remove object of non-entity type from collection.");
}
this._filter.makeNotFit(obj);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
}
/**
* A database implementation of the QueryCollection
* @param entityName the name of the entity to create the collection for
* @constructor
*/
function DbQueryCollection (session, entityName) {
this.init(session, entityName, DbQueryCollection);
}
/**
* Execute a function for each item in the list
* @param tx the transaction to use (or null to open a new one)
* @param eachFn (elem) the function to be executed for each item
*/
QueryCollection.prototype.each = function (tx, eachFn) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'eachFn', optional: true, check: argspec.isCallback() }
]);
tx = args.tx;
eachFn = args.eachFn;
this.list(tx, function(results) {
for(var i = 0; i < results.length; i++) {
eachFn(results[i]);
}
});
}
// Alias
QueryCollection.prototype.forEach = QueryCollection.prototype.each;
QueryCollection.prototype.one = function (tx, oneFn) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'oneFn', optional: false, check: argspec.isCallback() }
]);
tx = args.tx;
oneFn = args.oneFn;
var that = this;
this.limit(1).list(tx, function(results) {
if(results.length === 0) {
oneFn(null);
} else {
oneFn(results[0]);
}
});
}
DbQueryCollection.prototype = new QueryCollection();
/**
* An implementation of QueryCollection, that is used
* to represent all instances of an entity type
* @constructor
*/
function AllDbQueryCollection (session, entityName) {
this.init(session, entityName, AllDbQueryCollection);
}
AllDbQueryCollection.prototype = new DbQueryCollection();
AllDbQueryCollection.prototype.add = function(obj) {
this._session.add(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
};
AllDbQueryCollection.prototype.remove = function(obj) {
this._session.remove(obj);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
};
/**
* A ManyToMany implementation of QueryCollection
* @constructor
*/
function ManyToManyDbQueryCollection (session, entityName) {
this.init(session, entityName, persistence.ManyToManyDbQueryCollection);
this._localAdded = [];
this._localRemoved = [];
}
ManyToManyDbQueryCollection.prototype = new DbQueryCollection();
ManyToManyDbQueryCollection.prototype.initManyToMany = function(obj, coll) {
this._obj = obj;
this._coll = coll;
};
ManyToManyDbQueryCollection.prototype.add = function(obj) {
if(!arrayContains(this._localAdded, obj)) {
this._session.add(obj);
this._localAdded.push(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
};
ManyToManyDbQueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
if(!arrayContains(this._localAdded, obj)) {
this._session.add(obj);
this._localAdded.push(obj);
this.triggerEvent('add', this, obj);
}
}
this.triggerEvent('change', this);
}
ManyToManyDbQueryCollection.prototype.clone = function() {
var c = DbQueryCollection.prototype.clone.call(this);
c._localAdded = this._localAdded;
c._localRemoved = this._localRemoved;
c._obj = this._obj;
c._coll = this._coll;
return c;
};
ManyToManyDbQueryCollection.prototype.remove = function(obj) {
if(arrayContains(this._localAdded, obj)) { // added locally, can just remove it from there
arrayRemove(this._localAdded, obj);
} else if(!arrayContains(this._localRemoved, obj)) {
this._localRemoved.push(obj);
}
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
};
////////// Local implementation of QueryCollection \\\\\\\\\\\\\\\\
function LocalQueryCollection(initialArray) {
this.init(persistence, null, LocalQueryCollection);
this._items = initialArray || [];
}
LocalQueryCollection.prototype = new QueryCollection();
LocalQueryCollection.prototype.clone = function() {
var c = DbQueryCollection.prototype.clone.call(this);
c._items = this._items;
return c;
};
LocalQueryCollection.prototype.add = function(obj) {
if(!arrayContains(this._items, obj)) {
this._session.add(obj);
this._items.push(obj);
this.triggerEvent('add', this, obj);
this.triggerEvent('change', this, obj);
}
};
LocalQueryCollection.prototype.addAll = function(objs) {
for(var i = 0; i < objs.length; i++) {
var obj = objs[i];
if(!arrayContains(this._items, obj)) {
this._session.add(obj);
this._items.push(obj);
this.triggerEvent('add', this, obj);
}
}
this.triggerEvent('change', this);
}
LocalQueryCollection.prototype.remove = function(obj) {
var items = this._items;
for(var i = 0; i < items.length; i++) {
if(items[i] === obj) {
this._items.splice(i, 1);
this.triggerEvent('remove', this, obj);
this.triggerEvent('change', this, obj);
}
}
};
LocalQueryCollection.prototype.list = function(tx, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'callback', optional: true, check: argspec.isCallback() }
]);
callback = args.callback;
if(!callback || callback.executeSql) { // first argument is transaction
callback = arguments[1]; // set to second argument
}
var array = this._items.slice(0);
var that = this;
var results = [];
for(var i = 0; i < array.length; i++) {
if(this._filter.match(array[i])) {
results.push(array[i]);
}
}
results.sort(function(a, b) {
for(var i = 0; i < that._orderColumns.length; i++) {
var col = that._orderColumns[i][0];
var asc = that._orderColumns[i][1];
var sens = that._orderColumns[i][2];
var aVal = persistence.get(a, col);
var bVal = persistence.get(b, col);
if (!sens) {
aVal = aVal.toLowerCase();
bVal = bVal.toLowerCase();
}
if(aVal < bVal) {
return asc ? -1 : 1;
} else if(aVal > bVal) {
return asc ? 1 : -1;
}
}
return 0;
});
if(this._skip) {
results.splice(0, this._skip);
}
if(this._limit > -1) {
results = results.slice(0, this._limit);
}
if(this._reverse) {
results.reverse();
}
if(callback) {
callback(results);
} else {
return results;
}
};
LocalQueryCollection.prototype.destroyAll = function(callback) {
if(!callback || callback.executeSql) { // first argument is transaction
callback = arguments[1]; // set to second argument
}
this._items = [];
this.triggerEvent('change', this);
if(callback) callback();
};
LocalQueryCollection.prototype.count = function(tx, callback) {
var args = argspec.getArgs(arguments, [
{ name: 'tx', optional: true, check: persistence.isTransaction, defaultValue: null },
{ name: 'callback', optional: true, check: argspec.isCallback() }
]);
tx = args.tx;
callback = args.callback;
var result = this.list();
if(callback) {
callback(result.length);
} else {
return result.length;
}
};
persistence.QueryCollection = QueryCollection;
persistence.DbQueryCollection = DbQueryCollection;
persistence.ManyToManyDbQueryCollection = ManyToManyDbQueryCollection;
persistence.LocalQueryCollection = LocalQueryCollection;
persistence.Observable = Observable;
persistence.Subscription = Subscription;
persistence.AndFilter = AndFilter;
persistence.OrFilter = OrFilter;
persistence.PropertyFilter = PropertyFilter;
}());
// ArgSpec.js library: http://github.com/zefhemel/argspecjs
var argspec = {};
(function() {
argspec.getArgs = function(args, specs) {
var argIdx = 0;
var specIdx = 0;
var argObj = {};
while(specIdx < specs.length) {
var s = specs[specIdx];
var a = args[argIdx];
if(s.optional) {
if(a !== undefined && s.check(a)) {
argObj[s.name] = a;
argIdx++;
specIdx++;
} else {
if(s.defaultValue !== undefined) {
argObj[s.name] = s.defaultValue;
}
specIdx++;
}
} else {
if(s.check && !s.check(a)) {
throw new Error("Invalid value for argument: " + s.name + " Value: " + a);
}
argObj[s.name] = a;
specIdx++;
argIdx++;
}
}
return argObj;
}
argspec.hasProperty = function(name) {
return function(obj) {
return obj && obj[name] !== undefined;
};
}
argspec.hasType = function(type) {
return function(obj) {
return typeof obj === type;
};
}
argspec.isCallback = function() {
return function(obj) {
return obj && obj.apply;
};
}
}());
persistence.argspec = argspec;
return persistence;
} // end of createPersistence
// JSON2 library, source: http://www.JSON.org/js.html
// Most modern browsers already support this natively, but mobile
// browsers often don't, hence this implementation
// Relevant APIs:
// JSON.stringify(value, replacer, space)
// JSON.parse(text, reviver)
if(typeof JSON === 'undefined') {
JSON = {};
}
//var JSON = typeof JSON === 'undefined' ? window.JSON : {};
if (!JSON.stringify) {
(function () {
function f(n) {
return n < 10 ? '0' + n : n;
}
if (typeof Date.prototype.toJSON !== 'function') {
Date.prototype.toJSON = function (key) {
return isFinite(this.valueOf()) ?
this.getUTCFullYear() + '-' +
f(this.getUTCMonth() + 1) + '-' +
f(this.getUTCDate()) + 'T' +
f(this.getUTCHours()) + ':' +
f(this.getUTCMinutes()) + ':' +
f(this.getUTCSeconds()) + 'Z' : null;
};
String.prototype.toJSON =
Number.prototype.toJSON =
Boolean.prototype.toJSON = function (key) {
return this.valueOf();
};
}
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
gap, indent,
meta = {
'\b': '\\b',
'\t': '\\t',
'\n': '\\n',
'\f': '\\f',
'\r': '\\r',
'"' : '\\"',
'\\': '\\\\'
},
rep;
function quote(string) {
escapable.lastIndex = 0;
return escapable.test(string) ?
'"' + string.replace(escapable, function (a) {
var c = meta[a];
return typeof c === 'string' ? c :
'\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
}) + '"' :
'"' + string + '"';
}
function str(key, holder) {
var i, k, v, length, mind = gap, partial, value = holder[key];
if (value && typeof value === 'object' &&
typeof value.toJSON === 'function') {
value = value.toJSON(key);
}
if (typeof rep === 'function') {
value = rep.call(holder, key, value);
}
switch (typeof value) {
case 'string':
return quote(value);
case 'number':
return isFinite(value) ? String(value) : 'null';
case 'boolean':
case 'null':
return String(value);
case 'object':
if (!value) {
return 'null';
}
gap += indent;
partial = [];
if (Object.prototype.toString.apply(value) === '[object Array]') {
length = value.length;
for (i = 0; i < length; i += 1) {
partial[i] = str(i, value) || 'null';
}
v = partial.length === 0 ? '[]' :
gap ? '[\n' + gap +
partial.join(',\n' + gap) + '\n' +
mind + ']' :
'[' + partial.join(',') + ']';
gap = mind;
return v;
}
if (rep && typeof rep === 'object') {
length = rep.length;
for (i = 0; i < length; i += 1) {
k = rep[i];
if (typeof k === 'string') {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
} else {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = str(k, value);
if (v) {
partial.push(quote(k) + (gap ? ': ' : ':') + v);
}
}
}
}
v = partial.length === 0 ? '{}' :
gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
mind + '}' : '{' + partial.join(',') + '}';
gap = mind;
return v;
}
}
if (typeof JSON.stringify !== 'function') {
JSON.stringify = function (value, replacer, space) {
var i;
gap = '';
indent = '';
if (typeof space === 'number') {
for (i = 0; i < space; i += 1) {
indent += ' ';
}
} else if (typeof space === 'string') {
indent = space;
}
rep = replacer;
if (replacer && typeof replacer !== 'function' &&
(typeof replacer !== 'object' ||
typeof replacer.length !== 'number')) {
throw new Error('JSON.stringify');
}
return str('', {'': value});
};
}
if (typeof JSON.parse !== 'function') {
JSON.parse = function (text, reviver) {
var j;
function walk(holder, key) {
var k, v, value = holder[key];
if (value && typeof value === 'object') {
for (k in value) {
if (Object.hasOwnProperty.call(value, k)) {
v = walk(value, k);
if (v !== undefined) {
value[k] = v;
} else {
delete value[k];
}
}
}
}
return reviver.call(holder, key, value);
}
cx.lastIndex = 0;
if (cx.test(text)) {
text = text.replace(cx, function (a) {
return '\\u' +
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
});
}
if (/^[\],:{}\s]*$/.
test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
j = eval('(' + text + ')');
return typeof reviver === 'function' ?
walk({'': j}, '') : j;
}
throw new SyntaxError('JSON.parse');
};
}
}());
}
|
TimurStash/syncro
|
vendor/persistence.js
|
JavaScript
|
mit
| 81,298
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>dictionaries: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.14.0 / dictionaries - 8.7.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
dictionaries
<small>
8.7.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-03 21:53:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-03 21:53:52 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 3 Virtual package relying on a GMP lib system installation
coq 8.14.0 Formal proof management system
dune 2.9.1 Fast, portable, and opinionated build system
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler
ocamlfind 1.9.1 A library manager for OCaml
ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/dictionaries"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Dictionaries"]
depends: [
"ocaml"
"coq" {>= "8.7" & < "8.8~"}
]
tags: [
"keyword: modules"
"keyword: functors"
"keyword: search trees"
"category: Computer Science/Data Types and Data Structures"
"category: Miscellaneous/Extracted Programs/Data structures"
"date: 2003-02-6"
]
authors: [ "Pierre Castéran <casteran@labri.fr>" ]
bug-reports: "https://github.com/coq-contribs/dictionaries/issues"
dev-repo: "git+https://github.com/coq-contribs/dictionaries.git"
synopsis: "Dictionaries (with modules)"
description: """
This file contains a specification for dictionaries, and
an implementation using binary search trees. Coq's module system,
with module types and functors, is heavily used. It can be considered
as a certified version of an example proposed by Paulson in Standard ML.
A detailed description (in French) can be found in the chapter 11 of
The Coq'Art, the book written by Yves Bertot and Pierre Castéran
(please follow the link http://coq.inria.fr/doc-eng.html)"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/dictionaries/archive/v8.7.0.tar.gz"
checksum: "md5=1e1e78b0a76827b75de4f43ec8602c1d"
}
</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-dictionaries.8.7.0 coq.8.14.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.0).
The following dependencies couldn't be met:
- coq-dictionaries -> coq < 8.8~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-dictionaries.8.7.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.06.1-2.0.5/released/8.14.0/dictionaries/8.7.0.html
|
HTML
|
mit
| 7,762
|
.calendar-container {
background: #cebe29;
background: -moz-linear-gradient(-45deg, #cebe29 0%, #9b1f50 33%, #2989d8 71%, #89b4ff 91%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#cebe29), color-stop(33%,#9b1f50), color-stop(71%,#2989d8), color-stop(91%,#89b4ff));
background: -webkit-linear-gradient(-45deg, #cebe29 0%,#9b1f50 33%,#2989d8 71%,#89b4ff 91%);
background: -o-linear-gradient(-45deg, #cebe29 0%,#9b1f50 33%,#2989d8 71%,#89b4ff 91%);
background: -ms-linear-gradient(-45deg, #cebe29 0%,#9b1f50 33%,#2989d8 71%,#89b4ff 91%);
background: linear-gradient(135deg, #cebe29 0%,#9b1f50 33%,#2989d8 71%,#89b4ff 91%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cebe29', endColorstr='#89b4ff',GradientType=1 );
-webkit-background-size: 100% 100%;
-moz-background-size: 100% 100%;
background-size: 100% 100%;
}
.custom-calendar-full {
width: 100%;
height: auto;
}
.fc-calendar-container {
height: 600px;
width: 100%;
}
.custom-header{
padding: 20px 20px 10px 30px;
height: 50px;
position: relative;
}
.custom-header h2,
.custom-header h3 {
float: left;
font-weight: 300;
text-transform: uppercase;
letter-spacing: 4px;
text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}
.custom-header h2 {
color: #fff;
width: 60%;
}
.custom-header h2 a,
.custom-header h2 span {
color: rgba(255,255,255,0.3);
font-size: 18px;
letter-spacing: 3px;
white-space: nowrap;
}
.custom-header h2 a {
color: rgba(255,255,255,0.5);
}
.no-touch .custom-header h2 a:hover {
color: rgba(255,255,255,0.9);
}
.custom-header h3 {
width: 40%;
color: #ddd;
color: rgba(255,255,255,0.6);
font-weight: 300;
line-height: 30px;
text-align: right;
padding-right: 125px;
}
.custom-header nav {
position: absolute;
right: 20px;
top: 20px;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.custom-header nav span {
float: left;
width: 30px;
height: 30px;
position: relative;
color: transparent;
cursor: pointer;
background: rgba(255,255,255,0.3);
margin: 0 1px;
font-size: 20px;
border-radius: 0 3px 3px 0;
box-shadow: inset 0 1px rgba(255,255,255,0.2);
}
.custom-header nav span:first-child {
border-radius: 3px 0 0 3px;
}
.custom-header nav span:hover {
background: rgba(255,255,255,0.5);
}
.custom-header span:before {
font-family: 'fontawesome-selected';
color: #fff;
display: inline-block;
text-align: center;
width: 100%;
text-indent: 4px;
}
.custom-header nav span.custom-prev:before {
content: '\25c2';
}
.custom-header nav span.custom-next:before {
content: '\25b8';
}
.custom-header nav span:last-child {
margin-left: 20px;
border-radius: 3px;
}
.custom-header nav span.custom-current:before {
content: '\27a6';
}
.fc-calendar {
background: rgba(255,255,255,0.1);
width: auto;
top: 10px;
bottom: 20px;
left: 20px;
right: 20px;
height: auto;
border-radius: 20px;
position: absolute;
}
.fc-calendar .fc-head {
background: rgba(255,255,255,0.2);
color: rgba(255,255,255,0.9);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
border-radius: 20px 20px 0 0;
height: 40px;
line-height: 40px;
padding: 0 20px;
}
.fc-calendar .fc-head > div {
font-weight: 300;
text-transform: uppercase;
font-size: 14px;
letter-spacing: 3px;
text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.fc-calendar .fc-row > div > span.fc-date {
color: rgba(255,255,255,0.9);
text-shadow: none;
font-size: 26px;
font-weight: 300;
bottom: auto;
right: auto;
top: 10px;
left: 10px;
text-align: left;
text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.fc-calendar .fc-body {
border: none;
padding: 20px;
}
.fc-calendar .fc-row {
box-shadow: inset 0 -1px 0 rgba(255,255,255,0.2);
border: none;
}
.fc-calendar .fc-row:last-child {
box-shadow: none;
}
.fc-calendar .fc-row:first-child > div:first-child {
border-radius: 10px 0 0 0;
}
.fc-calendar .fc-row:first-child > div:last-child {
border-radius: 0 10px 0 0;
}
.fc-calendar .fc-row:last-child > div:first-child {
border-radius: 0 0 0 10px;
}
.fc-calendar .fc-row:last-child > div:last-child {
border-radius: 0 0 10px 0;
}
.fc-calendar .fc-row > div {
box-shadow: -1px 0 0 rgba(255, 255, 255, 0.2);
border: none;
padding: 10px;
cursor: pointer;
}
.fc-calendar .fc-row > div:first-child{
box-shadow: none;
}
.fc-calendar .fc-row > div.fc-today {
background: transparent;
box-shadow: inset 0 0 100px rgba(255,255,255,0.1);
}
.fc-calendar .fc-row > div.fc-today:after {
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.2;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255, 255, 255, 0.15)), to(rgba(0, 0, 0, 0.25))), -webkit-gradient(linear, left top, right bottom, color-stop(0, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(255, 255, 255, .15)), color-stop(0.501, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0)));
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), -moz-linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: -o-linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), -o-llinear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: -ms-linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), -ms-linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
}
.fc-calendar .fc-row > div > div {
margin-top: 35px;
}
.fc-calendar .fc-row > div > div a,
.fc-calendar .fc-row > div > div span {
color: rgba(255,255,255,0.7);
font-size: 12px;
text-transform: uppercase;
display: inline-block;
padding: 3px 5px;
border-radius: 3px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
margin-bottom: 1px;
background: rgba(255,255,255,0.1);
}
.no-touch .fc-calendar .fc-row > div > div a:hover {
background: rgba(255,255,255,0.3);
}
@media screen and (max-width: 880px) , screen and (max-height: 450px) {
html, body, .container {
height: auto;
}
.custom-header,
.custom-header nav,
.custom-calendar-full,
.fc-calendar-container,
.fc-calendar,
.fc-calendar .fc-head,
.fc-calendar .fc-row > div > span.fc-date {
position: relative;
top: auto;
left: auto;
bottom: auto;
right: auto;
height: auto;
width: auto;
}
.fc-calendar {
margin: 0 20px 20px;
}
.custom-header h2,
.custom-header h3 {
float: none;
width: auto;
text-align: left;
padding-right: 100px;
}
.fc-calendar .fc-row,
.ie9 .fc-calendar .fc-row > div,
.fc-calendar .fc-row > div {
height: auto;
width: 100%;
border: none;
}
.fc-calendar .fc-row > div {
float: none;
min-height: 50px;
box-shadow: inset 0 -1px rgba(255,255,255,0.2) !important;
border-radius: 0px !important;
}
.fc-calendar .fc-row > div:empty{
min-height: 0;
height: 0;
box-shadow: none !important;
padding: 0;
}
.fc-calendar .fc-row {
box-shadow: none;
}
.fc-calendar .fc-head {
display: none;
}
.fc-calendar .fc-row > div > div {
margin-top: 0px;
padding-left: 10px;
max-width: 70%;
display: inline-block;
}
.fc-calendar .fc-row > div.fc-today {
background: rgba(255, 255, 255, 0.2);
}
.fc-calendar .fc-row > div.fc-today:after {
display: none;
}
.fc-calendar .fc-row > div > span.fc-date {
width: 30px;
display: inline-block;
text-align: right;
}
.fc-calendar .fc-row > div > span.fc-weekday {
display: inline-block;
width: 40px;
color: #fff;
color: rgba(255,255,255,0.7);
font-size: 10px;
text-transform: uppercase;
}
}
|
danielgonzalez11/enjoyZaragoza
|
Quaver/App/Theme/Default/Resources/css/custom_1.css
|
CSS
|
mit
| 8,035
|
package com.openparts.common.utils;
import org.abstractj.kalium.crypto.Point;
import org.abstractj.kalium.encoders.Encoder;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_BOX_CURVE25519XSALSA20POLY1305_PUBLICKEYBYTES;
import static org.abstractj.kalium.NaCl.Sodium.CRYPTO_BOX_CURVE25519XSALSA20POLY1305_SECRETKEYBYTES;
import static org.abstractj.kalium.NaCl.sodium;
import static org.abstractj.kalium.crypto.Util.checkLength;
import static org.abstractj.kalium.crypto.Util.zeros;
public class KaliumKeyPair {
private byte[] publicKey;
private final byte[] secretKey;
public KaliumKeyPair() {
this.secretKey = zeros(CRYPTO_BOX_CURVE25519XSALSA20POLY1305_SECRETKEYBYTES);
this.publicKey = zeros(CRYPTO_BOX_CURVE25519XSALSA20POLY1305_PUBLICKEYBYTES);
sodium().crypto_box_curve25519xsalsa20poly1305_keypair(publicKey, secretKey);
}
public KaliumKeyPair(byte[] secretKey) {
this.secretKey = secretKey;
checkLength(this.secretKey, CRYPTO_BOX_CURVE25519XSALSA20POLY1305_SECRETKEYBYTES);
Point point = new Point();
this.publicKey = point.mult(secretKey).toBytes();
}
public KaliumKeyPair(String secretKey, Encoder encoder) {
this(encoder.decode(secretKey));
}
public String getPublicKey() {
return Base58.encode(publicKey);
}
public String getPrivateKey() {
return Base58.encode(secretKey);
}
}
|
XilongPei/Openparts
|
Openparts-framework/src/main/java/com/openparts/common/utils/KaliumKeyPair.java
|
Java
|
mit
| 1,432
|
/*
* Copyright 2014 MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MONGOC_MATCHER_OP_PRIVATE_H
#define MONGOC_MATCHER_OP_PRIVATE_H
#include <bson.h>
#include <uthash.h>
#ifdef WITH_YARA
#include <yara.h>
#endif //WITH_YARA
#ifdef WITH_TEXT
#ifdef WITH_STEMMER
#include <libstemmer.h>
#endif /* WITH_STEMMER */
#ifdef WITH_ASPELL
#include <aspell.h>
#endif /*WITH_ASPELL*/
#endif /*WITH_TEXT*/
#ifdef WITH_CRYPT
#include <sodium.h>
#endif /*WITH_CRYPT*/
#include "mongoc-matcher-op-modules-private.h"
BSON_BEGIN_DECLS
typedef union _mongoc_matcher_op_t mongoc_matcher_op_t;
typedef struct _mongoc_matcher_op_base_t mongoc_matcher_op_base_t;
typedef struct _mongoc_matcher_op_logical_t mongoc_matcher_op_logical_t;
typedef struct _mongoc_matcher_op_compare_t mongoc_matcher_op_compare_t;
typedef struct _mongoc_matcher_op_exists_t mongoc_matcher_op_exists_t;
typedef struct _mongoc_matcher_op_type_t mongoc_matcher_op_type_t;
typedef struct _mongoc_matcher_op_size_t mongoc_matcher_op_size_t;
typedef struct _mongoc_matcher_op_not_t mongoc_matcher_op_not_t;
typedef struct _mongoc_matcher_op_near_t mongoc_matcher_op_near_t;
typedef struct _mongoc_matcher_op_str_hashtable_t mongoc_matcher_op_str_hashtable_t;
typedef enum
{
MONGOC_MATCHER_OPCODE_EQ,
MONGOC_MATCHER_OPCODE_GT,
MONGOC_MATCHER_OPCODE_GTE,
MONGOC_MATCHER_OPCODE_IN,
MONGOC_MATCHER_OPCODE_INSET,
#ifdef WITH_YARA
MONGOC_MATCHER_OPCODE_YARA,
#endif //WITH_YARA
MONGOC_MATCHER_OPCODE_LT,
MONGOC_MATCHER_OPCODE_LTE,
MONGOC_MATCHER_OPCODE_NE,
MONGOC_MATCHER_OPCODE_NIN,
MONGOC_MATCHER_OPCODE_OR,
MONGOC_MATCHER_OPCODE_AND,
MONGOC_MATCHER_OPCODE_NOT,
MONGOC_MATCHER_OPCODE_NOR,
MONGOC_MATCHER_OPCODE_EXISTS,
MONGOC_MATCHER_OPCODE_TYPE,
MONGOC_MATCHER_OPCODE_SIZE,
MONGOC_MATCHER_OPCODE_STRLEN,
MONGOC_MATCHER_OPCODE_NEAR,
MONGOC_MATCHER_OPCODE_GEONEAR,
MONGOC_MATCHER_OPCODE_GEONEARBOUNDARY,
MONGOC_MATCHER_OPCODE_GEOWITHIN,
MONGOC_MATCHER_OPCODE_GEOWITHINPOLY,
MONGOC_MATCHER_OPCODE_GEOUNDEFINED,
#ifdef WITH_CONDITIONAL
MONGOC_MATCHER_OPCODE_CONDITIONAL,
#endif /*WITH_CONDITIONAL*/
#ifdef WITH_TEXT
MONGOC_MATCHER_OPCODE_TEXT_COUNT,
#ifdef WITH_STEMMER /* && WITH_TEXT*/
MONGOC_MATCHER_OPCODE_TEXT_COUNT_MATCHES,
#endif /*WITH_STEMMER && WITH_TEXT*/
#ifdef WITH_ASPELL /* && WITH_TEXT */
MONGOC_MATCHER_OPCODE_TEXT_SPELLING_CORRECT,
MONGOC_MATCHER_OPCODE_TEXT_SPELLING_INCORRECT,
MONGOC_MATCHER_OPCODE_TEXT_SPELLING_PERCENTAGE_CORRECT,
#endif /*WITH_ASPELL && WITH_TEXT*/
#endif /*WITH_TEXT*/
#ifdef WITH_PROJECTION
MONGOC_MATCHER_OPCODE_PROJECTION,
MONGOC_MATCHER_OPCODE_UNWIND,
MONGOC_MATCHER_OPCODE_REDACTION,
#endif //WITH_PROJECTION
#ifdef WITH_CRYPT
MONGOC_MATCHER_OPCODE_SEALOPEN,
#endif /*WITH_CRYPT*/
#ifdef WITH_IP
MONGOC_MATCHER_OPCODE_INIPRANGE,
MONGOC_MATCHER_OPCODE_INIPRANGESET,
#endif /*WITH_IP*/
#ifdef WITH_MODULES
MONGOC_MATCHER_OPCODE_MODULE,
#endif /*WITH_MODULES*/
MONGOC_MATCHER_OPCODE_UNDEFINED,
} mongoc_matcher_opcode_t;
typedef enum
{
MONGOC_MATCHER_NEAR_UNDEFINED,
MONGOC_MATCHER_NEAR_2D,
MONGOC_MATCHER_NEAR_3D,
MONGOC_MATCHER_NEAR_4D, //3D + Time
} mongoc_matcher_near_t;
struct _mongoc_matcher_op_base_t
{
mongoc_matcher_opcode_t opcode;
};
struct _mongoc_matcher_op_logical_t
{
mongoc_matcher_op_base_t base;
mongoc_matcher_op_t *left;
mongoc_matcher_op_t *right;
};
struct _mongoc_matcher_op_compare_t
{
mongoc_matcher_op_base_t base;
char *path;
bson_iter_t iter;
mongoc_matcher_op_str_hashtable_t *inset;
#ifdef WITH_YARA
YR_RULES *rules;
uint32_t timout;
bool fast_mode;
#endif //WITH_YARA
};
#ifdef WITH_CONDITIONAL
typedef struct _mongoc_matcher_op_conditional_t mongoc_matcher_op_conditional_t;
struct _mongoc_matcher_op_conditional_t
{
mongoc_matcher_op_base_t base;
mongoc_matcher_op_t *condition;
mongoc_matcher_op_t *iftrue;
mongoc_matcher_op_t *iffalse;
};
#endif /*WITH_CONDITIONAL*/
#ifdef WITH_TEXT
typedef struct _mongoc_matcher_op_text_t mongoc_matcher_op_text_t;
struct _mongoc_matcher_op_text_t
{
mongoc_matcher_op_base_t base;
char * path;
bool case_sensitive;
char * stop_word;
mongoc_matcher_op_t *size_container;
#ifdef WITH_STEMMER
char * language;
struct sb_stemmer * stemmer;
mongoc_matcher_op_str_hashtable_t *wordlist;
#endif /*WITH_STEMMER && WITH_TEXT*/
#ifdef WITH_ASPELL
char * dictionary;
AspellSpeller * spell_checker;
#endif /*WITH_ASPELL && WITH_TEXT*/
};
#endif /*WITH_TEXT*/
#ifdef WITH_PROJECTION
typedef struct _mongoc_matcher_op_projection_t mongoc_matcher_op_projection_t;
struct _mongoc_matcher_op_projection_t
{
mongoc_matcher_op_base_t base;
char *path;
mongoc_matcher_op_str_hashtable_t *pathlist;
char* as;
mongoc_matcher_op_t *next;
mongoc_matcher_op_t *query;
};
#endif //WITH_PROJECTION
#ifdef WITH_CRYPT
typedef struct _mongoc_matcher_op_crypt_t mongoc_matcher_op_crypt_t;
struct _mongoc_matcher_op_crypt_t
{
mongoc_matcher_op_base_t base;
char * path;
char pk[crypto_box_PUBLICKEYBYTES];
char sk[crypto_box_SECRETKEYBYTES];
mongoc_matcher_op_t *query;
};
#endif /*WITH_CRYPT*/
#ifdef WITH_IP
typedef struct _mongoc_matcher_op_ip_criteria_hashtable_t mongoc_matcher_op_ip_criteria_hashtable_t;
struct _mongoc_matcher_op_ip_criteria_hashtable_t {
uint8_t criteria[16]; //MONGOC_MATCHER_OP_IP_BYTES
UT_hash_handle hh;
};
typedef struct _mongoc_matcher_op_ip_t mongoc_matcher_op_ip_t;
struct _mongoc_matcher_op_ip_t
{
mongoc_matcher_op_base_t base;
char * path;
bson_subtype_t subtype;
uint32_t length;
uint8_t base_addr[16]; //MONGOC_MATCHER_OP_IP_BYTES
uint8_t netmask[16]; //MONGOC_MATCHER_OP_IP_BYTES
uint8_t criteria[16]; //MONGOC_MATCHER_OP_IP_BYTES
mongoc_matcher_op_t *next;
};
#endif /*WITH_IP*/
#ifdef WITH_MODULES
typedef struct _mongoc_matcher_op_outermodule_t mongoc_matcher_op_outermodule_t;
struct _mongoc_matcher_op_outermodule_t
{
mongoc_matcher_op_base_t base;
char * path;
mongoc_matcher_op_module_t config;
};
#endif /*WITH_MODULES*/
struct _mongoc_matcher_op_exists_t
{
mongoc_matcher_op_base_t base;
char *path;
bool exists;
mongoc_matcher_op_t *query;
};
struct _mongoc_matcher_op_size_t
{
mongoc_matcher_op_base_t base;
mongoc_matcher_opcode_t compare_type;
char *path;
u_int32_t size;
};
struct _mongoc_matcher_op_type_t
{
mongoc_matcher_op_base_t base;
bson_type_t type;
char *path;
};
struct _mongoc_matcher_op_not_t
{
mongoc_matcher_op_base_t base;
mongoc_matcher_op_t *child;
char *path;
};
struct _mongoc_matcher_op_near_t
{
mongoc_matcher_op_base_t base;
bson_iter_t iter;
char *path;
mongoc_matcher_near_t near_type;
double x;
double y;
double z;
double t; //normally for time, hijacked by some geo functions
double maxd; //distance
double mind; //distance
mongoc_matcher_op_t * next;
void ** pointers;
};
union _mongoc_matcher_op_t
{
mongoc_matcher_op_base_t base;
mongoc_matcher_op_logical_t logical;
mongoc_matcher_op_compare_t compare;
mongoc_matcher_op_exists_t exists;
mongoc_matcher_op_type_t type;
mongoc_matcher_op_size_t size;
mongoc_matcher_op_near_t near;
mongoc_matcher_op_not_t not_;
#ifdef WITH_PROJECTION
mongoc_matcher_op_projection_t projection;
#endif //WITH_PROJECTION
#ifdef WITH_CONDITIONAL
mongoc_matcher_op_conditional_t conditional;
#endif /*WITH_CONDITIONAL*/
#ifdef WITH_TEXT
mongoc_matcher_op_text_t text;
#endif /*WITH_TEXT*/
#ifdef WITH_CRYPT
mongoc_matcher_op_crypt_t crypt;
#endif /*WITH_CRYPT*/
#ifdef WITH_IP
mongoc_matcher_op_ip_t ip;
#endif /* WITH_IP */
#ifdef WITH_MODULES
mongoc_matcher_op_outermodule_t module;
#endif /* WITH_MODULES */
};
struct _mongoc_matcher_op_str_hashtable_t {
char* matcher_hash_key;
UT_hash_handle hh;
};
mongoc_matcher_op_t * _mongoc_matcher_op_inset_new (const char *path, /* IN */
const bson_iter_t *iter);
mongoc_matcher_op_t *_mongoc_matcher_op_logical_new (mongoc_matcher_opcode_t opcode,
mongoc_matcher_op_t *left,
mongoc_matcher_op_t *right);
mongoc_matcher_op_t *_mongoc_matcher_op_compare_new (mongoc_matcher_opcode_t opcode,
const char *path,
const bson_iter_t *iter);
mongoc_matcher_op_t *_mongoc_matcher_op_exists_new (const char *path,
bson_iter_t *iter);
mongoc_matcher_op_t *_mongoc_matcher_op_type_new (const char *path,
bson_iter_t *iter);
mongoc_matcher_op_t *_mongoc_matcher_op_size_new (mongoc_matcher_opcode_t opcode,
const char *path,
const bson_iter_t *iter);
mongoc_matcher_op_t *_mongoc_matcher_op_not_new (const char *path,
mongoc_matcher_op_t *child);
mongoc_matcher_op_t *_mongoc_matcher_op_near_new (mongoc_matcher_opcode_t opcode,
const char *path,
const bson_iter_t *iter,
double maxDistance);
bool _mongoc_matcher_op_match (mongoc_matcher_op_t *op,
const bson_t *bson);
bool _mongoc_matcher_op_near_cast_number_to_double (const bson_iter_t *right_array, /* IN */
double *maxDistance); /* OUT*/
bool _mongoc_matcher_op_array_to_op_t (const bson_iter_t *iter,
mongoc_matcher_op_t *op);
void _mongoc_matcher_op_destroy (mongoc_matcher_op_t *op);
void _mongoc_matcher_op_to_bson (mongoc_matcher_op_t *op,
bson_t *bson);
uint32_t _mongoc_matcher_op_size_get_iter_len (bson_iter_t *iter);
bool
_mongoc_matcher_op_length_match_value (mongoc_matcher_op_size_t *size, /* IN */
uint32_t length); /* IN */
BSON_END_DECLS
#endif /* MONGOC_MATCHER_OP_PRIVATE_H */
|
bauman/bsonsearch
|
lib/mongoc-matcher-op-private.h
|
C
|
mit
| 11,406
|
# MixedRequestDto class
Request for Mixed.
```csharp
public sealed class MixedRequestDto : ServiceDto<MixedRequestDto>
```
## Public Members
| name | description |
| --- | --- |
| [MixedRequestDto](MixedRequestDto/MixedRequestDto.md)() | Creates an instance. |
| [Header](MixedRequestDto/Header.md) { get; set; } | |
| [Normal](MixedRequestDto/Normal.md) { get; set; } | |
| [Path](MixedRequestDto/Path.md) { get; set; } | |
| [Query](MixedRequestDto/Query.md) { get; set; } | |
| override [IsEquivalentTo](MixedRequestDto/IsEquivalentTo.md)(…) | Determines if two DTOs are equivalent. |
| override [ToString](MixedRequestDto/ToString.md)() | Returns the DTO as JSON. |
## See Also
* namespace [Facility.ConformanceApi](../Facility.ConformanceApi.md)
* [MixedRequestDto.cs](https://github.com/FacilityApi/FacilityCSharp/tree/master/src/Facility.ConformanceApi/MixedRequestDto.cs)
<!-- DO NOT EDIT: generated by xmldocmd for Facility.ConformanceApi.dll -->
|
FacilityApi/FacilityCSharp
|
docs/Facility.ConformanceApi/MixedRequestDto.md
|
Markdown
|
mit
| 988
|
package net.sf.jxls.reader;
import java.util.ArrayList;
import java.util.List;
/**
* @author Leonid Vysochyn
*/
public class SimpleSectionCheck implements SectionCheck {
List offsetRowChecks = new ArrayList();
public SimpleSectionCheck() {
}
public SimpleSectionCheck(List relativeRowChecks) {
this.offsetRowChecks = relativeRowChecks;
}
public boolean isCheckSuccessful(XLSRowCursor cursor) {
for (int i = 0; i < offsetRowChecks.size(); i++) {
OffsetRowCheck offsetRowCheck = (OffsetRowCheck) offsetRowChecks.get(i);
if( !offsetRowCheck.isCheckSuccessful( cursor ) ){
return false;
}
}
return true;
}
public void addRowCheck(OffsetRowCheck offsetRowCheck) {
offsetRowChecks.add( offsetRowCheck );
}
public List getOffsetRowChecks() {
return offsetRowChecks;
}
public void setOffsetRowChecks(List offsetRowChecks) {
this.offsetRowChecks = offsetRowChecks;
}
}
|
neolfdev/dlscxx
|
jxls-reader/src/main/java/net/sf/jxls/reader/SimpleSectionCheck.java
|
Java
|
mit
| 1,032
|
<?php
/**
* @author Bill Skinner
* @package BiskMVC
* @version 1.0.0
* @copyright Bill Skinner, 2016
*/
/* Start session */
session_start();
/* CORS Access Headers. */
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-Token');
/* Autoload */
require_once __DIR__ . '/../vendor/autoload.php';
/* Bring everything together */
require_once __DIR__ . '/../app/bootstrap.php';
|
biskmedia/BiskMVC
|
public/index.php
|
PHP
|
mit
| 576
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>reglang: 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.9.1 / reglang - 1.1.1</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
reglang
<small>
1.1.1
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-16 00:21:27 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-16 00:21:27 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.9.1 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
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
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/coq-community/reglang"
dev-repo: "git+https://github.com/coq-community/reglang.git"
bug-reports: "https://github.com/coq-community/reglang/issues"
doc: "https://coq-community.org/reglang/"
license: "CECILL-B"
synopsis: "Representations of regular languages (i.e., regexps, various types of automata, and WS1S) with equivalence proofs, in Coq and MathComp"
description: """
This library provides definitions and verified translations between
different representations of regular languages: various forms of
automata (deterministic, nondeterministic, one-way, two-way),
regular expressions, and the logic WS1S. It also contains various
decidability results and closure properties of regular languages."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.10" & < "8.13~"}
"coq-mathcomp-ssreflect" {>= "1.9" & < "1.12~"}
]
tags: [
"category:Computer Science/Formal Languages Theory and Automata"
"keyword:regular languages"
"keyword:regular expressions"
"keyword:finite automata"
"keyword:two-way automata"
"keyword:monadic second-order logic"
"logpath:RegLang"
"date:2020-10-05"
]
authors: [
"Christian Doczkal"
"Jan-Oliver Kaiser"
"Gert Smolka"
]
url {
src: "https://github.com/coq-community/reglang/archive/v1.1.1.tar.gz"
checksum: "sha512=f3b92695d1c3fedd37dc0a6289c9cdc4bf051f0a7134123b633d9875e5ad01e260304488de3d12810e3de9054069362cbd46eedd3d59e3baf4b008862fafc783"
}
</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-reglang.1.1.1 coq.8.9.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.9.1).
The following dependencies couldn't be met:
- coq-reglang -> coq >= 8.10
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-reglang.1.1.1</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.07.1-2.0.6/released/8.9.1/reglang/1.1.1.html
|
HTML
|
mit
| 7,542
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>This is the about page!</title>
</head>
<body>
</body>
</html>
|
ana-vas/simple-site
|
about.html
|
HTML
|
mit
| 145
|
Package.describe({
summary: 'Meteor package to wrap TopoJSON: An extension to GeoJSON that encodes topology'
});
Package.on_use(function(api) {
api.export('topojson');
api.add_files('meteor-topojson.js', 'server');
api.add_files('topojson.js', 'client');
});
Package.on_test(function (api) {
api.use(['topojson', 'tinytest']);
api.add_files('topojson_tests.js', ['server', 'client']);
});
Npm.depends({
topojson: '1.6.8'
});
|
vsivsi/meteor-topojson
|
package.js
|
JavaScript
|
mit
| 442
|
<?php
// src/symfony/CinemaBundle/Controller/DefaultController.php
namespace symfony\CinemaBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class DefaultController extends Controller
{
/**
* @Route("/", name="page_accueil")
*/
public function indexAction()
{
return $this->render('symfonyCinemaBundle:Default:index.html.twig');
}
/**
* @Route("/films", name="page_films")
*/
public function listAction()
{
$films = $this->getDoctrine()->getRepository('symfonyCinemaBundle:Film')->findAll();
$titre_de_la_page = 'Films de la bibliothèques';
return $this->render(
'symfonyCinemaBundle:Film:list.html.twig',
['films' => $films, 'titre' => $titre_de_la_page]
);
}
/**
* @Route("/film/{id}", requirements={"id": "\d+"}, name="page_film")
*/
public function showAction($id)
{
$film = $this->getDoctrine()->getRepository('symfonyCinemaBundle:Film')->find($id);
return $this->render(
'symfonyCinemaBundle:Film:show.html.twig',
['film' => $film]
);
}
}
|
annelepape2/tdSymfony
|
src/symfony/CinemaBundle/Controller/DefaultController.php
|
PHP
|
mit
| 1,293
|
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=property.js.map
|
bmitchenko/webapi-ng2
|
src/specification/property.js
|
JavaScript
|
mit
| 113
|
%%%%%%%%%%%%%%%
\begin{frame}{}
\fignocaption{width = 0.40\textwidth}{figs/less-logo}
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\begin{definition}[$|A| \le |B|$]
$|A| \le |B|$ if there exists an \red{\it one-to-one} function $f$ from $A$ into $B$.
\end{definition}
\pause
\[
\text{bijection} \;f: A \to f(A) \; (\blue{\subseteq B})
\]
\pause
\vspace{0.80cm}
\begin{center}
{\red{\it $Q:$ What about onto function $f: A \to B$?}} \\[8pt] \pause
{\blue{$|B| \le |A|$ \pause {\footnotesize (Axiom of Choice)}}}
\end{center}
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\begin{definition}[$|A| < |B|$]
$|A| < |B| \iff |A| \le |B| \land |A| \neq |B|$
\end{definition}
\pause
\[
|\N| < |\R|
\]
\[
|X| < |2^{X}|
\]
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\begin{definition}[Countable Revisited]
$X$ is countable:
\[
\exists n \in \N: |X| = n \red{\;\lor\;} |X| = |\N|
\]
\end{definition}
\pause
\begin{theorem}[Proof for Countable (UD Exercise $22.5$)]
$X$ is countable iff there exists a \red{\it one-to-one} function
\[
f: X \to \N.
\]
\pause
$X$ is countable iff
\[
\blue{|X| \le |\N|.}
\]
\end{theorem}
\pause
\begin{exampleblock}{Subsets of Countable Set (UD $22.6$; UD Corollary $22.4$)}
Every subset $B$ of a countable set $A$ is countable.
\end{exampleblock}
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\begin{exampleblock}{Set Union (UD $22.1$)}
Give an example, if possible, of
\begin{enumerate}[(a)]
\setcounter{enumi}{2}
\item a countably infinite collection of \blue{\it pairwise disjoint} nonempty sets whose union is finite.
\setcounter{enumi}{1}
\pause
\item a countably infinite collection of nonempty sets whose union is finite.
\end{enumerate}
\end{exampleblock}
\pause
\[
\Big(\set{A_i: i \in R} \quad A_{i} = \set{1}\Big) \;\red{= \set{\set{1}}}
\]
\pause
\[
|A| = n \implies |2^{A}| = 2^n
\]
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\begin{exampleblock}{Slope (UD $22.2 \;(e)$)}
\begin{enumerate}[(a)]
\setcounter{enumi}{4}
\item the set of all lines with rational slopes
\end{enumerate}
\end{exampleblock}
\pause
\[
(\Q, \;\red{\R})
\]
\pause
\[
\teal{|\R| \le \;\red{|\Q \times \R|}\; \le |\R \times \R| = |\R|}
\]
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\centerline{\large \red{\it $Q:$ Is ``$\le$'' a partial order?}}
\pause
\vspace{0.30cm}
\begin{theorem}[Cantor-Schr\"{o}der–Bernstein (1887)]
\[
|X| \le |Y| \land |Y| \le |X| \implies |X| = |Y|
\]
\pause
\[
\exists\; \text{\blue{one-to-one} } f: A \to B \land g: B \to A \implies \exists\; \text{\blue{bijection} } h: A \to B
\]
\end{theorem}
\pause
\begin{columns}
\column{0.30\textwidth}
\fignocaption{width = 0.50\textwidth}{figs/proof-cantor-bernstein-book}
\column{0.30\textwidth}
\pause
\fignocaption{width = 0.50\textwidth}{figs/fudan-set-theory-book}
\column{0.30\textwidth}
\pause
\fignocaption{width = 0.50\textwidth}{figs/qrcode-cantor-bernstein-wiki}
\end{columns}
\end{frame}
%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
\begin{frame}{}
\centerline{\large \red{\it $Q:$ Is ``$\le$'' a total order?}}
\pause
\vspace{0.50cm}
\begin{theorem}[PCC]
\begin{center}
Principle of Cardinal Comparability (PCC) $\iff$ Axiom of Choice
\end{center}
\end{theorem}
\end{frame}
%%%%%%%%%%%%%%%
|
hengxin/problem-solving-class-lectures
|
2017/2017-autumn-1st-semester/1-11-infinity/tutorial/parts/compare-less.tex
|
TeX
|
mit
| 3,646
|
/**
* Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum of all keys greater than the original key in BST.
*
* Example:
*
* Input: The root of a Binary Search Tree like this:
* 5
* / \
* 2 13
*
* Output: The root of a Greater Tree like this:
* 18
* / \
* 20 13
*
*/
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public TreeNode convertBST(TreeNode root) {
return convertBSTWithRoot(root, root);
}
TreeNode convertBSTWithRoot(TreeNode curr, TreeNode root) {
if (curr == null) {
return curr;
}
TreeNode ret = new TreeNode(curr.val + sumLargerThan(root, curr.val));
TreeNode left = convertBSTWithRoot(curr.left, root);
TreeNode right = convertBSTWithRoot(curr.right, root);
ret.left = left;
ret.right = right;
return ret;
}
int sumLargerThan(TreeNode root, int val) {
if (root == null) {
return 0;
}
int sumRight = sumLargerThan(root.right, val);
if (root.val <= val) {
return sumRight;
}
return sumRight + root.val + sumLargerThan(root.left, val);
}
}
|
franklingu/leetcode-solutions
|
questions/convert-bst-to-greater-tree/Solution.java
|
Java
|
mit
| 1,470
|
import { themeGet } from "@styled-system/theme-get"
import React from "react"
import { Animated, View } from "react-native"
import styled from "styled-components/native"
import { Box, ClassTheme, Sans } from "palette"
/**
* Nearly all props are given by the ScrollableTabView,
* these are prefixed with Auto:
*/
interface TabBarProps {
/** Auto: A list of strings for the buttons */
tabs: string[]
/** Auto: A callback for usage in the tab buttons */
goToPage?: () => null
/** Auto: The index of the currently active tab */
activeTab?: number
/** Auto: How much horiztonal space do you have */
containerWidth?: number
/** Auto: Handled by ScrollableTabView */
scrollValue?: Animated.AnimatedInterpolation
/** Should space tabs evenly */
spaceEvenly?: boolean
}
const Button = styled.TouchableWithoutFeedback`
flex: 1;
`
const Underline = Animated.View
const Tabs = styled.View`
height: 50px;
flex-direction: row;
justify-content: space-around;
`
const TabButton = styled.View<{ spaceEvenly?: boolean; active?: boolean }>`
align-items: center;
justify-content: center;
padding-top: 5;
flex-grow: 1;
${(p) => p.spaceEvenly && `flex: 1;`};
${(p) =>
!p.spaceEvenly &&
p.active &&
`
border-color: ${themeGet("colors.black100")};
border-bottom-width: 1px;
margin-bottom: -1px;
`};
`
interface TabProps {
tabLabel: string
}
export const Tab: React.FC<TabProps> = ({ children }) => (
<View style={{ flex: 1, overflow: "hidden" }}>{children}</View>
)
export default class TabBar extends React.Component<TabBarProps> {
// @ts-expect-error STRICTNESS_MIGRATION --- 🚨 Unsafe legacy code 🚨 Please delete this and fix any type errors if you have time 🙏
renderTab(name, page, isTabActive, onPressHandler) {
return (
<Button
key={name}
accessible
accessibilityLabel={name}
accessibilityRole="button"
onPress={() => onPressHandler(page)}
>
<TabButton spaceEvenly={this.props.spaceEvenly} active={isTabActive}>
<ClassTheme>
{({ color }) => (
<Sans
numberOfLines={1}
ellipsizeMode="tail"
weight="medium"
size="3"
color={isTabActive ? "black" : color("black30")}
>
{name}
</Sans>
)}
</ClassTheme>
</TabButton>
</Button>
)
}
render() {
return (
<ClassTheme>
{({ space }) => {
// @ts-expect-error STRICTNESS_MIGRATION --- 🚨 Unsafe legacy code 🚨 Please delete this and fix any type errors if you have time 🙏
const containerWidth = this.props.containerWidth - space(4)
const numberOfTabs = this.props.tabs.length
// @ts-expect-error STRICTNESS_MIGRATION --- 🚨 Unsafe legacy code 🚨 Please delete this and fix any type errors if you have time 🙏
const translateX = this.props.scrollValue.interpolate({
inputRange: [0, 1],
outputRange: [0, containerWidth / numberOfTabs],
})
return (
<Wrapper px={2}>
<Tabs>
{this.props.tabs.map((name, page) => {
const isTabActive = this.props.activeTab === page
return this.renderTab(name, page, isTabActive, this.props.goToPage)
})}
{this.props.spaceEvenly ? (
<Underline
style={[
{
position: "absolute",
width: containerWidth / numberOfTabs,
height: 1,
backgroundColor: "black",
bottom: -1,
left: 0,
right: 0,
},
{
transform: [{ translateX }],
},
]}
/>
) : null}
</Tabs>
</Wrapper>
)
}}
</ClassTheme>
)
}
}
const Wrapper = styled(Box)`
border-bottom-width: 1px;
border-bottom-color: ${themeGet("colors.black30")};
`
|
artsy/eigen
|
src/app/Components/TabBar.tsx
|
TypeScript
|
mit
| 4,268
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>zsearch-trees: 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 / extra-dev</a></li>
<li class="active"><a href="">dev / zsearch-trees - 8.6.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
zsearch-trees
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-02 09:43:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-02 09:43:56 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 dev Formal proof management system
dune 3.0.2 Fast, portable, and opinionated build system
ocaml 4.13.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.13.1 Official release 4.13.1
ocaml-config 2 OCaml Switch Configuration
ocaml-options-vanilla 1 Ensure that OCaml is compiled with no special options enabled
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/zsearch-trees"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZSearchTrees"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: binary search trees" "category: Computer Science/Data Types and Data Structures" "category: Miscellaneous/Extracted Programs/Data structures" ]
authors: [ "Pierre Castéran" ]
bug-reports: "https://github.com/coq-contribs/zsearch-trees/issues"
dev-repo: "git+https://github.com/coq-contribs/zsearch-trees.git"
synopsis: "Binary Search Trees"
description:
"Algorithms for collecting, searching, inserting and deleting elements in binary search trees on Z"
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/zsearch-trees/archive/v8.6.0.tar.gz"
checksum: "md5=fca201467e21f6c236d51b3801924ce7"
}
</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-zsearch-trees.8.6.0 coq.dev</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is dev).
The following dependencies couldn't be met:
- coq-zsearch-trees -> coq < 8.7~ -> ocaml < 4.06.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-zsearch-trees.8.6.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.13.1-2.0.10/extra-dev/dev/zsearch-trees/8.6.0.html
|
HTML
|
mit
| 7,135
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>smc: 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.5.0 / smc - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
smc
<small>
8.9.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-29 07:47:20 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-29 07:47:20 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/smc"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/SMC"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
"coq-int-map" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: BDD"
"keyword: binary decision diagrams"
"keyword: classical logic"
"keyword: propositional logic"
"keyword: garbage collection"
"keyword: modal mu-calculus"
"keyword: model checking"
"keyword: symbolic model checking"
"keyword: reflection"
"category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"date: 2002-11"
]
authors: [
"Kumar Neeraj Verma <verma@lsv.ens-cachan.fr>"
]
bug-reports: "https://github.com/coq-contribs/smc/issues"
dev-repo: "git+https://github.com/coq-contribs/smc.git"
synopsis: "BDD based symbolic model checker for the modal mu-calculus"
description: """
Provides BDD algorithms, a symbolic model checker for the modal
mu-calculus based on it, together with a garbage collector"""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/smc/archive/v8.9.0.tar.gz"
checksum: "md5=5393bb4adae218fe834d80e06b62db6b"
}
</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-smc.8.9.0 coq.8.5.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.0).
The following dependencies couldn't be met:
- coq-smc -> coq-int-map >= 8.9 -> coq >= 8.9 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-smc.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.04.2-2.0.5/released/8.5.0/smc/8.9.0.html
|
HTML
|
mit
| 7,432
|
<?php namespace Elepunk\Evaluator\Contracts;
use \Closure;
interface EvaluatorInterface
{
/**
* Get the Expression Engine instance
*
* @return \Symfony\Component\ExpressionLanguage\ExpressionLanguage
*/
public function getExpressionEngine();
/**
* Get evaluator current adapter instance
*
* @return \Elepunk\Evaluator\Contracts\AdapterInterface
*/
public function expression();
/**
* Evaluate an expression using custom rule
*
* @param string $expression
* @param mixed $item
* @param \Closure $callback
* @return mixed|\Closure
*/
public function evaluate($expression, $item, Closure $callback = null);
/**
* Evaluate an expression using stored rule
*
* @param string $expressionKey
* @param mixed $item
* @param \Closure $callback
* @return mixed|\Closure
*/
public function evaluateRule($expressionKey, $item, Closure $callback = null);
/**
* Apply the condition rules to an item
*
* @param string $expressionKey
* @param mixex $item
* @param \Closure $callback
* @return \Elepunk\Evaluator\Collection | \Closure
*/
public function condition($expressionKey, $item, Closure $callback = null);
}
|
elepunk/evaluator
|
src/Contracts/EvaluatorInterface.php
|
PHP
|
mit
| 1,297
|
//
// FSTPoultryDuckBreastSousVideRecipe.h
// FirstBuild
//
// Created by Myles Caley on 12/17/15.
// Copyright © 2015 FirstBuild. All rights reserved.
//
#import "FSTPoultryDuckSousVideRecipe.h"
@interface FSTPoultryDuckBreastSousVideRecipe : FSTPoultryDuckSousVideRecipe
@end
|
FirstBuild/FirstBuild-Mobile
|
FirstBuild/FSTPoultryDuckBreastSousVideRecipe.h
|
C
|
mit
| 286
|
//
// Copyright (C) 2010, OMBT LLC and Mike A. Rumore
// All rights reserved.
// Contact: Mike A. Rumore, (mike.a.rumore@gmail.com)
//
#include "system/Debug.h"
#include "performance/NanoSecTime.h"
using namespace ombt;
// headers
#include <time.h>
#include <string.h>
#include <assert.h>
#include <iostream>
#include <sstream>
// cheap way
using namespace std;
//
// key board
//
class KeyBoard
{
public: // data types and constants
// constants
static const int max_row = 4;
static const int max_col = 5;
static const char null_key = ' ';
static const int el_moves[][2];
// data types
class Key
{
public:
Key(int val = null_key, bool vow = false, int idx = -1):
_value(val), _vowel(vow), _index(idx) { }
Key(const Key &src):
_value(src._value),
_vowel(src._vowel),
_index(src._index) { }
~Key() { }
Key &operator=(const Key &rhs)
{
if (this != &rhs)
{
_value = rhs._value;
_vowel = rhs._vowel;
_index = rhs._index;
}
return *this;
}
friend ostream &operator<<(ostream &, const Key &);
char _value; // value of key
bool _vowel; // is it a vowel?
int _index; // index into arrays
};
typedef int * AllowedMoves;
public:
// ctors and dtor
KeyBoard();
KeyBoard(const KeyBoard &);
~KeyBoard();
// assignment
KeyBoard &operator=(const KeyBoard &);
// output
friend ostream &operator<<(ostream &, const KeyBoard &);
// utilities
inline char key(int r, int c) const
{
MustBeTrue((0 <= r) && (r < max_row));
MustBeTrue((0 <= c) && (c < max_col));
return _board[r][c]._value;
}
inline bool vowel(int r, int c) const
{
MustBeTrue((0 <= r) && (r < max_row));
MustBeTrue((0 <= c) && (c < max_col));
return _board[r][c]._vowel;
}
// test crunching routines
void all_moves(ostream &os, int r, int c) const;
void one_vowel_moves(ostream &os, int r, int c);
void zero_vowel_moves(ostream &os, int r, int c);
void vowel_moves(ostream &os,
int vowels,
AllowedMoves &moves,
int r, int c,
int &how_many);
bool check_if_allowed(int vowels, int r, int c, bool exact = true) const;
// actual crunching routines
void brute_force_sequences(ostream &os,
string sequence, // pass by value to isolate
int sequence_number,
int number_of_vowels,
int row,
int col,
bool verbose,
long &seq_found);
void smart_sequences(ostream &os,
string sequence, // pass by value to isolate
int sequence_number,
int number_of_vowels,
int row,
int col,
bool verbose,
long &seq_found);
protected:
// internal board representation
Key _board[max_row][max_col];
// end-keys after L-step
int _key_num;
AllowedMoves _zero_vowel;
AllowedMoves _one_vowel;
};
// key board class
// allowed horizontal and vertical deltas
const int KeyBoard::el_moves[][2] = {
{ 2, 1 },
{ 2, -1 },
{ -2, +1 },
{ -2, -1 },
{ +1, +2 },
{ +1, -2 },
{ -1, +2 },
{ -1, -2 },
{ 0, 0 }, // sentinel
};
// ctors and dtor
KeyBoard::KeyBoard()
{
_key_num = 0;
// first row
_board[0][0] = Key('A', true, _key_num);
_board[0][1] = Key('B', false, ++_key_num);
_board[0][2] = Key('C', false, ++_key_num);
_board[0][3] = Key('D', false, ++_key_num);
_board[0][4] = Key('E', true, ++_key_num);
// second row
_board[1][0] = Key('F', false, ++_key_num);
_board[1][1] = Key('G', false, ++_key_num);
_board[1][2] = Key('H', false, ++_key_num);
_board[1][3] = Key('I', true, ++_key_num);
_board[1][4] = Key('J', false, ++_key_num);
// third row
_board[2][0] = Key('K', false, ++_key_num);
_board[2][1] = Key('L', false, ++_key_num);
_board[2][2] = Key('M', false, ++_key_num);
_board[2][3] = Key('N', false, ++_key_num);
_board[2][4] = Key('O', true, ++_key_num);
// fourth row
// _board[3][0] = Key();
_board[3][1] = Key('1', false, ++_key_num);
_board[3][2] = Key('2', false, ++_key_num);
_board[3][3] = Key('3', false, ++_key_num);
// _board[3][4] = Key();
// allocate and init allowed move lists
++_key_num;
int imax = _key_num*(_key_num+1)*2;
_one_vowel = new int [imax];
for (int i=0; i<imax; ++i)
{
_one_vowel[i] = -1;
}
_zero_vowel = new int [imax];
for (int i=0; i<imax; ++i)
{
_zero_vowel[i] = -1;
}
}
KeyBoard::KeyBoard(const KeyBoard &src)
{
::memcpy(_board, src._board, sizeof(_board));
}
KeyBoard::~KeyBoard()
{
}
// assignment operator
KeyBoard &
KeyBoard::operator=(const KeyBoard &rhs)
{
if (this != &rhs)
{
::memcpy(_board, rhs._board, sizeof(_board));
}
return *this;
}
// crunching routines
// test if move is legal
bool
KeyBoard::check_if_allowed(int vowels, int r, int c, bool exact) const
{
if (((0 <= r) && (r < max_row)) &&
((0 <= c) && (c < max_col)) &&
(_board[r][c]._value != null_key))
{
if (_board[r][c]._vowel) --vowels;
if (exact)
{
if (vowels == 0)
return true;
else
return false;
}
else
{
if (vowels >= 0)
return true;
else
return false;
}
}
else
{
return false;
}
}
// generate all single moves from a given key
void
KeyBoard::all_moves(ostream &os, int r, int c) const
{
// sanity checks
MustBeTrue((0<= r) && (r < max_row));
MustBeTrue((0<= c) && (c < max_col));
// try all moves
int count = 0;
if (_board[r][c]._value != null_key)
{
int vowels = 2;
for (int move=0; el_moves[move][0] != 0; ++move)
{
int new_r = r+el_moves[move][0];
int new_c = c+el_moves[move][1];
if (check_if_allowed(vowels, new_r, new_c, false))
{
os << _board[new_r][new_c] << endl;
++count;
}
}
}
os << "Total allowed moves: " << count << endl;
}
// generate all single moves with the given number of vowels
void
KeyBoard::vowel_moves(ostream &os,
int vowels,
AllowedMoves &moves,
int r,
int c,
int &how_many)
{
// sanity checks
MustBeTrue((0 <= r) && (r < max_row));
MustBeTrue((0 <= c) && (c < max_col));
MustBeTrue(0 <= vowels);
// try moves with the given number of vowels or less
if (_board[r][c]._value != null_key)
{
int index = _board[r][c]._index;
int *pm = moves + index*(_key_num+1)*2;
int &mi = (pm[0*2+0]);
for (int move=0; el_moves[move][0] != 0; ++move)
{
int new_r = r+el_moves[move][0];
int new_c = c+el_moves[move][1];
if (check_if_allowed(vowels, new_r, new_c, false))
{
os << _board[new_r][new_c] << endl;
how_many += 1;
++mi;
MustBeTrue(pm[((mi+1)*2)+0] == -1);
pm[((mi+1)*2)+0] = new_r;
MustBeTrue(pm[((mi+1)*2)+1] == -1);
pm[((mi+1)*2)+1] = new_c;
}
}
}
}
void
KeyBoard::one_vowel_moves(ostream &os, int r, int c)
{
int how_many = 0;
vowel_moves(os, 1, _one_vowel, r, c, how_many);
os << "Size of one-vowel list of allowed moves: "
<< how_many << endl;
}
void
KeyBoard::zero_vowel_moves(ostream &os, int r, int c)
{
int how_many = 0;
vowel_moves(os, 0, _zero_vowel, r, c, how_many);
os << "Size of zero-vowel list of allowed moves: "
<< how_many << endl;
}
// real routines to generate sequences
void
KeyBoard::brute_force_sequences(ostream &os,
string seq,
int seq_num,
int vowels,
int r,
int c,
bool verbose,
long &seq_found)
{
// sanity checks
if ((r < 0) || (r >= max_row) ||
(c < 0) || (c >= max_col)) return;
// is this an acceptable character?
if (_board[r][c]._value == null_key) return;
// is this a vowel?
if (_board[r][c]._vowel) --vowels;
// is the number of vowels valid?
if (vowels < 0) return;
// we found another character
if (verbose) seq += _board[r][c]._value;
--seq_num;
// is this the end of a sequence?
if (seq_num == 0)
{
// did we fulfill the required number of vowels?
// if (vowels == 0) os << seq << endl;
if (verbose) os << seq << endl;
seq_found += 1;
return;
}
// not the end of a sequence. check next L-step, that is,
// expand the horizon to the next step.
for (int move=0; el_moves[move][0] != 0; ++move)
{
int new_r = r+el_moves[move][0];
int new_c = c+el_moves[move][1];
brute_force_sequences(os, seq, seq_num, vowels, new_r, new_c, verbose, seq_found);
}
}
void
KeyBoard::smart_sequences(ostream &os,
string seq,
int seq_num,
int vowels,
int r,
int c,
bool verbose,
long &seq_found)
{
// sanity checks
if ((r < 0) || (r >= max_row) ||
(c < 0) || (c >= max_col)) return;
// is this an acceptable character?
if (_board[r][c]._value == null_key) return;
// is this a vowel?
if (_board[r][c]._vowel) --vowels;
// is the number of vowels valid?
if (vowels < 0) return;
// we found another character
if (verbose) seq += _board[r][c]._value;
--seq_num;
// is this the end of a sequence?
if (seq_num == 0)
{
if (verbose) os << seq << endl;
seq_found += 1;
return;
}
// not the end of a sequence. check next L-step, that is,
// expand the horizon to the next step.
int index = _board[r][c]._index;
if (vowels >= 1)
{
int *pm = _one_vowel + index*(_key_num+1)*2;
int mi = pm[0*2+0];
for (int i=0; i<=mi; ++i)
{
int new_r = pm[((i+1)*2)+0];
int new_c = pm[((i+1)*2)+1];
smart_sequences(os, seq, seq_num, vowels, new_r, new_c, verbose, seq_found);
}
}
else
{
int *pm = _zero_vowel + index*(_key_num+1)*2;
int mi = pm[0*2+0];
for (int i=0; i<=mi; ++i)
{
int new_r = pm[((i+1)*2)+0];
int new_c = pm[((i+1)*2)+1];
smart_sequences(os, seq, seq_num, vowels, new_r, new_c, verbose, seq_found);
}
}
}
// output operator
std::ostream &
operator<<(ostream &os, const KeyBoard::Key &o)
{
os << "(" << o._value << ";";
if (o._vowel)
{
os << "T;";
}
else
{
os << "F;";
}
os << o._index << ")";
return os;
}
std::ostream &
operator<<(ostream &os, const KeyBoard &o)
{
os << endl;
for (int r=0; r<KeyBoard::max_row; ++r)
{
os << o._board[r][0];
for (int c=1; c<KeyBoard::max_col; ++c)
{
os << " " << o._board[r][c];
}
os << endl;
}
return os;
}
// basic usage
void
usage(const char *cmd)
{
cout << "usage: " << cmd << " sequence_length number_of_vowels [verbose]" << endl;
}
// main entry
int
main(int argc, char **argv)
{
cout.imbue(std::locale(""));
if (argc != 3 && argc != 4)
{
usage(argv[0]);
return 2;
}
int sequence_length;
istringstream(argv[1]) >> sequence_length;
MustBeTrue(sequence_length > 0);
cout << endl << "Sequence Length: " << sequence_length << endl;
int number_of_vowels;
istringstream(argv[2]) >> number_of_vowels;
MustBeTrue(number_of_vowels >= 0);
cout << endl << "Number of Vowels: " << number_of_vowels << endl;
bool verbose = false;
if (argc == 4)
{
int dummy;
istringstream(argv[3]) >> dummy;
verbose = (dummy == 0) ? false : true;
}
KeyBoard b;
cout << endl << "initial board = " << b << endl;
// test routines for checking basic ideas.
cout << endl << "allowed moves per key = " << endl;
for (int r=0; r<KeyBoard::max_row; ++r)
{
for (int c=0; c<KeyBoard::max_col; ++c)
{
cout << endl << ">>>> Generate moves for key: "
<< b.key(r, c) << " <<<<" << endl;
cout << endl << ">>>> generate all allowed moves for key: "
<< b.key(r, c) << endl;
b.all_moves(cout, r, c);
cout << endl << ">>>> generate allowed one vowel moves for key: "
<< b.key(r, c) << endl;
b.one_vowel_moves(cout, r, c);
cout << endl << ">>>> generate allowed zero vowel moves for key: "
<< b.key(r, c) << endl;
b.zero_vowel_moves(cout, r, c);
}
}
cout << "generate sequences for the given length "
"and with the given number of vowels:" << endl;
cout << "Sequence Length: " << sequence_length << endl;
cout << "Number of Vowels: " << number_of_vowels << endl;
cout << "Brute-force crunching ..." << endl;
NanoSecTime br_s;
long brute_force_sequences_found = 0;
for (int row=0; row<KeyBoard::max_row; ++row)
{
for (int col=0; col<KeyBoard::max_col; ++col)
{
string sequence("");
b.brute_force_sequences(cout,
sequence,
sequence_length,
number_of_vowels,
row,
col,
verbose,
brute_force_sequences_found);
}
}
NanoSecTime br_e;
cout << "Number of sequences found (brute force): " << brute_force_sequences_found << endl;
NanoSecTime br_diff = br_e-br_s;
cout << "Time (brute force): " << br_diff << endl;
cout << "Smart crunching ..." << endl;
NanoSecTime sm_s;
long smart_sequences_found = 0;
for (int row=0; row<KeyBoard::max_row; ++row)
{
for (int col=0; col<KeyBoard::max_col; ++col)
{
string sequence("");
b.smart_sequences(cout,
sequence,
sequence_length,
number_of_vowels,
row,
col,
verbose,
smart_sequences_found);
}
}
NanoSecTime sm_e;
cout << "Number of sequences found (smart): " << smart_sequences_found << endl;
NanoSecTime sm_diff = sm_e-sm_s;
cout << "Time (smart): " << sm_diff << endl;
#undef CHECKCMP
#define CHECKCMP(EXPR) \
if (EXPR) \
{ \
cout << "(" << #EXPR << ") IS TRUE" << endl; \
} \
else \
{ \
cout << "(" << #EXPR << ") IS FALSE" << endl; \
}
CHECKCMP(br_diff < sm_diff);
CHECKCMP(br_diff > sm_diff);
CHECKCMP(br_diff == sm_diff);
CHECKCMP(br_diff <= sm_diff);
CHECKCMP(br_diff >= sm_diff);
CHECKCMP(br_diff != sm_diff);
CHECKCMP(sm_diff < br_diff);
CHECKCMP(sm_diff > br_diff);
CHECKCMP(sm_diff == br_diff);
CHECKCMP(sm_diff <= br_diff);
CHECKCMP(sm_diff >= br_diff);
CHECKCMP(sm_diff != br_diff);
CHECKCMP(sm_diff < sm_diff);
CHECKCMP(sm_diff > sm_diff);
CHECKCMP(sm_diff == sm_diff);
CHECKCMP(sm_diff <= sm_diff);
CHECKCMP(sm_diff >= sm_diff);
CHECKCMP(sm_diff != sm_diff);
return 0;
}
|
ombt/ombt
|
testsrc/performance/test3.cpp
|
C++
|
mit
| 16,537
|
#!/usr/bin/ipython
library_file = open('/srv/http/.config/cmus/lib.pl');
tracks = library_file.readlines()
for x in tracks:
print('<li>' + x + '</li>')
|
yisonPylkita/blace
|
Applications/Music_Player/getLibrary.py
|
Python
|
mit
| 157
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>vst-32: 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.5.3 / vst-32 - 2.8</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
vst-32
<small>
2.8
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-03-02 14:57:45 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-03-02 14:57:45 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.5.3 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.04.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.04.2 Official 4.04.2 release
ocaml-config 1 OCaml Switch Configuration
# opam file:
opam-version: "2.0"
synopsis: "Verified Software Toolchain"
description: "The software toolchain includes static analyzers to check assertions about your program; optimizing compilers to translate your program to machine language; operating systems and libraries to supply context for your program. The Verified Software Toolchain project assures with machine-checked proofs that the assertions claimed at the top of the toolchain really hold in the machine-language program, running in the operating-system context."
authors: [
"Andrew W. Appel"
"Lennart Beringer"
"Sandrine Blazy"
"Qinxiang Cao"
"Santiago Cuellar"
"Robert Dockins"
"Josiah Dodds"
"Nick Giannarakis"
"Samuel Gruetter"
"Aquinas Hobor"
"Jean-Marie Madiot"
"William Mansky"
]
maintainer: "VST team"
homepage: "http://vst.cs.princeton.edu/"
dev-repo: "git+https://github.com/PrincetonUniversity/VST.git"
bug-reports: "https://github.com/PrincetonUniversity/VST/issues"
license: "https://raw.githubusercontent.com/PrincetonUniversity/VST/master/LICENSE"
patches: [ "0001-Fix-issue-485-make-install-with-IGNORECOQVERSION.patch" "0002-Fix-Coq-8.14.0.patch" ]
build: [
[make "-j%{jobs}%" "IGNORECOQVERSION=true" "BITSIZE=32"]
]
install: [
[make "install" "IGNORECOQVERSION=true" "BITSIZE=32"]
]
depends: [
"ocaml"
"coq" {>= "8.12" & < "8.15~"}
"coq-compcert-32" {= "3.9"}
"coq-flocq" {>= "3.2.1"}
]
tags: [
"category:Computer Science/Semantics and Compilation/Semantics"
"keyword:C"
"logpath:VST"
"date:2021-06-01"
]
url {
src: "https://github.com/PrincetonUniversity/VST/archive/v2.8.tar.gz"
checksum: "sha512=80fae7277baf77319c9789fe4d170857862798988980f14c6ca4e11e5e027aff5dbf908848a193f90b0fb2a0dd7d12cf5f4446e2e5c13682e636d89838a08cae"
}
</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-vst-32.2.8 coq.8.5.3</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.5.3).
The following dependencies couldn't be met:
- coq-vst-32 -> coq-compcert-32 = 3.9 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-vst-32.2.8</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.04.2-2.0.5/released/8.5.3/vst-32/2.8.html
|
HTML
|
mit
| 7,871
|
# finance-notebooks
A collection of Jupyter Notebooks about finance
|
mbonix/finance-notebooks
|
README.md
|
Markdown
|
mit
| 68
|
package space.kyu.server;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
/**
* Unit test for simple App.
*/
public class AppTest
extends TestCase
{
/**
* Create the test case
*
* @param testName name of the test case
*/
public AppTest( String testName )
{
super( testName );
}
/**
* @return the suite of tests being tested
*/
public static Test suite()
{
return new TestSuite( AppTest.class );
}
/**
* Rigourous Test :-)
*/
public void testApp()
{
assertTrue( true );
}
}
|
Hikyu/SpringBoot-Thymeleaf-Materializecss-Demo
|
src/test/java/space/kyu/server/AppTest.java
|
Java
|
mit
| 644
|
#ifndef CRAY_BOX_H
#define CRAY_BOX_H
#include <CRayShape.h>
#include <CBox3D.h>
class CRayBox : public CRayShape, public CBox3D {
public:
CRayBox(double rx, double ry, double rz) :
CRayShape(), CBox3D(rx, ry, rz) {
}
CBBox3D getBBox() const {
return CBox3D::getBBox();
}
bool hit(const CRay &ray, double tmin, double tmax, CRayHitData *hit_data) const;
CVector3D pointNormal(const CPoint3D &point) const {
return CBox3D::pointNormal(point);
}
CVector2D pointToSurfaceVector(const CPoint3D &p) const {
return CBox3D::pointToSurfaceVector(p);
}
void translate(const CPoint3D &dist) {
CBox3D::translate(dist);
}
void scale(const CPoint3D &size) {
CBox3D::scale(size);
}
void rotate(const CPoint3D &angles) {
CBox3D::rotate(angles);
}
};
#endif
|
colinw7/CRayTrace
|
src/CRayBox.h
|
C
|
mit
| 810
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>elpi: 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.7.2 / elpi - 1.6.3~8.11</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
elpi
<small>
1.6.3~8.11
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-22 06:02:19 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-22 06:02:19 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-num base Num library distributed with the OCaml compiler
base-ocamlbuild base OCamlbuild binary and libraries distributed with the OCaml compiler
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 1 Virtual package relying on perl
coq 8.7.2 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.02.3 The OCaml compiler (virtual package)
ocaml-base-compiler 4.02.3 Official 4.02.3 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Enrico Tassi <enrico.tassi@inria.fr>"
authors: [ "Enrico Tassi" ]
license: "LGPL-2.1-or-later"
homepage: "https://github.com/LPCIC/coq-elpi"
bug-reports: "https://github.com/LPCIC/coq-elpi/issues"
dev-repo: "git+https://github.com/LPCIC/coq-elpi"
build: [ make "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" "OCAMLWARN=" ]
install: [ make "install" "COQBIN=%{bin}%/" "ELPIDIR=%{prefix}%/lib/elpi" ]
depends: [
"elpi" {>= "1.11.2" & < "1.12.0~"}
"coq" {>= "8.11" & < "8.12~"}
]
tags: [
"logpath:elpi"
]
synopsis: "Elpi extension language for Coq"
description: """
Coq-elpi provides a Coq plugin that embeds ELPI.
It also provides a way to embed Coq's terms into λProlog using
the Higher-Order Abstract Syntax approach
and a way to read terms back. In addition to that it exports to ELPI a
set of Coq's primitives, e.g. printing a message, accessing the
environment of theorems and data types, defining a new constant and so on.
For convenience it also provides a quotation and anti-quotation for Coq's
syntax in λProlog. E.g. `{{nat}}` is expanded to the type name of natural
numbers, or `{{A -> B}}` to the representation of a product by unfolding
the `->` notation. Finally it provides a way to define new vernacular commands
and new tactics."""
url {
src: "https://github.com/LPCIC/coq-elpi/archive/v1.6.3_8.11.tar.gz"
checksum: "sha256=01581a81d66d50c7afd705e83b5384de1bc4260eacc4997ea17638267c7c138d"
}
</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-elpi.1.6.3~8.11 coq.8.7.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.7.2).
The following dependencies couldn't be met:
- coq-elpi -> coq >= 8.11 -> ocaml >= 4.05.0
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-elpi.1.6.3~8.11</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>
|
coq-bench/coq-bench.github.io
|
clean/Linux-x86_64-4.02.3-2.0.6/released/8.7.2/elpi/1.6.3~8.11.html
|
HTML
|
mit
| 7,619
|
problem = """
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please note that the palindromic number, in either base, may not include leading zeros.)
"""
def is_palindromic(s):
return s[:len(s)/2] == s[:(len(s)-1)/2:-1]
def decimal2binary(num):
x = ''
while num > 0:
x = str(num % 2) + x
num /= 2
return x
double_base_palindromes = set()
for num in range(1000):
p1 = int(str(num) + str(num)[-2::-1])
p2 = int(str(num) + str(num)[::-1])
if is_palindromic(decimal2binary(p1)):
double_base_palindromes.add(p1)
if is_palindromic(decimal2binary(p2)):
double_base_palindromes.add(p2)
print sum(double_base_palindromes)
|
lorenyu/project-euler
|
problem-036.py
|
Python
|
mit
| 813
|
# -*- coding: utf-8 -*-
from flask import make_response
from flask.views import MethodView
class IndexView(MethodView):
def get(self):
return make_response('Congratulations!')
|
iceihehe/flaskr
|
app/demo/views.py
|
Python
|
mit
| 193
|
/*
* The MIT License
*
* Copyright 2014 Kamnev Georgiy (nt.gocha@gmail.com).
*
* Данная лицензия разрешает, безвозмездно, лицам, получившим копию данного программного
* обеспечения и сопутствующей документации (в дальнейшем именуемыми "Программное Обеспечение"),
* использовать Программное Обеспечение без ограничений, включая неограниченное право на
* использование, копирование, изменение, объединение, публикацию, распространение, сублицензирование
* и/или продажу копий Программного Обеспечения, также как и лицам, которым предоставляется
* данное Программное Обеспечение, при соблюдении следующих условий:
*
* Вышеупомянутый копирайт и данные условия должны быть включены во все копии
* или значимые части данного Программного Обеспечения.
*
* ДАННОЕ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ «КАК ЕСТЬ», БЕЗ ЛЮБОГО ВИДА ГАРАНТИЙ,
* ЯВНО ВЫРАЖЕННЫХ ИЛИ ПОДРАЗУМЕВАЕМЫХ, ВКЛЮЧАЯ, НО НЕ ОГРАНИЧИВАЯСЬ ГАРАНТИЯМИ ТОВАРНОЙ ПРИГОДНОСТИ,
* СООТВЕТСТВИЯ ПО ЕГО КОНКРЕТНОМУ НАЗНАЧЕНИЮ И НЕНАРУШЕНИЯ ПРАВ. НИ В КАКОМ СЛУЧАЕ АВТОРЫ
* ИЛИ ПРАВООБЛАДАТЕЛИ НЕ НЕСУТ ОТВЕТСТВЕННОСТИ ПО ИСКАМ О ВОЗМЕЩЕНИИ УЩЕРБА, УБЫТКОВ
* ИЛИ ДРУГИХ ТРЕБОВАНИЙ ПО ДЕЙСТВУЮЩИМ КОНТРАКТАМ, ДЕЛИКТАМ ИЛИ ИНОМУ, ВОЗНИКШИМ ИЗ, ИМЕЮЩИМ
* ПРИЧИНОЙ ИЛИ СВЯЗАННЫМ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ ИЛИ ИСПОЛЬЗОВАНИЕМ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
* ИЛИ ИНЫМИ ДЕЙСТВИЯМИ С ПРОГРАММНЫМ ОБЕСПЕЧЕНИЕМ.
*/
package xyz.cofe.lang2.vm.ext;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import xyz.cofe.lang2.vm.Callable;
import xyz.cofe.lang2.vm.Value;
import xyz.cofe.common.Wrapper;
import xyz.cofe.collection.Convertor;
import xyz.cofe.common.Text;
/**
* Расширение java.lang.String - поле template возвращающее соответ метод
* @author nt.gocha@gmail.com
* @see org.gocha.common.Text#template(java.lang.String, java.lang.Object[])
*/
public class StringTemplateField implements Convertor {
//<editor-fold defaultstate="collapsed" desc="log Функции">
private static void logFine(String message,Object ... args){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.FINE, message, args);
}
private static void logFiner(String message,Object ... args){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.FINER, message, args);
}
private static void logInfo(String message,Object ... args){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.INFO, message, args);
}
private static void logWarning(String message,Object ... args){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.WARNING, message, args);
}
private static void logSevere(String message,Object ... args){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.SEVERE, message, args);
}
private static void logException(Throwable ex){
Logger.getLogger(StringTemplateField.class.getName()).log(Level.SEVERE, null, ex);
}
//</editor-fold>
public static Callable template(final String string){
return new Callable() {
@Override
public Object call(Object... arguments) {
if( string!=null && arguments!=null ){
String res = null;
if( arguments[0] instanceof Map ){
Map<String,String> sm = new HashMap<String, String>();
Map m = (Map)arguments[0];
for( Object _e : m.entrySet() ){
if( !(_e instanceof Map.Entry) )continue;
Map.Entry e = (Map.Entry)_e;
Object _k = e.getKey();
Object _v = e.getValue();
if( _k instanceof Wrapper )
_k = ((Wrapper)_k).unwrap();
if( _v instanceof Wrapper )
_v = ((Wrapper)_v).unwrap();
if( _k instanceof Value )
_k = ((Value)_k).evaluate();
if( _v instanceof Value )
_v = ((Value)_v).evaluate();
if( _k==null )continue;
sm.put(_k.toString(), _v==null ? "null" : _v.toString());
}
res = Text.template(string, sm);
}else{
res = Text.template(string, arguments);
}
return res;
}
return string;
}
};
}
@Override
public Object convert(Object from) {
if( !(from instanceof String) )throw new ClassCastException(
from!=null ? (from.getClass().getName() + " to String") :
"null to String"
);
String str = (String)from;
return template(str);
}
}
|
gochaorg/lang2
|
src/main/java/xyz/cofe/lang2/vm/ext/StringTemplateField.java
|
Java
|
mit
| 6,116
|
=begin
store.rb
Copyright 2009 wollzelle GmbH (http://wollzelle.com). All rights reserved.
=end
class StorelocatorStore < Storelocator::Base
set_table_name "stores"
BOM = "\377\376" #Byte Order Mark for excel
GEO_PRECISION = 8
#address configuration for template
ADDRESS_SETTINGS = {}
acts_as_wz_translateable :table_name => 'store_translations', :foreign_key => 'store_id'
acts_as_wz_publishable :override_all_method => false, :uses_soft_delete => true, :revisioning => false
acts_as_mappable :default_units => :kms,
:default_formular => :sphere,
:distance_field_name => :distance,
:lat_column_name => :lat,
:lng_column_name => :lng,
:auto_geocode => false
belongs_to :city, :class_name => 'StorelocatorCity'
belongs_to :country, :class_name => 'StorelocatorCountry'
UPDATEABLE_FIELDS = [:name, :region_id, :country_id, :city_id, :state, :zip_code, :street, :additional, :phonenumber, :email, :lng, :lat, :shoptype_id, :accuracy]
SHOPTYPES = ['DOS', 'Retailer', 'Gucci duty free', 'Duty free retailer', 'Gucci flagship']
SHOPTYPES_LABEL = ['boutique', 'retailer', 'gucci duty free', 'duty free retailer', 'gucci flagship']
ALLOWED_UNITS = ["miles","kms"]
GUCCI_STORETYPES = [0,4]
GUCCI_FLAGSHIP = 4
validates_presence_of :name, :message => "Name can't be blank"
validates_presence_of :city_name, :message => "City name can't be blank"
validates_presence_of :street, :message => "Street can't be blank"
validates_presence_of :country_id, :message => "Country can't be blank"
validates_presence_of :city_id, :message => "City can't be blank"
validates_presence_of :shoptype_id, :message => "Shoptype can't be blank"
validates_inclusion_of :shoptype_id, :in => Array(0..SHOPTYPES.length-1)
named_scope :in_country, lambda {|country|
id = country.id rescue -1
{:conditions => {:country_id => id} } }
named_scope :valid_location, :conditions => ['stores.lat+stores.lng is not null and stores.accuracy >= :acc', {:acc => GEO_PRECISION}]
named_scope :missing_location, :conditions => 'lat is null or lng is null'
named_scope :gucci, :conditions => 'shoptype_id in (0,4)'
named_scope :retail, :conditions => 'shoptype_id = 1'
named_scope :dutyfree, :conditions => 'shoptype_id in (2,3)'
named_scope :without_retail, :conditions => 'shoptype_id != 1'
named_scope :export_latin, :joins => [:city, :country], :conditions => 'stores.lang_link_id is null', :select => 'stores.id as store_id, stores.name as latin_store_name,countries.printable_name as latin_country,countries.country_code as latin_country_code,cities.lng+cities.lat as city_coord, cities.printable_name as latin_city,state as latin_state,zip_code as latin_zip_code,street as latin_street,additional as latin_additional,shoptype_id,phonenumber as phone_number,email,accuracy'
named_scope :export_local, lambda {|mainlanguage_id| {
:conditions => ['stores.lang_link_id=:id',{:id => mainlanguage_id}], :joins => [:city, :country], :select => 'stores.name as local_storename,countries.printable_name as local_country,countries.country_code as local_country_code,cities.printable_name as local_city,state as local_state,zip_code as local_zip_code,street as local_street,additional as local_additional'}
}
named_scope :for_region, lambda {|region_id| {:conditions => ["region_id = :region", {:region => region_id} ] } }
before_publish :check_before_publish
before_save :check_city
def check_city
city = StorelocatorCity.first(:all, :conditions => ["country_id = :country_id and name = :name", {:country_id => self.country_id, :name => self.city_name}])
begin
if city.nil? then
create_missing_city
else
self.city = city
end
rescue
return false
end
true
end
def city_translation_modified?
changed_translation = self.translations.detect { |trans|
city_trans = self.city.translations.detect {|entry| entry.language == trans.language}
city_trans.nil? || (city_trans.printable_name != trans.city_name)
}
(!changed_translation.nil?)
end
def create_missing_city
pname = StorelocatorCity.named_stripped(self.city_name)
city = StorelocatorCity.create!(:country_id => self.country.id, :name => self.city_name, :printable_name => pname, :language => StorelocatorCity.default_language)
# create default city
ActiveRecord::Acts::WzTranslateable.configuration[:SITE_LANGUAGES].each do |lang|
if lang != city.language then
store_translation = self.translations.detect {|entry| entry.language == lang}
if store_translation then
city.translations << StorelocatorCity::Translation.create!(:language => lang, :printable_name => StorelocatorCity.named_stripped(store_translation.city_name)) # add additional lang
else
city.translations << StorelocatorCity::Translation.create!(:language => lang, :printable_name => pname) # add additional default lang
end
end
end
self.city = city
end
def update_city
city = self.city
self.translations.each do |trans|
if trans.language != city.language then # not default language
city_trans = self.city.translations.detect {|entry| entry.language == trans.language}
if (city_trans) then
city_trans.printable_name = StorelocatorCity.named_stripped(trans.city_name)
city_trans.save!
else
city.translations << StorelocatorCity::Translation.create!(:language => lang, :printable_name => StorelocatorCity.named_stripped(trans.city_name))
end
end
end
end
def check_before_publish
missing_translation = translations.detect {|trans| trans.name.blank? || trans.street.blank? }
self.errors.add(:translations, "For all translations name and street are required") if missing_translation
missing_translation.nil?
end
# get shoptypes as array
def self.shoptypes
SHOPTYPES.collect {|name| [name, SHOPTYPES.index(name)]}
end
def self.find_exclusive(id)
Store.with_exclusive_scope{find(id)}
end
def accurate?
(self.accuracy || 0) >= GEO_PRECISION
end
def formal_name
'store_' + self.name.parameterize.to_s.underscore
end
def self.shoptype(storetype_id)
SHOPTYPES[storetype_id].downcase
end
def shoptype
SHOPTYPES[self.storetype_id].downcase
end
def storeinfo_string
return "#{self.name}, #{self.street}, #{self.city.name} #{self.zip_code}, #{self.country.country_code}"
end
def address_string
return "#{self.street}, #{self.city.name} #{self.zip_code}, #{self.country.country_code}"
end
def update_location
self.lng = nil
self.lat = nil
if self.assign_location and self.lng then
self.save!
else
p "location not found: #{self.street}, #{self.city.name if self.city}, #{self.country.name}"
end
end
def accuracy_info
case self.accuracy
when nil,0: "No location"
when 1..4: "Very poor (#{accuracy})"
when 5..7: "Poor (#{accuracy})"
when 8..10: "Good (#{accuracy})"
when 99: "Manually set"
end
end
def geo_manualset?
return (self.accuracy == 99)
end
# location work better with country codes on googlemaps
def assign_location
if (self.lng.nil? || self.lat.nil?) && (self.street && self.city && self.country) then
geoloc = Geokit::GeoLoc.new
geoloc.country = self.country.name
geoloc.country_code = self.country.country_code
geoloc.city = self.city.name
geoloc.zip = self.zip_code
geoloc.street_address = self.street
geoloc.state = self.state
location = Storelocator::Location.geocode(geoloc, self.country)
self.lng = location.lng
self.lat = location.lat
self.accuracy = location.accuracy
end
end
end
|
lorgio/storelocator
|
app/models/storelocator_store.rb
|
Ruby
|
mit
| 7,842
|
# Trello Lists for StatusBoard
A simple jQuery plugin to display the cards and labels for a Trello list inside of a [Statusboard][statusboard].
## Directions
All you need is a User Token and the ID for the list you want to display.
**[Click Here to Generate a User Token][token]**
Edit `statusboard.html` and add in your list ID and token. You can adjust the refresh interval, but 20 seconds should provide a speed enough reload without refreshing too often.
```
$('div#theList1').trelloList( {
"user_token" : '', // Token you generated
"list_id" : '', // ID of the list to display
"refreshRate": 20000 // Refresh interval in MS. Default is 20 seconds
});
```
### Getting the ID of a list
The easiest way is to paste your token and the ID of the board into:
```
https://api.trello.com/1/boards/{BOARD_ID}/lists?key=83daea8130ecd89af1d8ab43695e84e8&token={USER_TOKEN}
```
And grab the ID from there.
## Label Colors
I've set the label colors to match the labels found in Trello, including the recent color adjustments and the ability to add unlimited labels.
However, if you would like to change or customize the color of the labels, you can do so in `css/_colors.scss`.
## Example:
[Example List][test-page]
## Screenshots


[statusboard]: http://panic.com/statusboard/ 'Statusboard by Panic Software'
[token]: https://trello.com/1/authorize?key=83daea8130ecd89af1d8ab43695e84e8&name=Trello%20Lists%20for%20StatusBoard%20By%20Chris%20Gerber&expiration=never&response_type=token 'Token Page'
[test-page]: http://www.chriswgerber.com/assets/trello-lists-statusboard/assets/statusboard-example.html 'Example Page'
|
ThatGerber/trello-for-statusboard
|
readme.md
|
Markdown
|
mit
| 1,847
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_31) on Wed Dec 17 20:48:07 PST 2014 -->
<title>TreeExpansionEvent (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<meta name="keywords" content="javax.swing.event.TreeExpansionEvent class">
<meta name="keywords" content="path">
<meta name="keywords" content="getPath()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="TreeExpansionEvent (Java Platform SE 8 )";
}
}
catch(err) {
}
//-->
var methods = {"i0":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TreeExpansionEvent.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><strong>Java™ Platform<br>Standard Ed. 8</strong></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/swing/event/TableModelListener.html" title="interface in javax.swing.event"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../javax/swing/event/TreeExpansionListener.html" title="interface in javax.swing.event"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/swing/event/TreeExpansionEvent.html" target="_top">Frames</a></li>
<li><a href="TreeExpansionEvent.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.swing.event</div>
<h2 title="Class TreeExpansionEvent" class="title">Class TreeExpansionEvent</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="../../../java/lang/Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../../java/util/EventObject.html" title="class in java.util">java.util.EventObject</a></li>
<li>
<ul class="inheritance">
<li>javax.swing.event.TreeExpansionEvent</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../java/io/Serializable.html" title="interface in java.io">Serializable</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">TreeExpansionEvent</span>
extends <a href="../../../java/util/EventObject.html" title="class in java.util">EventObject</a></pre>
<div class="block">An event used to identify a single path in a tree. The source
returned by <b>getSource</b> will be an instance of JTree.
<p>
For further documentation and examples see
the following sections in <em>The Java Tutorial</em>:
<a href="http://docs.oracle.com/javase/tutorial/uiswing/events/treeexpansionlistener.html">How to Write a Tree Expansion Listener</a> and
<a href="http://docs.oracle.com/javase/tutorial/uiswing/events/treewillexpandlistener.html">How to Write a Tree-Will-Expand Listener</a>.
<p>
<strong>Warning:</strong>
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans™
has been added to the <code>java.beans</code> package.
Please see <a href="../../../java/beans/XMLEncoder.html" title="class in java.beans"><code>XMLEncoder</code></a>.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/event/TreeExpansionEvent.html#path">path</a></span></code>
<div class="block">Path to the value this event represents.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.java.util.EventObject">
<!-- -->
</a>
<h3>Fields inherited from class java.util.<a href="../../../java/util/EventObject.html" title="class in java.util">EventObject</a></h3>
<code><a href="../../../java/util/EventObject.html#source">source</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/swing/event/TreeExpansionEvent.html#TreeExpansionEvent-java.lang.Object-javax.swing.tree.TreePath-">TreeExpansionEvent</a></span>(<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a> source,
<a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a> path)</code>
<div class="block">Constructs a TreeExpansionEvent object.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/swing/event/TreeExpansionEvent.html#getPath--">getPath</a></span>()</code>
<div class="block">Returns the path to the value that has been expanded/collapsed.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.EventObject">
<!-- -->
</a>
<h3>Methods inherited from class java.util.<a href="../../../java/util/EventObject.html" title="class in java.util">EventObject</a></h3>
<code><a href="../../../java/util/EventObject.html#getSource--">getSource</a>, <a href="../../../java/util/EventObject.html#toString--">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a></h3>
<code><a href="../../../java/lang/Object.html#clone--">clone</a>, <a href="../../../java/lang/Object.html#equals-java.lang.Object-">equals</a>, <a href="../../../java/lang/Object.html#finalize--">finalize</a>, <a href="../../../java/lang/Object.html#getClass--">getClass</a>, <a href="../../../java/lang/Object.html#hashCode--">hashCode</a>, <a href="../../../java/lang/Object.html#notify--">notify</a>, <a href="../../../java/lang/Object.html#notifyAll--">notifyAll</a>, <a href="../../../java/lang/Object.html#wait--">wait</a>, <a href="../../../java/lang/Object.html#wait-long-">wait</a>, <a href="../../../java/lang/Object.html#wait-long-int-">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="path">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>path</h4>
<pre>protected <a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a> path</pre>
<div class="block">Path to the value this event represents.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="TreeExpansionEvent-java.lang.Object-javax.swing.tree.TreePath-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TreeExpansionEvent</h4>
<pre>public TreeExpansionEvent(<a href="../../../java/lang/Object.html" title="class in java.lang">Object</a> source,
<a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a> path)</pre>
<div class="block">Constructs a TreeExpansionEvent object.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the Object that originated the event
(typically <code>this</code>)</dd>
<dd><code>path</code> - a TreePath object identifying the newly expanded
node</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getPath--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPath</h4>
<pre>public <a href="../../../javax/swing/tree/TreePath.html" title="class in javax.swing.tree">TreePath</a> getPath()</pre>
<div class="block">Returns the path to the value that has been expanded/collapsed.</div>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/TreeExpansionEvent.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><strong>Java™ Platform<br>Standard Ed. 8</strong></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/swing/event/TableModelListener.html" title="interface in javax.swing.event"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../javax/swing/event/TreeExpansionListener.html" title="interface in javax.swing.event"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/swing/event/TreeExpansionEvent.html" target="_top">Frames</a></li>
<li><a href="TreeExpansionEvent.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><font size="-1"> <a href="http://bugreport.sun.com/bugreport/">Submit a bug or feature</a> <br>For further API reference and developer documentation, see <a href="http://download.oracle.com/javase/8/docs/index.html" target="_blank">Java SE Documentation</a>. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.<br> <a href="../../../../legal/cpyr.html">Copyright</a> © 1993, 2015, Oracle and/or its affiliates. All rights reserved. </font></small></p>
</body>
</html>
|
fbiville/annotation-processing-ftw
|
doc/java/jdk8/javax/swing/event/TreeExpansionEvent.html
|
HTML
|
mit
| 15,762
|
## Preview
------
> [const ( APPNAME... ...FILE_NAME_HTML_CONFIG_JSON )](#f_const___APPNAME---_---FILE_NAME_HTML_CONFIG_JSON__)<a name="p_const___APPNAME---_---FILE_NAME_HTML_CONFIG_JSON__"><a/>
> [const ( DEFAULT_CONFIG_FILE_NAME... ...DEFAULT_OUTPATH )](#f_const___DEFAULT_CONFIG_FILE_NAME---_---DEFAULT_OUTPATH__)<a name="p_const___DEFAULT_CONFIG_FILE_NAME---_---DEFAULT_OUTPATH__"><a/>
> [const ( DOC_FILE_SUFFIX... ...NIL_DOC_NAME )](#f_const___DOC_FILE_SUFFIX---_---NIL_DOC_NAME__)<a name="p_const___DOC_FILE_SUFFIX---_---NIL_DOC_NAME__"><a/>
> [const ( ResultFileSuccess... ...ResultDebugErr )](#f_const___ResultFileSuccess---_---ResultDebugErr__)<a name="p_const___ResultFileSuccess---_---ResultDebugErr__"><a/>
> [var ( REXPrivateFile... ...REXDocIndexTitle )](#f_var___REXPrivateFile---_---REXDocIndexTitle__)<a name="p_var___REXPrivateFile---_---REXDocIndexTitle__"><a/>
> [func AddParser(parser DocParser) ](#f_func_AddParser_parser_DocParser__)<a name="p_func_AddParser_parser_DocParser__"><a/>
> [func CheckExistVersion(configPath, version string) bool](#f_func_CheckExistVersion_configPath_version_string__bool)<a name="p_func_CheckExistVersion_configPath_version_string__bool"><a/>
> [func ConverToVersionPath(version string) string](#f_func_ConverToVersionPath_version_string__string)<a name="p_func_ConverToVersionPath_version_string__string"><a/>
> [func CreateConfigFile(dirPath string, langs []string) (error, bool)](#f_func_CreateConfigFile_dirPath_string_langs___string___error_bool_)<a name="p_func_CreateConfigFile_dirPath_string_langs___string___error_bool_"><a/>
> [func FindPrefixFilterTag(src []byte) []byte](#f_func_FindPrefixFilterTag_src___byte____byte)<a name="p_func_FindPrefixFilterTag_src___byte____byte"><a/>
> [func Output(configPath, version string, fileFunc FileResultFunc) (error, bool)](#f_func_Output_configPath_version_string_fileFunc_FileResultFunc___error_bool_)<a name="p_func_Output_configPath_version_string_fileFunc_FileResultFunc___error_bool_"><a/>
> [func OutputWithConfig(config \*MainConfig, version string, fileFunc FileResultFunc) (error, bool)](#f_func_OutputWithConfig_config_+MainConfig_version_string_fileFunc_FileResultFunc___error_bool_)<a name="p_func_OutputWithConfig_config_+MainConfig_version_string_fileFunc_FileResultFunc___error_bool_"><a/>
> [func ReadConfigFile(configFilePath string) (config \*MainConfig, err error, pass bool)](#f_func_ReadConfigFile_configFilePath_string___config_+MainConfig_err_error_pass_bool_)<a name="p_func_ReadConfigFile_configFilePath_string___config_+MainConfig_err_error_pass_bool_"><a/>
> [type About struct](#f_type_About_struct)<a name="p_type_About_struct"><a/>
>> [func NewDefaultAbout() \*About](#f_func_NewDefaultAbout___+About)<a name="p_func_NewDefaultAbout___+About"><a/>
>> [func ParseAbout(fileBuf \*FileBuf) \*About](#f_func_ParseAbout_fileBuf_+FileBuf__+About)<a name="p_func_ParseAbout_fileBuf_+FileBuf__+About"><a/>
>> [func (\*About) WriteFilepath(path string) error](#f_func__+About__WriteFilepath_path_string__error)<a name="p_func__+About__WriteFilepath_path_string__error"><a/>
> [type CodeBlock struct](#f_type_CodeBlock_struct)<a name="p_type_CodeBlock_struct"><a/>
> [type CodeFile struct](#f_type_CodeFile_struct)<a name="p_type_CodeFile_struct"><a/>
> [type CodeFiles struct](#f_type_CodeFiles_struct)<a name="p_type_CodeFiles_struct"><a/>
>> [func NewCodeFiles() \*CodeFiles](#f_func_NewCodeFiles___+CodeFiles)<a name="p_func_NewCodeFiles___+CodeFiles"><a/>
>> [func (\*CodeFiles) FilesLen() int](#f_func__+CodeFiles__FilesLen___int)<a name="p_func__+CodeFiles__FilesLen___int"><a/>
>> [func (\*CodeFiles) IsAllDocFile() bool](#f_func__+CodeFiles__IsAllDocFile___bool)<a name="p_func__+CodeFiles__IsAllDocFile___bool"><a/>
> [type ContentJson struct](#f_type_ContentJson_struct)<a name="p_type_ContentJson_struct"><a/>
>> [func (ContentJson) WriteFilepath(path string) error](#f_func__ContentJson__WriteFilepath_path_string__error)<a name="p_func__ContentJson__WriteFilepath_path_string__error"><a/>
> [type DocConfig struct](#f_type_DocConfig_struct)<a name="p_type_DocConfig_struct"><a/>
> [type DocParser interface](#f_type_DocParser_interface)<a name="p_type_DocParser_interface"><a/>
>> [func MapParser() map[string]DocParser](#f_func_MapParser___map_string_DocParser)<a name="p_func_MapParser___map_string_DocParser"><a/>
> [type Document struct](#f_type_Document_struct)<a name="p_type_Document_struct"><a/>
>> [func ParseDocument(fileBuf \*FileBuf) []Document](#f_func_ParseDocument_fileBuf_+FileBuf____Document)<a name="p_func_ParseDocument_fileBuf_+FileBuf____Document"><a/>
> [type FileBuf struct](#f_type_FileBuf_struct)<a name="p_type_FileBuf_struct"><a/>
>> [func NewFileBuf(fileContent []byte, path string, info os.FileInfo, filter \*regexp.Regexp) \*FileBuf](#f_func_NewFileBuf_fileContent___byte_path_string_info_os-FileInfo_filter_+regexp-Regexp__+FileBuf)<a name="p_func_NewFileBuf_fileContent___byte_path_string_info_os-FileInfo_filter_+regexp-Regexp__+FileBuf"><a/>
>> [func (\*FileBuf) Byte(index int) (byte, bool)](#f_func__+FileBuf__Byte_index_int___byte_bool_)<a name="p_func__+FileBuf__Byte_index_int___byte_bool_"><a/>
>> [func (\*FileBuf) FileInfo() os.FileInfo](#f_func__+FileBuf__FileInfo___os-FileInfo)<a name="p_func__+FileBuf__FileInfo___os-FileInfo"><a/>
>> [func (\*FileBuf) Find(rex \*regexp.Regexp) []byte](#f_func__+FileBuf__Find_rex_+regexp-Regexp____byte)<a name="p_func__+FileBuf__Find_rex_+regexp-Regexp____byte"><a/>
>> [func (\*FileBuf) FindAll(rex \*regexp.Regexp) [][]byte](#f_func__+FileBuf__FindAll_rex_+regexp-Regexp______byte)<a name="p_func__+FileBuf__FindAll_rex_+regexp-Regexp______byte"><a/>
>> [func (\*FileBuf) FindAllSubmatch(rex \*regexp.Regexp) [][][]byte](#f_func__+FileBuf__FindAllSubmatch_rex_+regexp-Regexp________byte)<a name="p_func__+FileBuf__FindAllSubmatch_rex_+regexp-Regexp________byte"><a/>
>> [func (\*FileBuf) FindAllSubmatchIndex(rex \*regexp.Regexp) [][]int](#f_func__+FileBuf__FindAllSubmatchIndex_rex_+regexp-Regexp______int)<a name="p_func__+FileBuf__FindAllSubmatchIndex_rex_+regexp-Regexp______int"><a/>
>> [func (\*FileBuf) FindSubmatch(rex \*regexp.Regexp) [][]byte](#f_func__+FileBuf__FindSubmatch_rex_+regexp-Regexp______byte)<a name="p_func__+FileBuf__FindSubmatch_rex_+regexp-Regexp______byte"><a/>
>> [func (\*FileBuf) FindSubmatchIndex(rex \*regexp.Regexp) []int](#f_func__+FileBuf__FindSubmatchIndex_rex_+regexp-Regexp____int)<a name="p_func__+FileBuf__FindSubmatchIndex_rex_+regexp-Regexp____int"><a/>
>> [func (\*FileBuf) LineLen() int](#f_func__+FileBuf__LineLen___int)<a name="p_func__+FileBuf__LineLen___int"><a/>
>> [func (\*FileBuf) LineNumberByIndex(beginIndex, endIndex int) []int](#f_func__+FileBuf__LineNumberByIndex_beginIndex_endIndex_int____int)<a name="p_func__+FileBuf__LineNumberByIndex_beginIndex_endIndex_int____int"><a/>
>> [func (\*FileBuf) Path() string](#f_func__+FileBuf__Path___string)<a name="p_func__+FileBuf__Path___string"><a/>
>> [func (\*FileBuf) RowByIndex(lineNumber int) []byte](#f_func__+FileBuf__RowByIndex_lineNumber_int____byte)<a name="p_func__+FileBuf__RowByIndex_lineNumber_int____byte"><a/>
>> [func (\*FileBuf) String() string](#f_func__+FileBuf__String___string)<a name="p_func__+FileBuf__String___string"><a/>
>> [func (\*FileBuf) SubBytes(beginIndex, endIndex int) []byte](#f_func__+FileBuf__SubBytes_beginIndex_endIndex_int____byte)<a name="p_func__+FileBuf__SubBytes_beginIndex_endIndex_int____byte"><a/>
>> [func (\*FileBuf) SubNestAllIndex(subNest \*SFSubUtil.SubNest, outBetweens [][]int) [][]int](#f_func__+FileBuf__SubNestAllIndex_subNest_+SFSubUtil-SubNest_outBetweens_____int______int)<a name="p_func__+FileBuf__SubNestAllIndex_subNest_+SFSubUtil-SubNest_outBetweens_____int______int"><a/>
>> [func (\*FileBuf) SubNestAllIndexByBetween(startIndex, endIndex int, subNest \*SFSubUtil.SubNest, outBetweens [][]int) [][]int](#f_func__+FileBuf__SubNestAllIndexByBetween_startIndex_endIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int______int)<a name="p_func__+FileBuf__SubNestAllIndexByBetween_startIndex_endIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int______int"><a/>
>> [func (\*FileBuf) SubNestGetOutBetweens(nests ...\*SFSubUtil.SubNest) [][]int](#f_func__+FileBuf__SubNestGetOutBetweens_nests_---+SFSubUtil-SubNest______int)<a name="p_func__+FileBuf__SubNestGetOutBetweens_nests_---+SFSubUtil-SubNest______int"><a/>
>> [func (\*FileBuf) SubNestIndex(startIndex int, subNest \*SFSubUtil.SubNest, outBetweens [][]int) []int](#f_func__+FileBuf__SubNestIndex_startIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int____int)<a name="p_func__+FileBuf__SubNestIndex_startIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int____int"><a/>
>> [func (\*FileBuf) WriteFilepath(path string) error](#f_func__+FileBuf__WriteFilepath_path_string__error)<a name="p_func__+FileBuf__WriteFilepath_path_string__error"><a/>
> [type FileLink struct](#f_type_FileLink_struct)<a name="p_type_FileLink_struct"><a/>
> [type FileResultFunc func](#f_type_FileResultFunc_func)<a name="p_type_FileResultFunc_func"><a/>
> [type Intro struct](#f_type_Intro_struct)<a name="p_type_Intro_struct"><a/>
>> [func NewDefaultIntro() \*Intro](#f_func_NewDefaultIntro___+Intro)<a name="p_func_NewDefaultIntro___+Intro"><a/>
>> [func ParseIntro(fileBuf \*FileBuf) \*Intro](#f_func_ParseIntro_fileBuf_+FileBuf__+Intro)<a name="p_func_ParseIntro_fileBuf_+FileBuf__+Intro"><a/>
>> [func (\*Intro) WriteFilepath(path string) error](#f_func__+Intro__WriteFilepath_path_string__error)<a name="p_func__+Intro__WriteFilepath_path_string__error"><a/>
> [type MainConfig struct](#f_type_MainConfig_struct)<a name="p_type_MainConfig_struct"><a/>
>> [func (\*MainConfig) Check() (error, bool)](#f_func__+MainConfig__Check____error_bool_)<a name="p_func__+MainConfig__Check____error_bool_"><a/>
>> [func (MainConfig) GithubLink(relMDPath string, isToMarkdown bool) string](#f_func__MainConfig__GithubLink_relMDPath_string_isToMarkdown_bool__string)<a name="p_func__MainConfig__GithubLink_relMDPath_string_isToMarkdown_bool__string"><a/>
> [type MenuFile struct](#f_type_MenuFile_struct)<a name="p_type_MenuFile_struct"><a/>
> [type MenuMarkdown struct](#f_type_MenuMarkdown_struct)<a name="p_type_MenuMarkdown_struct"><a/>
> [type OperateResult int](#f_type_OperateResult_int)<a name="p_type_OperateResult_int"><a/>
> [type PackageInfo struct](#f_type_PackageInfo_struct)<a name="p_type_PackageInfo_struct"><a/>
> [type Preview struct](#f_type_Preview_struct)<a name="p_type_Preview_struct"><a/>
> [type SortSet struct](#f_type_SortSet_struct)<a name="p_type_SortSet_struct"><a/>
>> [func (SortSet) Len() int](#f_func__SortSet__Len___int)<a name="p_func__SortSet__Len___int"><a/>
>> [func (SortSet) Less(i, j int) bool](#f_func__SortSet__Less_i_j_int__bool)<a name="p_func__SortSet__Less_i_j_int__bool"><a/>
>> [func (SortSet) Swap(i, j int) ](#f_func__SortSet__Swap_i_j_int__)<a name="p_func__SortSet__Swap_i_j_int__"><a/>
<br/>
### Directory files
[config.go ](../../../../../src/github.com/slowfei/gosfdoc/config.go)[gosfdoc.go ](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go)[parse.go ](../../../../../src/github.com/slowfei/gosfdoc/parse.go)[struct.go ](../../../../../src/github.com/slowfei/gosfdoc/struct.go)
## Constants
------
### [source code](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L30-L53) <a name="f_const___APPNAME---_---FILE_NAME_HTML_CONFIG_JSON__"><a/> [↩](#p_const___APPNAME---_---FILE_NAME_HTML_CONFIG_JSON__) | [#](#f_const___APPNAME---_---FILE_NAME_HTML_CONFIG_JSON__)
<pre><code class='go custom'>const (
APPNAME = "gosfdoc" //
VERSION = "0.1.000" //
DIR_NAME_MAIN_MARKDOWN = "md" // save markdown file main directory name
DIR_NAME_MARKDOWN_DEFAULT = "default" // markdown default directory
DIR_NAME_SOURCE_CODE = "src" // source code save directory
DIR_NAME_ASSETS = "assets" // html use assets file directory
FILE_SUFFIX_MARKDOWN = ".md"
FILE_NAME_ABOUT_MD = "about.md"
FILE_NAME_INTRO_MD = "intro.md"
FILE_NAME_CONTENT_JSON = "content.json"
FILE_NAME_GOSFDOC_MIN_CSS = "gosfdoc.min.css"
FILE_NAME_ASSETS_MIN_JS = "assets.min.js"
FILE_NAME_GOSFDOC_MIN_JS = "gosfdoc.min.js"
FILE_NAME_GOSFDOC_SRC_MIN_JS = "gosfdoc.src.min.js"
FILE_NAME_HTML_INDEX = "index.html"
FILE_NAME_HTML_SRC = "src.html"
FILE_NAME_HTML_CONFIG_JSON = "config.json"
)</code></pre>
### [source code](../../../../../src/github.com/slowfei/gosfdoc/config.go#L24-L27) <a name="f_const___DEFAULT_CONFIG_FILE_NAME---_---DEFAULT_OUTPATH__"><a/> [↩](#p_const___DEFAULT_CONFIG_FILE_NAME---_---DEFAULT_OUTPATH__) | [#](#f_const___DEFAULT_CONFIG_FILE_NAME---_---DEFAULT_OUTPATH__)
<pre><code class='go custom'>const (
DEFAULT_CONFIG_FILE_NAME = "gosfdoc.json"
DEFAULT_OUTPATH = "doc"
)</code></pre>
### [source code](../../../../../src/github.com/slowfei/gosfdoc/parse.go#L22-L26) <a name="f_const___DOC_FILE_SUFFIX---_---NIL_DOC_NAME__"><a/> [↩](#p_const___DOC_FILE_SUFFIX---_---NIL_DOC_NAME__) | [#](#f_const___DOC_FILE_SUFFIX---_---NIL_DOC_NAME__)
<pre><code class='go custom'>const (
DOC_FILE_SUFFIX = ".dc" // document file suffix(document comments)
NIL_DOC_NAME = "document" // nilDocParser struct use
)</code></pre>
### [source code](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L111-L119) <a name="f_const___ResultFileSuccess---_---ResultDebugErr__"><a/> [↩](#p_const___ResultFileSuccess---_---ResultDebugErr__) | [#](#f_const___ResultFileSuccess---_---ResultDebugErr__)
<pre><code class='go custom'>const (
ResultFileSuccess OperateResult = iota
ResultFileInvalid
ResultFileNotRead
ResultFileReadErr
ResultFileFilter
ResultFileOutFail
ResultDebugErr
)</code></pre>
## Variables
------
### [source code](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L74-L104) <a name="f_var___REXPrivateFile---_---REXDocIndexTitle__"><a/> [↩](#p_var___REXPrivateFile---_---REXDocIndexTitle__) | [#](#f_var___REXPrivateFile---_---REXDocIndexTitle__)
> regex compile variable<br/>
> <br/>
<pre><code class='go custom'>var (
// private file tag ( //# private-doc-code )
REXPrivateFile = regexp.MustCompile("#private-(doc|code){1}(-doc|-code)?")
TagPrivateCode = []byte("code")
TagPrivateDoc = []byte("doc")
// private block tag ( //# private * //# private-end)
REXPrivateBlock = regexp.MustCompile("[^\\n][\\s]?")
// parse separate document file package info( //# package-info brief intro row)
REXDCPackageInfo = regexp.MustCompile("#package-info (.+)")
// parse about and intro block
/* * [About|Intro]
* content text or markdown text
*/
// [About|Intro]
// content text or markdown text
// End
REXAbout = regexp.MustCompile("(/\\*\\*About[\\s]+(\\s|.)*?[\\s]+\\*/)|(//About[\\s]?([\\s]|.)*?//[Ee][Nn][Dd])")
REXIntro = regexp.MustCompile("(/\\*\\*Intro[\\s]+(\\s|.)*?[\\s]+\\*/)|(//Intro[\\s]?([\\s]|.)*?//[Ee][Nn][Dd])")
// parse public document content
/* * *[z-index-][title]
* document text or markdown text
*/
// /[z-index-][title]
// document text or markdown text
// End
REXDocument = regexp.MustCompile("(/\\*\\*\\*[^\\*\\s](.+)\\n(\\s|.)*?\\*/)|(///[^/\\s](.+)\\n(\\s|.)*?//[Ee][Nn][Dd])")
REXDocIndexTitle = regexp.MustCompile("(/\\*\\*\\*|///)(\\d*-)?(.*)?")
)</code></pre>
## Func Details
------
### [func AddParser](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L208-L212) <a name="f_func_AddParser_parser_DocParser__"><a/> [↩](#p_func_AddParser_parser_DocParser__) | [#](#f_func_AddParser_parser_DocParser__)
> add parser<br/>
> @param parser<br/>
> <br/>
<pre><code class='go custom'>func AddParser(parser DocParser) { ...... }</code></pre>
### [func CheckExistVersion](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L329-L339) <a name="f_func_CheckExistVersion_configPath_version_string__bool"><a/> [↩](#p_func_CheckExistVersion_configPath_version_string__bool) | [#](#f_func_CheckExistVersion_configPath_version_string__bool)
> check whether there are version info<br/>
> @param `configPath` config path<br/>
> @param `version` check version string<br/>
> <br/>
<pre><code class='go custom'>func CheckExistVersion(configPath, version string) bool { ...... }</code></pre>
### [func ConverToVersionPath](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L344-L349) <a name="f_func_ConverToVersionPath_version_string__string"><a/> [↩](#p_func_ConverToVersionPath_version_string__string) | [#](#f_func_ConverToVersionPath_version_string__string)
> conver version to use the path info<br/>
> <br/>
<pre><code class='go custom'>func ConverToVersionPath(version string) string { ...... }</code></pre>
### [func CreateConfigFile](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L359-L445) <a name="f_func_CreateConfigFile_dirPath_string_langs___string___error_bool_"><a/> [↩](#p_func_CreateConfigFile_dirPath_string_langs___string___error_bool_) | [#](#f_func_CreateConfigFile_dirPath_string_langs___string___error_bool_)
> create config file<br/>
> @param `dirPath` directory path<br/>
> @param `langs` specify code language, nil is all language, value is parser name.<br/>
> @return `error` warn or error message<br/>
> @return `bool` true is operation success<br/>
> <br/>
<pre><code class='go custom'>func CreateConfigFile(dirPath string, langs []string) (error, bool) { ...... }</code></pre>
### [func FindPrefixFilterTag](../../../../../src/github.com/slowfei/gosfdoc/parse.go#L466-L477) <a name="f_func_FindPrefixFilterTag_src___byte____byte"><a/> [↩](#p_func_FindPrefixFilterTag_src___byte____byte) | [#](#f_func_FindPrefixFilterTag_src___byte____byte)
> find prefix filter tag index<br/>
> //<br/>
> // content ("// ") is prefix tag<br/>
> //<br/>
> see var _prefixFilterTags<br/>
> <br/>
<pre><code class='go custom'>func FindPrefixFilterTag(src []byte) []byte { ...... }</code></pre>
### [func Output](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L456-L462) <a name="f_func_Output_configPath_version_string_fileFunc_FileResultFunc___error_bool_"><a/> [↩](#p_func_Output_configPath_version_string_fileFunc_FileResultFunc___error_bool_) | [#](#f_func_Output_configPath_version_string_fileFunc_FileResultFunc___error_bool_)
> build output document<br/>
> @param `configPath` config file path<br/>
> @param `version` output document version<br/>
> @param `fileFunc`<br/>
> @return `error` warn or error message<br/>
> @return `bool` true is operation success<br/>
> <br/>
<pre><code class='go custom'>func Output(configPath, version string, fileFunc FileResultFunc) (error, bool) { ...... }</code></pre>
### [func OutputWithConfig](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L472-L549) <a name="f_func_OutputWithConfig_config_+MainConfig_version_string_fileFunc_FileResultFunc___error_bool_"><a/> [↩](#p_func_OutputWithConfig_config_+MainConfig_version_string_fileFunc_FileResultFunc___error_bool_) | [#](#f_func_OutputWithConfig_config_+MainConfig_version_string_fileFunc_FileResultFunc___error_bool_)
> build output document with config content<br/>
> @param `config`<br/>
> @param `version` e.g: "v=1.0"<br/>
> @return `error` warn or error message<br/>
> @return `bool` true is operation success<br/>
> <br/>
<pre><code class='go custom'>func OutputWithConfig(config *MainConfig, version string, fileFunc FileResultFunc) (error, bool) { ...... }</code></pre>
### [func ReadConfigFile](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L233-L258) <a name="f_func_ReadConfigFile_configFilePath_string___config_+MainConfig_err_error_pass_bool_"><a/> [↩](#p_func_ReadConfigFile_configFilePath_string___config_+MainConfig_err_error_pass_bool_) | [#](#f_func_ReadConfigFile_configFilePath_string___config_+MainConfig_err_error_pass_bool_)
> read config file<br/>
> @param `configFilePath`<br/>
> @return `config`<br/>
> @return `err` contains warn info<br/>
> @return `pass` true is valid file (pass does not mean that there are no errors)<br/>
> <br/>
<pre><code class='go custom'>func ReadConfigFile(configFilePath string) (config *MainConfig, err error, pass bool) { ...... }</code></pre>
### [type About struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L508-L510) <a name="f_type_About_struct"><a/> [↩](#p_type_About_struct) | [#](#f_type_About_struct)
> markdown about<br/>
> <br/>
<pre><code class='go custom'>type About struct {
Content []byte
}</code></pre>
### [func NewDefaultAbout](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L517-L519) <a name="f_func_NewDefaultAbout___+About"><a/> [↩](#p_func_NewDefaultAbout___+About) | [#](#f_func_NewDefaultAbout___+About)
> new default about<br/>
> @return pointer type<br/>
> <br/>
<pre><code class='go custom'>func NewDefaultAbout() *About { ...... }</code></pre>
### [func ParseAbout](../../../../../src/github.com/slowfei/gosfdoc/parse.go#L371-L380) <a name="f_func_ParseAbout_fileBuf_+FileBuf__+About"><a/> [↩](#p_func_ParseAbout_fileBuf_+FileBuf__+About) | [#](#f_func_ParseAbout_fileBuf_+FileBuf__+About)
> commons parse file about content<br/>
> @param `fileBuf`<br/>
> @return about content<br/>
> <br/>
<pre><code class='go custom'>func ParseAbout(fileBuf *FileBuf) *About { ...... }</code></pre>
### [func (\*About) WriteFilepath](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L527-L532) <a name="f_func__+About__WriteFilepath_path_string__error"><a/> [↩](#p_func__+About__WriteFilepath_path_string__error) | [#](#f_func__+About__WriteFilepath_path_string__error)
> output file<br/>
> @param `path` output full path<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*About) WriteFilepath(path string) error { ...... }</code></pre>
### [type CodeBlock struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L603-L613) <a name="f_type_CodeBlock_struct"><a/> [↩](#p_type_CodeBlock_struct) | [#](#f_type_CodeBlock_struct)
> body code block struct<br/>
> <br/>
<pre><code class='go custom'>type CodeBlock struct {
SortTag string // sort tag
MenuTitle string // left navigation menu title
Title string // function name or custom title
Anchor string // function anchor text.
Desc string // description markdown text or plain text
Code string // show code text
CodeLang string // source code lang type string
SourceFileName string // source code file name
FileLines []int // block where the file line [5,10] is L5-L10
}</code></pre>
### [type CodeFile struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L401-L407) <a name="f_type_CodeFile_struct"><a/> [↩](#p_type_CodeFile_struct) | [#](#f_type_CodeFile_struct)
> source code file<br/>
> <br/>
<pre><code class='go custom'>type CodeFile struct {
parser DocParser // file parser
docs []Document // current file public documents
FileCont *FileBuf // file buffer content
PrivateDoc bool // if private document not output
PrivateCode bool // if private source code not output
}</code></pre>
### [type CodeFiles struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L412-L414) <a name="f_type_CodeFiles_struct"><a/> [↩](#p_type_CodeFiles_struct) | [#](#f_type_CodeFiles_struct)
> source code file list<br/>
> <br/>
<pre><code class='go custom'>type CodeFiles struct {
files *list.List
}</code></pre>
### [func NewCodeFiles](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L419-L423) <a name="f_func_NewCodeFiles___+CodeFiles"><a/> [↩](#p_func_NewCodeFiles___+CodeFiles) | [#](#f_func_NewCodeFiles___+CodeFiles)
> new CodeFiles<br/>
> <br/>
<pre><code class='go custom'>func NewCodeFiles() *CodeFiles { ...... }</code></pre>
### [func (\*CodeFiles) FilesLen](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L481-L483) <a name="f_func__+CodeFiles__FilesLen___int"><a/> [↩](#p_func__+CodeFiles__FilesLen___int) | [#](#f_func__+CodeFiles__FilesLen___int)
> file list storage length<br/>
> @return file number<br/>
> <br/>
<pre><code class='go custom'>func (*CodeFiles) FilesLen() int { ...... }</code></pre>
### [func (\*CodeFiles) IsAllDocFile](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L442-L458) <a name="f_func__+CodeFiles__IsAllDocFile___bool"><a/> [↩](#p_func__+CodeFiles__IsAllDocFile___bool) | [#](#f_func__+CodeFiles__IsAllDocFile___bool)
> is all document files<br/>
> @return all document is true<br/>
> <br/>
<pre><code class='go custom'>func (*CodeFiles) IsAllDocFile() bool { ...... }</code></pre>
### [type ContentJson struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L488-L492) <a name="f_type_ContentJson_struct"><a/> [↩](#p_type_ContentJson_struct) | [#](#f_type_ContentJson_struct)
> output `content.json`<br/>
> <br/>
<pre><code class='go custom'>type ContentJson struct {
HtmlTitle string // html document title
DocTitle string // html top show title
MenuTitle string // html left menu title
}</code></pre>
### [func (ContentJson) WriteFilepath](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L497-L503) <a name="f_func__ContentJson__WriteFilepath_path_string__error"><a/> [↩](#p_func__ContentJson__WriteFilepath_path_string__error) | [#](#f_func__ContentJson__WriteFilepath_path_string__error)
> output write file path<br/>
> <br/>
<pre><code class='go custom'>func (ContentJson) WriteFilepath(path string) error { ...... }</code></pre>
### [type DocConfig struct](../../../../../src/github.com/slowfei/gosfdoc/config.go#L268-L278) <a name="f_type_DocConfig_struct"><a/> [↩](#p_type_DocConfig_struct) | [#](#f_type_DocConfig_struct)
> document directory html javascript use config<br/>
> output `config.json`<br/>
> <br/>
<pre><code class='go custom'>type DocConfig struct {
ContentJson string // content json file
IntroMd string // intro markdown file
AboutMd string // about markdown file
Languages []map[string]string // key is directory name, value is show text
LinkRoot bool // is link root directory
AppendPath string // append output source code and markdown relative path(scan path join)
Versions []string // output document versions
Markdowns []MenuMarkdown // markdown info list
Files []MenuFile // source code file links
}</code></pre>
### [type DocParser interface](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L133-L194) <a name="f_type_DocParser_interface"><a/> [↩](#p_type_DocParser_interface) | [#](#f_type_DocParser_interface)
> document parser<br/>
> <br/>
<pre><code class='go custom'>type DocParser interface {
/**
* parser name
*
* @return
*/
Name() string
/**
* check file
* detecting whether the file is a valid file
*
* @param `parh` file path
* @param `info` file info
* @return true is valid file
*/
CheckFile(path string, info os.FileInfo) bool
/**
* each file the content
* can be create keyword index and other operations
*
* @param `filebuf` file content buffer
*/
EachIndexFile(filebuf *FileBuf)
/**
* parse file preview tag
*
* @param `filebuf` file content buffer
* @return slice
*/
ParsePreview(filebuf *FileBuf) []Preview
/**
* parse code block tag
*
* @param `filebuf` file content buffer
* @return slice
*/
ParseCodeblock(filebuf *FileBuf) []CodeBlock
/**
* parse directory package info
* each file directory parse string join
*
* @param `filebuf`
* @return string file parse the only string
*/
ParsePackageInfo(filebuf *FileBuf) string
/**
* parse start
*/
ParseStart(config MainConfig)
/**
* parse end
*/
ParseEnd()
}</code></pre>
### [func MapParser](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L221-L223) <a name="f_func_MapParser___map_string_DocParser"><a/> [↩](#p_func_MapParser___map_string_DocParser) | [#](#f_func_MapParser___map_string_DocParser)
> get parsers<br/>
> key is parser name<br/>
> value is parser implement<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func MapParser() map[string]DocParser { ...... }</code></pre>
### [type Document struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L583-L587) <a name="f_type_Document_struct"><a/> [↩](#p_type_Document_struct) | [#](#f_type_Document_struct)
> document struct info<br/>
> <br/>
<pre><code class='go custom'>type Document struct {
SortTag int // sort tag
Title string // title plain text
Content string // markdown text or plain text
}</code></pre>
### [func ParseDocument](../../../../../src/github.com/slowfei/gosfdoc/parse.go#L290-L363) <a name="f_func_ParseDocument_fileBuf_+FileBuf____Document"><a/> [↩](#p_func_ParseDocument_fileBuf_+FileBuf____Document) | [#](#f_func_ParseDocument_fileBuf_+FileBuf____Document)
> parse public document content<br/>
> @param `fileBuf`<br/>
> @return document array<br/>
> <br/>
<pre><code class='go custom'>func ParseDocument(fileBuf *FileBuf) []Document { ...... }</code></pre>
### [type FileBuf struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L57-L63) <a name="f_type_FileBuf_struct"><a/> [↩](#p_type_FileBuf_struct) | [#](#f_type_FileBuf_struct)
> file content buffer<br/>
> <br/>
<pre><code class='go custom'>type FileBuf struct {
path string
fileInfo os.FileInfo
buf []byte
lineLenSum []int // 记录每行长度的总和
UserData interface{} // 自定义存储数据
}</code></pre>
### [func NewFileBuf](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L73-L97) <a name="f_func_NewFileBuf_fileContent___byte_path_string_info_os-FileInfo_filter_+regexp-Regexp__+FileBuf"><a/> [↩](#p_func_NewFileBuf_fileContent___byte_path_string_info_os-FileInfo_filter_+regexp-Regexp__+FileBuf) | [#](#f_func_NewFileBuf_fileContent___byte_path_string_info_os-FileInfo_filter_+regexp-Regexp__+FileBuf)
> new file buffer<br/>
> @param `fileContent`<br/>
> @param `path` file path<br/>
> @param `info` file info<br/>
> @param replace regexp, replace text to empty(''), call regexp.ReplaceAll func<br/>
> <br/>
<pre><code class='go custom'>func NewFileBuf(fileContent []byte, path string, info os.FileInfo, filter *regexp.Regexp) *FileBuf { ...... }</code></pre>
### [func (\*FileBuf) Byte](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L348-L360) <a name="f_func__+FileBuf__Byte_index_int___byte_bool_"><a/> [↩](#p_func__+FileBuf__Byte_index_int___byte_bool_) | [#](#f_func__+FileBuf__Byte_index_int___byte_bool_)
> by index get file buffer byte<br/>
> @param `index` buffer index<br/>
> @return `byte`<br/>
> @return `bool` success return true<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) Byte(index int) (byte, bool) { ...... }</code></pre>
### [func (\*FileBuf) FileInfo](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L385-L387) <a name="f_func__+FileBuf__FileInfo___os-FileInfo"><a/> [↩](#p_func__+FileBuf__FileInfo___os-FileInfo) | [#](#f_func__+FileBuf__FileInfo___os-FileInfo)
> get file info<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FileInfo() os.FileInfo { ...... }</code></pre>
### [func (\*FileBuf) Find](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L114-L116) <a name="f_func__+FileBuf__Find_rex_+regexp-Regexp____byte"><a/> [↩](#p_func__+FileBuf__Find_rex_+regexp-Regexp____byte) | [#](#f_func__+FileBuf__Find_rex_+regexp-Regexp____byte)
> regexp find bytes<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) Find(rex *regexp.Regexp) []byte { ...... }</code></pre>
### [func (\*FileBuf) FindAll](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L134-L136) <a name="f_func__+FileBuf__FindAll_rex_+regexp-Regexp______byte"><a/> [↩](#p_func__+FileBuf__FindAll_rex_+regexp-Regexp______byte) | [#](#f_func__+FileBuf__FindAll_rex_+regexp-Regexp______byte)
> regexp find all bytes<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FindAll(rex *regexp.Regexp) [][]byte { ...... }</code></pre>
### [func (\*FileBuf) FindAllSubmatch](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L144-L146) <a name="f_func__+FileBuf__FindAllSubmatch_rex_+regexp-Regexp________byte"><a/> [↩](#p_func__+FileBuf__FindAllSubmatch_rex_+regexp-Regexp________byte) | [#](#f_func__+FileBuf__FindAllSubmatch_rex_+regexp-Regexp________byte)
> Regexp.FindAllSubmatch<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FindAllSubmatch(rex *regexp.Regexp) [][][]byte { ...... }</code></pre>
### [func (\*FileBuf) FindAllSubmatchIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L164-L166) <a name="f_func__+FileBuf__FindAllSubmatchIndex_rex_+regexp-Regexp______int"><a/> [↩](#p_func__+FileBuf__FindAllSubmatchIndex_rex_+regexp-Regexp______int) | [#](#f_func__+FileBuf__FindAllSubmatchIndex_rex_+regexp-Regexp______int)
> Regexp.FindAllSubmatchIndex<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FindAllSubmatchIndex(rex *regexp.Regexp) [][]int { ...... }</code></pre>
### [func (\*FileBuf) FindSubmatch](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L124-L126) <a name="f_func__+FileBuf__FindSubmatch_rex_+regexp-Regexp______byte"><a/> [↩](#p_func__+FileBuf__FindSubmatch_rex_+regexp-Regexp______byte) | [#](#f_func__+FileBuf__FindSubmatch_rex_+regexp-Regexp______byte)
> regexp find submatch bytes<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FindSubmatch(rex *regexp.Regexp) [][]byte { ...... }</code></pre>
### [func (\*FileBuf) FindSubmatchIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L154-L156) <a name="f_func__+FileBuf__FindSubmatchIndex_rex_+regexp-Regexp____int"><a/> [↩](#p_func__+FileBuf__FindSubmatchIndex_rex_+regexp-Regexp____int) | [#](#f_func__+FileBuf__FindSubmatchIndex_rex_+regexp-Regexp____int)
> Regexp.FindSubmatchIndex<br/>
> @param `rex`<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) FindSubmatchIndex(rex *regexp.Regexp) []int { ...... }</code></pre>
### [func (\*FileBuf) LineLen](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L367-L369) <a name="f_func__+FileBuf__LineLen___int"><a/> [↩](#p_func__+FileBuf__LineLen___int) | [#](#f_func__+FileBuf__LineLen___int)
> get line length<br/>
> @return int<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) LineLen() int { ...... }</code></pre>
### [func (\*FileBuf) LineNumberByIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L233-L275) <a name="f_func__+FileBuf__LineNumberByIndex_beginIndex_endIndex_int____int"><a/> [↩](#p_func__+FileBuf__LineNumberByIndex_beginIndex_endIndex_int____int) | [#](#f_func__+FileBuf__LineNumberByIndex_beginIndex_endIndex_int____int)
> line number by begin and end index<br/>
> @param `beginIndex` buffer byte begin index<br/>
> @param `endIndex` end index<br/>
> @return []int [start line,end line], line number 1 start.<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) LineNumberByIndex(beginIndex, endIndex int) []int { ...... }</code></pre>
### [func (\*FileBuf) Path](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L376-L378) <a name="f_func__+FileBuf__Path___string"><a/> [↩](#p_func__+FileBuf__Path___string) | [#](#f_func__+FileBuf__Path___string)
> get file path<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) Path() string { ...... }</code></pre>
### [func (\*FileBuf) RowByIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L283-L318) <a name="f_func__+FileBuf__RowByIndex_lineNumber_int____byte"><a/> [↩](#p_func__+FileBuf__RowByIndex_lineNumber_int____byte) | [#](#f_func__+FileBuf__RowByIndex_lineNumber_int____byte)
> get row content by line number 1 start.<br/>
> @param `lineNumber` line number<br/>
> @param content of the specified line number<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) RowByIndex(lineNumber int) []byte { ...... }</code></pre>
### [func (\*FileBuf) String](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L394-L396) <a name="f_func__+FileBuf__String___string"><a/> [↩](#p_func__+FileBuf__String___string) | [#](#f_func__+FileBuf__String___string)
> buffer to string<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) String() string { ...... }</code></pre>
### [func (\*FileBuf) SubBytes](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L327-L339) <a name="f_func__+FileBuf__SubBytes_beginIndex_endIndex_int____byte"><a/> [↩](#p_func__+FileBuf__SubBytes_beginIndex_endIndex_int____byte) | [#](#f_func__+FileBuf__SubBytes_beginIndex_endIndex_int____byte)
> extracts the file buffer from a bytes<br/>
> @param `beginIndex`<br/>
> @param `endIndex`<br/>
> @return bytes<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) SubBytes(beginIndex, endIndex int) []byte { ...... }</code></pre>
### [func (\*FileBuf) SubNestAllIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L193-L195) <a name="f_func__+FileBuf__SubNestAllIndex_subNest_+SFSubUtil-SubNest_outBetweens_____int______int"><a/> [↩](#p_func__+FileBuf__SubNestAllIndex_subNest_+SFSubUtil-SubNest_outBetweens_____int______int) | [#](#f_func__+FileBuf__SubNestAllIndex_subNest_+SFSubUtil-SubNest_outBetweens_____int______int)
> all blocks subset<br/>
> @param `subNest`<br/>
> @param `outBetweens` rule out between index<br/>
> @return buffer start and end index list<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) SubNestAllIndex(subNest *SFSubUtil.SubNest, outBetweens [][]int) [][]int { ...... }</code></pre>
### [func (\*FileBuf) SubNestAllIndexByBetween](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L206-L214) <a name="f_func__+FileBuf__SubNestAllIndexByBetween_startIndex_endIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int______int"><a/> [↩](#p_func__+FileBuf__SubNestAllIndexByBetween_startIndex_endIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int______int) | [#](#f_func__+FileBuf__SubNestAllIndexByBetween_startIndex_endIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int______int)
> all blocks subset by buffer between index<br/>
> @param `startIndex`<br/>
> @param `endIndex`<br/>
> @param `subNest`<br/>
> @param `outBetweens` rule out between index<br/>
> @return buffer start and end index list<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) SubNestAllIndexByBetween(startIndex, endIndex int, subNest *SFSubUtil.SubNest, outBetweens [][]int) [][]int { ...... }</code></pre>
### [func (\*FileBuf) SubNestGetOutBetweens](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L222-L224) <a name="f_func__+FileBuf__SubNestGetOutBetweens_nests_---+SFSubUtil-SubNest______int"><a/> [↩](#p_func__+FileBuf__SubNestGetOutBetweens_nests_---+SFSubUtil-SubNest______int) | [#](#f_func__+FileBuf__SubNestGetOutBetweens_nests_---+SFSubUtil-SubNest______int)
> get between rule out points<br/>
> @param `nests` SubNest objects<br/>
> @return data source points [0] is start point [1] is end point<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) SubNestGetOutBetweens(nests ...*SFSubUtil.SubNest) [][]int { ...... }</code></pre>
### [func (\*FileBuf) SubNestIndex](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L176-L184) <a name="f_func__+FileBuf__SubNestIndex_startIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int____int"><a/> [↩](#p_func__+FileBuf__SubNestIndex_startIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int____int) | [#](#f_func__+FileBuf__SubNestIndex_startIndex_int_subNest_+SFSubUtil-SubNest_outBetweens_____int____int)
> block subset return range index<br/>
> param `startIndex` buffer start index<br/>
> param `subNest`<br/>
> param `outBetweens` rule out between index<br/>
> return buffer start and end index<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) SubNestIndex(startIndex int, subNest *SFSubUtil.SubNest, outBetweens [][]int) []int { ...... }</code></pre>
### [func (\*FileBuf) WriteFilepath](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L104-L106) <a name="f_func__+FileBuf__WriteFilepath_path_string__error"><a/> [↩](#p_func__+FileBuf__WriteFilepath_path_string__error) | [#](#f_func__+FileBuf__WriteFilepath_path_string__error)
> out file<br/>
> @param `path` out path<br/>
> <br/>
<pre><code class='go custom'>func (*FileBuf) WriteFilepath(path string) error { ...... }</code></pre>
### [type FileLink struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L573-L578) <a name="f_type_FileLink_struct"><a/> [↩](#p_type_FileLink_struct) | [#](#f_type_FileLink_struct)
<pre><code class='go custom'>type FileLink struct {
menuName string `json:"-"` // type belongs
Filename string // a tag show text
Link string // a tag link
}</code></pre>
### [type FileResultFunc func](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L127-L127) <a name="f_type_FileResultFunc_func"><a/> [↩](#p_type_FileResultFunc_func) | [#](#f_type_FileResultFunc_func)
> file scan result func<br/>
> @param `path`<br/>
> @param `result`<br/>
> <br/>
<pre><code class='go custom'>type FileResultFunc func</code></pre>
### [type Intro struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L537-L539) <a name="f_type_Intro_struct"><a/> [↩](#p_type_Intro_struct) | [#](#f_type_Intro_struct)
> markdown intro<br/>
> <br/>
<pre><code class='go custom'>type Intro struct {
Content []byte
}</code></pre>
### [func NewDefaultIntro](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L546-L548) <a name="f_func_NewDefaultIntro___+Intro"><a/> [↩](#p_func_NewDefaultIntro___+Intro) | [#](#f_func_NewDefaultIntro___+Intro)
> new default intro<br/>
> @return pointer type<br/>
> <br/>
<pre><code class='go custom'>func NewDefaultIntro() *Intro { ...... }</code></pre>
### [func ParseIntro](../../../../../src/github.com/slowfei/gosfdoc/parse.go#L388-L397) <a name="f_func_ParseIntro_fileBuf_+FileBuf__+Intro"><a/> [↩](#p_func_ParseIntro_fileBuf_+FileBuf__+Intro) | [#](#f_func_ParseIntro_fileBuf_+FileBuf__+Intro)
> commons parse file introduction content<br/>
> @param `fileBuf`<br/>
> @return introduction content<br/>
> <br/>
<pre><code class='go custom'>func ParseIntro(fileBuf *FileBuf) *Intro { ...... }</code></pre>
### [func (\*Intro) WriteFilepath](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L556-L561) <a name="f_func__+Intro__WriteFilepath_path_string__error"><a/> [↩](#p_func__+Intro__WriteFilepath_path_string__error) | [#](#f_func__+Intro__WriteFilepath_path_string__error)
> output file<br/>
> @param `path` output full path<br/>
> @return<br/>
> <br/>
<pre><code class='go custom'>func (*Intro) WriteFilepath(path string) error { ...... }</code></pre>
### [type MainConfig struct](../../../../../src/github.com/slowfei/gosfdoc/config.go#L51-L66) <a name="f_type_MainConfig_struct"><a/> [↩](#p_type_MainConfig_struct) | [#](#f_type_MainConfig_struct)
> main config info<br/>
> output `gosfdoc.json` use<br/>
> <br/>
<pre><code class='go custom'>type MainConfig struct {
path string `json:"-"` // private handle path, save console command path.
currentVersion string `json:"-"` // current output version, private record.
DocUrl string // custom link url to document http. e.g.: http://slowfei.github.io/gosfdoc/index.html
ScanPath string // scan document info file path, relative or absolute path, is "/" scan current config file directory path.
CodeLang []string // code languages
Outpath string // output document path, relative or absolute path.
OutAppendPath string // append output source code and markdown relative path(scan path join). defalut ""
CopyCode bool // copy source code to document directory. default false
CodeLinkRoot bool // source code link to root directory, 'CopyCode' is true was invalid, default true
HtmlTitle string // document html show title
DocTitle string // html top tabbar show title
MenuTitle string // html left menu show title
Languages []map[string]string // document support the language. key is directory name, value is show text.
FilterPaths []string // filter path, relative or absolute path
}</code></pre>
### [func (\*MainConfig) Check](../../../../../src/github.com/slowfei/gosfdoc/config.go#L104-L181) <a name="f_func__+MainConfig__Check____error_bool_"><a/> [↩](#p_func__+MainConfig__Check____error_bool_) | [#](#f_func__+MainConfig__Check____error_bool_)
> check config param value<br/>
> error value will update default.<br/>
> @return error<br/>
> @return bool fatal error is false, pass is true. (pass does not mean that there are no errors)<br/>
> <br/>
<pre><code class='go custom'>func (*MainConfig) Check() (error, bool) { ...... }</code></pre>
### [func (MainConfig) GithubLink](../../../../../src/github.com/slowfei/gosfdoc/config.go#L197-L241) <a name="f_func__MainConfig__GithubLink_relMDPath_string_isToMarkdown_bool__string"><a/> [↩](#p_func__MainConfig__GithubLink_relMDPath_string_isToMarkdown_bool__string) | [#](#f_func__MainConfig__GithubLink_relMDPath_string_isToMarkdown_bool__string)
> to github.com link path<br/>
> use on a tag href<br/>
> append path relative path<br/>
> e.g.: https://.../project/doc/v1_0_0/md/default/(github.com/slowfei)/(temp/gosfdoc.md)<br/>
> to: https://.../project/doc/v1_0_0/src/github.com/slowfei/gosfdoc.go (to source code path)<br/>
> to: https://.../project/doc/v1_0_0/md/default/github.com/test/test.md (to markdown path)<br/>
> @param `relMDPath` relative markdown out project path.<br/>
> relative path: $GOPATH/[github.com/slowfei]/projectname/( .../markdown.md )<br/>
> @param `isToMarkdown` to markdown link? false is source code access path<br/>
> @return use github.com to relative link. "../../../" or "../../src/[projectname]"<br/>
> <br/>
<pre><code class='go custom'>func (MainConfig) GithubLink(relMDPath string, isToMarkdown bool) string { ...... }</code></pre>
### [type MenuFile struct](../../../../../src/github.com/slowfei/gosfdoc/config.go#L257-L261) <a name="f_type_MenuFile_struct"><a/> [↩](#p_type_MenuFile_struct) | [#](#f_type_MenuFile_struct)
> html menu show helper struct<br/>
> src.html File list struct<br/>
> <br/>
<pre><code class='go custom'>type MenuFile struct {
MenuName string
Version string
List []FileLink
}</code></pre>
### [type MenuMarkdown struct](../../../../../src/github.com/slowfei/gosfdoc/config.go#L247-L251) <a name="f_type_MenuMarkdown_struct"><a/> [↩](#p_type_MenuMarkdown_struct) | [#](#f_type_MenuMarkdown_struct)
> html menu show helper struct<br/>
> index.html Markdown struct<br/>
> <br/>
<pre><code class='go custom'>type MenuMarkdown struct {
MenuName string
Version string
List []PackageInfo
}</code></pre>
### [type OperateResult int](../../../../../src/github.com/slowfei/gosfdoc/gosfdoc.go#L109-L109) <a name="f_type_OperateResult_int"><a/> [↩](#p_type_OperateResult_int) | [#](#f_type_OperateResult_int)
> operate result<br/>
> <br/>
<pre><code class='go custom'>type OperateResult int</code></pre>
### [type PackageInfo struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L566-L571) <a name="f_type_PackageInfo_struct"><a/> [↩](#p_type_PackageInfo_struct) | [#](#f_type_PackageInfo_struct)
> package info<br/>
> <br/>
<pre><code class='go custom'>type PackageInfo struct {
menuName string `json:"-"` // type belongs
Name string // package name plain text
Desc string // description plain text
Link string // markdown link
}</code></pre>
### [type Preview struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L592-L598) <a name="f_type_Preview_struct"><a/> [↩](#p_type_Preview_struct) | [#](#f_type_Preview_struct)
> preview struct info<br/>
> <br/>
<pre><code class='go custom'>type Preview struct {
SortTag string // sort tag
Level int // hierarchy level show. 0 is >, 1 is >>, 3 is >>> ...(markdown syntax)
ShowText string // show plain text
Anchor string // preferably unique, with the func link
DescText string // markdown brief description or implement objects, can empty.
}</code></pre>
### [type SortSet struct](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L618-L622) <a name="f_type_SortSet_struct"><a/> [↩](#p_type_SortSet_struct) | [#](#f_type_SortSet_struct)
> Preview,CodeBlock,Document sort implement<br/>
> <br/>
<pre><code class='go custom'>type SortSet struct {
previews []Preview
documents []Document
codeBlocks []CodeBlock
}</code></pre>
### [func (SortSet) Len](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L627-L639) <a name="f_func__SortSet__Len___int"><a/> [↩](#p_func__SortSet__Len___int) | [#](#f_func__SortSet__Len___int)
> sort Len() implement<br/>
> <br/>
<pre><code class='go custom'>func (SortSet) Len() int { ...... }</code></pre>
### [func (SortSet) Less](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L644-L656) <a name="f_func__SortSet__Less_i_j_int__bool"><a/> [↩](#p_func__SortSet__Less_i_j_int__bool) | [#](#f_func__SortSet__Less_i_j_int__bool)
> sort Less(...) implement<br/>
> <br/>
<pre><code class='go custom'>func (SortSet) Less(i, j int) bool { ...... }</code></pre>
### [func (SortSet) Swap](../../../../../src/github.com/slowfei/gosfdoc/struct.go#L661-L671) <a name="f_func__SortSet__Swap_i_j_int__"><a/> [↩](#p_func__SortSet__Swap_i_j_int__) | [#](#f_func__SortSet__Swap_i_j_int__)
> sort Swap(...) implement<br/>
> <br/>
<pre><code class='go custom'>func (SortSet) Swap(i, j int) { ...... }</code></pre>
|
slowfei/gosfdoc
|
doc/v0_1/md/default/github.com/slowfei/gosfdoc/gosfdoc.md
|
Markdown
|
mit
| 50,108
|
using Kliva.Models;
using System.Collections.Generic;
namespace Kliva.Helpers
{
public static class StatisticsHelper
{
private static StatisticsGroup CreateGroup(string name, int sort)
{
return new StatisticsGroup() { Name = name, Sort = sort };
}
public static void CreateDetailForGroup(StatisticsGroup group, int sort, string icon,
string displayName, string displayValue)
{
var detail = new StatisticsDetail()
{
Sort = sort,
Icon = icon,
DisplayDescription = displayName,
DisplayValue = displayValue,
Group = group
};
group.Details.Add(detail);
}
public static void CreateDetailForGroup(StatisticsGroup group, int sort, string icon,
string displayName, UserMeasurementUnitMetric metric)
{
var detail = new UserMeasurementUnitStatisticsDetail(metric)
{
Sort = sort,
Icon = icon,
DisplayDescription = displayName,
Group = group
};
group.Details.Add(detail);
}
public static StatisticsGroup CreateGroup(string groupName, int groupSort, string detailIcon,
string detailDisplayName, UserMeasurementUnitMetric detailMetric)
{
var group = CreateGroup(groupName, groupSort);
CreateDetailForGroup(group, 0, detailIcon, detailDisplayName, detailMetric);
return group;
}
public static StatisticsGroup CreateGroup(string groupName, int groupSort, string detailIcon,
string detailDisplayName, string detailDisplayValue)
{
var group = CreateGroup(groupName, groupSort);
CreateDetailForGroup(group, 0, detailIcon, detailDisplayName, detailDisplayValue);
return group;
}
private static void FillGroup(StatisticsGroup group, StatTotals stats)
{
CreateDetailForGroup(group, 0, "#", "activities", stats.Count.ToString());
CreateDetailForGroup(group, 1, "", "moving time",
$"{Converters.SecToTimeConverter.Convert(stats.MovingTime, typeof(int), null, string.Empty)}");
CreateDetailForGroup(group, 2, "", "total distance", stats.TotalDistanceUserMeasurementUnit);
CreateDetailForGroup(group, 3, "", "elevation gain", stats.ElevationGainUserMeasurementUnit);
}
public static List<StatisticsGroup> GetRunStatistics(Stats stats)
{
bool isMetric = MeasurementHelper.IsMetric(stats.MeasurementUnit);
var elevationDistanceUnitType = MeasurementHelper.GetElevationUnitType(isMetric);
var distanceUnitType = MeasurementHelper.GetDistanceUnitType(isMetric);
var runStatisticGroups = new List<StatisticsGroup>();
StatisticsGroup recent = CreateGroup("recent", 0);
FillGroup(recent, stats.RecentRunTotals);
runStatisticGroups.Add(recent);
StatisticsGroup year = CreateGroup("year total", 1);
FillGroup(year, stats.YearToDateRunTotals);
runStatisticGroups.Add(year);
StatisticsGroup allTime = CreateGroup("all time total", 2);
FillGroup(allTime, stats.RunTotals);
runStatisticGroups.Add(allTime);
return runStatisticGroups;
}
public static List<StatisticsGroup> GetRideStatistics(Stats stats)
{
bool isMetric = MeasurementHelper.IsMetric(stats.MeasurementUnit);
var elevationDistanceUnitType = MeasurementHelper.GetElevationUnitType(isMetric);
var distanceUnitType = MeasurementHelper.GetDistanceUnitType(isMetric);
var runStatisticGroups = new List<StatisticsGroup>();
StatisticsGroup recent = CreateGroup("recent", 0);
FillGroup(recent, stats.RecentRideTotals);
runStatisticGroups.Add(recent);
StatisticsGroup year = CreateGroup("year total", 1);
FillGroup(year, stats.YearToDateRideTotals);
runStatisticGroups.Add(year);
StatisticsGroup allTime = CreateGroup("all time total", 2);
FillGroup(allTime, stats.RideTotals);
runStatisticGroups.Add(allTime);
return runStatisticGroups;
}
}
}
|
AppCreativity/Kliva
|
src/Kliva/Helpers/StatisticsHelper.cs
|
C#
|
mit
| 4,478
|
describe('ds.utils.loadGoogleMapsAPI()', function() {
this.timeout(20000);
it('should load google maps api', function(done) {
ds.utils.loadGoogleMapsAPI().done(function(google) {
expect(google).to.be.an('object');
done();
});
});
it('should not make a http request second time google is requested', function(done) {
var start = new Date().getTime();
ds.utils.loadGoogleMapsAPI().done(function() {
var elapsed = new Date().getTime() - start;
expect(elapsed).to.be.lessThan(10);
done();
});
});
});
|
DanskSupermarked/ds-frontend
|
test/utils/load-google-maps-api.js
|
JavaScript
|
mit
| 619
|
import { Resource } from '../api-resource';
import logger from 'kolibri.lib.logging';
const logging = logger.getLogger(__filename);
export default class FacilityUserResource extends Resource {
static resourceName() {
return 'facilityuser';
}
getCurrentFacility() {
const promise = new Promise(
resolve => {
this.client({ path: this.currentFacilityUrl() }).then(
response => {
resolve(response.entity);
},
response => {
logging.error('An error occurred', response);
}
);
},
reject => {
reject(reject);
}
);
return promise;
}
get currentFacilityUrl() {
return this.urls[`currentfacility_list`];
}
}
|
christianmemije/kolibri
|
kolibri/core/assets/src/api-resources/facilityUser.js
|
JavaScript
|
mit
| 745
|
(function(){dust.register("red-tpl.tl",body_0);function body_0(chk,ctx){return chk.write("<div class=\"col-md-8\"><div class=\"row\"><div class=\"col-md-22 col-md-offset-1 red subpagecontrolhighlight\"> </div></div></div>");}return body_0;})();
|
BlackCloudConcepts/requireunderpin
|
dusttemplates/red-tpl.js
|
JavaScript
|
mit
| 249
|
.date-picker {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
-webkit-flex-flow: column;
-moz-flex-flow: column;
-ms-flex-flow: column;
-o-flex-flow: column;
flex-flow: column;
flex-flow: column;
-webkit-box-flex: 1 0 auto;
-moz-box-flex: 1 0 auto;
-ms-box-flex: 1 0 auto;
-ms-flex: 1 0 auto;
-webkit-flex: 1 0 auto;
flex: 1 0 auto;
}
.date-picker,
.date-picker * {
box-sizing: border-box;
}
.date-picker .dp-footer {
flex-direction: row;
-webkit-flex-flow: row;
-moz-flex-flow: row;
-ms-flex-flow: row;
-o-flex-flow: row;
flex-flow: row;
flex-flow: row;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.date-picker .dp-body {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
-webkit-flex-flow: column;
-moz-flex-flow: column;
-ms-flex-flow: column;
-o-flex-flow: column;
flex-flow: column;
flex-flow: column;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.date-picker .dp-table {
width: 100%;
height: 100%;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: column;
-webkit-flex-flow: column;
-moz-flex-flow: column;
-ms-flex-flow: column;
-o-flex-flow: column;
flex-flow: column;
flex-flow: column;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.date-picker .dp-row {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: row;
-webkit-flex-flow: row;
-moz-flex-flow: row;
-ms-flex-flow: row;
-o-flex-flow: row;
flex-flow: row;
flex-flow: row;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.date-picker .dp-cell {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
-webkit-box-pack: center;
flex-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
.date-picker .dp-nav-table {
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
flex-direction: row;
-webkit-flex-flow: row;
-moz-flex-flow: row;
-ms-flex-flow: row;
-o-flex-flow: row;
flex-flow: row;
flex-flow: row;
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
width: 100%;
}
.date-picker .dp-nav-table .dp-cell {
-webkit-box-flex: 7;
-moz-box-flex: 7;
-ms-box-flex: 7;
-ms-flex: 7;
-webkit-flex: 7;
flex: 7;
}
.date-picker .dp-nav-table .dp-nav-cell {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-ms-box-flex: 1;
-ms-flex: 1;
-webkit-flex: 1;
flex: 1;
}
/*
* Theme
*/
.date-picker {
overflow: hidden;
background: #fff;
font-size: 14px;
width: 100%;
height: 100%;
border: 1px solid rgba(0, 0, 0, 0.12);
}
.date-picker .dp-header {
background: #3F51B5;
color: #FFF;
}
.date-picker .dp-table {
border-color: rgba(0, 0, 0, 0.12);
}
.date-picker .dp-table .dp-row {
border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.date-picker .dp-table .dp-row:last-child {
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.date-picker .dp-table .dp-cell {
cursor: pointer;
padding: 5px;
background: inherit;
}
.date-picker .dp-table .dp-cell:not(:first-child) {
border-left: 1px solid rgba(0, 0, 0, 0.12);
}
.date-picker .dp-table .dp-cell.dp-prev,
.date-picker .dp-table .dp-cell.dp-next {
color: #5c5c5c;
background: inherit;
}
.date-picker .dp-table .dp-cell.dp-in-range {
background: #e2f0ff;
}
.date-picker .dp-table .dp-cell:hover {
color: inherit;
font-weight: inherit;
background: #C5CAE9;
}
.date-picker .dp-table .dp-cell.dp-disabled {
cursor: default;
color: #adadad;
background: inherit;
}
.date-picker .dp-table .dp-cell.dp-current {
color: #FF4081;
background: inherit;
}
.date-picker .dp-table .dp-cell.dp-value {
color: #FFF;
font-weight: bold;
background: #3F51B5;
}
.date-picker .dp-table .dp-cell.dp-in-range.dp-current,
.date-picker .dp-table .dp-cell.dp-in-range.dp-value {
background: #e2f0ff;
}
.date-picker .dp-table .dp-cell.dp-month {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.date-picker .dp-table .dp-cell.dp-week-day-name {
font-weight: bold;
cursor: default;
background: inherit;
}
.date-picker .dp-footer {
padding: 3px;
-webkit-justify-content: center;
-webkit-box-pack: center;
flex-pack: center;
-ms-flex-pack: center;
justify-content: center;
border-top-width: 0px;
}
.date-picker .dp-footer .dp-footer-selected,
.date-picker .dp-footer .dp-footer-today {
padding: 5px 15px;
border-width: 1px;
cursor: pointer;
}
.date-picker .dp-body {
overflow: hidden;
}
.date-picker .dp-nav-view,
.date-picker .dp-nav-cell,
.date-picker .dp-week-day-name {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
.date-picker .dp-nav-view,
.date-picker .dp-nav-cell {
cursor: pointer;
}
.date-picker .dp-nav-cell {
background: inherit;
}
.date-picker .dp-nav-cell:hover {
background: #303F9F;
}
.date-picker .dp-nav-view {
background: inherit;
}
.date-picker .dp-nav-view:hover {
background: #303F9F;
}
.date-picker .dp-nav-table .dp-cell {
border-top-width: 0px;
border-bottom-width: 0px;
padding: 8px;
font-weight: bold;
}
.date-picker .dp-decade-view,
.date-picker .dp-year-view,
.date-picker .dp-month-view {
touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}
|
MrSaints/historyx
|
assets/css/react-date-picker.css
|
CSS
|
mit
| 6,242
|
module.exports = (config) => {
const defaults = {
isWarmingUp: (event) => event.source === 'serverless-plugin-warmup',
onWarmup: (event) => console.log('Exiting early via warmup Middleware'),
waitForEmptyEventLoop: null
}
const options = Object.assign({}, defaults, config)
return ({
before: (handler, next) => {
if (options.isWarmingUp(handler.event)) {
options.onWarmup(handler.event)
if (options.waitForEmptyEventLoop !== null) {
handler.context.callbackWaitsForEmptyEventLoop = Boolean(options.waitForEmptyEventLoop)
}
return handler.callback(null, 'warmup')
}
next()
}
})
}
|
middyjs/middy
|
packages/warmup/index.js
|
JavaScript
|
mit
| 672
|
//
// ThirdMacros.h
// MiAiApp
//
// Created by 徐阳 on 2017/5/18.
// Copyright © 2017年 徐阳. All rights reserved.
//
#ifndef ThirdMacros_h
#define ThirdMacros_h
#endif /* ThirdMacros_h */
|
HarrisLee/Utils
|
UniversalApp-master/MiAiApp/Define/ThirdMacros.h
|
C
|
mit
| 203
|
---
layout: page
title: Koch Electronics Seminar
date: 2016-05-24
author: Philip Hudson
tags: weekly links, java
status: published
summary: Maecenas nec sollicitudin diam. Curabitur.
banner: images/banner/wedding.jpg
booking:
startDate: 07/08/2019
endDate: 07/09/2019
ctyhocn: SBYMDHX
groupCode: KES
published: true
---
Curabitur vitae elit mauris. Aenean posuere, mauris id tristique finibus, mauris tortor tempor metus, in gravida sapien ex eget tortor. Ut a venenatis purus, ut venenatis magna. Mauris non odio tincidunt, faucibus quam id, pharetra enim. Maecenas pretium diam mi, quis molestie neque egestas a. Phasellus a magna et nisl rutrum volutpat ac et elit. Morbi odio diam, volutpat in risus ac, feugiat iaculis risus. Aliquam erat volutpat. Sed augue diam, malesuada sit amet bibendum eget, ullamcorper eget tellus. Integer blandit tellus laoreet dolor euismod varius. Vestibulum ullamcorper non nibh quis gravida. Nunc sodales, ex nec iaculis vulputate, nibh nulla sagittis mauris, ut aliquam sapien ante id orci. Fusce venenatis metus in elementum lacinia. Morbi pellentesque sapien non ipsum rhoncus imperdiet. Sed eu vehicula urna, laoreet congue leo. Vivamus condimentum odio eu nulla gravida pulvinar.
1 Pellentesque et lectus in turpis tempus ullamcorper eget in neque
1 Sed lacinia est id velit tincidunt tempor
1 Praesent convallis magna eu magna tempus convallis.
Etiam hendrerit nisl et fringilla mattis. Nullam vitae vestibulum orci, eu vestibulum nisl. Nam efficitur arcu nisl, non varius nunc viverra sit amet. Pellentesque eget felis fermentum, volutpat eros in, consequat nunc. Sed sodales orci ut dolor sollicitudin dapibus. Aliquam tempor enim eget neque iaculis, vel posuere leo condimentum. Ut faucibus mauris sit amet quam tristique, ut dignissim elit tristique. Vivamus fermentum mi quis libero venenatis maximus.
Sed semper vestibulum dolor vel aliquam. Morbi tristique eros nisl. Pellentesque hendrerit augue quis lorem pharetra elementum. Aliquam posuere diam ac tortor auctor pulvinar. Aenean pharetra bibendum ligula eu pharetra. Praesent lacus mi, scelerisque porta justo vel, ornare sodales urna. In pellentesque est eros, at venenatis turpis lobortis eget. Mauris tristique nunc in nunc mattis, vitae semper turpis pellentesque. Praesent vulputate eu ligula ut aliquam. Sed ultrices ex nibh, at maximus magna imperdiet id. Nam scelerisque nisi ut justo egestas, eu mollis lacus aliquet. Nulla bibendum feugiat convallis.
|
KlishGroup/prose-pogs
|
pogs/S/SBYMDHX/KES/index.md
|
Markdown
|
mit
| 2,474
|
import logging
import sqlite3
from pyfcm import FCMNotification
def insert_token(token):
try:
con = sqlite3.connect('fcm.db')
cur = con.cursor()
cur.execute('CREATE TABLE IF NOT EXISTS tokens(token TEXT)')
cur.execute('INSERT INTO tokens VALUES (?)', (token, ))
con.commit()
finally:
if cur:
cur.close()
if con:
con.close()
def notify_all(message_title=None, message_body=None):
con = sqlite3.connect('fcm.db')
con.row_factory = lambda cursor, row: row[0]
cur = con.cursor()
cur.execute('CREATE TABLE IF NOT EXISTS tokens(token TEXT)')
cur.execute('SELECT * FROM tokens')
registration_ids = [row for row in cur.fetchall()]
if len(registration_ids) > 0:
noti = FCMNotification('API-KEY')
result = noti.notify_multiple_devices(registration_ids=registration_ids,
message_title=message_title,
message_body=message_body)
return result
|
walkover/auto-tracking-cctv-gateway
|
gateway/firebase/fcm.py
|
Python
|
mit
| 1,072
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.