code
stringlengths 3
1.05M
| repo_name
stringlengths 4
116
| path
stringlengths 3
942
| language
stringclasses 30
values | license
stringclasses 15
values | size
int32 3
1.05M
|
---|---|---|---|---|---|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>string: 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.13.0 / string - 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>
string
<small>
8.5.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2021-04-08 21:07:48 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-04-08 21:07:48 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.13.0 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.1 Official release 4.10.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/string"
license: "LGPL 2"
build: [make]
install: [make "install"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:string" "keyword:ascii character" "category:Miscellaneous/Coq Extensions" "date:2002-03" ]
authors: [ "Laurent Théry <>" ]
bug-reports: "https://github.com/coq-contribs/string/issues"
dev-repo: "git+https://github.com/coq-contribs/string.git"
synopsis: "Definition of strings in Coq"
description: "Strings as list of characters."
url {
src: "https://github.com/coq-contribs/string/archive/v8.5.0.tar.gz"
checksum: "md5=7c066e35b0b7ed1242241a6332e12092"
}
</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-string.8.5.0 coq.8.13.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.13.0).
The following dependencies couldn't be met:
- coq-string -> 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-string.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">
<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.10.1-2.0.6/released/8.13.0/string/8.5.0.html | HTML | mit | 6,632 |
using SMSServices.Models;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Validation;
using System.Data.SqlClient;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Web.Http;
using WebApi.ErrorHelper;
namespace SMSServices.Controllers
{
public class TeachersSubjectsController : ApiController
{
private SMSEntities entities = new SMSEntities();
// GET api/<controller>
[Route("api/TeachersSubjects/All/{teacherId}")]
//public IEnumerable<TeachersSubjects> Get()
public HttpResponseMessage Get(int teacherId)
{
entities.Configuration.ProxyCreationEnabled = false;
var query = entities.TeachersSubjects//.Include("Classes").Include("Shifts");
//query.Include("Sections")
.Where(t => t.TeacherID == teacherId)
.Select(e => new
{
e.TeacherSubjectID,
e.TeacherID,
TeacherName = e.Teachers.Name,
e.SubjectID,
SubjectCode = e.Subjects.Code,
SubjectName = e.Subjects.Name,
SubjectNameAr = e.Subjects.NameAr,
Id = e.SubjectID,
Code = e.Subjects.Code,
Name = e.Subjects.Name,
NameAr = e.Subjects.NameAr
});
//return query.ToList(); //entities.TeachersSubjects.Include("Classes").Include("Shifts").Include("Sections");
return this.Request.CreateResponse(HttpStatusCode.OK, query.ToList());
}
// POST api/<controller>
[Route("api/TeachersSubjects/{TeacherID}/{SubjectIDs}")]
public HttpResponseMessage Post(int TeacherID, string SubjectIDs)
{
try
{
foreach (string ID in SubjectIDs.Split(','))
{
entities.TeachersSubjects.Add(new TeachersSubjects()
{
TeacherID = TeacherID,
SubjectID = Convert.ToInt32(ID)
});
}
entities.SaveChanges();
return Request.CreateResponse(HttpStatusCode.OK, "Done ...");
}
//catch (Exception e)
//{
// return Request.CreateResponse(HttpStatusCode.BadRequest, "I have some issue ...");
//}
catch (DbUpdateException dbEx)
{
throw dbEx;
//return Request.CreateResponse(HttpStatusCode.BadRequest, "I have more issue ...");
//StringBuilder sb = new StringBuilder();
//foreach (var item in dbEx.EntityValidationErrors)
//{
// sb.Append(item + " errors: ");
// foreach (var i in item.ValidationErrors)
// {
// sb.Append(i.PropertyName + " : " + i.ErrorMessage);
// }
// sb.Append(Environment.NewLine);
//}
////throw new ApiDataException(GetErrorCode(dbEx), sb.ToString(), HttpStatusCode.BadRequest);
//throw new ApiDataException(1021, "too many errors ...", HttpStatusCode.BadRequest);
//return Request.CreateResponse(HttpStatusCode.OK, sb.ToString());
}
//catch (DbUpdateException ex)
//{
// throw ex;
// //return Request.CreateResponse(HttpStatusCode.BadRequest, ex);
//}
}
//// GET api/<controller>/5/1/2
//[Route("api/TeachersSubjects/{ShiftId}/{ClassId}/{SectionId}")]
//public TeachersSubjects Get(int ShiftId, int ClassId, int SectionId)
//{
// entities.Configuration.ProxyCreationEnabled = false;
// TeachersSubjects TeacherSubject = entities.TeachersSubjects
// .Where(t => t.ShiftID == ShiftId && t.ClassID == ClassId && t.SectionID == SectionId).FirstOrDefault();
// if (TeacherSubject == null)
// {
// TeacherSubject = new TeachersSubjects() { ClassID = 0 };
// }
// return TeacherSubject;
//}
//[Route("api/TeachersSubjectsById/{id}")]
//public TeachersSubjects Get(int id)
//{
// entities.Configuration.ProxyCreationEnabled = false;
// return entities.TeachersSubjects.Where(t => t.TeacherSubjectID == id).FirstOrDefault();
//}
// POST api/<controller>
//public HttpResponseMessage Post(TeachersSubjects teacher)
//{
// try
// {
// entities.TeachersSubjects.Add(new TeachersSubjects()
// {
// TeacherID = teacher.TeacherID,
// SubjectID = teacher.SubjectID
// });
// entities.SaveChanges();
// return Request.CreateResponse(HttpStatusCode.OK, "Done ...");
// }
// //catch (Exception e)
// //{
// // return Request.CreateResponse(HttpStatusCode.BadRequest, "I have some issue ...");
// //}
// catch (DbUpdateException dbEx)
// {
// throw dbEx;
// //return Request.CreateResponse(HttpStatusCode.BadRequest, "I have more issue ...");
// //StringBuilder sb = new StringBuilder();
// //foreach (var item in dbEx.EntityValidationErrors)
// //{
// // sb.Append(item + " errors: ");
// // foreach (var i in item.ValidationErrors)
// // {
// // sb.Append(i.PropertyName + " : " + i.ErrorMessage);
// // }
// // sb.Append(Environment.NewLine);
// //}
// ////throw new ApiDataException(GetErrorCode(dbEx), sb.ToString(), HttpStatusCode.BadRequest);
// //throw new ApiDataException(1021, "too many errors ...", HttpStatusCode.BadRequest);
// //return Request.CreateResponse(HttpStatusCode.OK, sb.ToString());
// }
// //catch (DbUpdateException ex)
// //{
// // throw ex;
// // //return Request.CreateResponse(HttpStatusCode.BadRequest, ex);
// //}
//}
private int GetErrorCode(DbEntityValidationException dbEx)
{
int ErrorCode = (int)HttpStatusCode.BadRequest;
if (dbEx.InnerException != null && dbEx.InnerException.InnerException != null)
{
if (dbEx.InnerException.InnerException is SqlException)
{
ErrorCode = (dbEx.InnerException.InnerException as SqlException).Number;
}
}
return ErrorCode;
}
// PUT api/<controller>/5
public void Put(TeachersSubjects TeacherSubject)
{
try
{
var entity = entities.TeachersSubjects.Find(TeacherSubject.TeacherSubjectID);
if (entity != null)
{
entities.Entry(entity).CurrentValues.SetValues(TeacherSubject);
entities.SaveChanges();
}
}
catch //(DbUpdateException)
{
throw;
}
}
/*
// DELETE api/<controller>/5
public void Delete(int id)
{
try
{
var teacher = new TeachersSubjects { TeacherId = id };
if (teacher != null)
{
entities.Entry(teacher).State = EntityState.Deleted;
entities.TeachersSubjects.Remove(teacher);
entities.SaveChanges();
}
}
catch (Exception)
{
throw;
}
}
*/
[HttpPost]
[Route("api/RemoveTeacherSubject/{id}")]
public HttpResponseMessage RemoveTeacherSubject(int id)
{
try
{
var TeacherSubject = new TeachersSubjects { TeacherSubjectID = id };
if (TeacherSubject != null)
{
entities.Entry(TeacherSubject).State = EntityState.Deleted;
entities.TeachersSubjects.Remove(TeacherSubject);
entities.SaveChanges();
return Request.CreateResponse(HttpStatusCode.OK, "Removed...");
}
else
return Request.CreateResponse(HttpStatusCode.NotFound, "not found...");
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.BadRequest, ex);
//return Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message +
// " inner ex: " + ex.InnerException !=null ? ex.InnerException.Message : "null" );
//throw;
}
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
entities.Dispose();
}
base.Dispose(disposing);
}
}
} | zraees/sms-project | SMSServices/SMSServices/Controllers/TeachersSubjectsController.cs | C# | mit | 9,436 |
<?php
namespace QnNguyen\EdtUbxNS\Condition;
/**
* Class MatchInArray
* Check if an element exists in an array
* @package QnNguyen\EdtUbxNS\Condition
*/
class MatchInArray extends PropertyCondition
{
/**
* @param $value
* @return bool
*/
function typeCheck($value)
{
return is_array($value);
}
/**
* @param $value
* @return boolean
*/
function doTest($value)
{
foreach ($value as $arrayItem) {
if ($this->_regex_test($this->regexPattern, $arrayItem)) {
return true;
}
}
return false;
}
} | nquocnghia/EdtUbx | src/Condition/MatchInArray.php | PHP | mit | 629 |
// Week 5 - Task 7
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.io.*;
public class TCPSerServer
{
private static ServerSocket servSock;
private static final int PORT = 1234;
public static void main(String[] args)
{
System.out.println("!!!Opening port...\n");
try
{
servSock = new ServerSocket(PORT);
}
catch(IOException e)
{
System.out.println("Unable to attach to port!");
System.exit(1);
}
do
{
run();
}while (true);
}
private static void run()
{
Socket link = null;
try{
link = servSock.accept();
PrintWriter out = new PrintWriter(link.getOutputStream(),true);
ObjectInputStream istream = new ObjectInputStream (link.getInputStream());
Person p = null;
while(true){
try{
p = (Person)istream.readObject();
System.out.println("SERVER - Received: New object.\n");
System.out.println("SERVER - Received: Person name=" + p.getName());
System.out.println("SERVER - Received: Person age=" + p.getAge());
System.out.println("SERVER - Received: Person address=" + p.getAddress());
out.println("Person object received.");
}
catch (Exception e) {
System.out.println("Exception in run");
System.out.println("\n* Closing connection... *");
break;
}
}
}
catch(IOException e)
{
e.printStackTrace();
}
finally
{
try
{
System.out.println("\n* Closing connection... *");
link.close();
}
catch(IOException e)
{
System.out.println("Unable to disconnect!");
System.exit(1);
}
}
}
}
| kieranhogan13/Java | Distributed Systems/Labs/Week 7_Lab_Review/Week_3_T7/TCPSerServer.java | Java | mit | 1,769 |
<?php
namespace Easybill\ZUGFeRD211\Model;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\XmlElement;
class DocumentLineDocument
{
/**
* @Type("string")
* @XmlElement(cdata = false, namespace = "urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100")
* @SerializedName("LineID")
*/
public string $lineId;
public static function create(string $lineId): self
{
$self = new self();
$self->lineId = $lineId;
return $self;
}
}
| easybill/zugferd-php | src/zugferd211/Model/DocumentLineDocument.php | PHP | mit | 584 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>menhirlib: 43 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 / menhirlib - 20200123</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
menhirlib
<small>
20200123
<span class="label label-success">43 s 🏆</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-11-16 15:55:17 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-11-16 15:55:17 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 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.08.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.08.1 Official release 4.08.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
synopsis: "A support library for verified Coq parsers produced by Menhir"
maintainer: "[email protected]"
authors: [
"Jacques-Henri Jourdan <[email protected]>"
]
homepage: "https://gitlab.inria.fr/fpottier/menhir"
dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git"
bug-reports: "[email protected]"
license: "LGPL-3.0-or-later"
build: [
[make "-C" "coq-menhirlib" "-j%{jobs}%"]
]
install: [
[make "-C" "coq-menhirlib" "install"]
]
depends: [
"coq" { >= "8.7" & < "8.12" }
]
conflicts: [
"menhir" { != "20200123" }
]
tags: [
"date:2020-01-23"
"logpath:MenhirLib"
]
url {
src:
"https://gitlab.inria.fr/fpottier/menhir/-/archive/20200123/archive.tar.gz"
checksum: [
"md5=91aeae45fbf781e82ec3fe636be6ad49"
"sha512=4a7c4a72d4437940a0f62d402f783efcf357dde6f0a9e9f164c315148776e4642a822b6472f1e6e641164d110bc1ee05a6c1ad4a733f5defe4603b6072c1a34f"
]
}
</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-menhirlib.20200123 coq.8.7.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-menhirlib.20200123 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>13 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-menhirlib.20200123 coq.8.7.1</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>43 s</dd>
</dl>
<h2>Installation size</h2>
<p>Total: 6 M</p>
<ul>
<li>2 M <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_complete.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Main.vo</code></li>
<li>1 M <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_complete.vo</code></li>
<li>333 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter.vo</code></li>
<li>264 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_correct.vo</code></li>
<li>156 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_safe.vo</code></li>
<li>124 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Automaton.vo</code></li>
<li>105 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_complete.glob</code></li>
<li>87 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Alphabet.vo</code></li>
<li>80 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Grammar.vo</code></li>
<li>42 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter.glob</code></li>
<li>41 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_classes.vo</code></li>
<li>38 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_complete.glob</code></li>
<li>33 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Alphabet.glob</code></li>
<li>33 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_complete.v</code></li>
<li>20 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_correct.glob</code></li>
<li>18 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_safe.glob</code></li>
<li>18 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter.v</code></li>
<li>15 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_complete.v</code></li>
<li>11 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Grammar.glob</code></li>
<li>9 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Automaton.glob</code></li>
<li>8 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Alphabet.v</code></li>
<li>8 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_safe.v</code></li>
<li>7 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Main.glob</code></li>
<li>7 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Interpreter_correct.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Automaton.v</code></li>
<li>6 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_classes.glob</code></li>
<li>6 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Grammar.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Main.v</code></li>
<li>3 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Validator_classes.v</code></li>
<li>2 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Version.vo</code></li>
<li>1 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Version.glob</code></li>
<li>1 K <code>../ocaml-base-compiler.4.08.1/lib/coq/user-contrib/MenhirLib/Version.v</code></li>
</ul>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq-menhirlib.20200123</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.08.1-2.0.5/released/8.7.1/menhirlib/20200123.html | HTML | mit | 10,617 |
---
layout: attachment
title: pic_md
date:
type: attachment
published: false
status: inherit
categories: []
tags: []
meta:
_wp_attached_file: 2013/05/pic_md-1p2ic7x.png
_wp_attachment_metadata: a:6:{s:5:"width";s:3:"343";s:6:"height";s:3:"412";s:14:"hwstring_small";s:22:"height='96'
width='79'";s:4:"file";s:26:"2013/05/pic_md-1p2ic7x.png";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:26:"pic_md-1p2ic7x-150x150.png";s:5:"width";s:3:"150";s:6:"height";s:3:"150";}s:6:"medium";a:3:{s:4:"file";s:26:"pic_md-1p2ic7x-249x300.png";s:5:"width";s:3:"249";s:6:"height";s:3:"300";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}
author:
login: rachels
email: [email protected]
display_name: Rachel
first_name: Rachel
last_name: Staples
---
| vscooper/vscooper.github.io | old_site/_attachments/pic_md.html | HTML | mit | 979 |
#include "nofx_ofSetOrientation.h"
#include "ofAppRunner.h"
namespace nofx
{
namespace AppRunner
{
NAN_METHOD(nofx_ofSetOrientation)
{
ofSetOrientation((ofOrientation) args[0]->Uint32Value());
NanReturnUndefined();
} // !nofx_ofSetOrientation
} // !namespace AppRunner
} // !namespace nofx | sepehr-laal/nofx | nofx/nofx_ofAppRunner/nofx_ofSetOrientation.cc | C++ | mit | 368 |
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("6. Fold and Sum")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("6. Fold and Sum")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c1bd8400-c942-4329-ae49-a7752bbf68bd")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
| tanyta78/ProgramingFundamentals | 05Dictionaries/LabDictionariesLambdaLINQ/6. Fold and Sum/Properties/AssemblyInfo.cs | C# | mit | 1,406 |
#Active Projects
| FSND2015/FSND2015-Side-Project-Ideas | Active.md | Markdown | mit | 17 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>relation-extraction: 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 / relation-extraction - 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>
relation-extraction
<small>
8.5.0
<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: "[email protected]"
homepage: "https://github.com/coq-contribs/relation-extraction"
license: "GPL 3"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/RelationExtraction"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:extraction" "keyword:inductive relations" "keyword:semantics" "category:Computer Science/Semantics and Compilation/Compilation" "date:2011" ]
authors: [ "Catherine Dubois <>" "David Delahaye <>" "Pierre-Nicolas Tollitte <>" ]
bug-reports: "https://github.com/coq-contribs/relation-extraction/issues"
dev-repo: "git+https://github.com/coq-contribs/relation-extraction.git"
synopsis: "Functions extraction from inductive relations"
description: """
This plugin introduces a new set of extraction commands that
generates functional code form inductive specifications."""
flags: light-uninstall
url {
src:
"https://github.com/coq-contribs/relation-extraction/archive/v8.5.0.tar.gz"
checksum: "md5=081bb10e77ea72dfef13df6b9f30248b"
}
</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-relation-extraction.8.5.0 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-relation-extraction -> 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-relation-extraction.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.06.1-2.0.5/released/8.7.1+2/relation-extraction/8.5.0.html | HTML | mit | 7,137 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_15) on Thu Mar 10 09:38:24 BRT 2011 -->
<TITLE>
DAO.exception
</TITLE>
<META NAME="date" CONTENT="2011-03-10">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../DAO/exception/package-summary.html" target="classFrame">DAO.exception</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Exceptions</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="InfraestruturaException.html" title="class in DAO.exception" target="classFrame">InfraestruturaException</A>
<BR>
<A HREF="ObjetoNaoEncontradoException.html" title="class in DAO.exception" target="classFrame">ObjetoNaoEncontradoException</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
| dayse/gesplan | doc/DAO/exception/package-frame.html | HTML | mit | 1,026 |
package top.cardone.func.vx.usercenter.userDepartment;
import com.google.common.base.Charsets;
import lombok.extern.log4j.Log4j2;
import lombok.val;
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.core.io.Resource;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StopWatch;
import top.cardone.ConsumerApplication;
import top.cardone.context.ApplicationContextHolder;
import java.io.IOException;
@Log4j2
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes = ConsumerApplication.class, value = {"spring.profiles.active=test"}, webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
public class D0002FuncTest {
@Value("http://localhost:${server.port:8765}${server.servlet.context-path:}/vx/usercenter/userDepartment/d0002.json")
private String funcUrl;
@Value("file:src/test/resources/top/cardone/func/vx/usercenter/userDepartment/D0002FuncTest.func.input.json")
private Resource funcInputResource;
@Value("file:src/test/resources/top/cardone/func/vx/usercenter/userDepartment/D0002FuncTest.func.output.json")
private Resource funcOutputResource;
private HttpEntity<String> httpEntity;
private int pressure = 10000;
@Before
public void setup() throws Exception {
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
headers.set("Accept", MediaType.APPLICATION_JSON_UTF8_VALUE);
headers.set("token", ApplicationContextHolder.getBean(org.apache.shiro.authc.credential.PasswordService.class).encryptPassword("admin"));
headers.set("username", "admin");
if (!funcInputResource.exists()) {
FileUtils.write(funcInputResource.getFile(), "{}", Charsets.UTF_8);
}
String input = FileUtils.readFileToString(funcInputResource.getFile(), Charsets.UTF_8);
httpEntity = new HttpEntity<>(input, headers);
}
@Test
public void func() throws RuntimeException {
String output = new org.springframework.boot.test.web.client.TestRestTemplate().postForObject(funcUrl, httpEntity, String.class);
try {
FileUtils.write(funcOutputResource.getFile(), output, Charsets.UTF_8);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
@Test
public void pressureFunc() throws Exception {
for (int i = 0; i < pressure; i++) {
val sw = new StopWatch();
sw.start(funcUrl);
new org.springframework.boot.test.web.client.TestRestTemplate().postForObject(funcUrl, httpEntity, String.class);
sw.stop();
if (sw.getTotalTimeMillis() > 500) {
log.error(sw.prettyPrint());
} else if (log.isDebugEnabled()) {
log.debug(sw.prettyPrint());
}
log.debug("pressured:" + (i + 1));
}
}
} | yht-fand/cardone-platform-usercenter | consumer/src/test/java/top/cardone/func/vx/usercenter/userDepartment/D0002FuncTest.java | Java | mit | 3,282 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using InvoiceProcessing.Messages.Commands;
using NServiceBus;
using Shared;
namespace Client
{
class Program
{
static void Main(string[] args)
{
MainAsync().GetAwaiter().GetResult();
}
static async Task MainAsync()
{
var numberOfInvoices = 150;
Console.Title = "Client";
Console.WriteLine($"Press a key to start a batch of {numberOfInvoices} customers.");
Console.ReadKey();
var endpointConfiguration = new EndpointConfiguration("Client");
endpointConfiguration.ApplyCommonConfiguration();
endpointConfiguration.SendOnly();
// Routing
var transport = endpointConfiguration.UseTransport<LearningTransport>();
transport.Routing().RouteToEndpoint(typeof(CreateInvoiceProposals).Assembly, "InvoiceProcessing");
// Start endpoint
var sendOnlyEndpoint = await Endpoint.Start(endpointConfiguration);
var customerIds = new List<Guid>();
for (int i = 0; i < numberOfInvoices; i++)
{
customerIds.Add(Guid.NewGuid());
}
var msg = new CreateInvoiceProposals();
msg.BillingRunId = Guid.NewGuid();
msg.Customers = customerIds;
await sendOnlyEndpoint.Send(msg);
await sendOnlyEndpoint.Stop();
Console.WriteLine("Send out batch, press any key to quit...");
Console.ReadKey();
}
}
}
| dvdstelt/batchprocessing | Client/Program.cs | C# | mit | 1,659 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>minic: 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.0 / minic - 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>
minic
<small>
8.5.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-24 12:53:50 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-24 12:53:50 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.9.0 Formal proof management system
num 0 The Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.03.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.03.0 Official 4.03.0 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/minic"
license: "LGPL 2"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/MiniC"]
depends: [
"ocaml"
"coq" {>= "8.5" & < "8.6~"}
]
tags: [ "keyword:denotational semantics" "keyword:compilation" "category:Computer Science/Semantics and Compilation/Semantics" ]
authors: [ "Eduardo Giménez <>" "Emmanuel Ledinot <>" ]
bug-reports: "https://github.com/coq-contribs/minic/issues"
dev-repo: "git+https://github.com/coq-contribs/minic.git"
synopsis: "Semantics of a subset of the C language"
description: """
This contribution defines the denotational semantics of MiniC, a
sub-set of the C language. This sub-set is sufficiently large to
contain any program generated by lustre2C.
The denotation function describing the semantics of a MiniC program
actually provides an interpreter for the program."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/minic/archive/v8.5.0.tar.gz"
checksum: "md5=8d252b80c4fc1e1fce6d89b5a64c0b96"
}
</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-minic.8.5.0 coq.8.9.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.9.0).
The following dependencies couldn't be met:
- coq-minic -> coq < 8.6~ -> ocaml < 4.03.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-minic.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.03.0-2.0.5/released/8.9.0/minic/8.5.0.html | HTML | mit | 7,217 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>presburger: 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 / presburger - 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>
presburger
<small>
8.8.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-02-26 23:22:14 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-02-26 23:22:14 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-m4 1 Virtual package relying on m4
coq 8.10.0 Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.09.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.09.0 Official release 4.09.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/presburger"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Presburger"]
depends: [
"ocaml"
"coq" {>= "8.8" & < "8.9~"}
]
tags: [ "keyword: Integers" "keyword: Arithmetic" "keyword: Decision Procedure" "keyword: Presburger" "category: Mathematics/Logic/Foundations" "category: Mathematics/Arithmetic and Number Theory/Miscellaneous" "category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures" "date: March 2002" ]
authors: [ "Laurent Théry" ]
bug-reports: "https://github.com/coq-contribs/presburger/issues"
dev-repo: "git+https://github.com/coq-contribs/presburger.git"
synopsis: "Presburger's algorithm"
description: """
A formalization of Presburger's algorithm as stated in
the initial paper by Presburger."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/presburger/archive/v8.8.0.tar.gz"
checksum: "md5=a1b064cf124b40bae0df70e22630d2d6"
}
</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-presburger.8.8.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-presburger -> 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-presburger.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">
<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.09.0-2.0.5/released/8.10.0/presburger/8.8.0.html | HTML | mit | 7,100 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>V8 API Reference Guide for node.js v0.1.92: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">V8 API Reference Guide for node.js v0.1.92
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1_boolean.html">Boolean</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">v8::Boolean Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classv8_1_1_boolean.html">v8::Boolean</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>BooleanValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#adc2a7a92a120675bbd4c992163a20869">Equals</a>(Handle< Value > that) const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Int32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>IntegerValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#aaee0b144087d20eae02314c9393ff80f">IsArray</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a0aceb7645e71b096df5cd73d1252b1b0">IsBoolean</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a8bc11fab0aded4a805722ab6df173cae">IsDate</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a7ac61a325c18af8dcb6d7d5bf47d2503">IsExternal</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a68c0296071d01ca899825d7643cf495a">IsFalse</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a05532a34cdd215f273163830ed8b77e7">IsFunction</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a01e1db51c65b2feace248b7acbf71a2c">IsInt32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#aa2c6ed8ef832223a7e2cd81e6ac61c78">IsNull</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a1bd51e3e55f67c65b9a8f587fbffb7c7">IsNumber</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a355b7991c5c978c0341f6f961b63c5a2">IsObject</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#ab23a34b7df62806808e01b0908bf5f00">IsString</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#a8f27462322186b295195eecb3e81d6d7">IsTrue</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classv8_1_1_value.html#a783c89631bac4ef3c4b909f40cc2b8d8">IsUint32</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#aea287b745656baa8a12a2ae1d69744b6">IsUndefined</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>New</b>(bool value) (defined in <a class="el" href="classv8_1_1_boolean.html">v8::Boolean</a>)</td><td class="entry"><a class="el" href="classv8_1_1_boolean.html">v8::Boolean</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">static</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>NumberValue</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>StrictEquals</b>(Handle< Value > that) const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classv8_1_1_value.html#ae810be0ae81a87f677592d0176daac48">ToArrayIndex</a>() const </td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToBoolean</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToDetailString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToInt32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToInteger</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToNumber</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToObject</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ToString</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>ToUint32</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Uint32Value</b>() const (defined in <a class="el" href="classv8_1_1_value.html">v8::Value</a>)</td><td class="entry"><a class="el" href="classv8_1_1_value.html">v8::Value</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>Value</b>() const (defined in <a class="el" href="classv8_1_1_boolean.html">v8::Boolean</a>)</td><td class="entry"><a class="el" href="classv8_1_1_boolean.html">v8::Boolean</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 11 2015 23:44:42 for V8 API Reference Guide for node.js v0.1.92 by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
| v8-dox/v8-dox.github.io | e72b7b8/html/classv8_1_1_boolean-members.html | HTML | mit | 12,646 |
'use strict';
// Configuring the Articles module
angular.module('categories').run(['Menus',
function(Menus) {
// Set top bar menu items
// Menus.addMenuItem('topbar', 'Categories', 'categories', 'item', '/categories(?:/[^/]+)?', null, null, 9);
// Set admin menu items
Menus.addMenuItem('admin', 'Categories', 'categories', 'dropdown', '/categories(/create)?');
Menus.addSubMenuItem('admin', 'categories', 'List Categories', 'categories');
Menus.addSubMenuItem('admin', 'categories', 'New Category', 'categories/create');
}
]);
| crosscent/platform | public/modules/categories/config/categories.client.config.js | JavaScript | mit | 544 |
# Angular HTML Window
AngularJS module that provides a draggable and resizable window directive.
Based on https://github.com/rlamana/Ventus
**This project is no longer maintained! However, feel free to fork and PR.**
## How to use
### Install via npm
Install the package over npm.
```
npm i angular-html-window
```
### Include in your project
Include the css and javascript in your html file.
```html
<link rel="stylesheet" type="text/css" href="path/to/library/ngHtmlWindow.css" />
<script type="text/javascript" src="path/to/library/ngHtmlWindow.js" />
```
And include it as a dependency in your application.
```javascript
angular.module('demo', ['ngHtmlWindow']);
```
### Creating a window
You can create windows by including the directive in your HTML. Use ng-repeat to iterate through a collection in the scope.
```html
<ng-html-window options="options" ng-repeat="window in windows">
<!--your content goes here-->
</ng-html-window>
```
### Options
Specify options and handlers in the options object. These are the standard values:
```javascript
options = {
title: 'Untitled window's,
width: 400,
height: 200,
x: 0,
y: 0,
minWidth: 200,
maxWidth: Infinity,
minHeight: 100,
maxHeight: Infinity,
resizable: true,
appendTo: element.parent(),
onClose: function() {
return true;
}
};
```
**Important:** When using ng-repeat, you should provide a onClose handler function that deletes the window from your collection.
## Events
Events are broadcast on the scope where the window is attached. This means they are available to any controller inside of the ng-html-window container.
### ngWindow.resize
Dispatched when a window is resized, debounced to occur only every 50ms.
```javascript
$scope.$on('ngWindow.resize', function(e, windowObject){});
```
### ngWindow.active
Only one window can have the focus. When a window gets focused (by clicking it), a broadcast with a reference to the window is sent to all child scopes:
```javascript
$scope.$on('ngWindow.active', function(e, windowObject){});
```
### ngWindow.inactive
The same goes for when a window looses the focus:
```javascript
$scope.$on('ngWindow.inactive', function(e, windowObject){});
```
## Z-Handling
The extent of z-values used for the window layering ranges from and to those values.
```javascript
var baseZ = 1000,
maxZ = 2000;
```
Be sure to consider this when you want to display other elements on top or bellow the windows.
| acjim/angular-html-window | README.md | Markdown | mit | 2,480 |
<html>
<title>代客訂位訂餐</title>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
</head>
<body>
<div><form>
姓名 : <input type="text" id="name"> <br>
電話:<input type="text" id="phonenum"> <br>
日期:<select name="date_" id="date_">
<?php for($i=0; $i<7; $i++){
$temp = $dates[$i];
echo "<option value=\"".$temp."\">".$temp."</option>";
} ?>
</select> <br>
時段:<select name="time_" id="time_">
<option value="0">11:00~13:00</option>
<option value="1">13:00~15:00</option>
<option value="2">17:00~19:00</option>
<option value="3">19:00~21:00</option>
</select> <br>
人數:<select name="quantity" id="quantity">
<?php for($i=1; $i<11; $i++){
echo "<option value=\"".$i."\">".$i."</option>";
} ?>
</select> <br>
<button class="myButton" id="submit">確認</button>
<button class="myButton" type="button" onclick="window.location.replace('/CI/index.php/reservation');">回到大廳</button> <br>
</form></div>
<script>
$(document).ready(function(){
$("#submit").click(function() {
var order_confirm = confirm("是否訂菜?");
$.ajax({
url : "upload_seat_reservation_by_manager",
type : "POST",
dataType : "text",
data : {"date_" : $('#date_').val(), "time_" : $('#time_').val(), "quantity" : $('#quantity').val(), "name" : $('#name').val(), "phonenum" : $('#phonenum').val()},
success : function(response){
var check = response;
if(check == "c"){
if(!order_confirm){
window.location.replace("/CI/index.php/reservation/create_reservation");
}else{
window.location.replace("/CI/index.php/reservation/menu");
}
}
else if(check == "n"){
alert("no enough seat");
}
else{
alert("invalid value");
}
}
});
});
});
</script>
</body>
</html>
<style>
body {
background: url("http://127.0.0.1/CI/image/index_back.jpg");
background-size: cover;
background-repeat: no-repeat;
font-style: oblique;
font-size: 18px;
font-weight: bold;
}
div {
background-color: #DDDDDD;
width: 350px;
height: 280px;
margin-top: 150px;
margin:0px auto;
border-radius: 10px;
box-shadow: 10px 10px 5px #111111;
text-align:center;
line-height:40px;
}
input {
border: 1px solid #BBBBBB; //改變外框
background: #fff; // 背景色
/* 邊角圓弧化,不同瀏器覧設定不同 */
-moz-border-radius:3px; // Firefox
-webkit-border-radius: 3px; // Safari 和 Chrome
border-radius: 3px; // Opera 10.5+
}
a{
text-decoration:none;
color: #666666;
}
.myButton {
margin-top: 15px;
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9));
background:-moz-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);
background:-webkit-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);
background:-o-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);
background:-ms-linear-gradient(top, #f9f9f9 5%, #e9e9e9 100%);
background:linear-gradient(to bottom, #f9f9f9 5%, #e9e9e9 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9',GradientType=0);
background-color:#f9f9f9;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #807480;
display:inline-block;
cursor:pointer;
color:#666666;
font-family:Arial;
font-size:15px;
font-weight:bold;
padding:11px 24px;
text-decoration:none;
text-shadow:0px 1px 0px #ffffff;
}
.myButton:hover {
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9));
background:-moz-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%);
background:-webkit-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%);
background:-o-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%);
background:-ms-linear-gradient(top, #e9e9e9 5%, #f9f9f9 100%);
background:linear-gradient(to bottom, #e9e9e9 5%, #f9f9f9 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9',GradientType=0);
background-color:#e9e9e9;
}
.myButton:active {
position:relative;
top:1px;
}
</style> | floydxiu/Restaurant-reservation-system | application/views/seat_reservation_by_manager.php | PHP | mit | 4,390 |
/**
* Created by zhang on 16/5/19.
*/
$.myjq = function () {
alert("hello my jQuery")
};
//js的扩展
$.fn.myjq=function(){
$(this).text("hello")
}; | qiang437587687/pythonBrother | jQueryFirst/jQuery扩展和noConflict/myjQuery.js | JavaScript | mit | 161 |
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SocketClient.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
| Lime-Parallelogram/Socket-Tutorial | C Sharp/SocketClient/SocketClient/Properties/Settings.Designer.cs | C# | mit | 1,099 |
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Module Hierarchy</title>
<link rel="stylesheet" href="epydoc.css" type="text/css" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="#204080"
alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
> Trees </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="file:///G:/Web%20Development/epydoc/">EIC Site-packages</a></th>
</tr></table></th>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr valign="top">
<td width="100%"> </td>
<td>
<table cellpadding="0" cellspacing="0">
<!-- hide/show private -->
<tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
onclick="toggle_private();">hide private</a>]</span></td></tr>
<tr><td align="right"><span class="options"
>[<a href="frames.html" target="_top">frames</a
>] | <a href="module-tree.html"
target="_top">no frames</a>]</span></td></tr>
</table>
</td>
</tr>
</table>
<center><b>
[ <a href="module-tree.html">Module Hierarchy</a>
| <a href="class-tree.html">Class Hierarchy</a> ]
</b></center><br />
<h1 class="epydoc">Module Hierarchy</h1>
<ul class="nomargin-top">
<li> <strong class="uidlink"><a href="bbpy-module.html">bbpy</a></strong>: <em class="summary">The BBpy module contains methods and classes that allow Python
programs to interface with BBx data files and structures.</em>
<ul>
<li> <strong class="uidlink"><a href="bbpy.config-module.html">bbpy.config</a></strong>: <em class="summary">The config module contains classes for getting the BBx environment
configuration information.</em> </li>
<li> <strong class="uidlink"><a href="bbpy.files-module.html">bbpy.files</a></strong>
<ul>
<li> <strong class="uidlink"><a href="bbpy.files.mkeyed-module.html">bbpy.files.mkeyed</a></strong>: <em class="summary">Python utilities for reading and writing MKEYED files</em> </li>
<li> <strong class="uidlink"><a href="bbpy.files.template-module.html">bbpy.files.template</a></strong> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="bbpy.functions-module.html">bbpy.functions</a></strong>
<ul>
<li class="private"> <strong class="uidlink"><a href="bbpy.functions.bitwise-module.html" onclick="show_private();">bbpy.functions.bitwise</a></strong> </li>
<li class="private"> <strong class="uidlink"><a href="bbpy.functions.checksums-module.html" onclick="show_private();">bbpy.functions.checksums</a></strong> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="bbpy.strings-module.html">bbpy.strings</a></strong> </li>
<li> <strong class="uidlink"><a href="bbpy.util-module.html">bbpy.util</a></strong>: <em class="summary">Utility functions for BBPy</em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="dateutil-module.html">dateutil</a></strong>: <em class="summary">Copyright (c) 2003-2010 Gustavo Niemeyer
<[email protected]></em>
<ul>
<li> <strong class="uidlink"><a href="dateutil.easter-module.html">dateutil.easter</a></strong>: <em class="summary">Copyright (c) 2003-2007 Gustavo Niemeyer
<[email protected]></em> </li>
<li> <strong class="uidlink"><a href="dateutil.parser-module.html">dateutil.parser</a></strong>: <em class="summary">Copyright (c) 2003-2007 Gustavo Niemeyer
<[email protected]></em> </li>
<li> <strong class="uidlink"><a href="dateutil.relativedelta-module.html">dateutil.relativedelta</a></strong>: <em class="summary">Copyright (c) 2003-2010 Gustavo Niemeyer
<[email protected]></em> </li>
<li> <strong class="uidlink"><a href="dateutil.rrule-module.html">dateutil.rrule</a></strong>: <em class="summary">Copyright (c) 2003-2010 Gustavo Niemeyer
<[email protected]></em> </li>
<li> <strong class="uidlink"><a href="dateutil.tz-module.html">dateutil.tz</a></strong>: <em class="summary">Copyright (c) 2003-2007 Gustavo Niemeyer
<[email protected]></em> </li>
<li> <strong class="uidlink"><a href="dateutil.tzwin-module.html">dateutil.tzwin</a></strong> </li>
<li> <strong class="uidlink"><a href="dateutil.zoneinfo-module.html">dateutil.zoneinfo</a></strong>: <em class="summary">Copyright (c) 2003-2005 Gustavo Niemeyer
<[email protected]></em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy-module.html">eicpy</a></strong>
<ul>
<li> <strong class="uidlink"><a href="eicpy.address-module.html">eicpy.address</a></strong> </li>
<li> <strong class="uidlink"><a href="eicpy.beta-module.html">eicpy.beta</a></strong>: <em class="summary">Check for agent allowed to access Beta features</em> </li>
<li> <strong class="uidlink"><a href="eicpy.bridge-module.html">eicpy.bridge</a></strong>
<ul>
<li> <strong class="uidlink"><a href="eicpy.bridge.acordxml-module.html">eicpy.bridge.acordxml</a></strong> </li>
<li> <strong class="uidlink"><a href="eicpy.bridge.bridge-module.html">eicpy.bridge.bridge</a></strong> </li>
<li> <strong class="uidlink"><a href="eicpy.bridge.common-module.html">eicpy.bridge.common</a></strong> </li>
<li> <strong class="uidlink"><a href="eicpy.bridge.common_itc-module.html">eicpy.bridge.common_itc</a></strong> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy.cgierror-module.html">eicpy.cgierror</a></strong>: <em class="summary">Traceback formatting for Equity's Python programs, inspired by
Ka-Ping Yee's cgitb.</em> </li>
<li> <strong class="uidlink"><a href="eicpy.coverage-module.html">eicpy.coverage</a></strong>: <em class="summary">Coverage library for accessing rate coverages</em> </li>
<li> <strong class="uidlink"><a href="eicpy.data-module.html">eicpy.data</a></strong>: <em class="summary">This module encapsulates the best (fastest) way to retrieve data
from legacy sources.</em> </li>
<li> <strong class="uidlink"><a href="eicpy.dcs-module.html">eicpy.dcs</a></strong>: <em class="summary">Module for interfacing with DCS.</em> </li>
<li> <strong class="uidlink"><a href="eicpy.elf-module.html">eicpy.elf</a></strong>: <em class="summary">Base classes for eLink currently only used for endorsements
(endorsement/edriver.py, etc.)</em> </li>
<li> <strong class="uidlink"><a href="eicpy.encrypt-module.html">eicpy.encrypt</a></strong>: <em class="summary">A replacement for SUBR.ENCRYPT; reverse-engineering ENCRYPT:</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement-module.html">eicpy.endorsement</a></strong>: <em class="summary">The endorsement module contains methods and classes for eLink
endorsements</em>
<ul>
<li> <strong class="uidlink"><a href="eicpy.endorsement.edriver-module.html">eicpy.endorsement.edriver</a></strong>: <em class="summary">Endorsement driver that uses the elf.py Driver class</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.endapply-module.html">eicpy.endorsement.endapply</a></strong>: <em class="summary">Endorsement request applied</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.epolicy-module.html">eicpy.endorsement.epolicy</a></strong>: <em class="summary">Endorsement policy that uses the elf.py Policy class</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.erequest-module.html">eicpy.endorsement.erequest</a></strong>: <em class="summary">Endorsement request classes</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.ersdriver-module.html">eicpy.endorsement.ersdriver</a></strong>: <em class="summary">Endorsement request driver class</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.ersvehicle-module.html">eicpy.endorsement.ersvehicle</a></strong>: <em class="summary">Endorsement request vehicle class</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.evehicle-module.html">eicpy.endorsement.evehicle</a></strong>: <em class="summary">Endorsement vehicle that uses the elf.py Vehicle class</em> </li>
<li> <strong class="uidlink"><a href="eicpy.endorsement.misc-module.html">eicpy.endorsement.misc</a></strong>: <em class="summary">Miscellaneous utilities for endorsements</em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy.erroremail-module.html">eicpy.erroremail</a></strong>: <em class="summary">This script is designed to handle error emails for the web side for
both Python and BBx.</em> </li>
<li> <strong class="uidlink"><a href="eicpy.insureds-module.html">eicpy.insureds</a></strong>
<ul>
<li> <strong class="uidlink"><a href="eicpy.insureds.mobile-module.html">eicpy.insureds.mobile</a></strong>
<ul>
<li> <strong class="uidlink"><a href="eicpy.insureds.mobile.eicmobile-module.html">eicpy.insureds.mobile.eicmobile</a></strong> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy.insureds.pesession-module.html">eicpy.insureds.pesession</a></strong>: <em class="summary">Sessions to work like previously created BBx PE.VALIDATE.SESSION</em> </li>
<li> <strong class="uidlink"><a href="eicpy.insureds.policelink-module.html">eicpy.insureds.policelink</a></strong>: <em class="summary">Polic-elink main python library script that's used heavily in
mobile</em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy.irupload-module.html">eicpy.irupload</a></strong>: <em class="summary">ImageRight Upload utilities</em> </li>
<li> <strong class="uidlink"><a href="eicpy.misc-module.html">eicpy.misc</a></strong>: <em class="summary">Miscellaneous functions</em> </li>
<li> <strong class="uidlink"><a href="eicpy.multiagent-module.html">eicpy.multiagent</a></strong>: <em class="summary">Multi state agent utilities</em> </li>
<li> <strong class="uidlink"><a href="eicpy.name_build-module.html">eicpy.name_build</a></strong> </li>
<li> <strong class="uidlink"><a href="eicpy.paypal-module.html">eicpy.paypal</a></strong>: <em class="summary">PayPal payment library</em> </li>
<li> <strong class="uidlink"><a href="eicpy.pdf-module.html">eicpy.pdf</a></strong>: <em class="summary">PDF handling for eLink including Printall functionality</em> </li>
<li> <strong class="uidlink"><a href="eicpy.rpc-module.html">eicpy.rpc</a></strong>
<ul>
<li class="private"> <strong class="uidlink"><a href="eicpy.rpc.driver-module.html" onclick="show_private();">eicpy.rpc.driver</a></strong>: <em class="summary">Location tools for XML-RPC.</em> </li>
<li class="private"> <strong class="uidlink"><a href="eicpy.rpc.location-module.html" onclick="show_private();">eicpy.rpc.location</a></strong>: <em class="summary">Location tools for XML-RPC.</em> </li>
<li class="private"> <strong class="uidlink"><a href="eicpy.rpc.vehicle-module.html" onclick="show_private();">eicpy.rpc.vehicle</a></strong>: <em class="summary">Vehicle tools for XML-RPC.</em> </li>
<li class="private"> <strong class="uidlink"><a href="eicpy.rpc.voucher-module.html" onclick="show_private();">eicpy.rpc.voucher</a></strong>: <em class="summary">Voucher tools for XML-RPC.</em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="eicpy.sql-module.html">eicpy.sql</a></strong>: <em class="summary">This module contains ezsql and supporting classes and functions.</em> </li>
<li> <strong class="uidlink"><a href="eicpy.vehicle-module.html">eicpy.vehicle</a></strong>: <em class="summary">Vehicle lookups including VIN, makes and models</em> </li>
<li> <strong class="uidlink"><a href="eicpy.www-module.html">eicpy.www</a></strong>: <em class="summary">Python module for Building a Web page using Zope Page Templates</em> </li>
<li> <strong class="uidlink"><a href="eicpy.yourpay-module.html">eicpy.yourpay</a></strong>: <em class="summary">YourPay request and response utility</em> </li>
</ul>
</li>
<li> <strong class="uidlink"><a href="simplejson-module.html">simplejson</a></strong>: <em class="summary">JSON (JavaScript Object Notation) <http://json.org> is a
subset of JavaScript syntax (ECMA-262 3rd edition) used as a
lightweight data interchange format.</em>
<ul>
<li class="private"> <strong class="uidlink"><a href="simplejson._speedups-module.html" onclick="show_private();">simplejson._speedups</a></strong>: <em class="summary">simplejson speedups</em> </li>
<li class="private"> <strong class="uidlink"><a href="simplejson.decoder-module.html" onclick="show_private();">simplejson.decoder</a></strong>: <em class="summary">Implementation of JSONDecoder</em> </li>
<li class="private"> <strong class="uidlink"><a href="simplejson.encoder-module.html" onclick="show_private();">simplejson.encoder</a></strong>: <em class="summary">Implementation of JSONEncoder</em> </li>
<li> <strong class="uidlink"><a href="simplejson.ordered_dict-module.html">simplejson.ordered_dict</a></strong>: <em class="summary">Drop-in replacement for collections.OrderedDict by Raymond
Hettinger</em> </li>
<li class="private"> <strong class="uidlink"><a href="simplejson.scanner-module.html" onclick="show_private();">simplejson.scanner</a></strong>: <em class="summary">JSON token scanner</em> </li>
<li> <strong class="uidlink"><a href="simplejson.tool-module.html">simplejson.tool</a></strong>: <em class="summary">Command-line tool to validate and pretty-print JSON</em> </li>
</ul>
</li>
</ul>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
bgcolor="#a0c0ff" cellspacing="0">
<tr valign="middle">
<!-- Tree link -->
<th bgcolor="#70b0f0" class="navbar-select"
> Trees </th>
<!-- Index link -->
<th> <a
href="identifier-index.html">Indices</a> </th>
<!-- Help link -->
<th> <a
href="help.html">Help</a> </th>
<!-- Project homepage -->
<th class="navbar" align="right" width="100%">
<table border="0" cellpadding="0" cellspacing="0">
<tr><th class="navbar" align="center"
><a class="navbar" target="_top" href="file:///G:/Web%20Development/epydoc/">EIC Site-packages</a></th>
</tr></table></th>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
<tr>
<td align="left" class="footer">
<a href="epydoc-log.html">Generated by Epydoc
3.0.1 on Mon Oct 8 11:15:33 2012</a>
</td>
<td align="right" class="footer">
<a target="mainFrame" href="http://epydoc.sourceforge.net"
>http://epydoc.sourceforge.net</a>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
// Private objects are initially displayed (because if
// javascript is turned off then we want them to be
// visible); but by default, we want to hide them. So hide
// them unless we have a cookie that says to show them.
checkCookie();
// -->
</script>
</body>
</html>
| chauncey/there-be-docs | static/docs/epydocs/module-tree.html | HTML | mit | 16,369 |
// Generated by CoffeeScript 1.10.0
var Graphics;
Graphics = (function() {
function Graphics(ctx, viewport1) {
this.ctx = ctx;
this.viewport = viewport1;
this.transform = {
x: 0,
y: 0,
rotation: 0,
scale: 1
};
}
Graphics.prototype.translate = function(dx, dy) {
this.transform.x += dx;
this.transform.y += dy;
return this.ctx.translate(dx, dy);
};
Graphics.prototype.setColor = function(color) {
this.ctx.fillStyle = color;
return this.ctx.strokeStyle = color;
};
Graphics.prototype.setLineWidth = function(linewidth) {
return this.ctx.lineWidth = linewidth;
};
Graphics.prototype.setFont = function(fontdef) {
return this.ctx.font = fontdef;
};
Graphics.prototype.drawArc = function(x, y, r, sAngle, eAngle) {
this.ctx.beginPath();
this.ctx.arc(x, y, r, sAngle, eAngle, true);
return this.ctx.stroke();
};
Graphics.prototype.fillArc = function(x, y, r, sAngle, eAngle) {
this.ctx.beginPath();
this.ctx.arc(x, y, r, sAngle, eAngle, true);
return this.ctx.fill();
};
Graphics.prototype.drawCircle = function(x, y, r) {
return this.drawArc(x, y, r, 0, 2 * Math.PI);
};
Graphics.prototype.fillCircle = function(x, y, r) {
return this.fillArc(x, y, r, 0, 2 * Math.PI);
};
Graphics.prototype.drawRect = function(x, y, width, height) {
return this.ctx.strokeRect(x, y, width, height);
};
Graphics.prototype.fillRect = function(x, y, width, height) {
return this.ctx.fillRect(x, y, width, height);
};
Graphics.prototype.drawText = function(x, y, text) {
return this.ctx.fillText(text, x, y);
};
Graphics.prototype.drawLine = function(x1, y1, x2, y2) {
this.ctx.beginPath();
this.ctx.moveTo(x1, y1);
this.ctx.lineTo(x2, y2);
return this.ctx.stroke();
};
Graphics.prototype.drawPoly = function(ptlist) {
var i, len, pt;
this.ctx.beginPath();
this.ctx.moveTo(ptlist[0].x, ptlist[0].y);
for (i = 0, len = ptlist.length; i < len; i++) {
pt = ptlist[i];
this.ctx.lineTo(pt.x, pt.y);
}
this.ctx.closePath();
return this.ctx.stroke();
};
Graphics.prototype.fillPoly = function(ptlist) {
var i, len, pt;
this.ctx.beginPath();
this.ctx.moveTo(ptlist[0].x, ptlist[0].y);
for (i = 0, len = ptlist.length; i < len; i++) {
pt = ptlist[i];
this.ctx.lineTo(pt.x, pt.y);
}
this.ctx.closePath();
return this.ctx.fill();
};
return Graphics;
})();
exports.createFromCanvas = function(canvas, viewport) {
return new Graphics(canvas.getContext('2d'), viewport);
};
| aziis98/node-canvas-graphics-wrapper | graphics.js | JavaScript | mit | 2,626 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
<A href="W29357.pdfs.html#outline" target="contents">Outline</a><br><A href="W29357.pdfs.html#1" target="contents" >Page 1</a><br>
<A href="W29357.pdfs.html#2" target="contents" >Page 2</a><br>
<A href="W29357.pdfs.html#3" target="contents" >Page 3</a><br>
<A href="W29357.pdfs.html#4" target="contents" >Page 4</a><br>
<A href="W29357.pdfs.html#5" target="contents" >Page 5</a><br>
<A href="W29357.pdfs.html#6" target="contents" >Page 6</a><br>
<A href="W29357.pdfs.html#7" target="contents" >Page 7</a><br>
<A href="W29357.pdfs.html#8" target="contents" >Page 8</a><br>
<A href="W29357.pdfs.html#9" target="contents" >Page 9</a><br>
<A href="W29357.pdfs.html#10" target="contents" >Page 10</a><br>
<A href="W29357.pdfs.html#11" target="contents" >Page 11</a><br>
<A href="W29357.pdfs.html#12" target="contents" >Page 12</a><br>
<A href="W29357.pdfs.html#13" target="contents" >Page 13</a><br>
<A href="W29357.pdfs.html#14" target="contents" >Page 14</a><br>
<A href="W29357.pdfs.html#15" target="contents" >Page 15</a><br>
<A href="W29357.pdfs.html#16" target="contents" >Page 16</a><br>
<A href="W29357.pdfs.html#17" target="contents" >Page 17</a><br>
<A href="W29357.pdfs.html#18" target="contents" >Page 18</a><br>
<A href="W29357.pdfs.html#19" target="contents" >Page 19</a><br>
<A href="W29357.pdfs.html#20" target="contents" >Page 20</a><br>
<A href="W29357.pdfs.html#21" target="contents" >Page 21</a><br>
<A href="W29357.pdfs.html#22" target="contents" >Page 22</a><br>
<A href="W29357.pdfs.html#23" target="contents" >Page 23</a><br>
<A href="W29357.pdfs.html#24" target="contents" >Page 24</a><br>
<A href="W29357.pdfs.html#25" target="contents" >Page 25</a><br>
<A href="W29357.pdfs.html#26" target="contents" >Page 26</a><br>
<A href="W29357.pdfs.html#27" target="contents" >Page 27</a><br>
<A href="W29357.pdfs.html#28" target="contents" >Page 28</a><br>
<A href="W29357.pdfs.html#29" target="contents" >Page 29</a><br>
<A href="W29357.pdfs.html#30" target="contents" >Page 30</a><br>
<A href="W29357.pdfs.html#31" target="contents" >Page 31</a><br>
<A href="W29357.pdfs.html#32" target="contents" >Page 32</a><br>
<A href="W29357.pdfs.html#33" target="contents" >Page 33</a><br>
<A href="W29357.pdfs.html#34" target="contents" >Page 34</a><br>
<A href="W29357.pdfs.html#35" target="contents" >Page 35</a><br>
<A href="W29357.pdfs.html#36" target="contents" >Page 36</a><br>
<A href="W29357.pdfs.html#37" target="contents" >Page 37</a><br>
<A href="W29357.pdfs.html#38" target="contents" >Page 38</a><br>
<A href="W29357.pdfs.html#39" target="contents" >Page 39</a><br>
<A href="W29357.pdfs.html#40" target="contents" >Page 40</a><br>
<A href="W29357.pdfs.html#41" target="contents" >Page 41</a><br>
<A href="W29357.pdfs.html#42" target="contents" >Page 42</a><br>
<A href="W29357.pdfs.html#43" target="contents" >Page 43</a><br>
<A href="W29357.pdfs.html#44" target="contents" >Page 44</a><br>
<A href="W29357.pdfs.html#45" target="contents" >Page 45</a><br>
<A href="W29357.pdfs.html#46" target="contents" >Page 46</a><br>
<A href="W29357.pdfs.html#47" target="contents" >Page 47</a><br>
<A href="W29357.pdfs.html#48" target="contents" >Page 48</a><br>
<A href="W29357.pdfs.html#49" target="contents" >Page 49</a><br>
<A href="W29357.pdfs.html#50" target="contents" >Page 50</a><br>
<A href="W29357.pdfs.html#51" target="contents" >Page 51</a><br>
<A href="W29357.pdfs.html#52" target="contents" >Page 52</a><br>
<A href="W29357.pdfs.html#53" target="contents" >Page 53</a><br>
<A href="W29357.pdfs.html#54" target="contents" >Page 54</a><br>
<A href="W29357.pdfs.html#55" target="contents" >Page 55</a><br>
<A href="W29357.pdfs.html#56" target="contents" >Page 56</a><br>
<A href="W29357.pdfs.html#57" target="contents" >Page 57</a><br>
<A href="W29357.pdfs.html#58" target="contents" >Page 58</a><br>
<A href="W29357.pdfs.html#59" target="contents" >Page 59</a><br>
<A href="W29357.pdfs.html#60" target="contents" >Page 60</a><br>
<A href="W29357.pdfs.html#61" target="contents" >Page 61</a><br>
<A href="W29357.pdfs.html#62" target="contents" >Page 62</a><br>
<A href="W29357.pdfs.html#63" target="contents" >Page 63</a><br>
</BODY>
</HTML>
| datamade/elpc_bakken | html/pdf/W29357.pdf_ind.html | HTML | mit | 4,269 |
<?php
// Autoload the library using Composer, if you're using a framework you shouldn't need to do this!!
require_once '../vendor/autoload.php';
use Ballen\Dodns\CredentialManager;
use Ballen\Dodns\Dodns;
/**
* Example of deleting a domain
*/
// We now create an instance of the DigitalOcean DNS client passing in our API credentials.
$dns = new Dodns(new CredentialManager(file_get_contents('token.txt')));
// Set the domain entity that we wish to delete from our account...
$domain = new \Ballen\Dodns\Entities\Domain();
$domain->setName('mytestdodmain.uk');
// Now we carry out the deletion and check if it was successful...
if (!$dns->deleteDomain($domain)) {
echo "An error occured and the domain could not be deleted!";
} else {
echo sprintf("Congratulations, the domain <strong>%s</strong> has been deleted successfully!", $domain->getName());
} | bobsta63/dodns | examples/delete_a_domain.php | PHP | mit | 886 |
const strip_patterns = @compat(UInt32(0))
const strip_corrupt_utf8 = @compat(UInt32(0x1)) << 0
const strip_case = @compat(UInt32(0x1)) << 1
const stem_words = @compat(UInt32(0x1)) << 2
const tag_part_of_speech = @compat(UInt32(0x1)) << 3
const strip_whitespace = @compat(UInt32(0x1)) << 5
const strip_punctuation = @compat(UInt32(0x1)) << 6
const strip_numbers = @compat(UInt32(0x1)) << 7
const strip_non_letters = @compat(UInt32(0x1)) << 8
const strip_indefinite_articles = @compat(UInt32(0x1)) << 9
const strip_definite_articles = @compat(UInt32(0x1)) << 10
const strip_articles = (strip_indefinite_articles |
strip_definite_articles)
const strip_prepositions = @compat(UInt32(0x1)) << 13
const strip_pronouns = @compat(UInt32(0x1)) << 14
const strip_stopwords = @compat(UInt32(0x1)) << 16
const strip_sparse_terms = @compat(UInt32(0x1)) << 17
const strip_frequent_terms = @compat(UInt32(0x1)) << 18
const strip_html_tags = @compat(UInt32(0x1)) << 20
const alpha_sparse = 0.05
const alpha_frequent = 0.95
const regex_cache = Dict{AbstractString, Regex}()
function mk_regex(regex_string)
d = haskey(regex_cache, regex_string) ?
regex_cache[regex_string] :
(regex_cache[regex_string] = Regex(regex_string))
(length(regex_cache) > 50) && empty!(regex_cache)
d
end
##############################################################################
#
# Remove corrupt UTF8 characters
#
##############################################################################
function remove_corrupt_utf8(s::AbstractString)
r = zeros(Char, endof(s)+1)
i = 0
for chr in s
i += 1
r[i] = (chr != 0xfffd) ? chr : ' '
end
return utf8(CharString(r))
end
remove_corrupt_utf8!(d::FileDocument) = error("FileDocument cannot be modified")
function remove_corrupt_utf8!(d::StringDocument)
d.text = remove_corrupt_utf8(d.text)
nothing
end
function remove_corrupt_utf8!(d::TokenDocument)
for i in 1:length(d.tokens)
d.tokens[i] = remove_corrupt_utf8(d.tokens[i])
end
end
function remove_corrupt_utf8!(d::NGramDocument)
new_ngrams = Dict{AbstractString, Int}()
for token in keys(d.ngrams)
new_token = remove_corrupt_utf8(token)
if haskey(new_ngrams, new_token)
new_ngrams[new_token] = new_ngrams[new_token] + 1
else
new_ngrams[new_token] = 1
end
end
d.ngrams = new_ngrams
end
function remove_corrupt_utf8!(crps::Corpus)
for doc in crps
remove_corrupt_utf8!(doc)
end
end
##############################################################################
#
# Conversion to lowercase
#
##############################################################################
remove_case{T <: AbstractString}(s::T) = lowercase(s)
remove_case!(d::FileDocument) = error("FileDocument cannot be modified")
function remove_case!(d::StringDocument)
d.text = remove_case(d.text)
nothing
end
function remove_case!(d::TokenDocument)
for i in 1:length(d.tokens)
d.tokens[i] = remove_case(d.tokens[i])
end
end
function remove_case!(d::NGramDocument)
new_ngrams = Dict{AbstractString, Int}()
for token in keys(d.ngrams)
new_token = remove_case(token)
if haskey(new_ngrams, new_token)
new_ngrams[new_token] = new_ngrams[new_token] + 1
else
new_ngrams[new_token] = 1
end
end
d.ngrams = new_ngrams
end
function remove_case!(crps::Corpus)
for doc in crps
remove_case!(doc)
end
end
##############################################################################
#
# Stripping HTML tags
#
##############################################################################
const script_tags = Regex("<script\\b[^>]*>([\\s\\S]*?)</script>")
const html_tags = Regex("<[^>]*>")
function remove_html_tags(s::AbstractString)
s = remove_patterns(s, script_tags)
remove_patterns(s, html_tags)
end
function remove_html_tags!(d::AbstractDocument)
error("HTML tags can be removed only from a StringDocument")
end
function remove_html_tags!(d::StringDocument)
d.text = remove_html_tags(d.text)
nothing
end
function remove_html_tags!(crps::Corpus)
for doc in crps
remove_html_tags!(doc)
end
end
##############################################################################
#
# Remove specified words
#
##############################################################################
function remove_words!{T <: AbstractString}(entity::(@compat Union{AbstractDocument,Corpus}),
words::Vector{T})
skipwords = Set{AbstractString}()
union!(skipwords, words)
prepare!(entity, strip_patterns, skip_words = skipwords)
end
function remove_whitespace!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_whitespace! is deprecated, Use prepare! instead.")
prepare!(entity, strip_whitespace)
end
function remove_punctuation!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_punctuation! is deprecated, Use prepare! instead.")
prepare!(entity, strip_punctuation)
end
function remove_nonletters!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_nonletters! is deprecated, Use prepare! instead.")
prepare!(entity, strip_non_letters)
end
function remove_numbers!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_numbers! is deprecated, Use prepare! instead.")
prepare!(entity, strip_numbers)
end
function remove_articles!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_articles! is deprecated, Use prepare! instead.")
prepare!(entity, strip_articles)
end
function remove_indefinite_articles!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_indefinite_articles! is deprecated, Use prepare! instead.")
prepare!(entity, strip_indefinite_articles)
end
function remove_definite_articles!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_definite_articles! is deprecated, Use prepare! instead.")
prepare!(entity, strip_definite_articles)
end
function remove_prepositions!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_prepositions! is deprecated, Use prepare! instead.")
prepare!(entity, strip_prepositions)
end
function remove_pronouns!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_pronouns! is deprecated, Use prepare! instead.")
prepare!(entity, strip_pronouns)
end
function remove_stop_words!(entity::(@compat Union{AbstractDocument,Corpus}))
Base.warn_once("remove_stop_words! is deprecated, Use prepare! instead.")
prepare!(entity, strip_stopwords)
end
##############################################################################
#
# Part-of-Speech tagging
#
##############################################################################
tag_pos!(entity) = error("Not yet implemented")
##############################################################################
#
# Drop terms based on frequency
#
##############################################################################
function sparse_terms(crps::Corpus, alpha::Real = alpha_sparse)
update_lexicon!(crps)
update_inverse_index!(crps)
res = Array(UTF8String, 0)
ndocs = length(crps.documents)
for term in keys(crps.lexicon)
f = length(crps.inverse_index[term]) / ndocs
if f <= alpha
push!(res, utf8(term))
end
end
return res
end
function frequent_terms(crps::Corpus, alpha::Real = alpha_frequent)
update_lexicon!(crps)
update_inverse_index!(crps)
res = Array(UTF8String, 0)
ndocs = length(crps.documents)
for term in keys(crps.lexicon)
f = length(crps.inverse_index[term]) / ndocs
if f >= alpha
push!(res, utf8(term))
end
end
return res
end
# Sparse terms occur in less than x percent of all documents
remove_sparse_terms!(crps::Corpus, alpha::Real = alpha_sparse) = remove_words!(crps, sparse_terms(crps, alpha))
# Frequent terms occur in more than x percent of all documents
remove_frequent_terms!(crps::Corpus, alpha::Real = alpha_frequent) = remove_words!(crps, frequent_terms(crps, alpha))
##############################################################################
#
# Remove parts from document based on flags or regular expressions
#
##############################################################################
function prepare!(crps::Corpus, flags::UInt32; skip_patterns = Set{AbstractString}(), skip_words = Set{AbstractString}())
((flags & strip_sparse_terms) > 0) && union!(skip_words, sparse_terms(crps))
((flags & strip_frequent_terms) > 0) && union!(skip_words, frequent_terms(crps))
((flags & strip_corrupt_utf8) > 0) && remove_corrupt_utf8!(crps)
((flags & strip_case) > 0) && remove_case!(crps)
((flags & strip_html_tags) > 0) && remove_html_tags!(crps)
lang = language(crps.documents[1]) # assuming all documents are of the same language - practically true
r = _build_regex(lang, flags, skip_patterns, skip_words)
!isempty(r.pattern) && remove_patterns!(crps, r)
((flags & stem_words) > 0) && stem!(crps)
((flags & tag_part_of_speech) > 0) && tag_pos!(crps)
nothing
end
function prepare!(d::AbstractDocument, flags::UInt32; skip_patterns = Set{AbstractString}(), skip_words = Set{AbstractString}())
((flags & strip_corrupt_utf8) > 0) && remove_corrupt_utf8!(d)
((flags & strip_case) > 0) && remove_case!(d)
((flags & strip_html_tags) > 0) && remove_html_tags!(d)
r = _build_regex(language(d), flags, skip_patterns, skip_words)
!isempty(r.pattern) && remove_patterns!(d, r)
((flags & stem_words) > 0) && stem!(d)
((flags & tag_part_of_speech) > 0) && tag_pos!(d)
nothing
end
##
# internal helper methods
function remove_patterns(s::AbstractString, rex::Regex)
iob = IOBuffer()
ibegin = 1
for m in matchall(rex, s)
len = m.offset-ibegin+1
if len > 0
Base.write_sub(iob, s.data, ibegin, len)
write(iob, ' ')
end
ibegin = m.endof+m.offset+1
end
len = length(s.data) - ibegin + 1
(len > 0) && Base.write_sub(iob, s.data, ibegin, len)
takebuf_string(iob)
end
function remove_patterns{T <: ByteString}(s::SubString{T}, rex::Regex)
iob = IOBuffer()
ioffset = s.offset
data = s.string.data
ibegin = 1
for m in matchall(rex, s)
len = m.offset-ibegin+1
if len > 0
Base.write_sub(iob, data, ibegin+ioffset, len)
write(iob, ' ')
end
ibegin = m.endof+m.offset+1
end
len = s.endof - ibegin + 1
(len > 0) && Base.write_sub(iob, data, ibegin+ioffset, len)
takebuf_string(iob)
end
remove_patterns!(d::FileDocument, rex::Regex) = error("FileDocument cannot be modified")
function remove_patterns!(d::StringDocument, rex::Regex)
d.text = remove_patterns(d.text, rex)
nothing
end
function remove_patterns!(d::TokenDocument, rex::Regex)
for i in 1:length(d.tokens)
d.tokens[i] = remove_patterns(d.tokens[i], rex)
end
end
function remove_patterns!(d::NGramDocument, rex::Regex)
new_ngrams = Dict{AbstractString, Int}()
for token in keys(d.ngrams)
new_token = remove_patterns(token, rex)
if haskey(new_ngrams, new_token)
new_ngrams[new_token] = new_ngrams[new_token] + 1
else
new_ngrams[new_token] = 1
end
end
d.ngrams = new_ngrams
nothing
end
function remove_patterns!(crps::Corpus, rex::Regex)
for doc in crps
remove_patterns!(doc, rex)
end
end
_build_regex(lang, flags::UInt32) = _build_regex(lang, flags, Set{AbstractString}(), Set{AbstractString}())
_build_regex{T <: AbstractString}(lang, flags::UInt32, patterns::Set{T}, words::Set{T}) = _combine_regex(_build_regex_patterns(lang, flags, patterns, words))
function _combine_regex{T <: AbstractString}(regex_parts::Set{T})
l = length(regex_parts)
(0 == l) && return r""
(1 == l) && return mk_regex(pop!(regex_parts))
iob = IOBuffer()
write(iob, "($(pop!(regex_parts)))")
for part in regex_parts
write(iob, "|($part)")
end
mk_regex(takebuf_string(iob))
end
function _build_regex_patterns{T <: AbstractString}(lang, flags::UInt32, patterns::Set{T}, words::Set{T})
((flags & strip_whitespace) > 0) && push!(patterns, "\\s+")
if (flags & strip_non_letters) > 0
push!(patterns, "[^a-zA-Z\\s]")
else
((flags & strip_punctuation) > 0) && push!(patterns, "[,;:.!?()]+")
((flags & strip_numbers) > 0) && push!(patterns, "\\d+")
end
if (flags & strip_articles) > 0
union!(words, articles(lang))
else
((flags & strip_indefinite_articles) > 0) && union!(words, indefinite_articles(lang))
((flags & strip_definite_articles) > 0) && union!(words, definite_articles(lang))
end
((flags & strip_prepositions) > 0) && union!(words, prepositions(lang))
((flags & strip_pronouns) > 0) && union!(words, pronouns(lang))
((flags & strip_stopwords) > 0) && union!(words, stopwords(lang))
words_pattern = _build_words_pattern(collect(words))
!isempty(words_pattern) && push!(patterns, words_pattern)
patterns
end
function _build_words_pattern{T <: AbstractString}(words::Vector{T})
isempty(words) && return ""
iob = IOBuffer()
write(iob, "\\b(")
write(iob, words[1])
l = length(words)
for idx in 2:l
write(iob, '|')
write(iob, words[idx])
end
write(iob, ")\\b")
takebuf_string(iob)
end
| slundberg/TextAnalysis.jl | src/preprocessing.jl | Julia | mit | 13,988 |
<?php
namespace MB\Bundle\OptimizationBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class MBOptimizationExtension extends Extension
{
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$container->setParameter('mb_optimization', $config);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
| mb-webdev/MBOptimizationBundle | DependencyInjection/MBOptimizationExtension.php | PHP | mit | 957 |
<?php
/*
Plugin Name: FramePress
Plugin URI: http://framepress.co
Description: Boost your plugins with extra power!
Author: Ivan Lansky (@perecedero)
Author URI: http://about.me/ivan.lansky
*/
//init framework
require 'bootstrap.php';
| perecedero/FramePress | main.php | PHP | mit | 245 |
using System;
using DogeNews.Web.Mvp.UserControls.ArticleComments.EventArguments;
using WebFormsMvp;
namespace DogeNews.Web.Mvp.UserControls.ArticleComments
{
public interface IArticleCommentsView : IView<ArticleCommentsViewModel>
{
event EventHandler<ArticleCommetnsPageLoadEventArgs> PageLoad;
event EventHandler<AddCommentEventArguments> AddComment;
}
} | SuchTeam-NoJoro-MuchSad/Doge-News | DogeNews/Src/Web/DogeNews.Web.Mvp/UserControls/ArticleComments/IArticleCommentsView.cs | C# | mit | 390 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mtac2: 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 / mtac2 - 1.0.1+8.8</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mtac2
<small>
1.0.1+8.8
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-01-20 06:05:22 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-01-20 06:05:22 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 dev Formal proof management system
dune 2.9.1 Fast, portable, and opinionated build system
ocaml 4.10.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.2 Official release 4.10.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/Mtac2/Mtac2"
dev-repo: "git+https://github.com/Mtac2/Mtac2.git"
bug-reports: "https://github.com/Mtac2/Mtac2/issues"
authors: ["Beta Ziliani <[email protected]>" "Jan-Oliver Kaiser <[email protected]>" "Robbert Krebbers <[email protected]>" "Yann Régis-Gianas <[email protected]>" "Derek Dreyer <[email protected]>"]
license: "MIT"
build: [
["./configure.sh"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Mtac2"]
depends: [
"ocaml"
"coq" {>= "8.8.0" & < "8.9~"}
"coq-unicoq" {>= "1.3~" & < "2~"}
]
synopsis: "Mtac2: Typed Tactics for Coq"
flags: light-uninstall
url {
src: "https://github.com/Mtac2/Mtac2/archive/v1.0.1-coq8.8.tar.gz"
checksum: "md5=e4a139572dc91efc7fe63b933029264c"
}
</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-mtac2.1.0.1+8.8 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-mtac2 -> coq < 8.9~ -> ocaml < 4.10
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-mtac2.1.0.1+8.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.10.2-2.0.6/extra-dev/dev/mtac2/1.0.1+8.8.html | HTML | mit | 6,990 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1, maximum-scale=1, user-scalable=no">
<style>
.btn-block {
display: block;
height: 40px;
line-height: 40px;
margin: 10px auto;
color: #fff;
background: #8bc53f;
border-radius: 10px;
text-align: center;
text-decoration: none;
font-size: 14px;
}
.btn-block1 {
display: block;
height: 40px;
line-height: 40px;
margin: 10px auto;
color: #fff;
background: #868686;
border-radius: 10px;
text-align: center;
text-decoration: none;
font-size: 14px;
}
.content {
text-align: left;
font-size: 14px;
margin-bottom: 25px;
}
</style>
</head>
<body>
<br>
<div class="btn-block" onclick="AppObject.appHandler('login','js调用App成功','')">
js调用App,App不用给js结果
</div>
<div class="content">js调用App,App不用给js结果</div>
<div class="btn-block" onclick="AppObject.appHandler('loginToResult','js调用App成功,给我反馈','loginToResult')">
js调用App,App给js结果
</div>
<div class="content" id="loginToResult">js调用App,App给js结果:内容会改变</div>
<div class="btn-block1">下面显示App调用js的结果,没有给App反馈</div>
<div class="content" id="appToJSNotResult">App调用js的结果:内容会改变</div>
<div class="btn-block1" onclick="appToJSResult()"> 下面显示App调用js的结果,需要给App反馈 </div>
<div class="content" id="appToJSResult">App调用js的结果:内容会改变</div>
<script type="text/javascript">
function loginToResult(argument) {
document.getElementById('loginToResult').innerHTML = "js调用App,App给js结果:" + argument;
}
function appToJSNotResult(argument) {
document.getElementById('appToJSNotResult').innerHTML = "App调用js的结果:" + argument['name'];
}
function appToJSResult(argument) {
document.getElementById('appToJSResult').innerHTML = "App调用js回调函数啦, 我是" + argument['name'];
AppObject.appHandler('appToJSResult','js已接受到App传来的' + argument['name'],'');
}
</script>
</body>
</html>
| spf-iOS/WebJSBridge | WebJSBridgeDemo/WebJSBridgeDemo/demo.html | HTML | mit | 3,163 |
/*
* Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice, this
* list of conditions and the following disclaimer in the documentation and/or
* other materials provided with the distribution.
*
* o Neither the name of Freescale Semiconductor, Inc. nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Debug console shall provide input and output functions to scan and print formatted data.
* o Support a format specifier for PRINTF follows this prototype "%[flags][width][.precision][length]specifier"
* - [flags] :'-', '+', '#', ' ', '0'
* - [width]: number (0,1...)
* - [.precision]: number (0,1...)
* - [length]: do not support
* - [specifier]: 'd', 'i', 'f', 'F', 'x', 'X', 'o', 'p', 'u', 'c', 's', 'n'
* o Support a format specifier for SCANF follows this prototype " %[*][width][length]specifier"
* - [*]: is supported.
* - [width]: number (0,1...)
* - [length]: 'h', 'hh', 'l','ll','L'. ignore ('j','z','t')
* - [specifier]: 'd', 'i', 'u', 'f', 'F', 'e', 'E', 'g', 'G', 'a', 'A', 'o', 'c', 's'
*/
#ifndef _FSL_DEBUGCONSOLE_H_
#define _FSL_DEBUGCONSOLE_H_
#include "fsl_common.h"
/*
* @addtogroup debug_console
* @{
*/
/*******************************************************************************
* Definitions
******************************************************************************/
/*! @brief Definition to select sdk or toolchain printf, scanf. */
#ifndef SDK_DEBUGCONSOLE
#define SDK_DEBUGCONSOLE 1U
#endif
/*! @brief Definition to printf float number. */
#ifndef PRINTF_FLOAT_ENABLE
#define PRINTF_FLOAT_ENABLE 1U
#endif /* PRINTF_FLOAT_ENABLE */
/*! @brief Definition to scanf float number. */
#ifndef SCANF_FLOAT_ENABLE
#define SCANF_FLOAT_ENABLE 1U
#endif /* SCANF_FLOAT_ENABLE */
/*! @brief Definition to support advanced format specifier for printf. */
#ifndef PRINTF_ADVANCED_ENABLE
#define PRINTF_ADVANCED_ENABLE 1U
#endif /* PRINTF_ADVANCED_ENABLE */
/*! @brief Definition to support advanced format specifier for scanf. */
#ifndef SCANF_ADVANCED_ENABLE
#define SCANF_ADVANCED_ENABLE 1U
#endif /* SCANF_ADVANCED_ENABLE */
#if SDK_DEBUGCONSOLE /* Select printf, scanf, putchar, getchar of SDK version. */
#define PRINTF DbgConsole_Printf
#define SCANF DbgConsole_Scanf
#define PUTCHAR DbgConsole_Putchar
#define GETCHAR DbgConsole_Getchar
#else /* Select printf, scanf, putchar, getchar of toolchain. */
#define PRINTF printf
#define SCANF scanf
#define PUTCHAR putchar
#define GETCHAR getchar
#endif /* SDK_DEBUGCONSOLE */
/*******************************************************************************
* Prototypes
******************************************************************************/
#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus */
/*! @name Initialization*/
/* @{ */
/*!
* @brief Initialize the the peripheral used for debug messages.
*
* Call this function to enable debug log messages to be output via the specified peripheral,
* frequency of peripheral source clock, base address at the specified baud rate.
* After this function has returned, stdout and stdin will be connected to the selected peripheral.
*
* @param baseAddr Which address of peripheral is used to send debug messages.
* @param baudRate The desired baud rate in bits per second.
* @param device Low level device type for the debug console, could be one of:
* @arg DEBUG_CONSOLE_DEVICE_TYPE_UART,
* @arg DEBUG_CONSOLE_DEVICE_TYPE_LPUART,
* @arg DEBUG_CONSOLE_DEVICE_TYPE_LPSCI,
* @arg DEBUG_CONSOLE_DEVICE_TYPE_USBCDC.
* @param clkSrcFreq Frequency of peripheral source clock.
*
* @return Whether initialization was successful or not.
* @retval kStatus_Success Execution successfully
* @retval kStatus_Fail Execution failure
* @retval kStatus_InvalidArgument Invalid argument existed
*/
status_t DbgConsole_Init(uint32_t baseAddr, uint32_t baudRate, uint8_t device, uint32_t clkSrcFreq);
/*!
* @brief De-initialize the peripheral used for debug messages.
*
* Call this function to disable debug log messages to be output via the specified peripheral
* base address and at the specified baud rate.
*
* @return Whether de-initialization was successful or not.
*/
status_t DbgConsole_Deinit(void);
#if SDK_DEBUGCONSOLE
/*!
* @brief Writes formatted output to the standard output stream.
*
* Call this function to Writes formatted output to the standard output stream.
*
* @param fmt_s Format control string.
* @return Returns the number of characters printed, or a negative value if an error occurs.
*/
int DbgConsole_Printf(char *fmt_s, ...);
/*!
* @brief Writes a character to stdout.
*
* Call this function to write a character to stdout.
*
* @param ch Character to be written.
* @return Returns the character written.
*/
int DbgConsole_Putchar(int ch);
/*!
* @brief Reads formatted data from the standard input stream.
*
* Call this function to read formatted data from the standard input stream.
*
* @param fmt_ptr Format control string.
* @return Returns the number of fields successfully converted and assigned.
*/
int DbgConsole_Scanf(char *fmt_ptr, ...);
/*!
* @brief Reads a character from standard input.
*
* Call this function to read a character from standard input.
*
* @return Returns the character read.
*/
int DbgConsole_Getchar(void);
#endif /* SDK_DEBUGCONSOLE */
/*! @} */
#if defined(__cplusplus)
}
#endif /* __cplusplus */
/*! @} */
#endif /* _FSL_DEBUGCONSOLE_H_ */
| andrewparlane/kinetis_test_projects | common/devices/MK66F18/utilities/fsl_debug_console.h | C | mit | 7,074 |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Latihan extends CI_Controller{
public function __construct(){
parent::__construct();
//Codeigniter : Write Less Do More
}
function index(){
$this->load->view('mhs/latihan');
// $this->load->view('sample');
}
}
?>
| aisy/polieditor | application/controllers/Latihan.php | PHP | mit | 334 |
package tabular
import (
"bufio"
"bytes"
"io"
"testing"
"github.com/stretchr/testify/suite"
)
var (
testHeaders = []struct {
Key string
Title string
}{
{
Key: "name",
Title: "First name",
},
{
Key: "surname",
Title: "Last name",
},
{
Key: "age",
Title: "Age",
},
}
testRows = [][]string{
{"Julia", "Roberts", "40"},
{"John", "Malkovich", "42"},
}
)
type mockWriter struct {
}
func (mw *mockWriter) Name() string {
return "mock"
}
func (mw *mockWriter) NeedsHeaders() bool {
return false
}
func (mw *mockWriter) Write(d *Dataset, w io.Writer) error {
return nil
}
func newTestDataset() (*Dataset, error) {
d := NewDataSet()
for _, hdr := range testHeaders {
d.AddHeader(hdr.Key, hdr.Title)
}
for _, row := range testRows {
r := NewRowFromSlice(row)
if err := d.Append(r); err != nil {
return nil, err
}
}
return d, nil
}
func newTestWrite(d *Dataset, w Writer) (string, error) {
var buf bytes.Buffer
bufw := bufio.NewWriter(&buf)
if err := d.Write(w, bufw); err != nil {
return "", err
}
if err := bufw.Flush(); err != nil {
return "", err
}
return buf.String(), nil
}
type DatasetTestSuite struct {
suite.Suite
}
func (s *DatasetTestSuite) TestRowWidthWithHeaders() {
d := NewDataSet()
d.AddHeader("name", "Name")
r1 := NewRow("john")
err := d.Append(r1)
s.Nil(err)
r2 := NewRow("julia", "mitchell")
err = d.Append(r2)
s.Error(err)
s.True(d.HasHeaders())
}
func (s *DatasetTestSuite) TestRowWidthWithoutHeaders() {
d := NewDataSet()
r1 := NewRow("julia", "mitchell")
err := d.Append(r1)
s.Nil(err)
r2 := NewRow("john")
err = d.Append(r2)
s.Error(err)
s.False(d.HasHeaders())
}
func (s *DatasetTestSuite) TestSort() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
r1 := NewRow("julia", "mitchell")
r2 := NewRow("martin", "brown")
r3 := NewRow("peter", "kafka")
s.NoError(d.Append(r1, r2, r3))
d.Sort("name", false)
e1, _ := d.Get(0)
e2, _ := d.Get(1)
e3, _ := d.Get(2)
s.Equal(e1, r1)
s.Equal(e2, r2)
s.Equal(e3, r3)
}
func (s *DatasetTestSuite) TestSortReverse() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
r1 := NewRow("julia", "mitchell")
r2 := NewRow("martin", "brown")
r3 := NewRow("peter", "kafka")
s.NoError(d.Append(r1, r2, r3))
d.Sort("name", true)
e1, _ := d.Get(0)
e2, _ := d.Get(1)
e3, _ := d.Get(2)
s.Equal(e1, r3)
s.Equal(e2, r2)
s.Equal(e3, r1)
}
func (s *DatasetTestSuite) TestHasColumns() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
s.True(d.HasCol("name"))
s.True(d.HasCol("surname"))
s.False(d.HasCol("not"))
s.Equal(2, d.HeaderCount())
}
func (s *DatasetTestSuite) TestColValues() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
r1 := NewRow("julia", "mitchell")
r2 := NewRow("martin", "brown")
r3 := NewRow("peter", "kafka")
s.NoError(d.Append(r1, r2, r3))
s.Equal([]string{"julia", "martin", "peter"}, d.GetColValues("name"))
s.Equal([]string{"mitchell", "brown", "kafka"}, d.GetColValues("surname"))
}
func (s *DatasetTestSuite) TestColWidth() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
r1 := NewRow("julia", "mitchell")
r2 := NewRow("martin", "brown")
r3 := NewRow("peter", "kafka")
s.NoError(d.Append(r1, r2, r3))
s.Equal(6, d.GetKeyWidth("name"))
s.Equal(8, d.GetKeyWidth("surname"))
s.Equal(0, d.GetKeyWidth("not"))
s.Equal(6, d.GetIdxWidth(0))
s.Equal(8, d.GetIdxWidth(1))
s.Equal(0, d.GetIdxWidth(23))
}
func (s *DatasetTestSuite) TestWriteEmptyDataset() {
d := NewDataSet()
d.AddHeader("name", "Name")
d.AddHeader("surname", "Surname")
mw := &mockWriter{}
err := d.Write(mw, nil)
s.Error(err)
s.Equal(err, ErrEmptyDataset)
}
func TestDatasetTestSuite(t *testing.T) {
suite.Run(t, new(DatasetTestSuite))
}
| jbub/tabular | dataset_test.go | GO | mit | 3,925 |
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new DLauritz\Forum\AdminBundle\DLauritzForumAdminBundle(),
new DLauritz\Forum\ForumBundle\DLauritzForumForumBundle(),
new DLauritz\Forum\UserBundle\DLauritzForumUserBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
}
}
| dlauritzen/CS-360-Forum | app/AppKernel.php | PHP | mit | 1,561 |
<section data-ng-controller="ArticlesController" data-ng-init="findOne()">
<div class="page-header">
<h1>Edit Post</h1>
</div>
<div class="col-md-12">
<form name="articleForm" class="form-horizontal" data-ng-submit="update()" novalidate>
<fieldset>
<div class="form-group">
<label class="control-label" for="title">Title</label>
<div class="controls">
<input name="title" type="text" data-ng-model="article.title" id="title" class="form-control" placeholder="Title" required>
</div>
</div>
<div class="form-group">
<label class="control-label" for="content">Content</label>
<div class="controls">
<textarea name="content" data-ng-model="article.content" id="content" class="form-control" cols="30" rows="10" placeholder="Content"></textarea>
</div>
</div>
<div class="form-group">
<input type="submit" value="Update" class="btn btn-default">
</div>
<div data-ng-show="error" class="text-danger">
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
</div>
</section>
| Kericthecoolguy/ayuda | modules/articles/client/views/edit-article.client.view.html | HTML | mit | 1,180 |
#PPP-QuestionParsing-ML-standalone
[](https://travis-ci.org/ProjetPP/PPP-QuestionParsing-ML-Standalone)
[](https://scrutinizer-ci.com/g/ProjetPP/PPP-QuestionParsing-ML-standalone/?branch=master)
[](https://scrutinizer-ci.com/g/ProjetPP/PPP-QuestionParsing-ML-standalone/?branch=master)
We provide here a tool to transform an English question into a triple:
(subject, predicate, object)
We emphasis on keywords questions like "Barack Obama birth date?"
You can find some examples of this transformation is the file data/AnnotatedQuestions.txt.
## How to install
Download the git repository:
```
git clone https://github.com/ProjetPP/PPP-QuestionParsing-ML-standalone
cd PPP-NLP-ML-standalone
```
Then, install the script:
python3 setup.py install
Use the `--user` option if you want to install it only for the current user.
## Bootstrap
Short version: run `./bootstrap.sh`
Detailed version:
###Download the look-up table:
```
cd data
wget http://metaoptimize.s3.amazonaws.com/cw-embeddings-ACL2010/embeddings-scaled.EMBEDDING_SIZE=25.txt.gz
gzip -d embeddings-scaled.EMBEDDING_SIZE=25.txt.gz
```
###Generate the data set
The goal of ppp_questionparsing_ml_standalone/Dataset.py is to transform English questions in a vectorized form that is compatible
with our ML model, according to a lookup table.
The english data set of questions is in the file: data/AnnotatedQuestions.txt
Compile the data set with the command:
python3 demo/Dataset.py
###Learn the Python model
python3 demo/Learn.py
##Use the tool in CLI
Execute the command:
python3 demo/Demo.py
Type a question in English, and the program will compute the triple associated to the question.
Example:
birth date Barack Obama?
(Barack Obama, birth date, ?)
##Use the tool with the server
gunicorn ppp_questionparsing_ml_standalone:app -b 127.0.0.1:8080
In a python shell:
import requests, json
requests.post('http://localhost:8080/', data=json.dumps({'id':
'foo', 'language': 'en', 'measures': {}, 'trace': [], 'tree': {'type':
'sentence', 'value': 'What is the birth date of George Washington?'}})).json()
| ProjetPP/PPP-QuestionParsing-ML-Standalone | README.md | Markdown | mit | 2,491 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>stalmarck: 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 / stalmarck - 8.14.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
stalmarck
<small>
8.14.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-07 06:33:16 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-07 06:33:16 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.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: "[email protected]"
homepage: "https://github.com/coq-community/stalmarck"
dev-repo: "git+https://github.com/coq-community/stalmarck.git"
bug-reports: "https://github.com/coq-community/stalmarck/issues"
license: "LGPL-2.1-or-later"
synopsis: "Correctness proof of Stålmarck's algorithm in Coq"
description: """
A two-level approach to prove tautologies using Stålmarck's
algorithm in Coq."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.14" & < "8.15~"}
]
tags: [
"category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures"
"keyword:boolean formula"
"keyword:tautology checker"
"logpath:Stalmarck.Algorithm"
"date:2021-10-30"
]
authors: [
"Pierre Letouzey"
"Laurent Théry"
]
url {
src: "https://github.com/coq-community/stalmarck/archive/v8.14.0.tar.gz"
checksum: "sha512=5080457e36384932e4f94bda7c68d816388a6ce282262c44b92cf00c482c43d06fe3df842121aa62d734f6b82af9687743bbb59a0b77571c4573bd75799ee2b8"
}
</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-stalmarck.8.14.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-stalmarck -> coq >= 8.14
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-stalmarck.8.14.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.10.0/stalmarck/8.14.0.html | HTML | mit | 6,859 |
-- a simple telnet server
-- https://github.com/nodemcu/nodemcu-firmware/blob/master/lua_examples/telnet.lua
tport = tport or 2323
_telnet_srv = net.createServer(net.TCP, 180)
print("Telnet port: " .. (tport))
_telnet_srv:listen(tport, function(socket)
local fifo = {}
local fifo_drained = true
local function sender(c)
if #fifo > 0 then
str=table.remove(fifo, 1)
if #str ==0 then
str = " "
end
c:send(str)
else
fifo_drained = true
end
end
local function s_output(str)
table.insert(fifo, str)
if socket ~= nil and fifo_drained then
fifo_drained = false
sender(socket)
end
end
node.output(s_output, 1) -- re-direct output to function s_ouput.
socket:on("receive", function(c, l)
node.input(l) -- works like pcall(loadstring(l)) but support multiple separate line
end)
socket:on("disconnection", function(c)
node.output(nil) -- un-regist the redirect output function, output goes to serial
print("Telnet fin")
end)
socket:on("sent", sender)
socket:on("connection", function(c)
print("ESP8266 Telnet on")
end )
--print("Welcome.")
end)
| BLavery/esuite-lua | library/lib-TELNET.lua | Lua | mit | 1,299 |
"use strict";
var EventEmitter = require ('events');
module.exports = new EventEmitter ();
| alexandruradovici/messengertrivia | source/bus.js | JavaScript | mit | 92 |
'use strict'
const tap = require('tap')
const ActiveDirectory = require('../index')
const config = require('./config')
const serverFactory = require('./mockServer')
const settings = require('./settings').getGroupMembershipForUser
tap.beforeEach((done, t) => {
serverFactory(function (err, server) {
if (err) return done(err)
const connectionConfig = config(server.port)
t.context.ad = new ActiveDirectory(connectionConfig)
t.context.server = server
done()
})
})
tap.afterEach((done, t) => {
if (t.context.server) t.context.server.close()
done()
})
tap.test('#getGroupMembershipForUser()', t => {
settings.users.forEach((user) => {
['dn', 'userPrincipalName', 'sAMAccountName'].forEach((attr) => {
const len = user.members.length
t.test(`should return ${len} groups for ${attr}`, t => {
t.context.ad.getGroupMembershipForUser(user[attr], function (err, groups) {
t.error(err)
t.true(groups.length >= user.members.length)
const groupNames = groups.map((g) => {
return g.cn
})
user.members.forEach((g) => {
t.true(groupNames.includes(g))
})
t.end()
})
})
})
})
t.test('should return empty groups if groupName doesn\'t exist', t => {
t.context.ad.getGroupMembershipForUser('!!!NON-EXISTENT GROUP!!!', function (err, groups) {
t.error(err)
t.type(groups, Array)
t.equal(groups.length, 0)
t.end()
})
})
t.test('should return default group attributes when not specified', t => {
const defaultAttributes = ['objectCategory', 'distinguishedName', 'cn', 'description']
const user = settings.users[0]
t.context.ad.getGroupMembershipForUser(user.userPrincipalName, function (err, groups) {
t.error(err)
t.ok(groups)
groups.forEach((g) => {
const keys = Object.keys(g)
defaultAttributes.forEach((attr) => {
t.true(keys.includes(attr))
})
})
t.end()
})
})
t.end()
})
tap.test('#getGroupMembershipForUser(opts)', t => {
t.test('should return only requested attributes', t => {
const opts = {
attributes: ['createTimeStamp']
}
const user = settings.users[0]
t.context.ad.getGroupMembershipForUser(opts, user.userPrincipalName, function (err, groups) {
t.error(err)
t.ok(groups)
t.true(groups.length >= user.members.length)
groups.forEach((g) => {
const keys = Object.keys(g)
keys.forEach((attr) => {
t.true(opts.attributes.includes(attr))
})
})
t.end()
})
})
t.end()
})
| jsumners/node-activedirectory | test/getgroupmembershipforuser.test.js | JavaScript | mit | 2,662 |
package com.github.lg198.codefray.jfx;
import com.github.lg198.codefray.api.game.Team;
import com.github.lg198.codefray.game.GameEndReason;
import com.github.lg198.codefray.game.GameStatistics;
import com.github.lg198.codefray.util.TimeFormatter;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Label;
import javafx.scene.control.ProgressBar;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
public class GameResultGui {
private final GameStatistics stats;
public GameResultGui(GameStatistics gs) {
stats = gs;
}
public VBox build() {
VBox root = new VBox();
root.setAlignment(Pos.CENTER);
root.setSpacing(10);
root.setPadding(new Insets(15));
Label title = new Label("Game Result");
title.setStyle("-fx-font-size: 30px");
title.setUnderline(true);
root.getChildren().add(title);
VBox.setMargin(title, new Insets(0, 0, 5, 0));
root.getChildren().addAll(
createWinnerStatBox(stats.reason),
createStatBox("Rounds:", "" + stats.rounds),
createStatBox("Length:", TimeFormatter.format(stats.timeInSeconds)),
createStatBox("Red Golems Left:", "" + stats.redLeft),
createStatBox("Blue Golems Left:", "" + stats.blueLeft),
createStatBox("Red Health:", stats.redHealthPercent, Team.RED),
createStatBox("Blue Health:", stats.blueHealthPercent, Team.BLUE)
);
return root;
}
private HBox createWinnerStatBox(GameEndReason reason) {
HBox box = new HBox();
box.setSpacing(6);
box.setAlignment(Pos.CENTER);
if (reason instanceof GameEndReason.Win) {
Label key = new Label("Winner:");
Label value = new Label(((GameEndReason.Win)reason).winner.name());
key.setStyle("-fx-font-size: 20px");
value.setStyle(key.getStyle());
box.getChildren().addAll(key, value);
return box;
} else if (reason instanceof GameEndReason.Infraction) {
Label key = new Label(((GameEndReason.Infraction)reason).guilty.name() + " cheated and lost");
key.setStyle("-fx-font-size: 20px");
box.getChildren().addAll(key);
return box;
} else {
Label key = new Label("Winner:");
Label value = new Label("None");
key.setStyle("-fx-font-size: 20px");
value.setStyle(key.getStyle());
box.getChildren().addAll(key, value);
return box;
}
}
private HBox createStatBox(String name, String value) {
HBox box = new HBox();
box.setSpacing(6);
box.setAlignment(Pos.CENTER);
box.getChildren().addAll(new Label(name), new Label(value));
return box;
}
private HBox createStatBox(String name, double perc, Team team) {
HBox box = new HBox();
box.setAlignment(Pos.CENTER);
box.setSpacing(6);
ProgressBar pb = new ProgressBar(perc);
if (team == Team.RED) {
pb.setStyle("-fx-accent: red");
} else {
pb.setStyle("-fx-accent: blue");
}
box.getChildren().addAll(new Label(name), pb);
return box;
}
}
| lg198/CodeFray | src/com/github/lg198/codefray/jfx/GameResultGui.java | Java | mit | 3,347 |
<?php
namespace Flatmate\UtilitiesBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Consumption
*
* @ORM\Table()
* @ORM\Entity
* @ORM\HasLifecycleCallbacks()
*/
class Consumption
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var integer
*
* @ORM\Column(name="category_id", type="integer")
*/
private $categoryId;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255)
* @Assert\NotBlank(message="consumption.name.not_blank")
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="value", type="decimal", scale=1)
* @Assert\NotBlank(message="consumption.value.not_blank")
*/
private $value;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private $createdAt;
/**
* @var
*
* @ORM\ManyToOne(targetEntity="Category")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $category;
/**
* @var integer
*
* @ORM\Column(name="user_id", type="integer")
*/
private $userId;
/**
* @var string
*
* @ORM\ManyToOne(targetEntity="Flatmate\UserBundle\Entity\User")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $user;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set categoryId
*
* @param integer $categoryId
* @return Consumption
*/
public function setCategoryId($categoryId)
{
$this->categoryId = $categoryId;
return $this;
}
/**
* Set category
*
* @param $category
* @return $this
*/
public function setCategory($category) {
$this->category = $category;
return $this;
}
/**
* Get categoryId
*
* @return integer
*/
public function getCategoryId()
{
return $this->categoryId;
}
/**
* Get category
*
* @return mixed
*/
public function getCategory() {
return $this->category;
}
/**
* Set name
*
* @param string $name
* @return Consumption
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set value
*
* @param string $value
* @return Consumption
*/
public function setValue($value)
{
$this->value = $value;
return $this;
}
/**
* Get value
*
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
* @return Consumption
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set Created At value at current time
*
* @ORM\PrePersist
*/
public function setCreatedAtNow()
{
$this->createdAt = new \DateTime();
}
/**
* Get User ID
*
* @return integer
*/
public function getUserId() {
return $this->userId;
}
/**
* Set User ID
*
* @param $userId
*/
public function setUserId($userId) {
$this->userId = $userId;
}
/**
* Get User
*
* @return string
*/
public function getUser() {
return $this->user;
}
/**
* Set User
*
* @param User
*/
public function setUser($user) {
$this->user = $user;
}
}
| TIIUNDER/flatmate | src/Flatmate/UtilitiesBundle/Entity/Consumption.php | PHP | mit | 4,174 |
<!--<?php
# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
require_once template('head');
echo <<<EOT
-->
</head>
<body>
<!--
EOT;
$title="<a href='index.php?anyid={$anyid}&lang={$lang}&class1={$class1}'>{$met_class[$class1][name]}</a>";
$class1=$class1?$class1:($id?$id:0);
$title=title($class1,$anyid,$lang)?title($class1,$anyid,$lang):$title;
require_once template('content/message/top');
echo <<<EOT
-->
<form method="POST" name="myform" action="inc.php?anyid={$anyid}&lang=$lang" target="_self">
<input name="action" type="hidden" value="modify">
<input name="class1" type="hidden" value="$class1">
<div class="v52fmbx_tbmax">
<div class="v52fmbx_tbbox">
<div class="v52fmbx">
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_messagesubmit}{$lang_marks}</dt>
<dd>
<label><input name="met_fd_ok" type="radio" class="radio" value="1" $met_fd_ok1[1] />{$lang_open}</label>
<label><input name="met_fd_ok" type="radio" class="radio" value="0" $met_fd_ok1[0]/>{$lang_close}</label>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincTime}{$lang_marks}</dt>
<dd>
<input name="met_fd_time" type="text" class="text" value="$met_fd_time" />
<span class="tips">{$lang_fdincTip4}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincSlash}{$lang_marks}</dt>
<dd>
<textarea name="met_fd_word" class="textarea gen" cols="50" rows="3" >$met_fd_word</textarea>
<span class="tips">{$lang_fdincTip5}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_message_name}{$lang_marks}</dt>
<dd>
<select name="met_message_fd_class">
<!--
EOT;
foreach($fd_paraall as $key=>$val){
$select1='';
if($val[id]==$met_message_fd_class)$select1="selected='selected'";
echo <<<EOT
--> <option value="$val[id]" $select1 >$val[name]</option>
<!--
EOT;
}
echo <<<EOT
-->
</select>
<span class="tips">{$lang_message_name1}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_message_content}{$lang_marks}</dt>
<dd>
<select name="met_message_fd_content">
<!--
EOT;
foreach($fd_paraalls as $key=>$val){
$select1='';
if($val[id]==$met_message_fd_content)$select1="selected='selected'";
echo <<<EOT
--> <option value="$val[id]" $select1 >$val[name]</option>
<!--
EOT;
}
echo <<<EOT
-->
</select>
<span class="tips">{$lang_message_content1}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_messageincShow}{$lang_marks}</dt>
<dd>
<label><input name="met_fd_type" type="checkbox" class="checkbox" value="1" $met_fd_type1 />{$lang_messageincTip3}</label>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_messageincSend}{$lang_marks}</dt>
<dd>
<label><input name="met_fd_email" type="checkbox" class="checkbox" value="1" $met_fd_email1 />{$lang_messageincTip4}</label>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_message_AcceptMail}{$lang_marks}</dt>
<dd>
<input name="met_fd_to" type="text" class="text" value="$met_fd_to" />
<span class="tips">{$lang_fdincTip9}</span>
</dd>
</dl>
</div>
<h3 class="v52fmbx_hr metsliding" sliding="1">{$lang_feedbackauto}</h3>
<div class="metsliding_box metsliding_box_1">
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincAuto}{$lang_marks}</dt>
<dd>
<label><input name="met_fd_back" type="checkbox" class="checkbox" value="1" {$met_fd_back1} />{$lang_fdincTip10}</label>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincEmailName}{$lang_marks}</dt>
<dd>
<select name="met_message_fd_email">
<!--
EOT;
foreach($fd_paraall as $key=>$val){
$select1='';
if($val[id]==$met_message_fd_email)$select1="selected='selected'";
echo <<<EOT
-->
<option value="$val[id]" $select1 >$val[name]</option>
<!--
EOT;
}
echo <<<EOT
-->
</select>
<span class="tips">{$lang_fdincTip11}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincFeedbackTitle}{$lang_marks}</dt>
<dd>
<input name="met_fd_title" type="text" class="text" value="$met_fd_title" />
<span class="tips">{$lang_fdincAutoFbTitle}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincAutoContent}{$lang_marks}</dt>
<dd>
<textarea name="met_fd_content" cols="50" class="textarea gen" rows="3">$met_fd_content</textarea>
<span class="tips">{$lang_htmlok}</span>
</dd>
</dl>
</div>
<h3 class="v52fmbx_hr metsliding" sliding="1">{$lang_feedbackautosms}</h3>
<div class="metsliding_box metsliding_box_1">
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincAutosms}{$lang_marks}</dt>
<dd>
<label><input type="checkbox" value=1 name="met_fd_sms_back" $met_fd_sms_back1/>{$lang_fdincTipsms}</label>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdinctellsms}{$lang_marks}</dt>
<dd>
<select name="met_message_fd_sms">
<!--
EOT;
foreach($fd_paraall as $key=>$val){
$select1='';
if($val[id]==$met_message_fd_sms)$select1="selected='selected'";
echo <<<EOT
-->
<option value="$val[id]" $select1 >$val[name]</option>
<!--
EOT;
}
echo <<<EOT
-->
</select>
<span class="tips">{$lang_fdinctells}</span>
</dd>
</dl>
</div>
<div class="v52fmbx_dlbox">
<div class="v52fmbx_dlbox">
<dl>
<dt>{$lang_fdincAutoContentsms}{$lang_marks}</dt>
<dd>
<textarea name="met_fd_sms_content" cols="50" class="textarea gen" rows="3">$met_fd_sms_content</textarea>
<span class="tips"></span>
</dd>
</dl>
</div>
<div class="v52fmbx_submit">
<input type="submit" name="Submit" value="{$lang_Submit}" class="submit" onclick="return Smit($(this),'myform')" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
<div class="footer">{$foot}</div>
</body>
</html>
<!--
EOT;
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.d.
?>--> | maicong/OpenAPI | MetInfo5.2/admin/templates/met/content/message/inc.html | HTML | mit | 6,182 |
<?
include('dbconnect.php');
$headerOptions = array(
"title" => "Edit Stats"
);
require_once "header.php";
?>
<?php
$tn = $_GET['tn'];
$played = $_GET['played'];
$wins = $_GET['wins'];
$losses = $_GET['losses'];
$draws = $_GET['draws'];
$ncs = $_GET['ncs'];
$sql = "SELECT team_id FROM Team WHERE team_name='".$tn."';";
$result = mysql_query($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
$tid = mysql_result($result, 0);
//Update game...
$sql = "UPDATE Stats SET played='".$played."', wins='".$wins."', losses='".$losses."', draws='".$draws."', ncs='".$ncs."' WHERE team_id='".$tid."';";
$result = mysql_query($sql) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $sql . "<br />\nError: (" . mysql_errno() . ") " . mysql_error());
//$sql = "SELECT game_id FROM Game WHERE game_date='".$date."' AND game_time='".$time."' AND game_location='".$location."';";
//Redirect back to getteam.php
header("Location: getteam.php?teamname=".$tn."");//?leaguetype='".$leaguetype."'&sport='".$sport."'&submit=Set+League");
?>
| anshaik/recsports | webapp/advproj/editstats.php | PHP | mit | 1,187 |
version https://git-lfs.github.com/spec/v1
oid sha256:b1b66ad7cf63a081650856aed61fbfdf1b6b511e47c622989e9927e504424a5d
size 2493
| yogeshsaroya/new-cdnjs | ajax/libs/jquery.lazyloadxt/0.8.12/jquery.lazyloadxt.extra.min.js | JavaScript | mit | 129 |
#include "ErrorCodes.h"
std::error_code make_error_code(SimBlockErrc ec)
{
return {static_cast<int>(ec), simblockErrCategory};
}
| josokw/Fuzzy | libDySySim/ErrorCodes.cpp | C++ | mit | 133 |
<?php
/*
Safe sample
input : backticks interpretation, reading the file /tmp/tainted.txt
sanitize : cast in float
construction : use of sprintf via a %d 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 = `cat /tmp/tainted.txt`;
$tainted = (float) $tainted ;
$var = include(sprintf("pages/'%d'.php", $tainted));
?> | stivalet/PHP-Vulnerability-test-suite | Injection/CWE_98/safe/CWE_98__backticks__CAST-cast_float__include_file_id-sprintf_%d_simple_quote.php | PHP | mit | 1,212 |
<div class="ui container" id="event">
<div class="ui stackable one column grid">
<div class="column">
<div class="ui card">
<div class="content">
<div class="header">{{ vm.event.attributes.title }}</div>
</div><!-- header -->
<div class="content">
<h3>Organization: {{ vm.event.attributes.organization }}</h3>
<div class="ui large feed">
<div class="event">
<div class="content">
<div class="summary">
<span ng-if="vm.event.attributes.address != null">Location: {{ vm.event.attributes.address }}</span>
<span ng-if="vm.event.attributes.address == null">Location: N/A</span>
<br>
<span ng-if="vm.event.attributes.start != null">Start Date: {{ vm.event.attributes.start | amDateFormat: 'dddd, MMMM Do YYYY, h:mm a' }}</span>
<span ng-if="vm.event.attributes.start == null">Start Date: N/A</span>
<br>
<span ng-if="vm.event.attributes.end != null">End Date: {{ vm.event.attributes.end | amDateFormat: 'dddd, MMMM Do YYYY, h:mm a' }}</span>
<span ng-if="vm.event.attributes.end == null">End Date: N/A</span>
<br>
<h3>Information</h3>
Description:
<br>
<p ng-if="vm.event.attributes.description != null">{{ vm.event.attributes.description }}</p>
<p ng-if="vm.event.attributes.description == null">No description. Please visit the link for more details!</p>
<p ng-if="vm.event.attributes.age != null">Minimum Age: {{ vm.event.attributes.age }}</p>
<p ng-if="vm.event.attributes.age == null">Minimum Age: No age requirement!</p>
<p ng-if="vm.event.attributes.skills != null">Skills Needed: {{ vm.event.attributes.skills }}</p>
<p ng-if="vm.event.attributes.skills == null">Skills Needed: No skills required!</p>
</div>
</div>
</div>
</div>
</div><!-- content -->
<div class="ui positive right labeled icon button" ng-click="vm.hyperlink()">Volunteer Now <i class="checkmark icon"></i></div><!-- volunteer button -->
</div><!-- card -->
<br>
<div class="ui card" id="comment">
<comments></comments>
<h3 class="form-header">Comments</h3>
<div class="ui relaxed divided list">
<div class="item" ng-repeat="comment in vm.comments">
<div class="item">
<div class="content">
<div class="header">{{ comment.attributes.name }} says...</div>
<div class="description">{{ comment.attributes.content }}</div>
</div>
</div>
</div>
</div>
</div><!-- comments -->
</div><!-- column -->
</div><!-- grid -->
</div>
| evanscloud/uponnyc | app/assets/javascripts/events/show.html | HTML | mit | 2,987 |
<?php
namespace Oriancci\Query;
class Insert extends Built
{
public function buildQuery()
{
// INSERT INTO
$sql = 'INSERT INTO ';
$sql .= $this->buildTableName(INSERT_INTO);
// SET
$sql .= ' SET ';
$sql .= $this->buildSet(SET);
return $sql;
}
}
| bashaus/oriancci | src/Oriancci/Query/Insert.php | PHP | mit | 322 |
package pl.yourempire.api.event;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
public class Event
{
private static Map<Class<Event>, ArrayList<ListenerCaller>> listenerMap = new HashMap<>();
public static void callEvent(Event e)
{
if (listenerMap.containsKey(e.getClass()))
{
for (ListenerCaller lc : listenerMap.get(e.getClass()))
{
try
{
lc.getEventMethod().invoke(lc.getInstance(), e);
} catch (IllegalAccessException e1)
{
e1.printStackTrace();
} catch (InvocationTargetException e1)
{
e1.printStackTrace();
}
}
}
}
public static boolean isEvent(Class<?> clazz)
{
try
{
clazz.cast(Event.class);
return true;
} catch(ClassCastException e)
{
return false;
}
}
public static void registerListener(Listener l)
{
Arrays.asList(l.getClass().getMethods()).forEach(m -> {
if (m.getParameterTypes().length == 1 && isEvent(m.getParameterTypes()[0]))
{
listenerMap.get(m.getParameterTypes()[0]).add(new ListenerCaller(l, m));
}
});
}
protected boolean cancelled;
public Event()
{
cancelled = false;
}
public void setCancelled(boolean flag)
{
this.cancelled = flag;
}
public boolean isCancelled()
{
return this.cancelled;
}
}
| YourEmpire/YourEmpire | Your Empire API/src/main/java/pl/yourempire/api/event/Event.java | Java | mit | 1,714 |
<!DOCTYPE html>
<html class="no-js" lang="hi">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="p5.js a JS client-side library for creating graphic and interactive experiences, based on the core principles of Processing.">
<title tabindex="1">examples | p5.js</title>
<link rel="stylesheet" href="/assets/css/all.css?v=4c8161">
<link href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inconsolata&display=swap" rel="stylesheet">
<link rel="shortcut icon" href="/../../assets/img/favicon.ico">
<link rel="icon" href="/../../assets/img/favicon.ico">
<script src="/../../assets/js/vendor/jquery-1.12.4.min.js"></script>
<script src="/../../assets/js/vendor/ace-nc/ace.js"></script>
<script src="/../../assets/js/vendor/ace-nc/mode-javascript.js"></script>
<script src="/../../assets/js/vendor/prism.js"></script>
<script src="/assets/js/init.js?v=97b4f7"></script>
</head>
<body>
<a href="#content" class="sr-only">Skip to content</a>
<!-- p5*js language buttons -->
<div id="i18n-btn">
<h2 id="i18n-settings" class="sr-only">Language Settings</h2>
<ul id="i18n-buttons" aria-labelledby="i18n-settings">
<li><a href='#' lang='en' data-lang='en'>English</a></li>
<li><a href='#' lang='es' data-lang='es'>Español</a></li>
<li><a href='#' lang='zh-Hans' data-lang='zh-Hans'>简体中文</a></li>
<li><a href='#' lang='ko' data-lang='ko'>한국어</a></li>
<li><a href='#' lang='hi' data-lang='hi'>हिन्दी</a></li>
</ul>
</div> <!-- .container -->
<div class="container">
<!-- logo -->
<header id="lockup">
<a href="/hi/">
<img src="/../../assets/img/p5js.svg" alt="p5 homepage" id="logo_image" class="logo" />
<div id="p5_logo"></div>
</a>
</header>
<!-- close logo -->
<div id="examples-page">
<!-- site navigation -->
<div class="column-span">
<nav class="sidebar-menu-nav-element">
<h2 id="menu-title" class="sr-only">Site Navigation</h2>
<input class="sidebar-menu-btn" type="checkbox" id="sidebar-menu-btn" />
<label class="sidebar-menu-icon" for="sidebar-menu-btn"><span class="sidebar-nav-icon"></span></label>
<ul id="menu" class="sidebar-menu" aria-labelledby="menu-title">
<li><a href="/hi/">सभी</a></li>
<li><a href="https://editor.p5js.org">एडीटर</a></li>
<li><a href="/hi/download/">डाउनलोड</a></li>
<li><a href="/hi/download/support.html">दान दिजिये</a></li>
<li><a href="/hi/get-started/">आरंभ करें</a></li>
<li><a href="/hi/reference/">संदर्भ</a></li>
<li><a href="/hi/libraries/">लाइब्रिरी</a></li>
<li><a href="/hi/learn/">सीखिए</a></li>
<li><a href="/hi/teach/">सिखाना</a></li>
<li><a href="/hi/examples/">उदाहरण</a></li>
<li><a href="/hi/books/">पुस्तकें</a></li>
<li><a href="/hi/community/">समुदाय</a></li>
<li><a href="https://showcase.p5js.org">प्रदर्शन</a></li>
<li><a href="https://discourse.processing.org/c/p5js" target=_blank class="other-link">फोरम</a></li>
<li><a href="http://github.com/processing/p5.js" target=_blank class="other-link">GitHub</a></li>
<li><a href="http://twitter.com/p5xjs" target=_blank class="other-link">Twitter</a></li>
<li><a href="https://www.instagram.com/p5xjs/" target=_blank class="other-link">Instagram</a></li>
<li><a href="https://discord.gg/SHQ8dH25r9" target=_blank class="other-link">Discord</a></li>
</ul>
</nav>
</div>
<div class="column-span">
<main id="content" >
<p id="backlink"><a href="./">< उदाहरण</a></p>
<h1 id='example-name'>example name placeholder</h1>
<p id='example-desc'>example description placeholder</p>
<div id="exampleDisplay">
<div class="edit_space">
<button id="toggleTextOutput" class="sr-only">toggle text output</button>
<button id="runButton" class="edit_button">run</button>
<button id="resetButton" class="reset_button">reset</button>
<button id="copyButton" class="copy_button">copy</button>
</div>
<div id="exampleEditor"></div>
<iframe id="exampleFrame" src="../../assets/examples/example.html" aria-label="example arialabel placeholder" ></iframe>
</div>
<p><a style="border-bottom:none !important;" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target=_blank><img src="https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png" alt="creative commons license" style="width:88px"/></a></p>
</main>
<footer>
<h2 class="sr-only">आभार सूची</h2>
<p>
वर्तमान में p5.js का नेतृत्व करने वाले <a href='http://qianqian-ye.com/' target="_blank">Qianqian Ye</a> और <a href='http://www.outofambit.com/' target="_blank">evelyn masso</a> हैं| इसकी खोज करने वाले थे <a href='https://lauren-mccarthy.com' target="_blank">Lauren Lee McCarthy</a> p5.js सहयोगियों के एक समुदाय द्वारा विकसित किया गया है और समर्थन करने वाले थे <a href="https://processingfoundation.org/" target="_blank">Processing Foundation</a> और <a href="https://itp.nyu.edu/itp/" target="_blank">NYU ITP</a> पहचान और ग्राफिक डिजाइन करने वाले थे <a href="https://jereljohnson.com/" target="_blank">Jerel Johnson</a>. <a href="/hi/copyright.html">© Info</a>.
</p>
</footer>
</div> <!-- end column-span -->
<!-- outside of column for footer to go across both -->
<p class="clearfix"> </p>
<object type="image/svg+xml" data="../../assets/img/thick-asterisk-alone.svg" id="asterisk-design-element" aria-hidden="true">
</object>
<!-- <script src="../../assets/js/vendor/ace-nc/ace.js"></script>
<script src="../../assets/js/examples.js"></script> -->
<script>
window._p5jsExample = '../../assets/examples/hi/10_Interaction/10_Tickle.js';
window.addEventListener('load', function() {
// examples.init('../../assets/examples/hi/10_Interaction/10_Tickle.js');
if (false) {
var isMobile = window.matchMedia("only screen and (max-width: 767px)");
// isMobile is true if viewport is less than 768 pixels wide
document.getElementById('exampleFrame').style.display = 'none';
if (isMobile.matches) {
document.getElementById('notMobile-message').style.display = 'none';
document.getElementById('isMobile-displayButton').style.display = 'block';
} else {
document.getElementById('notMobile-message').style.display = 'block';
document.getElementById('isMobile-displayButton').style.display = 'none';
document.getElementById('runButton').style.display = 'none';
document.getElementById('resetButton').style.display = 'none';
document.getElementById('copyButton').style.display = 'none';
}
}
}, true);
</script>
</div><!-- end id="get-started-page" -->
<script src="/../../assets/js/examples.js"></script>
</div> <!-- close class='container'-->
<nav id="family" aria-labelledby="processing-sites-heading">
<h2 id="processing-sites-heading" class="sr-only">Processing Sister Sites</h2>
<ul id="processing-sites" aria-labelledby="processing-sites-heading">
<li><a href="https://processing.org">Processing</a></li>
<li><a class="here" href="/hi/">p5.js</a></li>
<li><a href="https://py.processing.org/">Processing.py</a></li>
<li><a href="https://android.processing.org/">Processing for Android</a></li>
<li><a href="https://pi.processing.org/">Processing for Pi</a></li>
<li><a href="https://processingfoundation.org/">Processing Foundation</a></li>
</ul>
<a tabindex="1" href="#content" id="skip-to-content">Skip to main content</a>
</nav>
<script>
var langs = ["en","es","hi","ko","zh-Hans"];
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-53383000-1', 'auto');
ga('send', 'pageview');
$(window).ready(function() {
if (window.location.pathname !== '/' && window.location.pathname !== '/index.html') {
$('#top').remove();
} else {
$('#top').show();
}
});
</script>
</body>
</html>
| mayaman26/p5js-website | hi/examples/interaction-tickle.html | HTML | mit | 9,312 |
tinyMCE.init({
mode : 'textareas',
theme : "advanced",
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
}); | thoas/i386 | src/milkshape/media/tiny_mce/init.js | JavaScript | mit | 502 |
package org.fluentjava.iwant.plannerapi;
public interface ResourcePool {
boolean hasFreeResources();
Resource acquire();
void release(Resource resource);
}
| wipu/iwant | essential/iwant-planner-api/src/main/java/org/fluentjava/iwant/plannerapi/ResourcePool.java | Java | mit | 164 |
SampleApp
=========
| CriolloKit/SampleApp | README.md | Markdown | mit | 20 |
#ifndef ENDOCAST_EXTRACTOR_HPP
#define ENDOCAST_EXTRACTOR_HPP 1
#include <mi/VolumeData.hpp>
class EndocastExtractor
{
private:
public:
EndocastExtractor ( void ) ;
~EndocastExtractor ( void ) ;
bool extract ( mi::VolumeData<float>& distData, mi::VolumeData<int>& labelData, const double scale ) ;
private:
bool init ( mi::VolumeData<float>& distData, mi::VolumeData<int>& labelData, const double scale ) ;
bool run ( mi::VolumeData<float>& distData, mi::VolumeData<int>& labelData ) ;
};
#endif // ENDOCAST_EXTRACTOR_HPP | tmichi/xendocast | xendocast/EndocastExtractor.hpp | C++ | mit | 579 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>qcert: 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.2 / qcert - 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>
qcert
<small>
1.0.5
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-10-27 14:06:13 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-27 14:06:13 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.2 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: "[email protected]"
homepage: "https://querycert.github.io"
dev-repo: "git+https://github.com/querycert/qcert"
bug-reports: "https://github.com/querycert/qcert/issues"
authors: [ "Josh Auerbach" "Martin Hirzel" "Louis Mandel" "Avi Shinnar" "Jerome Simeon" ]
license: "Apache-2.0"
build: [
[make "-j%{jobs}%" "qcert-coq"]
]
install: [
[make "install-coq"]
]
depends: [
"ocaml"
"coq" {>= "8.7.2" & < "8.8"}
]
synopsis: "A platform for implementing and verifying query compilers"
url {
src: "https://github.com/querycert/qcert/archive/v1.0.5.tar.gz"
checksum: "md5=3904c818b69823498769cacc1774c5d6"
}
</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-qcert.1.0.5 coq.8.12.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.12.2).
The following dependencies couldn't be met:
- coq-qcert -> 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-qcert.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.07.1-2.0.6/released/8.12.2/qcert/1.0.5.html | HTML | mit | 6,495 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>menhirlib: 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 / menhirlib - 20201122</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
menhirlib
<small>
20201122
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-12-23 01:13:15 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-12-23 01:13:15 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.10.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.2 Official release 4.10.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.1 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
synopsis: "A support library for verified Coq parsers produced by Menhir"
maintainer: "[email protected]"
authors: [
"Jacques-Henri Jourdan <[email protected]>"
]
homepage: "https://gitlab.inria.fr/fpottier/coq-menhirlib"
dev-repo: "git+https://gitlab.inria.fr/fpottier/menhir.git"
bug-reports: "[email protected]"
license: "LGPL-3.0-or-later"
build: [
[make "-C" "coq-menhirlib" "-j%{jobs}%"]
]
install: [
[make "-C" "coq-menhirlib" "install"]
]
depends: [
"coq" { >= "8.7" & < "8.14" }
]
conflicts: [
"menhir" { != "20201122" }
]
tags: [
"date:2020-11-22"
"logpath:MenhirLib"
]
url {
src:
"https://gitlab.inria.fr/fpottier/menhir/-/archive/20201122/archive.tar.gz"
checksum: [
"md5=9ad6a5f88aab6ec677b970e0d9de1763"
"sha512=9174e74cfb2336c5008c7461411ba79190e673d310da99117e363f60782bcf9a4bb26a04f6448cf6f3ed7888aa2b5b04d38c32e6d86594accfaadbbb72528068"
]
}
</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-menhirlib.20201122 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-menhirlib -> coq < 8.14 -> ocaml < 4.10
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-menhirlib.20201122</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.10.2-2.0.6/released/8.14.0/menhirlib/20201122.html | HTML | mit | 7,030 |
/* eslint-env node */
'use strict';
const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
module.exports = function(defaults) {
let app = new EmberAddon(defaults, {
'ember-cli-babel': {
includePolyfill: true
}
});
app.import('node_modules/highlightjs/styles/monokai-sublime.css');
/*
This build file specifies the options for the dummy test app of this
addon, located in `/tests/dummy`
This build file does *not* influence how the addon or the app using it
behave. You most likely want to be modifying `./index.js` or app's build file
*/
return app.toTree();
};
| btecu/ember-keyboard | ember-cli-build.js | JavaScript | mit | 621 |
import { SplashEffect } from "./effect.js";
import { Linear } from "../interpolation.js";
export class TranslateFromPosition extends SplashEffect {
constructor(element, options) {
super(element);
options = options || {};
this.x = options.x || 0;
this.y = options.y || 0;
// Can be whatever, but the effect won't do
// anything if it isn't a valid css unit.
this.unit = options.unit || "px";
// Can be either "transform" or "position"
this.translationType = options.translationType || "transform";
this.interpolation = options.interpolation || new Linear();
}
in(value) {
this._set(
this.interpolation.in(value * -1 + 1) * this.x,
this.interpolation.in(value * -1 + 1) * this.y
);
}
out(value) {
this._set(
this.interpolation.out(value) * this.x,
this.interpolation.out(value) * this.y
);
}
_set(x, y) {
if (this.translationType = "transform") {
this.setTransform("translateX", x + this.unit);
this.setTransform("translateY", y + this.unit);
} else if (this.translationType = "position") {
this.setStyle("left", x + this.unit);
this.setStyle("top", y + this.unit);
} else {
console.error("Unknown translation type: " + this.translationType);
}
}
}
| magnontobi/splasher.js | src/js/effects/translateFromPosition.js | JavaScript | mit | 1,226 |
/*------------------------------------------------------------------------------
27.0 - Localization
------------------------------------------------------------------------------*/
/* RTL except Hebrew (see below): Tahoma as the first font; */
body.rtl,
body.rtl .press-this a.wp-switch-editor {
font-family: Tahoma, Arial, sans-serif;
}
/* Arial is best for RTL headings. */
.rtl h1,
.rtl h2,
.rtl h3,
.rtl h4,
.rtl h5,
.rtl h6 {
font-family: Arial, sans-serif;
font-weight: 600;
}
/* he_IL: Remove Tahoma from the font stack. Arial is best for Hebrew. */
body.locale-he-il,
body.locale-he-il .press-this a.wp-switch-editor {
font-family: Arial, sans-serif;
}
/* he_IL: Have <em> be bold rather than italic. */
.locale-he-il em {
font-style: normal;
font-weight: 600;
}
/* zh_CN: Remove italic properties. */
.locale-zh-cn .howto,
.locale-zh-cn .tablenav .displaying-num,
.locale-zh-cn .js .input-with-default-title,
.locale-zh-cn .link-to-original,
.locale-zh-cn .inline-edit-row fieldset span.title,
.locale-zh-cn .inline-edit-row fieldset span.checkbox-title,
.locale-zh-cn #utc-time,
.locale-zh-cn #local-time,
.locale-zh-cn p.install-help,
.locale-zh-cn p.help,
.locale-zh-cn p.description,
.locale-zh-cn span.description,
.locale-zh-cn .form-wrap p {
font-style: normal;
}
/* zh_CN: Enlarge dashboard widget 'Configure' link */
.locale-zh-cn .hdnle a { font-size: 12px; }
/* zn_CH: Enlarge font size, set font-size: normal */
.locale-zh-cn form.upgrade .hint { font-style: normal; font-size: 100%; }
/* zh_CN: Enlarge font-size. */
.locale-zh-cn #sort-buttons { font-size: 1em !important; }
/* de_DE: Text needs more space for translation */
.locale-de-de #customize-header-actions .button,
.locale-de-de-formal #customize-header-actions .button {
padding: 0 5px 1px; /* default 0 10px 1px */
}
.locale-de-de #customize-header-actions .spinner,
.locale-de-de-formal #customize-header-actions .spinner {
margin: 16px 3px 0; /* default 16px 4px 0 5px */
}
/* ru_RU: Text needs more room to breathe. */
.locale-ru-ru #adminmenu {
width: inherit; /* back-compat for pre-3.2 */
}
.locale-ru-ru #adminmenu,
.locale-ru-ru #wpbody {
margin-right: 0; /* back-compat for pre-3.2 */
}
.locale-ru-ru .inline-edit-row fieldset label span.title,
.locale-ru-ru .inline-edit-row fieldset.inline-edit-date legend {
width: 8em; /* default 6em */
}
.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap {
margin-right: 8em; /* default 6em */
}
.locale-ru-ru.post-php .tagsdiv .newtag,
.locale-ru-ru.post-new-php .tagsdiv .newtag {
width: 165px; /* default 180px - 15px */
}
.locale-ru-ru.press-this .posting {
margin-left: 277px; /* default 252px + 25px */
}
.locale-ru-ru .press-this-sidebar {
width: 265px; /* default 240px + 25px */
}
.locale-ru-ru #customize-header-actions .button {
padding: 0 5px 1px; /* default 0 10px 1px */
}
.locale-ru-ru #customize-header-actions .spinner {
margin: 16px 3px 0; /* default 16px 4px 0 5px */
}
/* lt_LT: QuickEdit */
.locale-lt-lt .inline-edit-row fieldset label span.title,
.locale-lt-lt .inline-edit-row fieldset.inline-edit-date legend {
width: 8em; /* default 6em */
}
.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
margin-right: 8em; /* default 6em */
}
@media screen and (max-width: 782px) {
.locale-ru-ru .inline-edit-row fieldset label span.input-text-wrap,
.locale-ru-ru .inline-edit-row fieldset .timestamp-wrap,
.locale-lt-lt .inline-edit-row fieldset label span.input-text-wrap,
.locale-lt-lt .inline-edit-row fieldset .timestamp-wrap {
margin-right: 0;
}
}
| GMack88/Portfolio-Website | bootstrap-3.3.7/blog/wp-admin/css/l10n-rtl.css | CSS | mit | 3,812 |
<html><img border=0 src=716-53-0.txt alt=716-53-0.txt></img><body>
"x"
"1" "KAZIUS, J, MCGUIRE, R AND BURSI, R. DERIVATION AND VALIDATION OF TOXICOPHORES FOR MUTAGENICITY PREDICTION. J. MED. CHEM. 48: 312-320, 2005"
</body></html>
| andrewdefries/Ames_ToxBenchmark | 716-53-0.txt.html | HTML | mit | 231 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>quicksort-complexity: 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.4.5 / quicksort-complexity - 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>
quicksort-complexity
<small>
8.6.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-02-05 04:20:23 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-05 04:20:23 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 2 Virtual package relying on perl
coq 8.4.5 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
ocamlbuild 0 Build system distributed with the OCaml compiler since OCaml 3.10.0
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-contribs/quicksort-complexity"
license: "BSD"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/QuicksortComplexity"]
depends: [
"ocaml"
"coq" {>= "8.6" & < "8.7~"}
]
tags: [ "keyword: quicksort" "keyword: complexity" "keyword: average-case" "category: Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms" "date: 2010-06" ]
authors: [ "Eelis" ]
bug-reports: "https://github.com/coq-contribs/quicksort-complexity/issues"
dev-repo: "git+https://github.com/coq-contribs/quicksort-complexity.git"
synopsis: "Proofs of Quicksort's worst- and average-case complexity"
description: """
The development contains:
- a set of monads and monad transformers for measuring a (possibly nondeterministic) algorithm's use of designated operations;
- monadically expressed deterministic and nondeterministic implementations of Quicksort;
- proofs of these implementations' worst- and average case complexity.
Most of the development is documented in the TYPES 2008 paper "A Machine-Checked Proof of the Average-Case Complexity of Quicksort in Coq", available at the homepage."""
flags: light-uninstall
url {
src:
"https://github.com/coq-contribs/quicksort-complexity/archive/v8.6.0.tar.gz"
checksum: "md5=8e941edc995b59591f737b122b66817c"
}
</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-quicksort-complexity.8.6.0 coq.8.4.5</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.4.5).
The following dependencies couldn't be met:
- coq-quicksort-complexity -> coq >= 8.6 -> 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-quicksort-complexity.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.02.3-2.0.6/released/8.4.5/quicksort-complexity/8.6.0.html | HTML | mit | 7,787 |
// The MIT License (MIT)
//
// Copyright (c) Andrew Armstrong/FacticiusVir 2020
//
// 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.
// This file was automatically generated and should not be edited directly.
using System;
using System.Runtime.InteropServices;
namespace SharpVk
{
/// <summary>
/// Structure specifying parameters of a newly created framebuffer.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct FramebufferCreateInfo
{
/// <summary>
/// Reserved for future use.
/// </summary>
public SharpVk.FramebufferCreateFlags? Flags
{
get;
set;
}
/// <summary>
/// A render pass that defines what render passes the framebuffer will
/// be compatible with.
/// </summary>
public SharpVk.RenderPass RenderPass
{
get;
set;
}
/// <summary>
/// An array of ImageView handles, each of which will be used as the
/// corresponding attachment in a render pass instance.
/// </summary>
public SharpVk.ImageView[] Attachments
{
get;
set;
}
/// <summary>
/// width, height and layers define the dimensions of the framebuffer.
/// If the render pass uses multiview, then layers must be one and each
/// attachment requires a number of layers that is greater than the
/// maximum bit index set in the view mask in the subpasses in which it
/// is used.
/// </summary>
public uint Width
{
get;
set;
}
/// <summary>
///
/// </summary>
public uint Height
{
get;
set;
}
/// <summary>
///
/// </summary>
public uint Layers
{
get;
set;
}
/// <summary>
///
/// </summary>
/// <param name="pointer">
/// </param>
internal unsafe void MarshalTo(SharpVk.Interop.FramebufferCreateInfo* pointer)
{
pointer->SType = StructureType.FramebufferCreateInfo;
pointer->Next = null;
if (this.Flags != null)
{
pointer->Flags = this.Flags.Value;
}
else
{
pointer->Flags = default(SharpVk.FramebufferCreateFlags);
}
pointer->RenderPass = this.RenderPass?.handle ?? default(SharpVk.Interop.RenderPass);
pointer->AttachmentCount = (uint)(Interop.HeapUtil.GetLength(this.Attachments));
if (this.Attachments != null)
{
var fieldPointer = (SharpVk.Interop.ImageView*)(Interop.HeapUtil.AllocateAndClear<SharpVk.Interop.ImageView>(this.Attachments.Length).ToPointer());
for(int index = 0; index < (uint)(this.Attachments.Length); index++)
{
fieldPointer[index] = this.Attachments[index]?.handle ?? default(SharpVk.Interop.ImageView);
}
pointer->Attachments = fieldPointer;
}
else
{
pointer->Attachments = null;
}
pointer->Width = this.Width;
pointer->Height = this.Height;
pointer->Layers = this.Layers;
}
}
}
| FacticiusVir/SharpVk | src/SharpVk/FramebufferCreateInfo.gen.cs | C# | mit | 4,531 |
namespace Sorting
{
using System;
using System.Collections.Generic;
using Constants;
/// <summary>
/// Define class for selection sort algorithm and its implementation
/// </summary>
/// <typeparam name="T">Type of the elements to be sorted</typeparam>
/// <see cref="https://en.wikipedia.org/wiki/Selection_sort"/>
/// <seealso cref="http://www.algolist.net/Algorithms/Sorting/Selection_sort"/>
public class SelectionSorter<T> : ISorter<T> where T : IComparable<T>
{
public void Sort(IList<T> collection)
{
if (collection == null)
{
throw new ArgumentNullException(ExceptionMessage.CollectionCannotBeNullExceptionMessage);
}
int swapIndex = 0;
for (int i = 0; i < collection.Count - 1; i++)
{
swapIndex = i;
for (int j = i + 1; j < collection.Count; j++)
{
if (collection[swapIndex].CompareTo(collection[j]) > 0)
{
swapIndex = j;
}
}
this.Swap(collection, i, swapIndex);
}
}
private void Swap(IList<T> collection, int index, int swapIndex)
{
T swap = collection[index];
collection[index] = collection[swapIndex];
collection[swapIndex] = swap;
}
}
}
| DimitarSD/Telerik-Academy | 01. Programming/05. Data Structures and Algorithms [C#]/11. Sorting Algorithms/Sorting/SelectionSorter.cs | C# | mit | 1,456 |
# encoding: utf-8
module Axiom
class Relation
module Operation
# A mixin for Binary relations
module Binary
include Axiom::Operation::Binary
# Hook called when module is included
#
# @param [Module] descendant
# the module or class including Binary
#
# @return [undefined]
#
# @api private
def self.included(descendant)
super
descendant.extend(ClassMethods)
end
private_class_method :included
# Initialize a Binary relation
#
# @return [undefined]
#
# @api private
def initialize(*)
super
@header = left.header | right.header
end
module ClassMethods
# Instantiate a new Binary relation
#
# @example
# binary = BinaryRelation.new(left, right)
#
# @param [Relation] left
# @param [Relation] right
#
# @return [Binary]
#
# @api public
def new(left, right)
assert_sorted_match(left, right)
super
end
private
# Assert that sorted and unsorted relations are not mixed
#
# @param [Relation] left
# @param [Relation] right
#
# @return [undefined]
#
# @raise [RelationMismatchError]
# raised if one relation is sorted and the other is not
#
# @api private
def assert_sorted_match(left, right)
if left.directions.empty? != right.directions.empty?
fail RelationMismatchError, 'both relations must be sorted or neither may be sorted'
end
end
end # module ClassMethods
end # module Binary
end # module Operation
end # class Relation
end # module Axiom
| solnic/axiom | lib/axiom/relation/operation/binary.rb | Ruby | mit | 1,923 |
<?php
/**
* @file
*
* Contains \Drupal\Tests\test_example\Unit\TestExampleConversionsTest.
*/
namespace Drupal\Tests\test_example\Functional;
use Drupal\simpletest\BrowserTestBase;
/**
* Ensure that the simpletest_example content type provided functions properly.
*
* The TestExampleFunctionalTest is a functional test case, meaning that it
* actually exercises a particular sequence of actions through the web UI.
* The majority of core test cases are done this way, but the SimpleTest suite
* also provides unit tests as demonstrated in the unit test case example later
* in this file.
*
* Functional test cases are far slower to execute than unit test cases because
* they require a complete Drupal install to be done for each test.
*
* @see Drupal\simpletest\BrowserTestBase
* @see SimpleTestUnitTestExampleTestCase
*
* @ingroup test_example
*
* SimpleTest uses group annotations to help you organize your tests.
*
* @group test_example
* @group examples
*/
class TestExampleFunctionalTest extends BrowserTestBase {
/**
* The installation profile to use with this test.
*
* @var string
*/
protected $profile = 'standard';
/**
* Test node creation through the user interface.
*
* Creates a node using the node/add form and verifies its consistency in
* the database.
*/
public function testSimpleTestExampleCreate() {
// Create a user.
$user = $this->drupalCreateUser([], NULL, TRUE);
// Log in our user.
$this->drupalLogin($user);
// Create a node using the node/add form.
$edit = [];
$edit['title[0][value]'] = $this->randomMachineName(32);
$edit['body[0][value]'] = $this->randomMachineName(32);
$this->drupalPostForm('node/add/article', $edit, t('Save and publish'));
// Check that our article node has been created.
$this->assertText(t('@post @title has been created.', [
'@post' => 'Article',
'@title' => $edit['title[0][value]'],
]));
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit['title[0][value]']);
$this->assertTrue($node, 'Node found in database.');
}
}
| bighappyface/d8-testing-example | test_example/tests/src/Functional/TestExampleFunctionalTest.php | PHP | mit | 2,154 |
<?php
/*
/*
Safe sample
input : use exec to execute the script /tmp/tainted.php and store the output in $tainted
SANITIZE : uses indirect reference
construction : prepared query and no right verification
*/
/*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.*/
$script = "/tmp/tainted.php";
exec($script, $result, $return);
$tainted = $result[0];
$course_array = array();
//get the user id
$user_id = intval($_SESSION[‘user_id’]);
//creation of the references with only data allowed to the user
$result = mysql_query("SELECT * FROM COURSE where course.allowed = {$user_id}");
while ($row = mysql_fetch_array($result)) {
$course_array[] = $result[‘id’];
}
$_SESSION[‘course_array’] = $course_array;
if (isset($_SESSION[‘course_array’])) {
$course_array = $_SESSION[‘course_array’];
if (isset($course_array[$taintedId])) {
//indirect reference > get the right id
$tainted = $course_array[$tainted];
}
} else {
$tainted = 0; //default value
}
$query = "SELECT * FROM COURSE WHERE id=?";
$conn = mysql_connect('localhost', 'mysql_user', 'mysql_password'); //Connection to the database (address, user, password)
$stmt = $conn->prepare($query);
$stmt->bind_param("i", $checked_data);
$stmt->execute();
mysql_close($conn);
| designsecurity/progpilot | projects/tests/tests/vulntestsuite/CWE_862_SQL__exec__Indirect_reference__prepared_query-no_right_verification.php | PHP | mit | 2,134 |
package com.myconnector.client.domain;
import java.util.List;
import com.google.gwt.user.client.rpc.IsSerializable;
import com.myconnector.client.domain.interfaces.ITodoContext;
import com.myconnector.client.domain.interfaces.ITodoItem;
import com.myconnector.client.domain.interfaces.ITodoList;
public class TodoListClient implements IsSerializable, ITodoList {
private Long id;
private String title;
private boolean todoItemsLoaded = false;
private List<ITodoItem> todoItems;
private Integer position;
private ITodoContext context;
public TodoListClient() {
}
public TodoListClient(Long id, String title) {
super();
this.id = id;
this.title = title;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public List<ITodoItem> getTodoItems() {
return todoItems;
}
public void setTodoItems(List<ITodoItem> todoItems) {
this.todoItems = todoItems;
}
public Integer getPosition() {
return position;
}
public void setPosition(Integer position) {
this.position = position;
}
public boolean isTodoItemsLoaded() {
return todoItemsLoaded;
}
public void setTodoItemsLoaded(boolean todoItemsLoaded) {
this.todoItemsLoaded = todoItemsLoaded;
}
public ITodoContext getContext() {
return context;
}
public void setContext(ITodoContext context) {
this.context = context;
}
}
| nileshk/truedolist-java | src/main/java/com/myconnector/client/domain/TodoListClient.java | Java | mit | 1,476 |
/**
* Wheel, copyright (c) 2019 - present by Arno van der Vegt
* Distributed under an MIT license: https://arnovandervegt.github.io/wheel/license.txt
**/
const File = require('./File');
exports.FileDetail = class extends File.File {
constructor(opts) {
opts.className = 'file detail';
super(opts);
}
initDOM(parentNode) {
let file = this._file;
this.create(
parentNode,
{
id: this.setElement.bind(this),
className: this._className,
children: [
File.getIcon(this._getImage, file),
{
id: this.setLinkElement.bind(this),
type: 'a',
href: '#',
className: 'no-select name',
innerHTML: file.name
},
!file.directory && file.size ?
{
type: 'span',
href: '#',
className: 'no-select size',
innerHTML: file.size + ' - ' + this.bytesToSize(file.size)
} :
null,
(file.modified || file.hash) ?
{
type: 'span',
href: '#',
className: 'no-select modified',
innerHTML: file.modified || file.hash
} :
null
]
}
);
}
/**
* https://stackoverflow.com/questions/15900485/correct-way-to-convert-size-in-bytes-to-kb-mb-gb-in-javascript
**/
bytesToSize(bytes) {
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (parseInt(bytes, 10) === 0) {
return '0 Byte';
}
let i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
}
};
| ArnoVanDerVegt/wheel | js/frontend/lib/components/files/FileDetail.js | JavaScript | mit | 2,137 |
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Position } from '../core/position';
import { Range } from '../core/range';
import { InlineDecoration, ViewModelDecoration } from './viewModel';
import { filterValidationDecorations } from '../config/editorOptions';
var ViewModelDecorations = /** @class */ (function () {
function ViewModelDecorations(editorId, model, configuration, linesCollection, coordinatesConverter) {
this.editorId = editorId;
this.model = model;
this.configuration = configuration;
this._linesCollection = linesCollection;
this._coordinatesConverter = coordinatesConverter;
this._decorationsCache = Object.create(null);
this._cachedModelDecorationsResolver = null;
this._cachedModelDecorationsResolverViewRange = null;
}
ViewModelDecorations.prototype._clearCachedModelDecorationsResolver = function () {
this._cachedModelDecorationsResolver = null;
this._cachedModelDecorationsResolverViewRange = null;
};
ViewModelDecorations.prototype.dispose = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.reset = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.onModelDecorationsChanged = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype.onLineMappingChanged = function () {
this._decorationsCache = Object.create(null);
this._clearCachedModelDecorationsResolver();
};
ViewModelDecorations.prototype._getOrCreateViewModelDecoration = function (modelDecoration) {
var id = modelDecoration.id;
var r = this._decorationsCache[id];
if (!r) {
var modelRange = modelDecoration.range;
var options = modelDecoration.options;
var viewRange = void 0;
if (options.isWholeLine) {
var start = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.startLineNumber, 1));
var end = this._coordinatesConverter.convertModelPositionToViewPosition(new Position(modelRange.endLineNumber, this.model.getLineMaxColumn(modelRange.endLineNumber)));
viewRange = new Range(start.lineNumber, start.column, end.lineNumber, end.column);
}
else {
viewRange = this._coordinatesConverter.convertModelRangeToViewRange(modelRange);
}
r = new ViewModelDecoration(viewRange, options);
this._decorationsCache[id] = r;
}
return r;
};
ViewModelDecorations.prototype.getDecorationsViewportData = function (viewRange) {
var cacheIsValid = (this._cachedModelDecorationsResolver !== null);
cacheIsValid = cacheIsValid && (viewRange.equalsRange(this._cachedModelDecorationsResolverViewRange));
if (!cacheIsValid) {
this._cachedModelDecorationsResolver = this._getDecorationsViewportData(viewRange);
this._cachedModelDecorationsResolverViewRange = viewRange;
}
return this._cachedModelDecorationsResolver;
};
ViewModelDecorations.prototype._getDecorationsViewportData = function (viewportRange) {
var modelDecorations = this._linesCollection.getDecorationsInRange(viewportRange, this.editorId, filterValidationDecorations(this.configuration.options));
var startLineNumber = viewportRange.startLineNumber;
var endLineNumber = viewportRange.endLineNumber;
var decorationsInViewport = [], decorationsInViewportLen = 0;
var inlineDecorations = [];
for (var j = startLineNumber; j <= endLineNumber; j++) {
inlineDecorations[j - startLineNumber] = [];
}
for (var i = 0, len = modelDecorations.length; i < len; i++) {
var modelDecoration = modelDecorations[i];
var decorationOptions = modelDecoration.options;
var viewModelDecoration = this._getOrCreateViewModelDecoration(modelDecoration);
var viewRange = viewModelDecoration.range;
decorationsInViewport[decorationsInViewportLen++] = viewModelDecoration;
if (decorationOptions.inlineClassName) {
var inlineDecoration = new InlineDecoration(viewRange, decorationOptions.inlineClassName, decorationOptions.inlineClassNameAffectsLetterSpacing ? 3 /* RegularAffectingLetterSpacing */ : 0 /* Regular */);
var intersectedStartLineNumber = Math.max(startLineNumber, viewRange.startLineNumber);
var intersectedEndLineNumber = Math.min(endLineNumber, viewRange.endLineNumber);
for (var j = intersectedStartLineNumber; j <= intersectedEndLineNumber; j++) {
inlineDecorations[j - startLineNumber].push(inlineDecoration);
}
}
if (decorationOptions.beforeContentClassName) {
if (startLineNumber <= viewRange.startLineNumber && viewRange.startLineNumber <= endLineNumber) {
var inlineDecoration = new InlineDecoration(new Range(viewRange.startLineNumber, viewRange.startColumn, viewRange.startLineNumber, viewRange.startColumn), decorationOptions.beforeContentClassName, 1 /* Before */);
inlineDecorations[viewRange.startLineNumber - startLineNumber].push(inlineDecoration);
}
}
if (decorationOptions.afterContentClassName) {
if (startLineNumber <= viewRange.endLineNumber && viewRange.endLineNumber <= endLineNumber) {
var inlineDecoration = new InlineDecoration(new Range(viewRange.endLineNumber, viewRange.endColumn, viewRange.endLineNumber, viewRange.endColumn), decorationOptions.afterContentClassName, 2 /* After */);
inlineDecorations[viewRange.endLineNumber - startLineNumber].push(inlineDecoration);
}
}
}
return {
decorations: decorationsInViewport,
inlineDecorations: inlineDecorations
};
};
return ViewModelDecorations;
}());
export { ViewModelDecorations };
| TeamSPoon/logicmoo_workspace | packs_web/swish/web/node_modules/monaco-editor/esm/vs/editor/common/viewModel/viewModelDecorations.js | JavaScript | mit | 6,682 |
<?php namespace Code200\ImageKing\Classes;
use Cms\Helpers\File;
use Code200\ImageKing\Classes\Exceptions\ExtensionNotAllowedException;
use Code200\Imageking\models\Settings;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\URL;
class ImageService
{
/**
* @var string
*/
private $html;
/**
* @var DomManipulator
*/
private $domImageFinder;
/**
* Filepath of current image
* @var string
*/
private $imageFilePath;
/**
* @var Settings
*/
private $s;
/**
* Allowed image extensions
* @var array
*/
private $allowedExtensions;
/**
* Responsive sizes
* @var array
*/
private $responsiveSizes;
/**
* ImageService constructor.
* @param string $html
*/
public function __construct($html)
{
$this->html = $html;
$this->setDomImageFinder();
$this->s = Settings::instance();
}
protected function setDomImageFinder() {
$this->domImageFinder = new DomImageFinder($this->html);
}
/**
* Process images and returns modified HTML containing images.
*
* @return string
*/
public function process()
{
$imageNodes = $this->domImageFinder->getImageNodes();
foreach ($imageNodes as $node) {
try {
//get image
$this->imageFilePath = $this->getFilePathFromNode($node);
$image = $this->getNewImageManipulator($this->imageFilePath);
$this->checkIfProcessable($image);
//check cache
$newMainImagePath = $image->getStoragePath();
if(!file_exists($newMainImagePath) || empty(Settings::get("enable_cache", 0)) ) {
$imgChanged = $this->processMainImage($image);
}
$node->setAttribute("src", $image->getPublicUrl($newMainImagePath));
//responsive versions
$this->prepareResponsiveVersions($this->imageFilePath, $node);
//captions
$this->applyCaptions($node);
} catch (\RemotePathException $e) {
//we simply cant and dont want to process remote images ...
continue;
} catch (ExtensionNotAllowedException $e) {
//we dont want to process certain files I guess
continue;
} catch (\Exception $e) {
Log::warning("[Code200.ImageKing] could not process image: " . $this->imageFilePath);
continue;
}
}
return $this->domImageFinder->dom->saveHTML();
}
private function processMainImage(&$image) {
$imgChanged = false;
//limit its output size in case we dont want to share sources
$maxWidth = $this->s->get("max_width");
if (!empty($maxWidth) && $maxWidth < $image->getWidth() ) {
$image->resize($maxWidth, null);
$imgChanged = true;
}
//watermark
if ($this->shouldWatermark()) {
$image->applyWatermark();
$imgChanged = true;
}
if($imgChanged || $this->s->get("enable_private_paths")) {
$newMainImagePath = $image->getStoragePath();
$image->save($newMainImagePath);
// $node->setAttribute("src", $image->getPublicUrl($newMainImagePath));
}
return $imgChanged;
}
/**
* Return new image manipulator object
* @param $imagePath
* @return ImageManipulator
*/
protected function getNewImageManipulator($imagePath){
return new ImageManipulator($imagePath);
}
/**
* Is watermarking enabled in settings
* @return bool
*/
private function shouldWatermark()
{
$isWatermarkEnabled = $this->s->get("enable_watermark");
if (!$isWatermarkEnabled) {
return false;
}
return true;
}
private function applyCaptions(&$node){
if(empty($this->s->get("enable_captions")) && ! empty($node->getAttribute("title"))){
return;
}
$figureElement = $this->domImageFinder->dom->createElement("figure");
$captionElement = $this->domImageFinder->dom->createElement("figcaption", $node->getAttribute("title"));
$node->parentNode->replaceChild($figureElement, $node);
$figureElement->appendChild($node);
$figureElement->appendChild($captionElement);
}
/**
* Returns array of allowed image extensions to be manipulated
* @return array string
*/
private function getAllowedExtensions()
{
if (empty($this->allowedExtensions)) {
$this->allowedExtensions = array_map(
function ($element) {
return trim($element);
},
explode(",", $this->s->get("allowed_extensions"))
);
}
return $this->allowedExtensions;
}
/**
* Returns int array of responsive sizes
* @return array int
*/
private function getResponsiveSizes()
{
if (empty($this->responsiveSizes)) {
if(!empty($this->s->get("responsive_sizes"))) {
//fetch from settings
$this->responsiveSizes = array_map(
function ($el) {
if (empty($el)) {
return null;
}
return (int)trim($el);
},
explode(",", $this->s->get("responsive_sizes"))
);
//limit max size to settings
$this->responsiveSizes = array_filter($this->responsiveSizes, function($el){
if(!empty($el) && (empty($this->getMaxWidth()) || $this->getMaxWidth() >= $el)) {
return true;
}
});
} else {
$this->responsiveSizes = array();
}
}
return $this->responsiveSizes;
}
/**
* Checks if image is processable
* @param ImageManipulator $image
* @return bool
*/
protected function checkIfProcessable($image)
{
if (!in_array($image->getExtension(), $this->getAllowedExtensions())) {
throw new ExtensionNotAllowedException("Extension not allowed.");
}
return true;
}
/**
* @param $imagePath
* @param $node
* @return ImageManipulator
* @throws \Exception
*/
private function prepareResponsiveVersions($imagePath, &$node)
{
$srcSetAttributes = array();
foreach ($this->getResponsiveSizes() as $newSize) {
$image = $this->getNewImageManipulator($imagePath);
$newPath = $image->getStoragePath($newSize);
if( !file_exists($newPath) || empty(Settings::get("enable_cache", false))){
$image->resize($newSize, null);
if($this->shouldWatermark()){
$image->applyWatermark();
}
// $newPath = $image->getStoragePath($newSize);
$image->save($newPath);
$srcSetAttributes[] = sprintf('%s %sw', $image->getPublicUrl($newPath), $newSize);
} else {
$srcSetAttributes[] = sprintf('%s %sw', $image->getPublicUrl($newPath), $newSize);
}
}
$node->setAttribute('srcset', implode(",", $srcSetAttributes));
}
/**
* Gets max (limit) image width from settings
* @return int
*/
private function getMaxWidth(){
return (int)trim($this->s->get("max_width"));
}
/**
* Remove the local host name from path src and add the base path.
*
* @param $node
* @return mixed
*/
protected function getFilePathFromNode($node)
{
$imagePath = rawurldecode($this->domImageFinder->getSrcAttribute($node));
return str_replace(URL::to('/'), '', base_path($imagePath));
}
} | webeks/octobercms-imageking | classes/ImageService.php | PHP | mit | 8,124 |
wedge = 14
background = {
epsilon = 0.997179,
q = 0.619347
}
streams = {
{
epsilon = -1.297424,
mu = 190.545111,
r = 13.878006,
theta = 0.198390,
phi = 3.139994,
sigma = 3.743833
},
{
epsilon = -1.008419,
mu = 199.646461,
r = 39.369932,
theta = 1.119290,
phi = 0.926942,
sigma = 8.875175
},
{
epsilon = -3.069995,
mu = 156.562280,
r = 16.517515,
theta = 0.332154,
phi = 0.588367,
sigma = 1.400307
}
}
area = {
{
r_min = 16,
r_max = 22.5,
r_steps = 700,
mu_min = 135,
mu_max = 235,
mu_steps = 800,
nu_min = -1.25,
nu_max = 1.25,
nu_steps = 320
}
}
| weissj3/MWTools | Data/LuaFilesFullSkyErrors/params_14.lua | Lua | mit | 808 |
/*
*
* Confidential Information of Telekinesys Research Limited (t/a Havok). Not for disclosure or distribution without Havok's
* prior written consent. This software contains code, techniques and know-how which is confidential and proprietary to Havok.
* Product and Trade Secret source code contains trade secrets of Havok. Havok Software (C) Copyright 1999-2014 Telekinesys Research Limited t/a Havok. All Rights Reserved. Use of this software is subject to the terms of an end user license agreement.
*
*/
#ifndef HKBASE_MEMORY_TRACKER_H
#define HKBASE_MEMORY_TRACKER_H
struct hkSubString;
class hkMemorySystem;
class HK_EXPORT_COMMON hkMemoryTracker
{
//+reflected(false)
//+hk.MemoryTracker(ignore=True)
public:
HK_DECLARE_PLACEMENT_ALLOCATOR();
typedef hkMemoryRouter::Allocator Allocator;
struct Member //+reflected(false)
{
//+hk.MemoryTracker(ignore=True)
enum
{
FLAG_BACK_POINTER = 1
};
hkUint16 m_offset; ///< Offset from object start (in bytes)
hkUint16 m_memberSize; ///< Size of the member - this is the only way I can see if a member is a reference
const char* m_typeName; ///< The type of the field
const char* m_name; ///< The name of the field
hkUint32 m_flags;
};
// Basic types are guarenteed to not have any pointers (such as enums, or structs that contain only ints/floats)
// NOTE! Do not change the order of these members without updating the init structure
struct TypeDefinition //+reflected(false)
{
//+hk.MemoryTracker(ignore=True)
enum Type
{
TYPE_BASIC, ///< Contains no pointers to anything else
TYPE_CLASS, ///< Is a class (or struct). May contain pointers.
TYPE_SCAN, ///< Its a class that contains variable amount of pointers. Will be scanned.
};
const char* m_typeName; ///< The type
const char* m_library; ///< The library this type belongs to
hkUint16 m_size; ///< The size
hkUint8 m_alignment; ///< the alignment
hkUint8 m_type; ///< The type
};
struct ClassDefinition: public TypeDefinition //+reflected(false)
{
//+hk.MemoryTracker(ignore=True)
// Extra members
const Member* m_members; ///< The members that belong to this class (or HK_NULL)
const char* m_parentTypeName; ///< The parent classes name (or HK_NULL if doesn't have one)
hkUint16 m_numMembers; ///< The number of members
hkUint8 m_isVirtual; ///< True if the type is virtual
hkInt8 m_parentOffset; ///< Num bytes from this type to the parent (often 0, but not always). I.e., add to this to get to the parent.
};
struct InitClassDefinition //+reflected(false)
{
//+hk.MemoryTracker(ignore=True)
// TypeDefinition
const char* m_typeName; ///< The type
const char* m_library; ///< The library this belongs to
hkUint16 m_size; ///< The size
hkUint8 m_alignment; ///< the alignment
hkUint8 m_type; ///< The type
// Class definition
const Member* m_members; ///< The members that belong to this class (or HK_NULL)
const char* m_parentTypeName; ///< The parent classes name (or HK_NULL if doesn't have one)
hkUint16 m_numMembers; ///< The number of members
hkUint8 m_isVirtual; ///< True if the type is virtual
hkInt8 m_parentOffset; ///< Num bytes from this type to the parent (often 0, but not always). I.e., add to this to get to the parent.
};
/// New hkReferenced derived object
virtual void onNewReferencedObject(const char* typeName, hk_size_t size, void* ptr) = 0;
/// Delete hkReferenced derived object
virtual void onDeleteReferencedObject(void* ptr) = 0;
/// New object
virtual void onNewObject(const char* typeName, hk_size_t size, void* ptr) = 0;
/// Delete hkReferenced derived object
virtual void onDeleteObject(void* ptr) = 0;
/// New untyped buffer - will not be scanned
virtual void onNewRaw(const char* name, hk_size_t size, void* ptr) = 0;
/// Delete untyped buffer
virtual void onDeleteRaw(void* ptr) = 0;
/// Add a class definition. NOTE the clsDef structure, and its members are assumed to be stay in scope for
/// the life of the tracker.
virtual void addTypeDefinition(const TypeDefinition& def)= 0;
/// Clear the type definition list, any registered types are now forgotten about until they are
/// registered again
virtual void clearTypeDefinitions() = 0;
/// Find a class definition
virtual const TypeDefinition* findTypeDefinition(const char* name) = 0;
/// For type determination
virtual const hkClass* getClassType() const { return HK_NULL; }
/// Get all of the class. Returns number of definitions. Passing typeDefinition as HK_NULL just returns size.
virtual hk_size_t getTypeDefinitions(const TypeDefinition** typeDefinitions) = 0;
/// Find a class definition from a regular c string
const TypeDefinition* findTypeDefinition(const hkSubString& name);
/// Returns true if its a basic (i.e., has no pointers etc) type.
hkBool isBasicType(const hkSubString& name);
/// Get the class definition
const ClassDefinition* findClassDefinition(const hkSubString& name);
const ClassDefinition* findClassDefinition(const char* name);
/// Virtual Dtor
virtual ~hkMemoryTracker() {}
/// Get the instance - may return null if tracking is not initialized.
static inline hkMemoryTracker* HK_CALL getInstancePtr() { return s_singleton; }
/// Get the instance - if not set, returns a dummy tracker that ignores all events.
static hkMemoryTracker& HK_CALL getInstance();
/// Set the instance
static void HK_CALL setInstance(hkMemoryTracker* tracker);
protected:
static hkMemoryTracker* s_singleton;
};
#endif // HKBASE_MEMORY_TRACKER_H
/*
* Havok SDK - NO SOURCE PC DOWNLOAD, BUILD(#20140907)
*
* Confidential Information of Havok. (C) Copyright 1999-2014
* Telekinesys Research Limited t/a Havok. All Rights Reserved. The Havok
* Logo, and the Havok buzzsaw logo are trademarks of Havok. Title, ownership
* rights, and intellectual property rights in the Havok software remain in
* Havok and/or its suppliers.
*
* Use of this software for evaluation purposes is subject to and indicates
* acceptance of the End User licence Agreement for this product. A copy of
* the license is included with this software and is also available at www.havok.com/tryhavok.
*
*/
| wobbier/source3-engine | ThirdParty/Havok/include/Common/Base/Memory/Tracker/hkMemoryTracker.h | C | mit | 6,711 |
const _transform = require('lodash/transform');
function MatchTransformer(match) {
if( !(this instanceof MatchTransformer) ) {
return this.transform(new MatchTransformer(match));
}
if( typeof match === 'string' ) {
// Escape string
match = match.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
match = new RegExp(match);
}
this._match = match;
}
MatchTransformer.prototype.parse = function(source) {
return _transform(source, (result, value, key) => {
if( this._match.test(key) )
result[key] = value;
}, {});
};
MatchTransformer.prototype.reverse = MatchTransformer.prototype.parse;
module.exports = MatchTransformer;
| bubobox/parse-js | src/transformers/match.js | JavaScript | mit | 696 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>huffman: 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.1 / huffman - 8.13.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
huffman
<small>
8.13.0
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2021-10-15 03:37:57 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2021-10-15 03:37:57 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 1 Virtual package relying on perl
coq 8.5.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
# opam file:
opam-version: "2.0"
maintainer: "[email protected]"
homepage: "https://github.com/coq-community/huffman"
dev-repo: "git+https://github.com/coq-community/huffman.git"
bug-reports: "https://github.com/coq-community/huffman/issues"
doc: "https://coq-community.github.io/huffman/"
license: "LGPL-2.1-or-later"
synopsis: "Coq proof of the correctness of the Huffman coding algorithm"
description: """
This projects contains a Coq proof of the correctness of the Huffman coding algorithm,
as described in David A. Huffman's paper A Method for the Construction of Minimum-Redundancy
Codes, Proc. IRE, pp. 1098-1101, September 1952."""
build: [make "-j%{jobs}%"]
install: [make "install"]
depends: [
"coq" {>= "8.12" & < "8.15~"}
]
tags: [
"category:Computer Science/Decision Procedures and Certified Algorithms/Correctness proofs of algorithms"
"category:Miscellaneous/Extracted Programs/Combinatorics"
"keyword:data compression"
"keyword:code"
"keyword:huffman tree"
"logpath:Huffman"
"date:2021-07-30"
]
authors: [
"Laurent Théry"
]
url {
src: "https://github.com/coq-community/huffman/archive/v8.13.0.tar.gz"
checksum: "sha512=7a38feed6b2757badaf696729287bf5df7a8786e97e3133faf647335ab36ecd7c83caa8c359288d4b8dff89012bdc240a9eb548f3ffe3dc5757244d4ea0f9b78"
}
</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-huffman.8.13.0 coq.8.5.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.5.1).
The following dependencies couldn't be met:
- coq-huffman -> coq >= 8.12
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-huffman.8.13.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.05.0-2.0.1/released/8.5.1/huffman/8.13.0.html | HTML | mit | 7,260 |
body {
margin:0;
padding:0;
font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;
-webkit-font-smoothing:antialiased;
font-size:11px;
}
a {
color:#111;
}
a:hover {
text-decoration:none;
}
header {
background:url(header.jpg) center center #111;
text-align:center;
color:#fff;
position:relative;
padding:5em 5% 10em;
background-size:cover;
}
header h1 {
font-size:3em;
text-transform:uppercase;
margin-bottom:0.2em;
color:#fff;
letter-spacing:0.1em;
font-weight:500;
}
header h2 {
font-size:1.7em;
font-weight:400;
line-height:1.2;
color:#fff;
max-width:25em;
margin-bottom:1.5em;
}
header a {
color:#fff;
}
header .btn {
border:0.2em solid #fff;
color:#fff;
text-transform:uppercase;
padding:0.6em 1em;
font-weight:bold;
font-size:1.1em;
text-decoration:none;
margin:1em 0.5em;
display:inline-block;
transition:0.15s all ease;
}
header .btn:hover {
background:#fff;
color:#5e5d9d;
transition:0.15s all ease;
}
header span {
font-size:1em;
font-weight:normal;
text-transform:uppercase;
color:rgb(30, 128, 105);
position:absolute;
bottom:2em;
text-align:center;
left:0;
right:0;
letter-spacing:0.3em;
}
address {
display:inline;
}
address a {
color:rgb(30, 128, 105);
}
h1, h2, h3, h4, h5, h6, p, li, blockquote {
font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;
}
h2, h3 {
margin:0 auto 0.2em;
color:#000;
font-weight:400;
line-height:1.2;
}
h2 {
font-size:3em;
max-width:60rem;
text-align:center;
}
h3, p {
max-width:60rem;
}
hr {
border:0;
border-bottom:1px solid #ddd;
}
.lead {
text-align:center;
}
p {
color:#65777c;
font-size:1.5em;
margin:0 auto 1.5em;
line-height:1.45;
}
blockquote {
color:#13b38f;
font-size:3em;
max-width:18em;
margin:1.5em auto;
border:0;
text-align:center;
line-height:1.2;
font-weight:300;
padding:0;
}
section {
padding:4em 5%;
text-align:center;
max-width:90%;
margin:0 auto;
overflow:hidden;
}
footer {
padding:6em 0 0em;
margin:0 auto;
}
footer hr {
border-color:#333;
margin:5em 0 0;
}
footer > div > * {
display:inline-block;
vertical-align:middle;
margin-right:2em;
}
footer span {
color:#999;
}
section img {
max-width:90%;
}
h3 {
font-size:1.6em;
}
footer {
background:#000;
color:#fff;
text-align:center;
}
footer h2 {
color:#fff;
max-width:60em;
font-size:2.5em;
}
footer p {
color:#959DA0;
max-width:60em;
font-size:1.3em;
}
footer a {
text-decoration:none;
color:#eee;
}
footer a:hover {
background:rgba(255,255,255,0.1);
color:#fff;
border-color:#fff;
}
footer .btn {
color:#eee;
text-decoration:none;
padding-bottom:0.2em;
display:inline-block;
margin:0 0.5em;
border-bottom:2px solid #ccc;
}
iframe {
border:0;
}
footer {
padding-left:10%;
padding-right:10%;
}
.social-buttons li {
list-style:none;
display:inline-block;
padding:1em;
}
#box > div {
text-align:left;
}
#box hr {
clear:both;
border-color:transparent;
}
footer > div {
padding:2em 0;
max-width:70em;
text-align:left;
margin:0 auto;
}
@media(min-width:764px) {
body {
font-size:13px;
}
#box > div {
width:30%;
float:left;
text-align:left;
margin:2em 0 0 3%;
}
#box > div p {
font-size:1.2em;
}
.logo {
position:absolute;
top:30px;
left:30px;
}
section {
max-width:70em;
padding:5em 5%;
}
header {
padding-top:10em;
padding-bottom:20em;
}
footer {
padding:5em 0 1em;
}
.social-buttons {
margin:5em 0 0;
}
}
@media(min-width:960px) {
body {
font-size:14px;
}
header h1 {
font-size:5em;
}
h3 {
font-size:1.5em;
}
}
div#demo {
min-height: 374px;
}
.container{
padding: 20px;
}
.container h2{
padding-bottom: .3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
float: left;
}
.container a{
margin-right: 5px;
}
.container p{
margin-left: 0px;
}
.container img{
border-radius: 3px;
}
.container code{
padding: 2px 4px;
border: 1px solid #ccc;
margin: 0;
font-size: 14px;
background-color: #e8e7e7;
border-radius: 3px;
}
.container .install p{
position: absolute;
margin-top: 65px;
}
.container .listbox{
padding: 20px;
position: absolute;
margin-top: 120px;
}
| Sridatta19/react-listbox | docs/style.css | CSS | mit | 4,792 |
import ProgressBar from "progress";
import padEnd from "lodash/padEnd";
class ProgressBarController {
constructor() {
this.bar = null;
}
init(total) {
if (this.bar) {
this.terminate();
}
// Intentionally a noop because node-progress doesn't work well in non-TTY
// environments
if (!process.stdout.isTTY) {
return;
}
// Don't do any of this while testing
if (process.env.NODE_ENV === "lerna-test") {
return;
}
this.bar = new ProgressBar(":packagename ╢:bar╟", {
total: total,
complete: "█",
incomplete: "░",
clear: true,
// terminal columns - package name length - additional characters length
width: (process.stdout.columns || 100) - 50 - 3
});
}
tick(name) {
if (this.bar) {
this.bar.tick({
packagename: padEnd(name.slice(0, 50), 50)
});
}
}
clear() {
if (this.bar) {
this.bar.terminate();
}
}
restore() {
if (this.bar) {
// This is a hack to get the bar to redraw it's last state.
// See: https://github.com/tj/node-progress/blob/d47913502ba5b551fcaad9e94fe7b2f5876a7939/lib/node-progress.js#L154-L159
this.bar.stream.write(this.bar.lastDraw);
}
}
terminate() {
this.clear();
this.bar = null;
}
}
export default new ProgressBarController();
| onigoetz/lerna-hg | src/progressBar.js | JavaScript | mit | 1,365 |
var commons = require('../commons')
var frisby = require('frisby');
var FormData = require('form-data');
frisby.create('Get file')
.get(commons.host+'/file/2134354/zgzhrthztrh/sgeh' )
.after(function(err, res, body) {
expect(res.request.href.match(/errcode=404/)).not.toBeNull()
})
.toss()
| bodji/test2 | test/file/non_existing_spec.js | JavaScript | mit | 312 |
<!doctype html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<!-- Meta, title, CSS, favicons, etc. -->
{% include base/head.html %}
</head>
<body>
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
{% include components/toolbar.html %}
{% include layout/header.html %}
{% include components/banner.html %}
<main class="app-main" role="main">
<div class="app-main-section">
<div class="app-main-aside">
{% include layout/sidebar.html %}
</div>
<div class="app-main-content">
{{ content }}
</div>
</div>
</main>
{% include layout/footer.html %}
{% include base/javascript.html %}
<div class="app-js-slot">
{% include base/webfonts.html %}
</div>
</body>
</html>
| a25kk/dakhli | src/dakhli.sitetheme/dakhli/sitetheme/resources/app/_layouts/default.html | HTML | mit | 1,063 |
<?php
namespace Frontend\PublicBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader;
/**
* This is the class that loads and manages your bundle configuration
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
*/
class FrontendPublicExtension extends Extension
{
/**
* {@inheritDoc}
*/
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
}
}
| OliverMartin/Travel | src/Frontend/PublicBundle/DependencyInjection/FrontendPublicExtension.php | PHP | mit | 887 |
package command
import (
"fmt"
"os"
"path/filepath"
"time"
"github.com/kemokemo/gckdir/lib"
"github.com/skratchdot/open-golang/open"
"github.com/urfave/cli"
)
var (
// UsageVerify is Usage of verify subcommand for cli
UsageVerify = "Verifies the structure and each hash value of files."
)
// CmdVerify verifies directory information below cases.
// Case 1. a json file of hash list with target directory
// Case 2. source directory with target directory
func CmdVerify(c *cli.Context) error {
help := fmt.Sprintf("Please see '%s %s --help'.", c.App.Name, c.Command.FullName())
source := c.Args().Get(0)
target := c.Args().Get(1)
if source == "" || target == "" {
return cli.NewExitError(
fmt.Sprintf("Source path or target path is empty. %s", help),
ExitCodeInvalidArguments)
}
source = filepath.Clean(source)
target = filepath.Clean(target)
sourceList, err := lib.GetHashList(source)
if err != nil {
return cli.NewExitError(
fmt.Sprintf("Failed to get the hash list. %v\n%s", err, help),
ExitCodeFunctionError)
}
targetList, err := lib.GetHashList(target)
if err != nil {
return cli.NewExitError(
fmt.Sprintf("Failed to get the hash list. %v\n%s", err, help),
ExitCodeFunctionError)
}
result := lib.VerifyHashList(sourceList, targetList, !c.Bool("no-hv"), !c.Bool("no-uv"))
var path string
if c.Bool("report") || c.Bool("open") {
pathList := lib.PathList{SourcePath: source, TargetPath: target}
path, err = createReport(c.String("output"), pathList, result)
if err != nil {
return cli.NewExitError(
fmt.Sprintf("Failed to create a result report. %v\n%s", err, help),
ExitCodeFunctionError)
}
}
if c.Bool("open") {
err = open.Run(path)
if err != nil {
return cli.NewExitError(
fmt.Sprintf("Failed to open a result report. %v\n%s", err, help),
ExitCodeFunctionError)
}
}
if result.VerifyResult == false {
fmt.Println("Verification failed.")
return cli.NewExitError("", ExitCodeVerificationFailed)
}
return nil
}
func createReport(output string, pathList lib.PathList, result lib.HashList) (string, error) {
cd, err := os.Getwd()
if err != nil {
return "", err
}
if output == "" {
output = time.Now().Format("Result_20060102-030405.000000000.html")
}
path := filepath.Join(cd, output)
file, err := os.Create(path)
defer func() {
err = file.Close()
if err != nil {
fmt.Println("failed to close file: ", err)
}
}()
err = lib.CreateReport(file, pathList, result)
if err != nil {
return "", err
}
path = filepath.Join("file:///", path)
return path, nil
}
| KemoKemo/gckdir | command/verify.go | GO | mit | 2,586 |
search_result['2189']=["topic_0000000000000543_attached_props--.html","VerifyPhoneNumberModel Attached Properties",""]; | asiboro/asiboro.github.io | vsdoc/search--/s_2189.js | JavaScript | mit | 119 |
/// <reference path="Transform3D.ts" />
namespace zen {
export class GameObject extends Transform3D {
public name:string = "GameObject";
public tag:string = "";
public layer:string = "";
private _guid:string = zen.guid.create();
public get guid() {
return this._guid;
}
private _app:Application;
constructor(app:Application) {
super();
this._app = app;
}
private _components:{[key:string]:Component} = {};
public addComponent(component:Component):void {
let system:System = this._app.systemManager.getSystem(component.type);
if(system) {
if(!this._components[component.type]) {
component.gameObject = this;
system.addComponent(this, component);
this._components[component.type] = component;
} else {
console.error("Game Object already has " + component.type + " Component");
}
} else {
console.error("System: " + component.type + " doesn't exist");
}
}
public getComponent<T extends Component>(type:ComponentType | number):T {
return <T>this._components[type];
}
public removeComponent(component:Component):void {
let system:System = this._app.systemManager.getSystem(component.type);
if(system) {
if(this._components[component.type]) {
component.gameObject = null;
system.removeComponent(this);
delete this._components[component.type];
} else {
console.error("Game Object doesn't have " + component.type + " Component");
}
} else {
console.error("System: " + component.type + " doesn't exist");
}
}
}
} | shawn0326/zen | src/GameObject.ts | TypeScript | mit | 1,986 |
$(document).ready(function () {
startAnimation();
});
if (!window.requestAnimationFrame) {
window.requestAnimationFrame = (window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame || function (callback) {
return window.setTimeout(callback, 1000 / 60);
});
}
(function ($, window) {
function Constellation (canvas, options) {
var $canvas = $(canvas),
context = canvas.getContext('2d'),
defaults = {
star: {
color: 'rgba(255, 255, 255, .5)',
width: 2
},
line: {
color: 'rgba(255, 255, 255, .5)',
width: 0.4
},
position: {
x: 0, // This value will be overwritten at startup
y: 0 // This value will be overwritten at startup
},
width: window.innerWidth,
height: window.innerHeight,
velocity: 0.1,
length: 100,
distance: 120,
radius: 150,
stars: []
},
config = $.extend(true, {}, defaults, options);
function Star () {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.vx = (config.velocity - (Math.random() * 0.5));
this.vy = (config.velocity - (Math.random() * 0.5));
this.radius = Math.random() * config.star.width;
}
Star.prototype = {
create: function(){
context.beginPath();
context.arc(this.x, this.y, this.radius, 0, Math.PI * 2, false);
context.fill();
},
animate: function(){
var i;
for (i = 0; i < config.length; i++) {
var star = config.stars[i];
if (star.y < 0 || star.y > canvas.height) {
star.vx = star.vx;
star.vy = - star.vy;
} else if (star.x < 0 || star.x > canvas.width) {
star.vx = - star.vx;
star.vy = star.vy;
}
star.x += star.vx;
star.y += star.vy;
}
},
line: function(){
var length = config.length,
iStar,
jStar,
i,
j;
for (i = 0; i < length; i++) {
for (j = 0; j < length; j++) {
iStar = config.stars[i];
jStar = config.stars[j];
if (
(iStar.x - jStar.x) < config.distance &&
(iStar.y - jStar.y) < config.distance &&
(iStar.x - jStar.x) > - config.distance &&
(iStar.y - jStar.y) > - config.distance
) {
if (
(iStar.x - config.position.x) < config.radius &&
(iStar.y - config.position.y) < config.radius &&
(iStar.x - config.position.x) > - config.radius &&
(iStar.y - config.position.y) > - config.radius
) {
context.beginPath();
context.moveTo(iStar.x, iStar.y);
context.lineTo(jStar.x, jStar.y);
context.stroke();
context.closePath();
}
}
}
}
}
};
this.createStars = function () {
var length = config.length,
star,
i;
context.clearRect(0, 0, canvas.width, canvas.height);
for (i = 0; i < length; i++) {
config.stars.push(new Star());
star = config.stars[i];
star.create();
}
star.line();
star.animate();
};
this.setCanvas = function () {
canvas.width = config.width;
canvas.height = config.height;
};
this.setContext = function () {
context.fillStyle = config.star.color;
context.strokeStyle = config.line.color;
context.lineWidth = config.line.width;
};
this.setInitialPosition = function () {
if (!options || !options.hasOwnProperty('position')) {
config.position = {
x: canvas.width * 0.5,
y: canvas.height * 0.5
};
}
};
this.loop = function (callback) {
callback();
window.requestAnimationFrame(function () {
this.loop(callback);
}.bind(this));
};
this.bind = function () {
$canvas.on('mousemove', function(e){
config.position.x = e.pageX - $canvas.offset().left;
config.position.y = e.pageY - $canvas.offset().top;
});
};
this.init = function () {
this.setCanvas();
this.setContext();
this.setInitialPosition();
this.loop(this.createStars);
this.bind();
};
}
$.fn.constellation = function (options) {
return this.each(function () {
var c = new Constellation(this, options);
c.init();
});
};
})($, window);
var startAnimation = function() {
window.addEventListener("resize", function() { startAnimation()} );
$('canvas').constellation({
line: {
color: 'rgba(255, 255, 255, .5)'
}
});
};
| mzgnr/black-screen.github.io | js/script.js | JavaScript | mit | 4,347 |
<?php get_template_part('templates/front', 'page'); ?>
| miso999/nabytoktt | front-page.php | PHP | mit | 59 |
---
layout: post
title: 'Palestras Novembro 2013: Instituto de Informática da Universidade Federal
de Goiás (UFG), Conferência Web da W3C (São Paulo) e FrontInFloripa (Santa Catarina)'
date: 2013-11-04 19:36:33.000000000 -02:00
type: post
published: true
status: publish
categories:
- Eventos
tags:
- Conferência Web W3C
- Eventos
- FrontInFloripa
- Instituto de Informática da Universidade Federal de Goiás (UFG)
- mobile
- palestras
- W3C
language: pt-br
category: pt-br
---
<p>Oi Pessoal,</p>
<p>No mês de novembro irei palestrar em 3 eventos, em 3 diferentes estados.</p>
<h1>Instituto de Informática da Universidade Federal de Goiás (UFG)</h1>
<p><a href="http://www.loiane.com/wp-content/uploads/2013/10/InfUFG.jpg"><img class="aligncenter size-medium wp-image-6614" alt="InfUFG" src="{{ site.baseurl }}/assets/images/assets/InfUFG-300x101.jpg" width="300" height="101" /></a></p>
<p>O primeiro será no dia 12 de Novembro, em Goiânia - GO, às 19:10, na UFG Campus II.</p>
<p>Irei palestrar sobre desenvolvimento web híbrido. A palestra será um pouco mais iniciante para atender a demanda do público do evento. E a entrada é gratuita para toda a comunidade! :)</p>
<p>Site do evento: <a href="https://www.docs.google.com/forms/d/1RefXzp7I7H4tyaEmliH7Wy4oORzqO9klmlvaPvTMNss/viewform" target="_blank" rel="noopener">https://www.docs.google.com/forms/d/1RefXzp7I7H4tyaEmliH7Wy4oORzqO9klmlvaPvTMNss/viewform</a></p>
<h1>Conferência Web da W3C (São Paulo)</h1>
<p style="text-align: center;"><a href="http://www.loiane.com/wp-content/uploads/2013/10/webConfw3c.gif"><img class="aligncenter wp-image-6613" alt="webConfw3c" src="{{ site.baseurl }}/assets/images/assets/webConfw3c.gif" width="385" height="300" /></a></p>
<p>O segundo evento será na Conferência Web da W3C que acontece nos dias 18 e 19 de novembro em São Paulo (capital). Vou palestrar no dia 19 pela manhã na trilha de Input.</p>
<p>A palestra será sobre Sencha Touch e PhoneGap, mostrando uma app que usa alguns recursos em ambas tecnologias. App com tela de login, todos os componentes UI do Sencha Touch e usando PhoneGap para acessar os recursos nativos e também como wrapper para podermos fazer deploy nativo.</p>
<p><strong>Site do evento: <a href="http://conferenciaweb.w3c.br/" target="_blank" rel="noopener">http://conferenciaweb.w3c.br/</a></strong></p>
<h1>FrontInFloripa (Santa Catarina)</h1>
<p><a href="http://www.loiane.com/wp-content/uploads/2013/10/logo-front-in-floripa.png"><img class="aligncenter size-full wp-image-6612" alt="logo-front-in-floripa" src="{{ site.baseurl }}/assets/images/assets/logo-front-in-floripa.png" width="288" height="278" /></a></p>
<p>E o terceiro evento será em Florianópolis, em Santa Catarina, no dia 22 de novembro.</p>
<p>A palestra será sobre Sencha Touch e Phonegap, mostrando os recursos de ambas as tecnologias e mostrando também uma app de exemplo.</p>
<p><strong>Site do evento: <a href="http://frontinfloripa.com.br/" target="_blank" rel="noopener">http://frontinfloripa.com.br/</a></strong></p>
<p>Todas essas palestras são inéditas, ou seja, não dei em nenhum evento antes! :)</p>
<p>Espero encontrar vocês em algum desses eventos! :)</p>
| loiane/loiane.github.io | _posts/2013-11-04-palestras-novembro-2013-instituto-de-informatica-da-universidade-federal-de-goias-ufg-conferencia-web-da-w3c-sao-paulo-e-frontinfloripa-santa-catarina.html | HTML | mit | 3,205 |
/*jshint camelcase: false */
(function(window, module, undefined) {
'use strict';
// lifted from Underscore then bastardized
var _flatten = function(input, output) {
for (var i = 0, length = input.length; i < length; i++) {
var value = input[i];
if (value.type === 'div') {
_flatten(value.contents, output);
}
else if (value.type !== 'button') {
output.push(formBuilder.determineFieldName(value));
}
}
return output;
};
var flatten = function(array) {
return _flatten(array, []);
};
var copyObject = function(obj) {
return window.JSON.parse(window.JSON.stringify(obj));
};
var unionArrays = function (x, y) {
var obj = {};
for (var ix = x.length-1; ix >= 0; -- ix) {
obj[x[ix]] = x[ix];
}
for (var iy = y.length-1; iy >= 0; -- iy) {
obj[y[iy]] = y[iy];
}
var res = [];
for (var k in obj) {
if (obj.hasOwnProperty(k)) {
res.push(obj[k]);
}
}
return res;
};
var formBuilder = {
buildForm: function(buildArray, config) {
return this.buildRecurse(buildArray, config);
},
buildRecurse: function(buildArray, config) {
var htmlString = "";
for (var i = 0; i < buildArray.length; i++) {
var current = buildArray[i];
if(['number', 'text', 'email', 'tel', 'week', 'url', 'date', 'datetime', 'datetime-local', 'color', 'search', 'password'].indexOf(current.type) >= 0) {
htmlString += formBuilder.input(current, config);
}
else if(current.type === 'select') {
htmlString += formBuilder.select(current, config);
}
else if (current.type === 'div') {
var className = formBuilder.determineClassString(current, config);
var openTag = "<div>";
if (className) {
openTag = "<div class='" + className + "'>";
}
htmlString += openTag + this.buildRecurse(current.contents, config) + "</div>";
}
else if (current.type === 'textarea') {
htmlString += formBuilder.textarea(current, config);
}
else if (current.type === 'button') {
htmlString += formBuilder.button(current, config);
}
else if (current.type === 'hidden') {
htmlString += formBuilder.hidden(current, config);
}
else if (current.type === 'checkbox') {
htmlString += formBuilder.checkbox(current, config);
}
}
return htmlString;
},
camelcase: function(input) {
return input.toLowerCase().replace(/[- ](.)/g, function(match, group1) {
return group1.toUpperCase();
});
},
determineFieldName: function(config) {
return config.fieldName || this.camelcase(config.name);
},
determineClassString: function(config, global) {
var className = "";
if (!config.noDefaultClasses && global.defaultClass) {
className = global.defaultClass;
}
if (config.className) {
if (className) {
className += " ";
}
className += config.className;
}
return className;
},
input: function(config, global) {
var className = this.determineClassString(config, global);
var placeholder = config.placeholder || config.name;
var fieldName = this.determineFieldName(config);
var options = " ";
if (config.required) {
options += "required ";
}
if (config.charLimit) {
options += "maxlength='" + config.charLimit + "' ";
}
return "<input type='" + config.type + "' class='" + className +
"' placeholder='" + placeholder + "' data-forge-key='" + fieldName + "'" + options +"/>";
},
select: function(config, global) {
var className = this.determineClassString(config, global);
var fieldName = (config.fieldName) ? config.fieldName : this.camelcase(config.name);
var options = " ";
if (config.required) {
options += "required ";
}
var html = "<select class='" + className + "' data-forge-key='" + fieldName + "'" + options +">";
for (var i = 0; i < config.options.length; i++) {
html += "<option value='" + config.options[i][0] + "'>" + config.options[i][1] + "</option>";
}
html += "</select>";
return html;
},
textarea: function(config, global) {
var className = this.determineClassString(config, global);
var placeholder = config.placeholder || config.name;
var fieldName = this.determineFieldName(config);
var options = " ";
if (config.required) {
options += "required ";
}
if (config.charLimit) {
options += "maxlength='" + config.charLimit + "' ";
}
return "<textarea class='" + className + "' placeholder='" + placeholder +
"' data-forge-key='" + fieldName + "'" + options +"></textarea>";
},
button: function(config, global) {
return "<button type='submit' class='" + this.determineClassString(config, global) + "'>" + config.name + "</button>";
},
hidden: function(config, global) {
var fieldName = this.determineFieldName(config);
return "<input value='' type='" + config.type + "' data-forge-key='" + fieldName + "'/>";
},
checkbox: function(config, global) {
return "<label class='" + config.label.className + "'><input data-forge-key=" + this.determineFieldName(config, global) + " class='" + config.className + "' type='checkbox' /> " + config.label.text + "</label>";
}
};
var mergeObjects = function(obj1, obj2) {
var impureMerge = function(fromObj, toObj) {
for (var key in fromObj) {
if (fromObj.hasOwnProperty(key)) {
toObj[key] = fromObj[key];
}
}
return toObj;
};
var newObj = {};
newObj = impureMerge(obj1, newObj);
newObj = impureMerge(obj2, newObj);
return newObj;
};
var discoverWatches = function(form) {
var watches = {};
for (var i = 0; i < form.length; i++) {
var current = form[i];
if (current.type === 'div') {
var newWatches = discoverWatches(current.contents);
watches = mergeObjects(watches, newWatches);
}
else if (current.conditional) {
if (current.conditional.callback && current.conditional.dependencies) {
for (var j = 0; j < current.conditional.dependencies.length; j++) {
if (!watches[current.conditional.dependencies[j]]) {
watches[current.conditional.dependencies[j]] = [];
}
var clone = {
targets: formBuilder.determineFieldName(current),
dependencies: current.conditional.dependencies,
callback: current.conditional.callback
};
watches[current.conditional.dependencies[j]].push(clone);
}
}
else {
window.console.warn('To register a conditional watch, you must include both callback and dependencies. Watch skipped for ', current);
}
}
}
return watches;
};
var isEmptyObject = function(obj) {
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
return false;
}
}
return true;
};
var gatherArgs = function(deps, values, config) {
var ans = [];
for (var i = 0, l = deps.length; i < l; i++) {
if (deps[i] !== '$internals') {
ans.push(values[deps[i]]);
}
else {
ans.push(config.internals);
}
}
return ans;
};
var gatherNodes = function(domTree, values) {
var nodes = {};
for (var key in values) {
if (values.hasOwnProperty(key)) {
var node = domTree.querySelector("[data-forge-key='" + key +"']");
nodes[key] = node;
if (node.type !== 'checkbox') {
this._values[key] = nodes[key].value;
}
else {
this._values[key] = nodes[key].checked;
}
}
}
return nodes;
};
var Forge = function(form, config){
this._form = form;
this._config = config;
this._target = null;
this._innerHTML = "";
this._values = {};
this._domNode = null;
this._watches = {};
this._nodes = {};
this._init();
};
Forge.prototype._init = function() {
var flattened = flatten(this._form);
var obj = {};
flattened.map(function(el) {
obj[el] = "";
});
this._values = obj;
this._watches = discoverWatches(this._form);
this._hasWatches = !isEmptyObject(this._watches);
this._generateCss();
};
Forge.prototype._generateCss = function() {
if (!window.document.getElementById('forge-generated-styles')) {
var style = window.document.createElement('style');
style.type = 'text/css';
style.id = "forge-generated-styles";
style.innerHTML = '.forge-hidden { display: none !important; }';
window.document.getElementsByTagName('head')[0].appendChild(style);
}
};
Forge.prototype._runAllConditionals = function() {
for (var key in this._watches) {
if (this._watches.hasOwnProperty(key)) {
this._checkValueForConditionals(key);
}
}
};
Forge.prototype.render = function(target) {
var node = window.document.querySelector(target);
this._innerHTML = formBuilder.buildForm(this._form, this._config);
var form = window.document.createElement('form');
form.innerHTML = this._innerHTML;
form.id = this._config.formId;
form.addEventListener('change', this.eventDispatch.bind(this));
form.addEventListener('keydown', this.eventDispatch.bind(this));
if (this._config.formSubmit) {
form.addEventListener('submit', this._config.formSubmit);
}
this._domNode= form;
this._nodes = gatherNodes.call(this, form, this._values);
this._runAllConditionals();
node.appendChild(form);
this._target = target;
};
Forge.prototype.eventDispatch = function(e) {
var target = e.target;
var key = target.dataset.forgeKey;
if (target.type === 'checkbox') {
this._values[key] = e.target.checked;
}
else {
this._values[key] = e.target.value;
}
this._checkValueForConditionals(key);
};
Forge.prototype._checkValueForConditionals = function(key) {
if (this._hasWatches && this._watches[key]) {
var current = this._watches[key];
for (var i = 0, l = current.length; i < l; i++) {
var node = this._nodes[current[i].targets];
var gatheredArgs = gatherArgs(current[i].dependencies, this._values, this._config);
if (!current[i].callback.apply(this, gatheredArgs)) {
if (node.className.indexOf('forge-hidden') < 0) {
node.className += " forge-hidden";
}
}
else if (node.className.indexOf('forge-hidden') >= 0) {
node.className = node.className.replace('forge-hidden','','i');
}
}
}
};
Forge.prototype.set = function(key, value) {
var node = this._domNode.querySelector("[data-forge-key='" + key +"']");
this._values[key] = value;
if (node.type === 'checkbox') {
node.checked = value;
}
else {
node.value = value;
}
this._checkValueForConditionals(key);
};
Forge.prototype.getData = function() {
return copyObject(this._values);
};
Forge.prototype.getConfig = function() {
return copyObject(this._config);
};
Forge.prototype.validate = function() {
var validateRecurse = function(form, acc) {
for (var i = 0, l = form.length; i < l; i++) {
if (form[i].type === 'div') {
validateRecurse(form[i].contents, acc);
}
else if (form[i].type === 'button') {
// do nothing
}
else {
var fieldName = formBuilder.determineFieldName(form[i]);
if (form[i].required && !this._values[fieldName]) {
acc.push(fieldName);
}
}
}
return acc;
}.bind(this);
var errors = validateRecurse(this._form, []);
if (this._config.validate) {
var validateErrors = this._config.validate(this._values);
errors = unionArrays(errors, validateErrors);
}
for (var key in this._values) {
if (this._values.hasOwnProperty(key)) {
var node = this._nodes[key];
if (errors.indexOf(key) >= 0 && node.className.indexOf('forge-error') < 0) {
node.className += " forge-error";
}
else if (errors.indexOf(key) < 0 && node.className.indexOf('forge-error') >= 0) {
node.className = node.className.replace('forge-error','','i');
}
}
}
return errors;
};
module.exports = function(form, config) {
return new Forge(form, config);
};
})(window, module);
| btholt/fucina | fucina.js | JavaScript | mit | 12,761 |
0.12.0 (Next)
=============
#### Features
* [#956](https://github.com/intridea/grape/issues/956): Support `present` with `Grape::Presenters::Presenter` - [@u2](https://github.com/u2).
#### Fixes
* [#936](https://github.com/intridea/grape/pull/936): Fixed default params processing for optional groups - [@dm1try](https://github.com/dm1try).
* [#942](https://github.com/intridea/grape/pull/942): Fixed forced presence for optional params when based on a reused entity that was also required in another context - [@croeck](https://github.com/croeck).
* [#950](https://github.com/intridea/grape/pull/950): Status method can now accept one of Rack::Utils status code symbols (:ok, :found, :bad_request, etc.) - [@dabrorius](https://github.com/dabrorius).
* [#952](https://github.com/intridea/grape/pull/952): Status method now raises error when called with invalid status code - [@dabrorius](https://github.com/dabrorius).
* [#957](https://github.com/intridea/grape/pull/957): Regexp validator now supports `allow_blank`, `nil` value behavior changed - [@calfzhou](https://giihub.com/calfzhou).
* [#962](https://github.com/intridea/grape/pull/962): The `default` attribute with `false` value is documented now - [@ajvondrak](https://github.com/ajvondrak).
* [#974](https://github.com/intridea/grape/pull/974): Add error! to rescue_from blocks - [@whatasunnyday](https://github.com/whatasunnyday).
* Your contribution here.
0.11.0 (2/23/2015)
==================
* [#925](https://github.com/intridea/grape/pull/925): Fixed `toplevel constant DateTime referenced by Virtus::Attribute::DateTime` - [@u2](https://github.com/u2).
* [#916](https://github.com/intridea/grape/pull/916): Added `DateTime/Date/Numeric/Boolean` type support `allow_blank` - [@u2](https://github.com/u2).
* [#871](https://github.com/intridea/grape/pull/871): Fixed `Grape::Middleware::Base#response` - [@galathius](https://github.com/galathius).
* [#559](https://github.com/intridea/grape/issues/559): Added support for Rack 1.6.0, which parses requests larger than 128KB - [@myitcv](https://github.com/myitcv).
* [#876](https://github.com/intridea/grape/pull/876): Call to `declared(params)` now returns a `Hashie::Mash` - [@rodzyn](https://github.com/rodzyn).
* [#879](https://github.com/intridea/grape/pull/879): The `route_info` value is no longer included in `params` Hash - [@rodzyn](https://github.com/rodzyn).
* [#881](https://github.com/intridea/grape/issues/881): Fixed `Grape::Validations::ValuesValidator` support for `Range` type - [@ajvondrak](https://github.com/ajvondrak).
* [#901](https://github.com/intridea/grape/pull/901): Fix: callbacks defined in a version block are only called for the routes defined in that block - [@kushkella](https://github.com/kushkella).
* [#886](https://github.com/intridea/grape/pull/886): Group of parameters made to require an explicit type of Hash or Array - [@jrichter1](https://github.com/jrichter1).
* [#912](https://github.com/intridea/grape/pull/912): Extended the `:using` feature for param documentation to `optional` fields - [@croeck](https://github.com/croeck).
* [#906](https://github.com/intridea/grape/pull/906): Fix: invalid body parse errors are not rescued by handlers - [@croeck](https://github.com/croeck).
* [#913](https://github.com/intridea/grape/pull/913): Fix: Invalid accept headers are not processed by rescue handlers - [@croeck](https://github.com/croeck).
* [#913](https://github.com/intridea/grape/pull/913): Fix: Invalid accept headers cause internal processing errors (500) when http_codes are defined - [@croeck](https://github.com/croeck).
* [#917](https://github.com/intridea/grape/pull/917): Use HTTPS for rubygems.org - [@O-I](https://github.com/O-I).
0.10.1 (12/28/2014)
===================
* [#868](https://github.com/intridea/grape/pull/868), [#862](https://github.com/intridea/grape/pull/862), [#861](https://github.com/intridea/grape/pull/861): Fixed `version`, `prefix`, and other settings being overridden or changing scope when mounting API - [@yesmeck](https://github.com/yesmeck).
* [#864](https://github.com/intridea/grape/pull/864): Fixed `declared(params, include_missing: false)` now returning attributes with `nil` and `false` values - [@ppadron](https://github.com/ppadron).
0.10.0 (12/19/2014)
===================
* [#803](https://github.com/intridea/grape/pull/803), [#820](https://github.com/intridea/grape/pull/820): Added `all_or_none_of` parameter validator - [@loveltyoic](https://github.com/loveltyoic), [@natecj](https://github.com/natecj).
* [#774](https://github.com/intridea/grape/pull/774): Extended `mutually_exclusive`, `exactly_one_of`, `at_least_one_of` to work inside any kind of group: `requires` or `optional`, `Hash` or `Array` - [@ShPakvel](https://github.com/ShPakvel).
* [#743](https://github.com/intridea/grape/pull/743): Added `allow_blank` parameter validator to validate non-empty strings - [@elado](https://github.com/elado).
* [#745](https://github.com/intridea/grape/pull/745): Removed `atom+xml`, `rss+xml`, and `jsonapi` content-types - [@akabraham](https://github.com/akabraham).
* [#745](https://github.com/intridea/grape/pull/745): Added `:binary, application/octet-stream` content-type - [@akabraham](https://github.com/akabraham).
* [#757](https://github.com/intridea/grape/pull/757): Changed `desc` can now be used with a block syntax - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#779](https://github.com/intridea/grape/pull/779): Fixed using `values` with a `default` proc - [@ShPakvel](https://github.com/ShPakvel).
* [#799](https://github.com/intridea/grape/pull/799): Fixed custom validators with required `Hash`, `Array` types - [@bwalex](https://github.com/bwalex).
* [#784](https://github.com/intridea/grape/pull/784): Fixed `present` to not overwrite the previously added contents of the response body whebn called more than once - [@mfunaro](https://github.com/mfunaro).
* [#809](https://github.com/intridea/grape/pull/809): Removed automatic `(.:format)` suffix on paths if you're using only one format (e.g., with `format :json`, `/path` will respond with JSON but `/path.xml` will be a 404) - [@ajvondrak](https://github.com/ajvondrak).
* [#816](https://github.com/intridea/grape/pull/816): Added ability to filter out missing params if params is a nested hash with `declared(params, include_missing: false)` - [@georgimitev](https://github.com/georgimitev).
* [#819](https://github.com/intridea/grape/pull/819): Allowed both `desc` and `description` in the params DSL - [@mzikherman](https://github.com/mzikherman).
* [#821](https://github.com/intridea/grape/pull/821): Fixed passing string value when hash is expected in params - [@rebelact](https://github.com/rebelact).
* [#824](https://github.com/intridea/grape/pull/824): Validate array params against list of acceptable values - [@dnd](https://github.com/dnd).
* [#813](https://github.com/intridea/grape/pull/813): Routing methods dsl refactored to get rid of explicit `paths` parameter - [@AlexYankee](https://github.com/AlexYankee).
* [#826](https://github.com/intridea/grape/pull/826): Find `coerce_type` for `Array` when not specified - [@manovotn](https://github.com/manovotn).
* [#645](https://github.com/intridea/grape/issues/645): Invoking `body false` will return `204 No Content` - [@dblock](https://github.com/dblock).
* [#801](https://github.com/intridea/grape/issues/801): Only evaluate permitted parameter `values` and `default` lazily on each request when declared as a proc - [@dblock](https://github.com/dblock).
* [#679](https://github.com/intridea/grape/issues/679): Fixed `OPTIONS` method returning 404 when combined with `prefix`- [@dblock](https://github.com/dblock).
* [#679](https://github.com/intridea/grape/issues/679): Fixed unsupported methods returning 404 instead of 405 when combined with `prefix`- [@dblock](https://github.com/dblock).
0.9.0 (8/27/2014)
=================
#### Features
* [#691](https://github.com/intridea/grape/issues/691): Added `at_least_one_of` parameter validator - [@dblock](https://github.com/dblock).
* [#698](https://github.com/intridea/grape/pull/698): `error!` sets `status` for `Endpoint` too - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#703](https://github.com/intridea/grape/pull/703): Added support for Auth-Middleware extension - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#703](https://github.com/intridea/grape/pull/703): Removed `Grape::Middleware::Auth::Basic` - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#703](https://github.com/intridea/grape/pull/703): Removed `Grape::Middleware::Auth::Digest` - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#703](https://github.com/intridea/grape/pull/703): Removed `Grape::Middleware::Auth::OAuth2` - [@dspaeth-faber](https://github.com/dspaeth-faber).
* [#719](https://github.com/intridea/grape/pull/719): Allow passing options hash to a custom validator - [@elado](https://github.com/elado).
* [#716](https://github.com/intridea/grape/pull/716): Calling `content-type` will now return the current content-type - [@dblock](https://github.com/dblock).
* [#705](https://github.com/intridea/grape/pull/705): Errors can now be presented with a `Grape::Entity` class - [@dspaeth-faber](https://github.com/dspaeth-faber).
#### Fixes
* [#687](https://github.com/intridea/grape/pull/687): Fix: `mutually_exclusive` and `exactly_one_of` validation error messages now label parameters as strings, consistently with `requires` and `optional` - [@dblock](https://github.com/dblock).
0.8.0 (7/10/2014)
=================
#### Features
* [#639](https://github.com/intridea/grape/pull/639): Added support for blocks with reusable params - [@mibon](https://github.com/mibon).
* [#637](https://github.com/intridea/grape/pull/637): Added support for `exactly_one_of` parameter validation - [@Morred](https://github.com/Morred).
* [#626](https://github.com/intridea/grape/pull/626): Added support for `mutually_exclusive` parameters - [@oliverbarnes](https://github.com/oliverbarnes).
* [#617](https://github.com/intridea/grape/pull/617): Running tests on Ruby 2.1.1, Rubinius 2.1 and 2.2, Ruby and JRuby HEAD - [@dblock](https://github.com/dblock).
* [#397](https://github.com/intridea/grape/pull/397): Adds `Grape::Endpoint.before_each` to allow easy helper stubbing - [@mbleigh](https://github.com/mbleigh).
* [#673](https://github.com/intridea/grape/pull/673): Avoid requiring non-existent fields when using Grape::Entity documentation - [@qqshfox](https://github.com/qqshfox).
#### Fixes
* [#671](https://github.com/intridea/grape/pull/671): Allow required param with predefined set of values to be nil inside optional group - [@dm1try](https://github.com/dm1try).
* [#651](https://github.com/intridea/grape/pull/651): The `rescue_from` keyword now properly defaults to rescuing subclasses of exceptions - [@xevix](https://github.com/xevix).
* [#614](https://github.com/intridea/grape/pull/614): Params with `nil` value are now refused by `RegexpValidator` - [@dm1try](https://github.com/dm1try).
* [#494](https://github.com/intridea/grape/issues/494): Fixed performance issue with requests carrying a large payload - [@dblock](https://github.com/dblock).
* [#619](https://github.com/intridea/grape/pull/619): Convert specs to RSpec 3 syntax with Transpec - [@danielspector](https://github.com/danielspector).
* [#632](https://github.com/intridea/grape/pull/632): `Grape::Endpoint#present` causes ActiveRecord to make an extra query during entity's detection - [@fixme](https://github.com/fixme).
0.7.0 (4/2/2014)
=================
#### Features
* [#558](https://github.com/intridea/grape/pull/558): Support lambda-based values for params - [@wpschallenger](https://github.com/wpschallenger).
* [#510](https://github.com/intridea/grape/pull/510): Support lambda-based default values for params - [@myitcv](https://github.com/myitcv).
* [#511](https://github.com/intridea/grape/pull/511): Added `required` option for OAuth2 middleware - [@bcm](https://github.com/bcm).
* [#520](https://github.com/intridea/grape/pull/520): Use `default_error_status` to specify the default status code returned from `error!` - [@salimane](https://github.com/salimane).
* [#525](https://github.com/intridea/grape/pull/525): The default status code returned from `error!` has been changed from 403 to 500 - [@dblock](https://github.com/dblock).
* [#526](https://github.com/intridea/grape/pull/526): Allowed specifying headers in `error!` - [@dblock](https://github.com/dblock).
* [#527](https://github.com/intridea/grape/pull/527): The `before_validation` callback is now a distinct one - [@myitcv](https://github.com/myitcv).
* [#530](https://github.com/intridea/grape/pull/530): Added ability to restrict `declared(params)` to the local endpoint with `include_parent_namespaces: false` - [@myitcv](https://github.com/myitcv).
* [#531](https://github.com/intridea/grape/pull/531): Helpers are now available to auth middleware, executing in the context of the endpoint - [@joelvh](https://github.com/joelvh).
* [#540](https://github.com/intridea/grape/pull/540): Ruby 2.1.0 is now supported - [@salimane](https://github.com/salimane).
* [#544](https://github.com/intridea/grape/pull/544): The `rescue_from` keyword now handles subclasses of exceptions by default - [@xevix](https://github.com/xevix).
* [#545](https://github.com/intridea/grape/pull/545): Added `type` (`Array` or `Hash`) support to `requires`, `optional` and `group` - [@bwalex](https://github.com/bwalex).
* [#550](https://github.com/intridea/grape/pull/550): Added possibility to define reusable params - [@dm1try](https://github.com/dm1try).
* [#560](https://github.com/intridea/grape/pull/560): Use `Grape::Entity` documentation to define required and optional parameters with `requires using:` - [@reynardmh](https://github.com/reynardmh).
* [#572](https://github.com/intridea/grape/pull/572): Added `documentation` support to `requires`, `optional` and `group` parameters - [@johnallen3d](https://github.com/johnallen3d).
#### Fixes
* [#600](https://github.com/intridea/grape/pull/600): Don't use an `Entity` constant that is available in the namespace as presenter - [@fuksito](https://github.com/fuksito).
* [#590](https://github.com/intridea/grape/pull/590): Fix issue where endpoint param of type `Integer` cannot set values array - [@xevix](https://github.com/xevix).
* [#586](https://github.com/intridea/grape/pull/586): Do not repeat the same validation error messages - [@kiela](https://github.com/kiela).
* [#508](https://github.com/intridea/grape/pull/508): Allow parameters, such as content encoding, in `content_type` - [@dm1try](https://github.com/dm1try).
* [#492](https://github.com/intridea/grape/pull/492): Don't allow to have nil value when a param is required and has a list of allowed values - [@Antti](https://github.com/Antti).
* [#495](https://github.com/intridea/grape/pull/495): Fixed `ParamsScope#params` for parameters nested inside arrays - [@asross](https://github.com/asross).
* [#498](https://github.com/intridea/grape/pull/498): Dry'ed up options and headers logic, allow headers to be passed to OPTIONS requests - [@karlfreeman](https://github.com/karlfreeman).
* [#500](https://github.com/intridea/grape/pull/500): Skip entity auto-detection when explicitely passed - [@yaneq](https://github.com/yaneq).
* [#503](https://github.com/intridea/grape/pull/503): Calling declared(params) from child namespace fails to include parent namespace defined params - [@myitcv](https://github.com/myitcv).
* [#512](https://github.com/intridea/grape/pull/512): Don't create `Grape::Request` multiple times - [@dblock](https://github.com/dblock).
* [#538](https://github.com/intridea/grape/pull/538): Fixed default values for grouped params - [@dm1try](https://github.com/dm1try).
* [#549](https://github.com/intridea/grape/pull/549): Fixed handling of invalid version headers to return 406 if a header cannot be parsed - [@bwalex](https://github.com/bwalex).
* [#557](https://github.com/intridea/grape/pull/557): Pass `content_types` option to `Grape::Middleware::Error` to fix the content-type header for custom formats. - [@bernd](https://github.com/bernd).
* [#585](https://github.com/intridea/grape/pull/585): Fix after boot thread-safety issue - [@etehtsea](https://github.com/etehtsea).
* [#587](https://github.com/intridea/grape/pull/587): Fix oauth2 middleware compatibility with [draft-ietf-oauth-v2-31](http://tools.ietf.org/html/draft-ietf-oauth-v2-31) spec - [@etehtsea](https://github.com/etehtsea).
* [#610](https://github.com/intridea/grape/pull/610): Fixed group keyword was not working with type parameter - [@klausmeyer](https://github.com/klausmeyer/).
0.6.1 (10/19/2013)
==================
#### Features
* [#475](https://github.com/intridea/grape/pull/475): Added support for the `:jsonapi`, `application/vnd.api+json` media type registered at http://jsonapi.org - [@bcm](https://github.com/bcm).
* [#471](https://github.com/intridea/grape/issues/471): Added parameter validator for a list of allowed values - [@vickychijwani](https://github.com/vickychijwani).
* [#488](https://github.com/intridea/grape/issues/488): Upgraded to Virtus 1.0 - [@dblock](https://github.com/dblock).
#### Fixes
* [#477](https://github.com/intridea/grape/pull/477): Fixed `default_error_formatter` which takes a format symbol - [@vad4msiu](https://github.com/vad4msiu).
#### Development
* Implemented Rubocop, a Ruby code static code analyzer - [@dblock](https://github.com/dblock).
0.6.0 (9/16/2013)
=================
#### Features
* Grape is no longer tested against Ruby 1.8.7.
* [#442](https://github.com/intridea/grape/issues/442): Enable incrementally building on top of a previous API version - [@dblock](https://github.com/dblock).
* [#442](https://github.com/intridea/grape/issues/442): API `version` can now take an array of multiple versions - [@dblock](https://github.com/dblock).
* [#444](https://github.com/intridea/grape/issues/444): Added `:en` as fallback locale for I18n - [@aew](https://github.com/aew).
* [#448](https://github.com/intridea/grape/pull/448): Adding POST style parameters for DELETE requests - [@dquimper](https://github.com/dquimper).
* [#450](https://github.com/intridea/grape/pull/450): Added option to pass an exception handler lambda as an argument to `rescue_from` - [@robertopedroso](https://github.com/robertopedroso).
* [#443](https://github.com/intridea/grape/pull/443): Let `requires` and `optional` take blocks that initialize new scopes - [@asross](https://github.com/asross).
* [#452](https://github.com/intridea/grape/pull/452): Added `with` as a hash option to specify handlers for `rescue_from` and `error_formatter` [@robertopedroso](https://github.com/robertopedroso).
* [#433](https://github.com/intridea/grape/issues/433), [#462](https://github.com/intridea/grape/issues/462): Validation errors are now collected and `Grape::Exceptions::ValidationErrors` is raised - [@stevschmid](https://github.com/stevschmid).
#### Fixes
* [#428](https://github.com/intridea/grape/issues/428): Removes memoization from `Grape::Request` params to prevent middleware from freezing parameter values before `Formatter` can get them - [@mbleigh](https://github.com/mbleigh).
0.5.0 (6/14/2013)
=================
#### Features
* [#344](https://github.com/intridea/grape/pull/344): Added `parser :type, nil` which disables input parsing for a given content-type - [@dblock](https://github.com/dblock).
* [#381](https://github.com/intridea/grape/issues/381): Added `cascade false` option at API level to remove the `X-Cascade: true` header from the API response - [@dblock](https://github.com/dblock).
* [#392](https://github.com/intridea/grape/pull/392): Extracted headers and params from `Endpoint` to `Grape::Request` - [@niedhui](https://github.com/niedhui).
* [#376](https://github.com/intridea/grape/pull/376): Added `route_param`, syntax sugar for quick declaration of route parameters - [@mbleigh](https://github.com/mbleigh).
* [#390](https://github.com/intridea/grape/pull/390): Added default value for an `optional` parameter - [@oivoodoo](https://github.com/oivoodoo).
* [#403](https://github.com/intridea/grape/pull/403): Added support for versioning using the `Accept-Version` header - [@politician](https://github.com/politician).
* [#407](https://github.com/intridea/grape/issues/407): Specifying `default_format` will also set the default POST/PUT data parser to the given format - [@dblock](https://github.com/dblock).
* [#241](https://github.com/intridea/grape/issues/241): Present with multiple entities using an optional Symbol - [@niedhui](https://github.com/niedhui).
#### Fixes
* [#378](https://github.com/intridea/grape/pull/378): Fix: stop rescuing all exceptions during formatting - [@kbarrette](https://github.com/kbarrette).
* [#380](https://github.com/intridea/grape/pull/380): Fix: `Formatter#read_body_input` when transfer encoding is chunked - [@paulnicholon](https://github.com/paulnicholson).
* [#347](https://github.com/intridea/grape/issues/347): Fix: handling non-hash body params - [@paulnicholon](https://github.com/paulnicholson).
* [#394](https://github.com/intridea/grape/pull/394): Fix: path version no longer overwrites a `version` parameter - [@tmornini](https://github.com/tmornini).
* [#412](https://github.com/intridea/grape/issues/412): Fix: specifying `content_type` will also override the selection of the data formatter - [@dblock](https://github.com/dblock).
* [#383](https://github.com/intridea/grape/issues/383): Fix: Mounted APIs aren't inheriting settings (including `before` and `after` filters) - [@seanmoon](https://github.com/seanmoon).
* [#408](https://github.com/intridea/grape/pull/408): Fix: Goliath passes request header keys as symbols not strings - [@bobek](https://github.com/bobek).
* [#417](https://github.com/intridea/grape/issues/417): Fix: Rails 4 does not rewind input, causes POSTed data to be empty - [@dblock](https://github.com/dblock).
* [#423](https://github.com/intridea/grape/pull/423): Fix: `Grape::Endpoint#declared` now correctly handles nested params (ie. declared with `group`) - [@jbarreneche](https://github.com/jbarreneche).
* [#427](https://github.com/intridea/grape/issues/427): Fix: `declared(params)` breaks when `params` contains array - [@timhabermaas](https://github.com/timhabermaas)
0.4.1 (4/1/2013)
================
* [#375](https://github.com/intridea/grape/pull/375): Fix: throwing an `:error` inside a middleware doesn't respect the `format` settings - [@dblock](https://github.com/dblock).
0.4.0 (3/17/2013)
=================
* [#356](https://github.com/intridea/grape/pull/356): Fix: presenting collections other than `Array` (eg. `ActiveRecord::Relation`) - [@zimbatm](https://github.com/zimbatm).
* [#352](https://github.com/intridea/grape/pull/352): Fix: using `Rack::JSONP` with `Grape::Entity` responses - [@deckchair](https://github.com/deckchair).
* [#347](https://github.com/intridea/grape/issues/347): Grape will accept any valid JSON as PUT or POST, including strings, symbols and arrays - [@qqshfox](https://github.com/qqshfox), [@dblock](https://github.com/dblock).
* [#347](https://github.com/intridea/grape/issues/347): JSON format APIs always return valid JSON, eg. strings are now returned as `"string"` and no longer `string` - [@dblock](https://github.com/dblock).
* Raw body input from POST and PUT requests (`env['rack.input'].read`) is now available in `api.request.input` - [@dblock](https://github.com/dblock).
* Parsed body input from POST and PUT requests is now available in `api.request.body` - [@dblock](https://github.com/dblock).
* [#343](https://github.com/intridea/grape/pull/343): Fix: return `Content-Type: text/plain` with error 405 - [@gustavosaume](https://github.com/gustavosaume), [@wyattisimo](https://github.com/wyattisimo).
* [#357](https://github.com/intridea/grape/pull/357): Grape now requires Rack 1.3.0 or newer - [@jhecking](https://github.com/jhecking).
* [#320](https://github.com/intridea/grape/issues/320): API `namespace` now supports `requirements` - [@niedhui](https://github.com/niedhui).
* [#353](https://github.com/intridea/grape/issues/353): Revert to standard Ruby logger formatter, `require active_support/all` if you want old behavior - [@rhunter](https://github.com/rhunter), [@dblock](https://github.com/dblock).
* Fix: `undefined method 'call' for nil:NilClass` for an API method implementation without a block, now returns an empty string - [@dblock](https://github.com/dblock).
0.3.2 (2/28/2013)
=================
* [#355](https://github.com/intridea/grape/issues/355): Relax dependency constraint on Hashie - [@reset](https://github.com/reset).
0.3.1 (2/25/2013)
=================
* [#351](https://github.com/intridea/grape/issues/351): Compatibility with Ruby 2.0 - [@mbleigh](https://github.com/mbleigh).
0.3.0 (02/21/2013)
==================
* [#294](https://github.com/intridea/grape/issues/294): Extracted `Grape::Entity` into a [grape-entity](https://github.com/agileanimal/grape-entity) gem - [@agileanimal](https://github.com/agileanimal).
* [#340](https://github.com/intridea/grape/pull/339), [#342](https://github.com/intridea/grape/pull/342): Added `:cascade` option to `version` to allow disabling of rack/mount cascade behavior - [@dieb](https://github.com/dieb).
* [#333](https://github.com/intridea/grape/pull/333): Added support for validation of arrays in `params` - [@flyerhzm](https://github.com/flyerhzm).
* [#306](https://github.com/intridea/grape/issues/306): Added I18n support for all Grape exceptions - [@niedhui](https://github.com/niedhui).
* [#309](https://github.com/intridea/grape/pull/309): Added XML support to the entity presenter - [@johnnyiller](https://github.com/johnnyiller), [@dblock](http://github.com/dblock).
* [#131](https://github.com/intridea/grape/issues/131): Added instructions for Grape API reloading in Rails - [@jyn](http://github.com/jyn), [@dblock](http://github.com/dblock).
* [#317](https://github.com/intridea/grape/issues/317): Added `headers` that returns a hash of parsed HTTP request headers - [@dblock](http://github.com/dblock).
* [#332](https://github.com/intridea/grape/pull/332): `Grape::Exceptions::Validation` now contains full nested parameter names - [@alovak](https://github.com/alovak).
* [#328](https://github.com/intridea/grape/issues/328): API version can now be specified as both String and Symbol - [@dblock](http://github.com/dblock).
* [#190](https://github.com/intridea/grape/issues/190): When you add a `GET` route for a resource, a route for the `HEAD` method will also be added automatically. You can disable this behavior with `do_not_route_head!` - [@dblock](http://github.com/dblock).
* Added `do_not_route_options!`, which disables the automatic creation of the `OPTIONS` route - [@dblock](http://github.com/dblock).
* [#309](https://github.com/intridea/grape/pull/309): An XML format API will return an error instead of returning a string representation of the response if the latter cannot be converted to XML - [@dblock](http://github.com/dblock).
* A formatter that raises an exception will cause the API to return a 500 error - [@dblock](http://github.com/dblock).
* [#322](https://github.com/intridea/grape/issues/322): When returning a 406 status, Grape will include the requested format or content-type in the response body - [@dblock](http://github.com/dblock).
* [#60](https://github.com/intridea/grape/issues/60): Fix: mounting of a Grape API onto a path - [@dblock](http://github.com/dblock).
* [#335](https://github.com/intridea/grape/pull/335): Fix: request body parameters from a `PATCH` request not available in `params` - [@FreakenK](http://github.com/FreakenK).
0.2.6 (01/11/2013)
==================
* Fix: support content-type with character set when parsing POST and PUT input - [@dblock](http://github.com/dblock).
* Fix: CVE-2013-0175, multi_xml parse vulnerability, require multi_xml 0.5.2 - [@dblock](http://github.com/dblock).
0.2.5 (01/10/2013)
==================
* Added support for custom parsers via `parser`, in addition to built-in multipart, JSON and XML parsers - [@dblock](http://github.com/dblock).
* Removed `body_params`, data sent via a POST or PUT with a supported content-type is merged into `params` - [@dblock](http://github.com/dblock).
* Setting `format` will automatically remove other content-types by calling `content_type` - [@dblock](http://github.com/dblock).
* Setting `content_type` will prevent any input data other than the matching content-type or any Rack-supported form and parseable media types (`application/x-www-form-urlencoded`, `multipart/form-data`, `multipart/related` and `multipart/mixed`) from being parsed - [@dblock](http://github.com/dblock).
* [#305](https://github.com/intridea/grape/issues/305): Fix: presenting arrays of objects via `represent` or when auto-detecting an `Entity` constant in the objects being presented - [@brandonweiss](https://github.com/brandonweiss).
* [#306](https://github.com/intridea/grape/issues/306): Added i18n support for validation error messages - [@niedhui](https://github.com/niedhui).
0.2.4 (01/06/2013)
==================
* [#297](https://github.com/intridea/grape/issues/297): Added `default_error_formatter` - [@dblock](https://github.com/dblock).
* [#297](https://github.com/intridea/grape/issues/297): Setting `format` will automatically set `default_error_formatter` - [@dblock](https://github.com/dblock).
* [#295](https://github.com/intridea/grape/issues/295): Storing original API source block in endpoint's `source` attribute - [@dblock](https://github.com/dblock).
* [#293](https://github.com/intridea/grape/pull/293): Added options to `cookies.delete`, enables passing a path - [@inst](https://github.com/inst).
* [#174](https://github.com/intridea/grape/issues/174): The value of `env['PATH_INFO']` is no longer altered with `path` versioning - [@dblock](https://github.com/dblock).
* [#296](https://github.com/intridea/grape/issues/296): Fix: ArgumentError with default error formatter - [@dblock](https://github.com/dblock).
* [#298](https://github.com/intridea/grape/pull/298): Fix: subsequent calls to `body_params` would fail due to IO read - [@justinmcp](https://github.com/justinmcp).
* [#301](https://github.com/intridea/grape/issues/301): Fix: symbol memory leak in cookie and formatter middleware - [@dblock](https://github.com/dblock).
* [#300](https://github.com/intridea/grape/issues/300): Fix `Grape::API.routes` to include mounted api routes - [@aiwilliams](https://github.com/aiwilliams).
* [#302](https://github.com/intridea/grape/pull/302): Fix: removed redundant `autoload` entries - [@ugisozols](https://github.com/ugisozols).
* [#172](https://github.com/intridea/grape/issues/172): Fix: MultiJson deprecated methods warnings - [@dblock](https://github.com/dblock).
* [#133](https://github.com/intridea/grape/issues/133): Fix: header-based versioning with use of `prefix` - [@seanmoon](https://github.com/seanmoon), [@dblock](https://github.com/dblock).
* [#280](https://github.com/intridea/grape/issues/280): Fix: grouped parameters mangled in `route_params` hash - [@marcusg](https://github.com/marcusg), [@dblock](https://github.com/dblock).
* [#304](https://github.com/intridea/grape/issues/304): Fix: `present x, :with => Entity` returns class references with `format :json` - [@dblock](https://github.com/dblock).
* [#196](https://github.com/intridea/grape/issues/196): Fix: root requests don't work with `prefix` - [@dblock](https://github.com/dblock).
0.2.3 (24/12/2012)
==================
* [#179](https://github.com/intridea/grape/issues/178): Using `content_type` will remove all default content-types - [@dblock](https://github.com/dblock).
* [#265](https://github.com/intridea/grape/issues/264): Fix: Moved `ValidationError` into `Grape::Exceptions` - [@thepumpkin1979](https://github.com/thepumpkin1979).
* [#269](https://github.com/intridea/grape/pull/269): Fix: `LocalJumpError` will not be raised when using explict return in API methods - [@simulacre](https://github.com/simulacre).
* [#86](https://github.com/intridea/grape/issues/275): Fix Path-based versioning not recognizing `/` route - [@walski](https://github.com/walski).
* [#273](https://github.com/intridea/grape/pull/273): Disabled formatting via `serializable_hash` and added support for `format :serializable_hash` - [@dblock](https://github.com/dblock).
* [#277](https://github.com/intridea/grape/pull/277): Added a DSL to declare `formatter` in API settings - [@tim-vandecasteele](https://github.com/tim-vandecasteele).
* [#284](https://github.com/intridea/grape/pull/284): Added a DSL to declare `error_formatter` in API settings - [@dblock](https://github.com/dblock).
* [#285](https://github.com/intridea/grape/pull/285): Removed `error_format` from API settings, now matches request format - [@dblock](https://github.com/dblock).
* [#290](https://github.com/intridea/grape/pull/290): The default error format for XML is now `error/message` instead of `hash/error` - [@dpsk](https://github.com/dpsk).
* [#44](https://github.com/intridea/grape/issues/44): Pass `env` into formatters to enable templating - [@dblock](https://github.com/dblock).
0.2.2
=====
#### Features
* [#201](https://github.com/intridea/grape/pull/201), [#236](https://github.com/intridea/grape/pull/236), [#221](https://github.com/intridea/grape/pull/221): Added coercion and validations support to `params` DSL - [@schmurfy](https://github.com/schmurfy), [@tim-vandecasteele](https://github.com/tim-vandecasteele), [@adamgotterer](https://github.com/adamgotterer).
* [#204](https://github.com/intridea/grape/pull/204): Added ability to declare shared `params` at `namespace` level - [@tim-vandecasteele](https://github.com/tim-vandecasteele).
* [#234](https://github.com/intridea/grape/pull/234): Added a DSL for creating entities via mixin - [@mbleigh](https://github.com/mbleigh).
* [#240](https://github.com/intridea/grape/pull/240): Define API response format from a query string `format` parameter, if specified - [@neetiraj](https://github.com/neetiraj).
* Adds Endpoint#declared to easily filter out unexpected params. - [@mbleigh](https://github.com/mbleigh)
#### Fixes
* [#248](https://github.com/intridea/grape/pull/248): Fix: API `version` returns last version set - [@narkoz](https://github.com/narkoz).
* [#242](https://github.com/intridea/grape/issues/242): Fix: permanent redirect status should be `301`, was `304` - [@adamgotterer](https://github.com/adamgotterer).
* [#211](https://github.com/intridea/grape/pull/211): Fix: custom validations are no longer triggered when optional and parameter is not present - [@adamgotterer](https://github.com/adamgotterer).
* [#210](https://github.com/intridea/grape/pull/210): Fix: `Endpoint#body_params` causing undefined method 'size' - [@adamgotterer](https://github.com/adamgotterer).
* [#205](https://github.com/intridea/grape/pull/205): Fix: Corrected parsing of empty JSON body on POST/PUT - [@tim-vandecasteele](https://github.com/tim-vandecasteele).
* [#181](https://github.com/intridea/grape/pull/181): Fix: Corrected JSON serialization of nested hashes containing `Grape::Entity` instances - [@benrosenblum](https://github.com/benrosenblum).
* [#203](https://github.com/intridea/grape/pull/203): Added a check to `Entity#serializable_hash` that verifies an entity exists on an object - [@adamgotterer](https://github.com/adamgotterer).
* [#208](https://github.com/intridea/grape/pull/208): `Entity#serializable_hash` must also check if attribute is generated by a user supplied block - [@ppadron](https://github.com/ppadron).
* [#252](https://github.com/intridea/grape/pull/252): Resources that don't respond to a requested HTTP method return 405 (Method Not Allowed) instead of 404 (Not Found) - [@simulacre](https://github.com/simulacre)
0.2.1 (7/11/2012)
=================
* [#186](https://github.com/intridea/grape/issues/186): Fix: helpers allow multiple calls with modules and blocks - [@ppadron](https://github.com/ppadron).
* [#188](https://github.com/intridea/grape/pull/188): Fix: multi-method routes append '(.:format)' only once - [@kainosnoema](https://github.com/kainosnoema).
* [#64](https://github.com/intridea/grape/issues/64), [#180](https://github.com/intridea/grape/pull/180): Added support to `GET` request bodies as parameters - [@bobbytables](https://github.com/bobbytables).
* [#175](https://github.com/intridea/grape/pull/175): Added support for API versioning based on a request parameter - [@jackcasey](https://github.com/jackcasey).
* [#168](https://github.com/intridea/grape/pull/168): Fix: Formatter can parse symbol keys in the headers hash - [@netmask](https://github.com/netmask).
* [#169](https://github.com/intridea/grape/pull/169): Silence multi_json deprecation warnings - [@whiteley](https://github.com/whiteley).
* [#166](https://github.com/intridea/grape/pull/166): Added support for `redirect`, including permanent and temporary - [@allenwei](https://github.com/allenwei).
* [#159](https://github.com/intridea/grape/pull/159): Added `:requirements` to routes, allowing to use reserved characters in paths - [@gaiottino](https://github.com/gaiottino).
* [#156](https://github.com/intridea/grape/pull/156): Added support for adding formatters to entities - [@bobbytables](https://github.com/bobbytables).
* [#183](https://github.com/intridea/grape/pull/183): Added ability to include documentation in entities - [@flah00](https://github.com/flah00).
* [#189](https://github.com/intridea/grape/pull/189): `HEAD` requests no longer return a body - [@stephencelis](https://github.com/stephencelis).
* [#97](https://github.com/intridea/grape/issues/97): Allow overriding `Content-Type` - [@dblock](https://github.com/dblock).
0.2.0 (3/28/2012)
=================
* Added support for inheriting exposures from entities - [@bobbytables](https://github.com/bobbytables).
* Extended formatting with `default_format` - [@dblock](https://github.com/dblock).
* Added support for cookies - [@lukaszsliwa](https://github.com/lukaszsliwa).
* Added support for declaring additional content-types - [@joeyAghion](https://github.com/joeyAghion).
* Added support for HTTP PATCH - [@LTe](https://github.com/LTe).
* Added support for describing, documenting and reflecting APIs - [@dblock](https://github.com/dblock).
* Added support for anchoring and vendoring - [@jwkoelewijn](https://github.com/jwkoelewijn).
* Added support for HTTP OPTIONS - [@grimen](https://github.com/grimen).
* Added support for silencing logger - [@evansj](https://github.com/evansj).
* Added support for helper modules - [@freelancing-god](https://github.com/freelancing-god).
* Added support for Accept header-based versioning - [@jch](https://github.com/jch), [@rodzyn](https://github.com/rodzyn).
* Added support for mounting APIs and other Rack applications within APIs - [@mbleigh](https://github.com/mbleigh).
* Added entities, multiple object representations - [@mbleigh](https://github.com/mbleigh).
* Added ability to handle XML in the incoming request body - [@jwillis](https://github.com/jwillis).
* Added support for a configurable logger - [@mbleigh](https://github.com/mbleigh).
* Added support for before and after filters - [@mbleigh](https://github.com/mbleigh).
* Extended `rescue_from`, which can now take a block - [@dblock](https://github.com/dblock).
0.1.5 (6/14/2011)
==================
* Extended exception handling to all exceptions - [@dblock](https://github.com/dblock).
* Added support for returning JSON objects from within error blocks - [@dblock](https://github.com/dblock).
* Added support for handling incoming JSON in body - [@tedkulp](https://github.com/tedkulp).
* Added support for HTTP digest authentication - [@daddz](https://github.com/daddz).
0.1.4 (4/8/2011)
==================
* Allow multiple definitions of the same endpoint under multiple versions - [@chrisrhoden](https://github.com/chrisrhoden).
* Added support for multipart URL parameters - [@mcastilho](https://github.com/mcastilho).
* Added support for custom formatters - [@spraints](https://github.com/spraints).
0.1.3 (1/10/2011)
==================
* Added support for JSON format in route matching - [@aiwilliams](https://github.com/aiwilliams).
* Added suport for custom middleware - [@mbleigh](https://github.com/mbleigh).
0.1.1 (11/14/2010)
==================
* Endpoints properly reset between each request - [@mbleigh](https://github.com/mbleigh).
0.1.0 (11/13/2010)
==================
* Initial public release - [@mbleigh](https://github.com/mbleigh).
| phusion/grape | CHANGELOG.md | Markdown | mit | 40,604 |
module.exports = function(grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
// watch for changes and trigger compass, jshint, uglify and livereload
watch: {
js: {
files: ['jquery.accrue.js'],
tasks: ['jshint','uglify'],
options: {
livereload: true,
},
},
css: {
files: 'example.scss',
tasks: ['sass'],
options: {
livereload: true,
},
}
},
// we use the Sass
sass: {
dist: {
options: {
// nested, compact, compressed, expanded
style: 'compressed'
},
files: {
'example.css': 'example.scss'
}
}
},
// uglify to concat & minify
uglify: {
js: {
files: {
'jquery.accrue.min.js': 'jquery.accrue.js',
}
}
},
// lint me.
jshint: {
all: ['jquery.accrue.js']
}
});
// register task
grunt.registerTask('default', ['watch']);
}; | jpederson/Accrue.js | gruntfile.js | JavaScript | mit | 1,376 |
require "lita"
Lita.load_locales Dir[File.expand_path(
File.join("..", "..", "locales", "*.yml"), __FILE__
)]
require "lita/handlers/urban"
| taylorlapeyre/lita-urban | lib/lita-urban.rb | Ruby | mit | 144 |
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.IO;
using System.Text;
public class KinectManager : MonoBehaviour
{
public enum Smoothing : int { None, Default, Medium, Aggressive }
// Public Bool to determine how many players there are. Default of one user.
public bool TwoUsers = false;
// Public Bool to determine if the sensor is used in near mode.
public bool NearMode = false;
// Public Bool to determine whether to receive and compute the user map
public bool ComputeUserMap = false;
// Public Bool to determine whether to receive and compute the color map
public bool ComputeColorMap = false;
// Public Bool to determine whether to display user map on the GUI
public bool DisplayUserMap = false;
// Public Bool to determine whether to display color map on the GUI
public bool DisplayColorMap = false;
// Public Bool to determine whether to display the skeleton lines on user map
public bool DisplaySkeletonLines = false;
// Public Floats to specify the width and height of the depth and color maps as % of the camera width and height
// if percents are zero, they are calculated based on actual Kinect image´s width and height
public float MapsPercentWidth = 0f;
public float MapsPercentHeight = 0f;
// How high off the ground is the sensor (in meters).
public float SensorHeight = 1.0f;
// Kinect elevation angle (in degrees)
public int SensorAngle = 0;
// Minimum user distance in order to process skeleton data
public float MinUserDistance = 1.0f;
// Public Bool to determine whether to detect only the closest user or not
public bool DetectClosestUser = true;
// Public Bool to determine whether to use only the tracked joints (and ignore the inferred ones)
public bool IgnoreInferredJoints = true;
// Selection of smoothing parameters
public Smoothing smoothing = Smoothing.Default;
// Public Bool to determine the use of additional filters
public bool UseBoneOrientationsFilter = false;
public bool UseClippedLegsFilter = false;
public bool UseBoneOrientationsConstraint = true;
public bool UseSelfIntersectionConstraint = false;
// Lists of GameObjects that will be controlled by which player.
public List<GameObject> Player1Avatars;
public List<GameObject> Player2Avatars;
// Calibration poses for each player, if needed
public KinectGestures.Gestures Player1CalibrationPose;
public KinectGestures.Gestures Player2CalibrationPose;
// List of Gestures to detect for each player
public List<KinectGestures.Gestures> Player1Gestures;
public List<KinectGestures.Gestures> Player2Gestures;
// Minimum time between gesture detections
public float MinTimeBetweenGestures = 0f;
// List of Gesture Listeners. They must implement KinectGestures.GestureListenerInterface
public List<MonoBehaviour> GestureListeners;
// GUI Text to show messages.
public GameObject CalibrationText;
// GUI Texture to display the hand cursor for Player1
public GameObject HandCursor1;
// GUI Texture to display the hand cursor for Player1
public GameObject HandCursor2;
// Bool to specify whether Left/Right-hand-cursor and the Click-gesture control the mouse cursor and click
public bool ControlMouseCursor = false;
// Bool to keep track of whether Kinect has been initialized
private bool KinectInitialized = false;
// Bools to keep track of who is currently calibrated.
private bool Player1Calibrated = false;
private bool Player2Calibrated = false;
private bool AllPlayersCalibrated = false;
// Values to track which ID (assigned by the Kinect) is player 1 and player 2.
private uint Player1ID;
private uint Player2ID;
// Lists of AvatarControllers that will let the models get updated.
private List<AvatarController> Player1Controllers;
private List<AvatarController> Player2Controllers;
// User Map vars.
private Texture2D usersLblTex;
private Color32[] usersMapColors;
private ushort[] usersPrevState;
private Rect usersMapRect;
private int usersMapSize;
private Texture2D usersClrTex;
//Color[] usersClrColors;
private Rect usersClrRect;
//short[] usersLabelMap;
private short[] usersDepthMap;
private float[] usersHistogramMap;
// List of all users
private List<uint> allUsers;
// Image stream handles for the kinect
private IntPtr colorStreamHandle;
private IntPtr depthStreamHandle;
// Color image data, if used
private Color32[] colorImage;
private byte[] usersColorMap;
// Skeleton related structures
private KinectWrapper.NuiSkeletonFrame skeletonFrame;
private KinectWrapper.NuiTransformSmoothParameters smoothParameters;
private int player1Index, player2Index;
// Skeleton tracking states, positions and joints' orientations
private Vector3 player1Pos, player2Pos;
private Matrix4x4 player1Ori, player2Ori;
private bool[] player1JointsTracked, player2JointsTracked;
private bool[] player1PrevTracked, player2PrevTracked;
private Vector3[] player1JointsPos, player2JointsPos;
private Matrix4x4[] player1JointsOri, player2JointsOri;
private KinectWrapper.NuiSkeletonBoneOrientation[] jointOrientations;
// Calibration gesture data for each player
private KinectGestures.GestureData player1CalibrationData;
private KinectGestures.GestureData player2CalibrationData;
// Lists of gesture data, for each player
private List<KinectGestures.GestureData> player1Gestures = new List<KinectGestures.GestureData>();
private List<KinectGestures.GestureData> player2Gestures = new List<KinectGestures.GestureData>();
// general gesture tracking time start
private float[] gestureTrackingAtTime;
// List of Gesture Listeners. They must implement KinectGestures.GestureListenerInterface
public List<KinectGestures.GestureListenerInterface> gestureListeners;
private Matrix4x4 kinectToWorld, flipMatrix;
private static KinectManager instance;
// Timer for controlling Filter Lerp blends.
private float lastNuiTime;
// Filters
private TrackingStateFilter[] trackingStateFilter;
private BoneOrientationsFilter[] boneOrientationFilter;
private ClippedLegsFilter[] clippedLegsFilter;
private BoneOrientationsConstraint boneConstraintsFilter;
private SelfIntersectionConstraint selfIntersectionConstraint;
// returns the single KinectManager instance
public static KinectManager Instance
{
get
{
return instance;
}
}
// checks if Kinect is initialized and ready to use. If not, there was an error during Kinect-sensor initialization
public static bool IsKinectInitialized()
{
return instance != null ? instance.KinectInitialized : false;
}
// checks if Kinect is initialized and ready to use. If not, there was an error during Kinect-sensor initialization
public bool IsInitialized()
{
return KinectInitialized;
}
// this function is used internally by AvatarController
public static bool IsCalibrationNeeded()
{
return false;
}
// // returns the raw depth/user data,if ComputeUserMap is true
// public short[] GetUsersDepthMap()
// {
// return usersDepthMap;
// }
// returns the depth data for a specific pixel,if ComputeUserMap is true
public short GetDepthForPixel(int x, int y)
{
int index = y * KinectWrapper.Constants.ImageWidth + x;
if(index >= 0 && index < usersDepthMap.Length)
return usersDepthMap[index];
else
return 0;
}
// returns the depth map position for a 3d joint position
public Vector2 GetDepthMapPosForJointPos(Vector3 posJoint)
{
Vector3 vDepthPos = KinectWrapper.MapSkeletonPointToDepthPoint(posJoint);
Vector2 vMapPos = new Vector2(vDepthPos.x, vDepthPos.y);
return vMapPos;
}
// returns the color map position for a depth 2d position
public Vector2 GetColorMapPosForDepthPos(Vector2 posDepth)
{
int cx, cy;
KinectWrapper.NuiImageViewArea pcViewArea = new KinectWrapper.NuiImageViewArea
{
eDigitalZoom = 0,
lCenterX = 0,
lCenterY = 0
};
int hr = KinectWrapper.NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution(
KinectWrapper.Constants.ImageResolution,
KinectWrapper.Constants.ImageResolution,
ref pcViewArea,
(int)posDepth.x, (int)posDepth.y, GetDepthForPixel((int)posDepth.x, (int)posDepth.y),
out cx, out cy);
return new Vector2(cx, cy);
}
// returns the depth image/users histogram texture,if ComputeUserMap is true
public Texture2D GetUsersLblTex()
{
return usersLblTex;
}
// returns the color image texture,if ComputeColorMap is true
public Texture2D GetUsersClrTex()
{
return usersClrTex;
}
// returns true if at least one user is currently detected by the sensor
public bool IsUserDetected()
{
return KinectInitialized && (allUsers.Count > 0);
}
// returns the UserID of Player1, or 0 if no Player1 is detected
public uint GetPlayer1ID()
{
return Player1ID;
}
// returns the UserID of Player2, or 0 if no Player2 is detected
public uint GetPlayer2ID()
{
return Player2ID;
}
// returns true if the User is calibrated and ready to use
public bool IsPlayerCalibrated(uint UserId)
{
if(UserId == Player1ID)
return Player1Calibrated;
else if(UserId == Player2ID)
return Player2Calibrated;
return false;
}
// returns the raw unmodified joint position, as returned by the Kinect sensor
public Vector3 GetRawSkeletonJointPos(uint UserId, int joint)
{
if(UserId == Player1ID)
return joint >= 0 && joint < player1JointsPos.Length ? (Vector3)skeletonFrame.SkeletonData[player1Index].SkeletonPositions[joint] : Vector3.zero;
else if(UserId == Player2ID)
return joint >= 0 && joint < player2JointsPos.Length ? (Vector3)skeletonFrame.SkeletonData[player2Index].SkeletonPositions[joint] : Vector3.zero;
return Vector3.zero;
}
// returns the User position, relative to the Kinect-sensor, in meters
public Vector3 GetUserPosition(uint UserId)
{
if(UserId == Player1ID)
return player1Pos;
else if(UserId == Player2ID)
return player2Pos;
return Vector3.zero;
}
// returns the User rotation, relative to the Kinect-sensor
public Quaternion GetUserOrientation(uint UserId, bool flip)
{
if(UserId == Player1ID && player1JointsTracked[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter])
return ConvertMatrixToQuat(player1Ori, (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter, flip);
else if(UserId == Player2ID && player2JointsTracked[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter])
return ConvertMatrixToQuat(player2Ori, (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter, flip);
return Quaternion.identity;
}
// returns true if the given joint of the specified user is being tracked
public bool IsJointTracked(uint UserId, int joint)
{
if(UserId == Player1ID)
return joint >= 0 && joint < player1JointsTracked.Length ? player1JointsTracked[joint] : false;
else if(UserId == Player2ID)
return joint >= 0 && joint < player2JointsTracked.Length ? player2JointsTracked[joint] : false;
return false;
}
// returns the joint position of the specified user, relative to the Kinect-sensor, in meters
public Vector3 GetJointPosition(uint UserId, int joint)
{
if(UserId == Player1ID)
return joint >= 0 && joint < player1JointsPos.Length ? player1JointsPos[joint] : Vector3.zero;
else if(UserId == Player2ID)
return joint >= 0 && joint < player2JointsPos.Length ? player2JointsPos[joint] : Vector3.zero;
return Vector3.zero;
}
// returns the local joint position of the specified user, relative to the parent joint, in meters
public Vector3 GetJointLocalPosition(uint UserId, int joint)
{
int parent = KinectWrapper.GetSkeletonJointParent(joint);
if(UserId == Player1ID)
return joint >= 0 && joint < player1JointsPos.Length ?
(player1JointsPos[joint] - player1JointsPos[parent]) : Vector3.zero;
else if(UserId == Player2ID)
return joint >= 0 && joint < player2JointsPos.Length ?
(player2JointsPos[joint] - player2JointsPos[parent]) : Vector3.zero;
return Vector3.zero;
}
// returns the joint rotation of the specified user, relative to the Kinect-sensor
public Quaternion GetJointOrientation(uint UserId, int joint, bool flip)
{
if(UserId == Player1ID)
{
if(joint >= 0 && joint < player1JointsOri.Length && player1JointsTracked[joint])
return ConvertMatrixToQuat(player1JointsOri[joint], joint, flip);
}
else if(UserId == Player2ID)
{
if(joint >= 0 && joint < player2JointsOri.Length && player2JointsTracked[joint])
return ConvertMatrixToQuat(player2JointsOri[joint], joint, flip);
}
return Quaternion.identity;
}
// returns the joint rotation of the specified user, relative to the parent joint
public Quaternion GetJointLocalOrientation(uint UserId, int joint, bool flip)
{
int parent = KinectWrapper.GetSkeletonJointParent(joint);
if(UserId == Player1ID)
{
if(joint >= 0 && joint < player1JointsOri.Length && player1JointsTracked[joint])
{
Matrix4x4 localMat = (player1JointsOri[parent].inverse * player1JointsOri[joint]);
return Quaternion.LookRotation(localMat.GetColumn(2), localMat.GetColumn(1));
}
}
else if(UserId == Player2ID)
{
if(joint >= 0 && joint < player2JointsOri.Length && player2JointsTracked[joint])
{
Matrix4x4 localMat = (player2JointsOri[parent].inverse * player2JointsOri[joint]);
return Quaternion.LookRotation(localMat.GetColumn(2), localMat.GetColumn(1));
}
}
return Quaternion.identity;
}
// returns the direction between baseJoint and nextJoint, for the specified user
public Vector3 GetDirectionBetweenJoints(uint UserId, int baseJoint, int nextJoint, bool flipX, bool flipZ)
{
Vector3 jointDir = Vector3.zero;
if(UserId == Player1ID)
{
if(baseJoint >= 0 && baseJoint < player1JointsPos.Length && player1JointsTracked[baseJoint] &&
nextJoint >= 0 && nextJoint < player1JointsPos.Length && player1JointsTracked[nextJoint])
{
jointDir = player1JointsPos[nextJoint] - player1JointsPos[baseJoint];
}
}
else if(UserId == Player2ID)
{
if(baseJoint >= 0 && baseJoint < player2JointsPos.Length && player2JointsTracked[baseJoint] &&
nextJoint >= 0 && nextJoint < player2JointsPos.Length && player2JointsTracked[nextJoint])
{
jointDir = player2JointsPos[nextJoint] - player2JointsPos[baseJoint];
}
}
if(jointDir != Vector3.zero)
{
if(flipX)
jointDir.x = -jointDir.x;
if(flipZ)
jointDir.z = -jointDir.z;
}
return jointDir;
}
// adds a gesture to the list of detected gestures for the specified user
public void DetectGesture(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index >= 0)
DeleteGesture(UserId, gesture);
KinectGestures.GestureData gestureData = new KinectGestures.GestureData();
gestureData.userId = UserId;
gestureData.gesture = gesture;
gestureData.state = 0;
gestureData.joint = 0;
gestureData.progress = 0f;
gestureData.complete = false;
gestureData.cancelled = false;
gestureData.checkForGestures = new List<KinectGestures.Gestures>();
switch(gesture)
{
case KinectGestures.Gestures.ZoomIn:
gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomOut);
gestureData.checkForGestures.Add(KinectGestures.Gestures.Wheel);
break;
case KinectGestures.Gestures.ZoomOut:
gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomIn);
gestureData.checkForGestures.Add(KinectGestures.Gestures.Wheel);
break;
case KinectGestures.Gestures.Wheel:
gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomIn);
gestureData.checkForGestures.Add(KinectGestures.Gestures.ZoomOut);
break;
// case KinectGestures.Gestures.Jump:
// gestureData.checkForGestures.Add(KinectGestures.Gestures.Squat);
// break;
//
// case KinectGestures.Gestures.Squat:
// gestureData.checkForGestures.Add(KinectGestures.Gestures.Jump);
// break;
//
// case KinectGestures.Gestures.Push:
// gestureData.checkForGestures.Add(KinectGestures.Gestures.Pull);
// break;
//
// case KinectGestures.Gestures.Pull:
// gestureData.checkForGestures.Add(KinectGestures.Gestures.Push);
// break;
}
if(UserId == Player1ID)
player1Gestures.Add(gestureData);
else if(UserId == Player2ID)
player2Gestures.Add(gestureData);
}
// resets the gesture-data state for the given gesture of the specified user
public bool ResetGesture(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index < 0)
return false;
KinectGestures.GestureData gestureData = (UserId == Player1ID) ? player1Gestures[index] : player2Gestures[index];
gestureData.state = 0;
gestureData.joint = 0;
gestureData.progress = 0f;
gestureData.complete = false;
gestureData.cancelled = false;
gestureData.startTrackingAtTime = Time.realtimeSinceStartup + KinectWrapper.Constants.MinTimeBetweenSameGestures;
if(UserId == Player1ID)
player1Gestures[index] = gestureData;
else if(UserId == Player2ID)
player2Gestures[index] = gestureData;
return true;
}
// resets the gesture-data states for all detected gestures of the specified user
public void ResetPlayerGestures(uint UserId)
{
if(UserId == Player1ID)
{
int listSize = player1Gestures.Count;
for(int i = 0; i < listSize; i++)
{
ResetGesture(UserId, player1Gestures[i].gesture);
}
}
else if(UserId == Player2ID)
{
int listSize = player2Gestures.Count;
for(int i = 0; i < listSize; i++)
{
ResetGesture(UserId, player2Gestures[i].gesture);
}
}
}
// deletes the given gesture from the list of detected gestures for the specified user
public bool DeleteGesture(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index < 0)
return false;
if(UserId == Player1ID)
player1Gestures.RemoveAt(index);
else if(UserId == Player2ID)
player2Gestures.RemoveAt(index);
return true;
}
// clears detected gestures list for the specified user
public void ClearGestures(uint UserId)
{
if(UserId == Player1ID)
{
player1Gestures.Clear();
}
else if(UserId == Player2ID)
{
player2Gestures.Clear();
}
}
// returns the count of detected gestures in the list of detected gestures for the specified user
public int GetGesturesCount(uint UserId)
{
if(UserId == Player1ID)
return player1Gestures.Count;
else if(UserId == Player2ID)
return player2Gestures.Count;
return 0;
}
// returns the list of detected gestures for the specified user
public List<KinectGestures.Gestures> GetGesturesList(uint UserId)
{
List<KinectGestures.Gestures> list = new List<KinectGestures.Gestures>();
if(UserId == Player1ID)
{
foreach(KinectGestures.GestureData data in player1Gestures)
list.Add(data.gesture);
}
else if(UserId == Player2ID)
{
foreach(KinectGestures.GestureData data in player1Gestures)
list.Add(data.gesture);
}
return list;
}
// returns true, if the given gesture is in the list of detected gestures for the specified user
public bool IsGestureDetected(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
return index >= 0;
}
// returns true, if the given gesture for the specified user is complete
public bool IsGestureComplete(uint UserId, KinectGestures.Gestures gesture, bool bResetOnComplete)
{
int index = GetGestureIndex(UserId, gesture);
if(index >= 0)
{
if(UserId == Player1ID)
{
KinectGestures.GestureData gestureData = player1Gestures[index];
if(bResetOnComplete && gestureData.complete)
{
ResetPlayerGestures(UserId);
return true;
}
return gestureData.complete;
}
else if(UserId == Player2ID)
{
KinectGestures.GestureData gestureData = player2Gestures[index];
if(bResetOnComplete && gestureData.complete)
{
ResetPlayerGestures(UserId);
return true;
}
return gestureData.complete;
}
}
return false;
}
// returns true, if the given gesture for the specified user is cancelled
public bool IsGestureCancelled(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index >= 0)
{
if(UserId == Player1ID)
{
KinectGestures.GestureData gestureData = player1Gestures[index];
return gestureData.cancelled;
}
else if(UserId == Player2ID)
{
KinectGestures.GestureData gestureData = player2Gestures[index];
return gestureData.cancelled;
}
}
return false;
}
// returns the progress in range [0, 1] of the given gesture for the specified user
public float GetGestureProgress(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index >= 0)
{
if(UserId == Player1ID)
{
KinectGestures.GestureData gestureData = player1Gestures[index];
return gestureData.progress;
}
else if(UserId == Player2ID)
{
KinectGestures.GestureData gestureData = player2Gestures[index];
return gestureData.progress;
}
}
return 0f;
}
// returns the current "screen position" of the given gesture for the specified user
public Vector3 GetGestureScreenPos(uint UserId, KinectGestures.Gestures gesture)
{
int index = GetGestureIndex(UserId, gesture);
if(index >= 0)
{
if(UserId == Player1ID)
{
KinectGestures.GestureData gestureData = player1Gestures[index];
return gestureData.screenPos;
}
else if(UserId == Player2ID)
{
KinectGestures.GestureData gestureData = player2Gestures[index];
return gestureData.screenPos;
}
}
return Vector3.zero;
}
// recreates and reinitializes the lists of avatar controllers, after the list of avatars for player 1/2 was changed
public void SetAvatarControllers()
{
if(Player1Avatars.Count == 0 && Player2Avatars.Count == 0)
{
AvatarController[] avatars = FindObjectsOfType(typeof(AvatarController)) as AvatarController[];
foreach(AvatarController avatar in avatars)
{
Player1Avatars.Add(avatar.gameObject);
}
}
if(Player1Controllers != null)
{
Player1Controllers.Clear();
foreach(GameObject avatar in Player1Avatars)
{
if(avatar != null && avatar.activeInHierarchy)
{
AvatarController controller = avatar.GetComponent<AvatarController>();
controller.RotateToInitialPosition();
controller.Start();
Player1Controllers.Add(controller);
}
}
}
if(Player2Controllers != null)
{
Player2Controllers.Clear();
foreach(GameObject avatar in Player2Avatars)
{
if(avatar != null && avatar.activeInHierarchy)
{
AvatarController controller = avatar.GetComponent<AvatarController>();
controller.RotateToInitialPosition();
controller.Start();
Player2Controllers.Add(controller);
}
}
}
}
// removes the currently detected kinect users, allowing a new detection/calibration process to start
public void ClearKinectUsers()
{
if(!KinectInitialized)
return;
// remove current users
for(int i = allUsers.Count - 1; i >= 0; i--)
{
uint userId = allUsers[i];
RemoveUser(userId);
}
ResetFilters();
}
// clears Kinect buffers and resets the filters
public void ResetFilters()
{
if(!KinectInitialized)
return;
// clear kinect vars
player1Pos = Vector3.zero; player2Pos = Vector3.zero;
player1Ori = Matrix4x4.identity; player2Ori = Matrix4x4.identity;
int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count;
for(int i = 0; i < skeletonJointsCount; i++)
{
player1JointsTracked[i] = false; player2JointsTracked[i] = false;
player1PrevTracked[i] = false; player2PrevTracked[i] = false;
player1JointsPos[i] = Vector3.zero; player2JointsPos[i] = Vector3.zero;
player1JointsOri[i] = Matrix4x4.identity; player2JointsOri[i] = Matrix4x4.identity;
}
if(trackingStateFilter != null)
{
for(int i = 0; i < trackingStateFilter.Length; i++)
if(trackingStateFilter[i] != null)
trackingStateFilter[i].Reset();
}
if(boneOrientationFilter != null)
{
for(int i = 0; i < boneOrientationFilter.Length; i++)
if(boneOrientationFilter[i] != null)
boneOrientationFilter[i].Reset();
}
if(clippedLegsFilter != null)
{
for(int i = 0; i < clippedLegsFilter.Length; i++)
if(clippedLegsFilter[i] != null)
clippedLegsFilter[i].Reset();
}
}
//----------------------------------- end of public functions --------------------------------------//
void Start()
{
//CalibrationText = GameObject.Find("CalibrationText");
int hr = 0;
try
{
hr = KinectWrapper.NuiInitialize(KinectWrapper.NuiInitializeFlags.UsesSkeleton |
KinectWrapper.NuiInitializeFlags.UsesDepthAndPlayerIndex |
(ComputeColorMap ? KinectWrapper.NuiInitializeFlags.UsesColor : 0));
if (hr != 0)
{
throw new Exception("NuiInitialize Failed");
}
hr = KinectWrapper.NuiSkeletonTrackingEnable(IntPtr.Zero, 8); // 0, 12,8
if (hr != 0)
{
throw new Exception("Cannot initialize Skeleton Data");
}
depthStreamHandle = IntPtr.Zero;
if(ComputeUserMap)
{
hr = KinectWrapper.NuiImageStreamOpen(KinectWrapper.NuiImageType.DepthAndPlayerIndex,
KinectWrapper.Constants.ImageResolution, 0, 2, IntPtr.Zero, ref depthStreamHandle);
if (hr != 0)
{
throw new Exception("Cannot open depth stream");
}
}
colorStreamHandle = IntPtr.Zero;
if(ComputeColorMap)
{
hr = KinectWrapper.NuiImageStreamOpen(KinectWrapper.NuiImageType.Color,
KinectWrapper.Constants.ImageResolution, 0, 2, IntPtr.Zero, ref colorStreamHandle);
if (hr != 0)
{
throw new Exception("Cannot open color stream");
}
}
// set kinect elevation angle
KinectWrapper.NuiCameraElevationSetAngle(SensorAngle);
// init skeleton structures
skeletonFrame = new KinectWrapper.NuiSkeletonFrame()
{
SkeletonData = new KinectWrapper.NuiSkeletonData[KinectWrapper.Constants.NuiSkeletonCount]
};
// values used to pass to smoothing function
smoothParameters = new KinectWrapper.NuiTransformSmoothParameters();
switch(smoothing)
{
case Smoothing.Default:
smoothParameters.fSmoothing = 0.5f;
smoothParameters.fCorrection = 0.5f;
smoothParameters.fPrediction = 0.5f;
smoothParameters.fJitterRadius = 0.05f;
smoothParameters.fMaxDeviationRadius = 0.04f;
break;
case Smoothing.Medium:
smoothParameters.fSmoothing = 0.5f;
smoothParameters.fCorrection = 0.1f;
smoothParameters.fPrediction = 0.5f;
smoothParameters.fJitterRadius = 0.1f;
smoothParameters.fMaxDeviationRadius = 0.1f;
break;
case Smoothing.Aggressive:
smoothParameters.fSmoothing = 0.7f;
smoothParameters.fCorrection = 0.3f;
smoothParameters.fPrediction = 1.0f;
smoothParameters.fJitterRadius = 1.0f;
smoothParameters.fMaxDeviationRadius = 1.0f;
break;
}
// init the tracking state filter
trackingStateFilter = new TrackingStateFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked];
for(int i = 0; i < trackingStateFilter.Length; i++)
{
trackingStateFilter[i] = new TrackingStateFilter();
trackingStateFilter[i].Init();
}
// init the bone orientation filter
boneOrientationFilter = new BoneOrientationsFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked];
for(int i = 0; i < boneOrientationFilter.Length; i++)
{
boneOrientationFilter[i] = new BoneOrientationsFilter();
boneOrientationFilter[i].Init();
}
// init the clipped legs filter
clippedLegsFilter = new ClippedLegsFilter[KinectWrapper.Constants.NuiSkeletonMaxTracked];
for(int i = 0; i < clippedLegsFilter.Length; i++)
{
clippedLegsFilter[i] = new ClippedLegsFilter();
}
// init the bone orientation constraints
boneConstraintsFilter = new BoneOrientationsConstraint();
boneConstraintsFilter.AddDefaultConstraints();
// init the self intersection constraints
selfIntersectionConstraint = new SelfIntersectionConstraint();
// create arrays for joint positions and joint orientations
int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count;
player1JointsTracked = new bool[skeletonJointsCount];
player2JointsTracked = new bool[skeletonJointsCount];
player1PrevTracked = new bool[skeletonJointsCount];
player2PrevTracked = new bool[skeletonJointsCount];
player1JointsPos = new Vector3[skeletonJointsCount];
player2JointsPos = new Vector3[skeletonJointsCount];
player1JointsOri = new Matrix4x4[skeletonJointsCount];
player2JointsOri = new Matrix4x4[skeletonJointsCount];
gestureTrackingAtTime = new float[KinectWrapper.Constants.NuiSkeletonMaxTracked];
//create the transform matrix that converts from kinect-space to world-space
Quaternion quatTiltAngle = new Quaternion();
quatTiltAngle.eulerAngles = new Vector3(-SensorAngle, 0.0f, 0.0f);
//float heightAboveHips = SensorHeight - 1.0f;
// transform matrix - kinect to world
//kinectToWorld.SetTRS(new Vector3(0.0f, heightAboveHips, 0.0f), quatTiltAngle, Vector3.one);
kinectToWorld.SetTRS(new Vector3(0.0f, SensorHeight, 0.0f), quatTiltAngle, Vector3.one);
flipMatrix = Matrix4x4.identity;
flipMatrix[2, 2] = -1;
instance = this;
DontDestroyOnLoad(gameObject);
}
catch(DllNotFoundException e)
{
string message = "Please check the Kinect SDK installation.";
Debug.LogError(message);
Debug.LogError(e.ToString());
if(CalibrationText != null)
CalibrationText.guiText.text = message;
return;
}
catch (Exception e)
{
string message = e.Message + " - " + KinectWrapper.GetNuiErrorString(hr);
Debug.LogError(message);
Debug.LogError(e.ToString());
if(CalibrationText != null)
CalibrationText.guiText.text = message;
return;
}
// get the main camera rectangle
Rect cameraRect = Camera.main.pixelRect;
// calculate map width and height in percent, if needed
if(MapsPercentWidth == 0f)
MapsPercentWidth = (KinectWrapper.GetDepthWidth() / 2) / cameraRect.width;
if(MapsPercentHeight == 0f)
MapsPercentHeight = (KinectWrapper.GetDepthHeight() / 2) / cameraRect.height;
if(ComputeUserMap)
{
// Initialize depth & label map related stuff
usersMapSize = KinectWrapper.GetDepthWidth() * KinectWrapper.GetDepthHeight();
usersLblTex = new Texture2D(KinectWrapper.GetDepthWidth(), KinectWrapper.GetDepthHeight());
usersMapColors = new Color32[usersMapSize];
usersPrevState = new ushort[usersMapSize];
//usersMapRect = new Rect(Screen.width, Screen.height - usersLblTex.height / 2, -usersLblTex.width / 2, usersLblTex.height / 2);
//usersMapRect = new Rect(cameraRect.width, cameraRect.height - cameraRect.height * MapsPercentHeight, -cameraRect.width * MapsPercentWidth, cameraRect.height * MapsPercentHeight);
usersMapRect = new Rect(cameraRect.width - cameraRect.width * MapsPercentWidth, cameraRect.height, cameraRect.width * MapsPercentWidth, -cameraRect.height * MapsPercentHeight);
usersDepthMap = new short[usersMapSize];
usersHistogramMap = new float[8192];
}
if(ComputeColorMap)
{
// Initialize color map related stuff
usersClrTex = new Texture2D(KinectWrapper.GetDepthWidth(), KinectWrapper.GetDepthHeight());
//usersClrRect = new Rect(cameraRect.width, cameraRect.height - cameraRect.height * MapsPercentHeight, -cameraRect.width * MapsPercentWidth, cameraRect.height * MapsPercentHeight);
usersClrRect = new Rect(cameraRect.width - cameraRect.width * MapsPercentWidth, cameraRect.height, cameraRect.width * MapsPercentWidth, -cameraRect.height * MapsPercentHeight);
if(ComputeUserMap)
usersMapRect.x -= cameraRect.width * MapsPercentWidth; //usersClrTex.width / 2;
colorImage = new Color32[KinectWrapper.GetDepthWidth() * KinectWrapper.GetDepthHeight()];
usersColorMap = new byte[colorImage.Length << 2];
}
// try to automatically find the available avatar controllers in the scene
if(Player1Avatars.Count == 0 && Player2Avatars.Count == 0)
{
AvatarController[] avatars = FindObjectsOfType(typeof(AvatarController)) as AvatarController[];
foreach(AvatarController avatar in avatars)
{
Player1Avatars.Add(avatar.gameObject);
}
}
// Initialize user list to contain ALL users.
allUsers = new List<uint>();
// Pull the AvatarController from each of the players Avatars.
Player1Controllers = new List<AvatarController>();
Player2Controllers = new List<AvatarController>();
// Add each of the avatars' controllers into a list for each player.
foreach(GameObject avatar in Player1Avatars)
{
if(avatar != null && avatar.activeInHierarchy)
{
Player1Controllers.Add(avatar.GetComponent<AvatarController>());
}
}
foreach(GameObject avatar in Player2Avatars)
{
if(avatar != null && avatar.activeInHierarchy)
{
Player2Controllers.Add(avatar.GetComponent<AvatarController>());
}
}
// create the list of gesture listeners
gestureListeners = new List<KinectGestures.GestureListenerInterface>();
foreach(MonoBehaviour script in GestureListeners)
{
if(script && (script is KinectGestures.GestureListenerInterface))
{
KinectGestures.GestureListenerInterface listener = (KinectGestures.GestureListenerInterface)script;
gestureListeners.Add(listener);
}
}
// GUI Text.
if(CalibrationText != null)
{
CalibrationText.guiText.text = "WAITING FOR USERS";
}
Debug.Log("Waiting for users.");
KinectInitialized = true;
}
void Update()
{
if(KinectInitialized)
{
// // for testing purposes only
// KinectWrapper.UpdateKinectSensor();
// If the players aren't all calibrated yet, draw the user map.
if(ComputeUserMap)
{
if(depthStreamHandle != IntPtr.Zero &&
KinectWrapper.PollDepth(depthStreamHandle, NearMode, ref usersDepthMap))
{
UpdateUserMap();
}
}
if(ComputeColorMap)
{
if(colorStreamHandle != IntPtr.Zero &&
KinectWrapper.PollColor(colorStreamHandle, ref usersColorMap, ref colorImage))
{
UpdateColorMap();
}
}
if(KinectWrapper.PollSkeleton(ref smoothParameters, ref skeletonFrame))
{
ProcessSkeleton();
}
// Update player 1's models if he/she is calibrated and the model is active.
if(Player1Calibrated)
{
foreach (AvatarController controller in Player1Controllers)
{
//if(controller.Active)
{
controller.UpdateAvatar(Player1ID, NearMode);
}
}
// Check for complete gestures
foreach(KinectGestures.GestureData gestureData in player1Gestures)
{
if(gestureData.complete)
{
if(gestureData.gesture == KinectGestures.Gestures.Click)
{
if(ControlMouseCursor)
{
MouseControl.MouseClick();
}
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
if(listener.GestureCompleted(Player1ID, 0, gestureData.gesture,
(KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos))
{
ResetPlayerGestures(Player1ID);
}
}
}
else if(gestureData.cancelled)
{
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
if(listener.GestureCancelled(Player1ID, 0, gestureData.gesture,
(KinectWrapper.SkeletonJoint)gestureData.joint))
{
ResetGesture(Player1ID, gestureData.gesture);
}
}
}
else if(gestureData.progress >= 0.1f)
{
if((gestureData.gesture == KinectGestures.Gestures.RightHandCursor ||
gestureData.gesture == KinectGestures.Gestures.LeftHandCursor) &&
gestureData.progress >= 0.5f)
{
if(HandCursor1 != null)
{
HandCursor1.transform.position = Vector3.Lerp(HandCursor1.transform.position, gestureData.screenPos, 3 * Time.deltaTime);
}
if(ControlMouseCursor)
{
MouseControl.MouseMove(gestureData.screenPos);
}
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.GestureInProgress(Player1ID, 0, gestureData.gesture, gestureData.progress,
(KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos);
}
}
}
}
// Update player 2's models if he/she is calibrated and the model is active.
if(Player2Calibrated)
{
foreach (AvatarController controller in Player2Controllers)
{
//if(controller.Active)
{
controller.UpdateAvatar(Player2ID, NearMode);
}
}
// Check for complete gestures
foreach(KinectGestures.GestureData gestureData in player2Gestures)
{
if(gestureData.complete)
{
if(gestureData.gesture == KinectGestures.Gestures.Click)
{
if(ControlMouseCursor)
{
MouseControl.MouseClick();
}
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
if(listener.GestureCompleted(Player2ID, 1, gestureData.gesture,
(KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos))
{
ResetPlayerGestures(Player2ID);
}
}
}
else if(gestureData.cancelled)
{
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
if(listener.GestureCancelled(Player2ID, 1, gestureData.gesture,
(KinectWrapper.SkeletonJoint)gestureData.joint))
{
ResetGesture(Player2ID, gestureData.gesture);
}
}
}
else if(gestureData.progress >= 0.1f)
{
if((gestureData.gesture == KinectGestures.Gestures.RightHandCursor ||
gestureData.gesture == KinectGestures.Gestures.LeftHandCursor) &&
gestureData.progress >= 0.5f)
{
if(HandCursor2 != null)
{
HandCursor2.transform.position = Vector3.Lerp(HandCursor2.transform.position, gestureData.screenPos, 3 * Time.deltaTime);
}
if(ControlMouseCursor)
{
MouseControl.MouseMove(gestureData.screenPos);
}
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.GestureInProgress(Player2ID, 1, gestureData.gesture, gestureData.progress,
(KinectWrapper.SkeletonJoint)gestureData.joint, gestureData.screenPos);
}
}
}
}
}
// Kill the program with ESC.
if(Input.GetKeyDown(KeyCode.Escape))
{
Application.Quit();
}
}
// Make sure to kill the Kinect on quitting.
void OnApplicationQuit()
{
if(KinectInitialized)
{
// Shutdown OpenNI
KinectWrapper.NuiShutdown();
instance = null;
}
}
// Draw the Histogram Map on the GUI.
void OnGUI()
{
if(KinectInitialized)
{
if(ComputeUserMap && (/**(allUsers.Count == 0) ||*/ DisplayUserMap))
{
GUI.DrawTexture(usersMapRect, usersLblTex);
}
if(ComputeColorMap && (/**(allUsers.Count == 0) ||*/ DisplayColorMap))
{
GUI.DrawTexture(usersClrRect, usersClrTex);
}
}
}
// Update the User Map
void UpdateUserMap()
{
int numOfPoints = 0;
Array.Clear(usersHistogramMap, 0, usersHistogramMap.Length);
// Calculate cumulative histogram for depth
for (int i = 0; i < usersMapSize; i++)
{
// Only calculate for depth that contains users
if ((usersDepthMap[i] & 7) != 0)
{
usersHistogramMap[usersDepthMap[i] >> 3]++;
numOfPoints++;
}
}
if (numOfPoints > 0)
{
for (int i = 1; i < usersHistogramMap.Length; i++)
{
usersHistogramMap[i] += usersHistogramMap[i-1];
}
for (int i = 0; i < usersHistogramMap.Length; i++)
{
usersHistogramMap[i] = 1.0f - (usersHistogramMap[i] / numOfPoints);
}
}
// dummy structure needed by the coordinate mapper
KinectWrapper.NuiImageViewArea pcViewArea = new KinectWrapper.NuiImageViewArea
{
eDigitalZoom = 0,
lCenterX = 0,
lCenterY = 0
};
// Create the actual users texture based on label map and depth histogram
Color32 clrClear = Color.clear;
for (int i = 0; i < usersMapSize; i++)
{
// Flip the texture as we convert label map to color array
int flipIndex = i; // usersMapSize - i - 1;
ushort userMap = (ushort)(usersDepthMap[i] & 7);
ushort userDepth = (ushort)(usersDepthMap[i] >> 3);
ushort nowUserPixel = userMap != 0 ? (ushort)((userMap << 13) | userDepth) : userDepth;
ushort wasUserPixel = usersPrevState[flipIndex];
// draw only the changed pixels
if(nowUserPixel != wasUserPixel)
{
usersPrevState[flipIndex] = nowUserPixel;
if (userMap == 0)
{
usersMapColors[flipIndex] = clrClear;
}
else
{
if(colorImage != null)
{
int x = i % KinectWrapper.Constants.ImageWidth;
int y = i / KinectWrapper.Constants.ImageWidth;
int cx, cy;
int hr = KinectWrapper.NuiImageGetColorPixelCoordinatesFromDepthPixelAtResolution(
KinectWrapper.Constants.ImageResolution,
KinectWrapper.Constants.ImageResolution,
ref pcViewArea,
x, y, usersDepthMap[i],
out cx, out cy);
if(hr == 0)
{
int colorIndex = cx + cy * KinectWrapper.Constants.ImageWidth;
//colorIndex = usersMapSize - colorIndex - 1;
if(colorIndex >= 0 && colorIndex < usersMapSize)
{
Color32 colorPixel = colorImage[colorIndex];
usersMapColors[flipIndex] = colorPixel; // new Color(colorPixel.r / 256f, colorPixel.g / 256f, colorPixel.b / 256f, 0.9f);
usersMapColors[flipIndex].a = 230; // 0.9f
}
}
}
else
{
// Create a blending color based on the depth histogram
float histDepth = usersHistogramMap[userDepth];
Color c = new Color(histDepth, histDepth, histDepth, 0.9f);
switch(userMap % 4)
{
case 0:
usersMapColors[flipIndex] = Color.red * c;
break;
case 1:
usersMapColors[flipIndex] = Color.green * c;
break;
case 2:
usersMapColors[flipIndex] = Color.blue * c;
break;
case 3:
usersMapColors[flipIndex] = Color.magenta * c;
break;
}
}
}
}
}
// Draw it!
usersLblTex.SetPixels32(usersMapColors);
usersLblTex.Apply();
}
// Update the Color Map
void UpdateColorMap()
{
usersClrTex.SetPixels32(colorImage);
usersClrTex.Apply();
}
// Assign UserId to player 1 or 2.
void CalibrateUser(uint UserId, ref KinectWrapper.NuiSkeletonData skeletonData)
{
// If player 1 hasn't been calibrated, assign that UserID to it.
if(!Player1Calibrated)
{
// Check to make sure we don't accidentally assign player 2 to player 1.
if (!allUsers.Contains(UserId))
{
if(CheckForCalibrationPose(UserId, ref Player1CalibrationPose, ref player1CalibrationData, ref skeletonData))
{
Player1Calibrated = true;
Player1ID = UserId;
allUsers.Add(UserId);
foreach(AvatarController controller in Player1Controllers)
{
controller.SuccessfulCalibration(UserId);
}
// add the gestures to detect, if any
foreach(KinectGestures.Gestures gesture in Player1Gestures)
{
DetectGesture(UserId, gesture);
}
print ("user.detected");
// notify the gesture listeners about the new user
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.UserDetected(UserId, 0);
}
// reset skeleton filters
ResetFilters();
// If we're not using 2 users, we're all calibrated.
//if(!TwoUsers)
{
AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // true;
}
}
}
}
// Otherwise, assign to player 2.
else if(TwoUsers && !Player2Calibrated)
{
if (!allUsers.Contains(UserId))
{
if(CheckForCalibrationPose(UserId, ref Player2CalibrationPose, ref player2CalibrationData, ref skeletonData))
{
Player2Calibrated = true;
Player2ID = UserId;
allUsers.Add(UserId);
foreach(AvatarController controller in Player2Controllers)
{
controller.SuccessfulCalibration(UserId);
}
// add the gestures to detect, if any
foreach(KinectGestures.Gestures gesture in Player2Gestures)
{
DetectGesture(UserId, gesture);
}
// notify the gesture listeners about the new user
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.UserDetected(UserId, 1);
}
// reset skeleton filters
ResetFilters();
// All users are calibrated!
AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // true;
}
}
}
// If all users are calibrated, stop trying to find them.
if(AllPlayersCalibrated)
{
Debug.Log("All players calibrated.");
if(CalibrationText != null)
{
CalibrationText.guiText.text = "";
}
}
}
// Remove a lost UserId
void RemoveUser(uint UserId)
{
// If we lose player 1...
if(UserId == Player1ID)
{
// Null out the ID and reset all the models associated with that ID.
Player1ID = 0;
Player1Calibrated = false;
foreach(AvatarController controller in Player1Controllers)
{
controller.RotateToCalibrationPose(UserId, IsCalibrationNeeded());
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.UserLost(UserId, 0);
}
player1CalibrationData.userId = 0;
}
// If we lose player 2...
if(UserId == Player2ID)
{
// Null out the ID and reset all the models associated with that ID.
Player2ID = 0;
Player2Calibrated = false;
foreach(AvatarController controller in Player2Controllers)
{
controller.RotateToCalibrationPose(UserId, IsCalibrationNeeded());
}
foreach(KinectGestures.GestureListenerInterface listener in gestureListeners)
{
listener.UserLost(UserId, 1);
}
player2CalibrationData.userId = 0;
}
// clear gestures list for this user
ClearGestures(UserId);
// remove from global users list
allUsers.Remove(UserId);
AllPlayersCalibrated = !TwoUsers ? allUsers.Count >= 1 : allUsers.Count >= 2; // false;
// Try to replace that user!
Debug.Log("Waiting for users.");
if(CalibrationText != null)
{
CalibrationText.guiText.text = "WAITING FOR USERS";
}
}
// Some internal constants
private const int stateTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.Tracked;
private const int stateNotTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.NotTracked;
private int [] mustBeTrackedJoints = {
(int)KinectWrapper.NuiSkeletonPositionIndex.AnkleLeft,
(int)KinectWrapper.NuiSkeletonPositionIndex.FootLeft,
(int)KinectWrapper.NuiSkeletonPositionIndex.AnkleRight,
(int)KinectWrapper.NuiSkeletonPositionIndex.FootRight,
};
// Process the skeleton data
void ProcessSkeleton()
{
List<uint> lostUsers = new List<uint>();
lostUsers.AddRange(allUsers);
// calculate the time since last update
float currentNuiTime = Time.realtimeSinceStartup;
float deltaNuiTime = currentNuiTime - lastNuiTime;
for(int i = 0; i < KinectWrapper.Constants.NuiSkeletonCount; i++)
{
KinectWrapper.NuiSkeletonData skeletonData = skeletonFrame.SkeletonData[i];
uint userId = skeletonData.dwTrackingID;
if(skeletonData.eTrackingState == KinectWrapper.NuiSkeletonTrackingState.SkeletonTracked)
{
// get the skeleton position
Vector3 skeletonPos = kinectToWorld.MultiplyPoint3x4(skeletonData.Position);
if(!AllPlayersCalibrated)
{
// check if this is the closest user
bool bClosestUser = true;
if(DetectClosestUser)
{
for(int j = 0; j < KinectWrapper.Constants.NuiSkeletonCount; j++)
{
if(j != i)
{
KinectWrapper.NuiSkeletonData skeletonDataOther = skeletonFrame.SkeletonData[j];
if((skeletonDataOther.eTrackingState == KinectWrapper.NuiSkeletonTrackingState.SkeletonTracked) &&
(Mathf.Abs(kinectToWorld.MultiplyPoint3x4(skeletonDataOther.Position).z) < Mathf.Abs(skeletonPos.z)))
{
bClosestUser = false;
break;
}
}
}
}
if(bClosestUser)
{
CalibrateUser(userId, ref skeletonData);
}
}
//// get joints orientations
//KinectWrapper.NuiSkeletonBoneOrientation[] jointOrients = new KinectWrapper.NuiSkeletonBoneOrientation[(int)KinectWrapper.NuiSkeletonPositionIndex.Count];
//KinectWrapper.NuiSkeletonCalculateBoneOrientations(ref skeletonData, jointOrients);
if(userId == Player1ID && Mathf.Abs(skeletonPos.z) >= MinUserDistance)
{
player1Index = i;
// get player position
player1Pos = skeletonPos;
// apply tracking state filter first
trackingStateFilter[0].UpdateFilter(ref skeletonData);
// fixup skeleton to improve avatar appearance.
if(UseClippedLegsFilter && clippedLegsFilter[0] != null)
{
clippedLegsFilter[0].FilterSkeleton(ref skeletonData, deltaNuiTime);
}
if(UseSelfIntersectionConstraint && selfIntersectionConstraint != null)
{
selfIntersectionConstraint.Constrain(ref skeletonData);
}
// get joints' position and rotation
for (int j = 0; j < (int)KinectWrapper.NuiSkeletonPositionIndex.Count; j++)
{
bool playerTracked = IgnoreInferredJoints ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked :
(Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked :
(int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked);
player1JointsTracked[j] = player1PrevTracked[j] && playerTracked;
player1PrevTracked[j] = playerTracked;
if(player1JointsTracked[j])
{
player1JointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]);
//player1JointsOri[j] = jointOrients[j].absoluteRotation.rotationMatrix * flipMatrix;
}
// if(j == (int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter)
// {
// string debugText = String.Format("{0} {1}", /**(int)skeletonData.eSkeletonPositionTrackingState[j], */
// player1JointsTracked[j] ? "T" : "F", player1JointsPos[j]/**, skeletonData.SkeletonPositions[j]*/);
//
// if(CalibrationText)
// CalibrationText.guiText.text = debugText;
// }
}
// draw the skeleton on top of texture
if(DisplaySkeletonLines && ComputeUserMap)
{
DrawSkeleton(usersLblTex, ref skeletonData, ref player1JointsTracked);
}
// calculate joint orientations
KinectWrapper.GetSkeletonJointOrientation(ref player1JointsPos, ref player1JointsTracked, ref player1JointsOri);
// filter orientation constraints
if(UseBoneOrientationsConstraint && boneConstraintsFilter != null)
{
boneConstraintsFilter.Constrain(ref player1JointsOri, ref player1JointsTracked);
}
// filter joint orientations.
// it should be performed after all joint position modifications.
if(UseBoneOrientationsFilter && boneOrientationFilter[0] != null)
{
boneOrientationFilter[0].UpdateFilter(ref skeletonData, ref player1JointsOri);
}
// get player rotation
player1Ori = player1JointsOri[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter];
// check for gestures
if(Time.realtimeSinceStartup >= gestureTrackingAtTime[0])
{
int listGestureSize = player1Gestures.Count;
float timestampNow = Time.realtimeSinceStartup;
for(int g = 0; g < listGestureSize; g++)
{
KinectGestures.GestureData gestureData = player1Gestures[g];
if((timestampNow >= gestureData.startTrackingAtTime) &&
!IsConflictingGestureInProgress(gestureData))
{
KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup,
ref player1JointsPos, ref player1JointsTracked);
player1Gestures[g] = gestureData;
if(gestureData.complete)
{
gestureTrackingAtTime[0] = timestampNow + MinTimeBetweenGestures;
}
}
}
}
}
else if(userId == Player2ID && Mathf.Abs(skeletonPos.z) >= MinUserDistance)
{
player2Index = i;
// get player position
player2Pos = skeletonPos;
// apply tracking state filter first
trackingStateFilter[1].UpdateFilter(ref skeletonData);
// fixup skeleton to improve avatar appearance.
if(UseClippedLegsFilter && clippedLegsFilter[1] != null)
{
clippedLegsFilter[1].FilterSkeleton(ref skeletonData, deltaNuiTime);
}
if(UseSelfIntersectionConstraint && selfIntersectionConstraint != null)
{
selfIntersectionConstraint.Constrain(ref skeletonData);
}
// get joints' position and rotation
for (int j = 0; j < (int)KinectWrapper.NuiSkeletonPositionIndex.Count; j++)
{
bool playerTracked = IgnoreInferredJoints ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked :
(Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked :
(int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked);
player2JointsTracked[j] = player2PrevTracked[j] && playerTracked;
player2PrevTracked[j] = playerTracked;
if(player2JointsTracked[j])
{
player2JointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]);
}
}
// draw the skeleton on top of texture
if(DisplaySkeletonLines && ComputeUserMap)
{
DrawSkeleton(usersLblTex, ref skeletonData, ref player2JointsTracked);
}
// calculate joint orientations
KinectWrapper.GetSkeletonJointOrientation(ref player2JointsPos, ref player2JointsTracked, ref player2JointsOri);
// filter orientation constraints
if(UseBoneOrientationsConstraint && boneConstraintsFilter != null)
{
boneConstraintsFilter.Constrain(ref player2JointsOri, ref player2JointsTracked);
}
// filter joint orientations.
// it should be performed after all joint position modifications.
if(UseBoneOrientationsFilter && boneOrientationFilter[1] != null)
{
boneOrientationFilter[1].UpdateFilter(ref skeletonData, ref player2JointsOri);
}
// get player rotation
player2Ori = player2JointsOri[(int)KinectWrapper.NuiSkeletonPositionIndex.HipCenter];
// check for gestures
if(Time.realtimeSinceStartup >= gestureTrackingAtTime[1])
{
int listGestureSize = player2Gestures.Count;
float timestampNow = Time.realtimeSinceStartup;
for(int g = 0; g < listGestureSize; g++)
{
KinectGestures.GestureData gestureData = player2Gestures[g];
if((timestampNow >= gestureData.startTrackingAtTime) &&
!IsConflictingGestureInProgress(gestureData))
{
KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup,
ref player2JointsPos, ref player2JointsTracked);
player2Gestures[g] = gestureData;
if(gestureData.complete)
{
gestureTrackingAtTime[1] = timestampNow + MinTimeBetweenGestures;
}
}
}
}
}
lostUsers.Remove(userId);
}
}
// update the nui-timer
lastNuiTime = currentNuiTime;
// remove the lost users if any
if(lostUsers.Count > 0)
{
foreach(uint userId in lostUsers)
{
RemoveUser(userId);
}
lostUsers.Clear();
}
}
// draws the skeleton in the given texture
private void DrawSkeleton(Texture2D aTexture, ref KinectWrapper.NuiSkeletonData skeletonData, ref bool[] playerJointsTracked)
{
int jointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count;
for(int i = 0; i < jointsCount; i++)
{
int parent = KinectWrapper.GetSkeletonJointParent(i);
if(playerJointsTracked[i] && playerJointsTracked[parent])
{
Vector3 posParent = KinectWrapper.MapSkeletonPointToDepthPoint(skeletonData.SkeletonPositions[parent]);
Vector3 posJoint = KinectWrapper.MapSkeletonPointToDepthPoint(skeletonData.SkeletonPositions[i]);
// posParent.y = KinectWrapper.Constants.ImageHeight - posParent.y - 1;
// posJoint.y = KinectWrapper.Constants.ImageHeight - posJoint.y - 1;
// posParent.x = KinectWrapper.Constants.ImageWidth - posParent.x - 1;
// posJoint.x = KinectWrapper.Constants.ImageWidth - posJoint.x - 1;
//Color lineColor = playerJointsTracked[i] && playerJointsTracked[parent] ? Color.red : Color.yellow;
DrawLine(aTexture, (int)posParent.x, (int)posParent.y, (int)posJoint.x, (int)posJoint.y, Color.yellow);
}
}
aTexture.Apply();
}
// draws a line in a texture
private void DrawLine(Texture2D a_Texture, int x1, int y1, int x2, int y2, Color a_Color)
{
int width = KinectWrapper.Constants.ImageWidth;
int height = KinectWrapper.Constants.ImageHeight;
int dy = y2 - y1;
int dx = x2 - x1;
int stepy = 1;
if (dy < 0)
{
dy = -dy;
stepy = -1;
}
int stepx = 1;
if (dx < 0)
{
dx = -dx;
stepx = -1;
}
dy <<= 1;
dx <<= 1;
if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height)
for(int x = -1; x <= 1; x++)
for(int y = -1; y <= 1; y++)
a_Texture.SetPixel(x1 + x, y1 + y, a_Color);
if (dx > dy)
{
int fraction = dy - (dx >> 1);
while (x1 != x2)
{
if (fraction >= 0)
{
y1 += stepy;
fraction -= dx;
}
x1 += stepx;
fraction += dy;
if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height)
for(int x = -1; x <= 1; x++)
for(int y = -1; y <= 1; y++)
a_Texture.SetPixel(x1 + x, y1 + y, a_Color);
}
}
else
{
int fraction = dx - (dy >> 1);
while (y1 != y2)
{
if (fraction >= 0)
{
x1 += stepx;
fraction -= dy;
}
y1 += stepy;
fraction += dx;
if(x1 >= 0 && x1 < width && y1 >= 0 && y1 < height)
for(int x = -1; x <= 1; x++)
for(int y = -1; y <= 1; y++)
a_Texture.SetPixel(x1 + x, y1 + y, a_Color);
}
}
}
// convert the matrix to quaternion, taking care of the mirroring
private Quaternion ConvertMatrixToQuat(Matrix4x4 mOrient, int joint, bool flip)
{
Vector4 vZ = mOrient.GetColumn(2);
Vector4 vY = mOrient.GetColumn(1);
if(!flip)
{
vZ.y = -vZ.y;
vY.x = -vY.x;
vY.z = -vY.z;
}
else
{
vZ.x = -vZ.x;
vZ.y = -vZ.y;
vY.z = -vY.z;
}
if(vZ.x != 0.0f || vZ.y != 0.0f || vZ.z != 0.0f)
return Quaternion.LookRotation(vZ, vY);
else
return Quaternion.identity;
}
// return the index of gesture in the list, or -1 if not found
private int GetGestureIndex(uint UserId, KinectGestures.Gestures gesture)
{
if(UserId == Player1ID)
{
int listSize = player1Gestures.Count;
for(int i = 0; i < listSize; i++)
{
if(player1Gestures[i].gesture == gesture)
return i;
}
}
else if(UserId == Player2ID)
{
int listSize = player2Gestures.Count;
for(int i = 0; i < listSize; i++)
{
if(player2Gestures[i].gesture == gesture)
return i;
}
}
return -1;
}
private bool IsConflictingGestureInProgress(KinectGestures.GestureData gestureData)
{
foreach(KinectGestures.Gestures gesture in gestureData.checkForGestures)
{
int index = GetGestureIndex(gestureData.userId, gesture);
if(index >= 0)
{
if(gestureData.userId == Player1ID)
{
if(player1Gestures[index].progress > 0f)
return true;
}
else if(gestureData.userId == Player2ID)
{
if(player2Gestures[index].progress > 0f)
return true;
}
}
}
return false;
}
// check if the calibration pose is complete for given user
private bool CheckForCalibrationPose(uint userId, ref KinectGestures.Gestures calibrationGesture,
ref KinectGestures.GestureData gestureData, ref KinectWrapper.NuiSkeletonData skeletonData)
{
if(calibrationGesture == KinectGestures.Gestures.None)
return true;
// init gesture data if needed
if(gestureData.userId != userId)
{
gestureData.userId = userId;
gestureData.gesture = calibrationGesture;
gestureData.state = 0;
gestureData.joint = 0;
gestureData.progress = 0f;
gestureData.complete = false;
gestureData.cancelled = false;
}
// get temporary joints' position
int skeletonJointsCount = (int)KinectWrapper.NuiSkeletonPositionIndex.Count;
bool[] jointsTracked = new bool[skeletonJointsCount];
Vector3[] jointsPos = new Vector3[skeletonJointsCount];
int stateTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.Tracked;
int stateNotTracked = (int)KinectWrapper.NuiSkeletonPositionTrackingState.NotTracked;
int [] mustBeTrackedJoints = {
(int)KinectWrapper.NuiSkeletonPositionIndex.AnkleLeft,
(int)KinectWrapper.NuiSkeletonPositionIndex.FootLeft,
(int)KinectWrapper.NuiSkeletonPositionIndex.AnkleRight,
(int)KinectWrapper.NuiSkeletonPositionIndex.FootRight,
};
for (int j = 0; j < skeletonJointsCount; j++)
{
jointsTracked[j] = Array.BinarySearch(mustBeTrackedJoints, j) >= 0 ? (int)skeletonData.eSkeletonPositionTrackingState[j] == stateTracked :
(int)skeletonData.eSkeletonPositionTrackingState[j] != stateNotTracked;
if(jointsTracked[j])
{
jointsPos[j] = kinectToWorld.MultiplyPoint3x4(skeletonData.SkeletonPositions[j]);
}
}
// estimate the gesture progess
KinectGestures.CheckForGesture(userId, ref gestureData, Time.realtimeSinceStartup,
ref jointsPos, ref jointsTracked);
// check if gesture is complete
if(gestureData.complete)
{
gestureData.userId = 0;
return true;
}
return false;
}
}
| Acidburn0zzz/Corridors | Assets/KinectScripts/KinectManager.cs | C# | mit | 63,304 |
<?php
namespace Lam\MdlBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Lam\MdlBundle\Entity\FormationInformatique
* @ORM\Table()
* @ORM\Entity(repositoryClass="Lam\MdlBundle\Entity\FormationInformatiqueRepository")
*/
class Formationinformatique
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string $titre
*
* @ORM\Column(name="Titre", type="string", length=100, nullable=false)
*/
private $titre;
/**
* @var text $objectif
*
* @ORM\Column(name="Objectif", type="text", nullable=false)
*/
private $objectif;
/**
* @var string $public
*
* @ORM\Column(name="Public", type="string", length=150, nullable=false)
*/
private $public;
/**
* @var text $prerequis
*
* @ORM\Column(name="Prerequis", type="text", nullable=false)
*/
private $prerequis;
/**
* @var string $logo
*
* @ORM\Column(name="Logo", type="string", length=50, nullable=false)
*/
private $logo;
/**
* @var integer $nbplace
*
* @ORM\Column(name="nbPlace", type="integer", nullable=false)
*/
private $nbplace;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set titre
*
* @param string $titre
*/
public function setTitre($titre)
{
$this->titre = $titre;
}
/**
* Get titre
*
* @return string
*/
public function getTitre()
{
return $this->titre;
}
/**
* Set objectif
*
* @param text $objectif
*/
public function setObjectif($objectif)
{
$this->objectif = $objectif;
}
/**
* Get objectif
*
* @return text
*/
public function getObjectif()
{
return $this->objectif;
}
/**
* Set public
*
* @param string $public
*/
public function setPublic($public)
{
$this->public = $public;
}
/**
* Get public
*
* @return string
*/
public function getPublic()
{
return $this->public;
}
/**
* Set prerequis
*
* @param text $prerequis
*/
public function setPrerequis($prerequis)
{
$this->prerequis = $prerequis;
}
/**
* Get prerequis
*
* @return text
*/
public function getPrerequis()
{
return $this->prerequis;
}
/**
* Set logo
*
* @param string $logo
*/
public function setLogo($logo)
{
$this->logo = $logo;
}
/**
* Get logo
*
* @return string
*/
public function getLogo()
{
return $this->logo;
}
/**
* Set nbplace
*
* @param integer $nbplace
*/
public function setNbplace($nbplace)
{
$this->nbplace = $nbplace;
}
/**
* Get nbplace
*
* @return integer
*/
public function getNbplace()
{
return $this->nbplace;
}
} | gody77/SymfonyMDL | src/Lam/MdlBundle/Entity/FormationInformatique.php | PHP | mit | 3,232 |
package com.hackathon.hackathon2014.activity;
import android.app.Activity;
import android.app.Fragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.Toast;
import com.hackathon.hackathon2014.R;
import com.hackathon.hackathon2014.webservice.PostRequestHandler;
import com.hackathon.hackathon2014.webservice.RestProvider;
import com.hackathon.hackathon2014.adapter.QuestionListAdapter;
import com.hackathon.hackathon2014.model.Question;
import java.util.List;
public class QuestionActivity extends Activity {
public static String EXTRA_QUESTION = "question";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_question);
if (savedInstanceState == null) {
getFragmentManager().beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.question, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
/**
* A placeholder fragment containing a simple view.
*/
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
final View rootView = inflater.inflate(R.layout.fragment_question, container, false);
Toast.makeText(rootView.getContext(),"Loading...",Toast.LENGTH_LONG).show();
RestProvider.getQuestions(new PostRequestHandler<List<Question>>() {
@Override
public void handle(List<Question> questions) {
QuestionListAdapter questionListAdapter = new QuestionListAdapter(getActivity(), questions);
ListView listView = (ListView) rootView.findViewById(R.id.questionListView);
listView.setAdapter(questionListAdapter);
listView.setOnItemClickListener(new OpenAnswerEvent(getActivity(), questions));
}
});
return rootView;
}
private class OpenAnswerEvent implements android.widget.AdapterView.OnItemClickListener {
private List<Question> questions;
private Activity activity;
private OpenAnswerEvent(Activity activity, List<Question> questions) {
this.activity = activity;
this.questions = questions;
}
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Question question = questions.get(i);
question.setSelected(true);
Intent intent = new Intent(activity,CategoryActivity.class);
intent.putExtra(EXTRA_QUESTION, question);
activity.startActivity(intent);
final ImageView questionIcon = (ImageView) view.findViewById(R.id.questionIcon);
QuestionListAdapter.renderChecked(question.isSelected(), questionIcon, R.drawable.ok_enable, R.drawable.ok_disable);
}
}
}
}
| dst-hackathon/socialradar-android | hackathon2014/app/src/main/java/com/hackathon/hackathon2014/activity/QuestionActivity.java | Java | mit | 4,070 |
require_relative 'shell/version'
require_relative 'shell/loader'
require_relative 'shell/alfrc'
module Alf
module Shell
# This is the default configuration to be forked from
DEFAULT_CONFIG = Alfrc.new
# Command factory
def self.Command(*args)
Quickl::Command(*args){|builder|
builder.command_parent = Alf::Shell::Main
builder.instance_module Shell::Support
yield(builder) if block_given?
}
end
end # module Shell
end # module Alf
require_relative 'shell/support'
require_relative 'shell/command'
| alf-tool/alf-shell | lib/alf/shell.rb | Ruby | mit | 559 |
package net.tqft.iterables.interfaces;
public interface Transformer<S, T> {
public abstract T evaluate(S s);
}
| craigfreilly/masters-project-submission | src/KnotTheory/JavaKh-v2/src/net/tqft/iterables/interfaces/Transformer.java | Java | mit | 126 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>mathcomp-analysis: 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 / mathcomp-analysis - 0.3.2</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
mathcomp-analysis
<small>
0.3.2
<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: "[email protected]"
homepage: "https://github.com/math-comp/analysis"
bug-reports: "https://github.com/math-comp/analysis/issues"
dev-repo: "git+https://github.com/math-comp/analysis.git"
license: "CECILL-C"
authors: [
"Reynald Affeldt"
"Cyril Cohen"
"Assia Mahboubi"
"Damien Rouhling"
"Pierre-Yves Strub"
]
build: [
[make "INSTMODE=global" "config"]
[make "-j%{jobs}%"]
]
install: [
[make "install"]
]
depends: [
"coq" { ((>= "8.10" & < "8.13~") | = "dev") }
"coq-mathcomp-bigenough" {(>= "1.0.0")}
"coq-mathcomp-field" {(>= "1.11.0" & < "1.12~")}
"coq-mathcomp-finmap" {(>= "1.5.0" & < "1.6~")}
]
synopsis: "An analysis library for mathematical components"
description: """
This repository contains an experimental library for real analysis for
the Coq proof-assistant and using the Mathematical Components library.
It is inspired by the Coquelicot library.
"""
tags: [
"category:Mathematics/Real Calculus and Topology"
"keyword: analysis"
"keyword: topology"
"keyword: real numbers"
"logpath: mathcomp.analysis"
"date:2020-08-11"
]
url {
http: "https://github.com/math-comp/analysis/archive/0.3.2.tar.gz"
checksum: "sha512=aa2ffac487d71d3aceea9dafca21d7c8bfcbaaf52d9977fd9bf19a055d65597b95d9e2e10dc7da10676ab2f86a8cc205aac9e0fa08360fc127971f60f68c5430"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-mathcomp-analysis.0.3.2 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-mathcomp-analysis -> coq >= dev
no matching version
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-mathcomp-analysis.0.3.2</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/mathcomp-analysis/0.3.2.html | HTML | mit | 7,550 |
require "capybarel/dsl/elements"
require "capybarel/dsl/javascript"
require "capybarel/dsl/from_yaml"
module Capybarel
module DSL
module All
include Capybarel::DSL::Elements
include Capybarel::DSL::JavaScript
include Capybarel::DSL::FromYaml
end
end
end
| fantactuka/capybarel | lib/capybarel/dsl.rb | Ruby | mit | 285 |
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import update from 'immutability-helper';
class ListItemBullet extends Component {
render() {
let cssClasses = `listbullet`;
const bulletStyle = {
border: `5px solid ${this.props.color}`,
backgroundColor: 'white'
};
return (
<div className={cssClasses} style={bulletStyle}></div>
);
}
};
class MyRouteMap extends Component {
render() {
const renderList = (list) => {
const lis = list.map((data, index) => {
return (<li key={index}><ListItemBullet color={this.props.color} />
{
data.url?
(<a href={data.url}><span className='description'>{data.name}</span><div className='details'>This is a test.<br/>This is second line</div></a>)
:
(<span className='description'>{data.name}</span>)
}
</li>);
})
return lis;
};
const cssClasses = `App-routemap ${this.props.color}`;
const ulStyle = {
//color: this.props.color,
marginTop: '30px'
};
const ulBeforeStyle = {
content: " ",
position: 'absolute',
marginLeft: '8px',
left: '0px',
top: '20px',
bottom: '40px',
width: '12px',
zIndex: -5,
backgroundColor: this.props.color
};
return (
<div className="App-routemap-div">
<h2>{this.props.title}</h2>
<ul className={cssClasses} style={ulStyle}>
<div style={ulBeforeStyle}></div>
{ renderList(this.props.datalist) }
</ul>
</div>
);
}
}
class App extends Component {
constructor() {
super();
this.state = {
list_unix: [
{
name: "Git 使用與教學",
url: "https://se101.mtsa.me/Slide/Git/#/"
}
],
'list_system': [
"作業系統概述",
"分散式系統架構",
"Scaling Up"
],
'list_data': [
"大數據分析簡介",
"TensorFlow 簡介",
],
'list_algo': [
"Python3 語法介紹",
"演算法簡介",
"基礎資料結構",
"字串處理",
"動態規劃",
"圖論演算法"
]
};
}
handleClick(e) {
var p = this.state.list_data;
p.push("Test Item");
var newState = update(this.state, {'list_data': {$set: p}});
this.setState(newState);
}
render() {
return (
<div className="App">
<div className="App-header">
<h1>SE101: 我想成為軟體工程師!</h1>
<span className="App-intro">UMich Taiwanese Software Engineers Reading Group - Fall 2017</span>
</div>
<div className="App-contents">
<MyRouteMap title='黑框框與開發者工具'datalist={this.state.list_unix} color='red' />
<MyRouteMap title='系統架設與維運' datalist={this.state.list_system} color='darkgreen' />
<MyRouteMap title='資料科學與技術' datalist={this.state.list_data} color='darkblue' />
<MyRouteMap title='編程面試與程式語言' datalist={this.state.list_algo} color='orange' />
</div>
</div>
);
//<button onClick={() => this.handleClick()}>Add Item</button>
}
}
export default App;
| tmt514/se101f17 | website/src/App.js | JavaScript | mit | 3,281 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.